forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix 57215 -- add support for import attributes to OrganizeImports (mi…
- Loading branch information
Showing
5 changed files
with
175 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// import { A } from "./file"; | ||
//// import { type B } from "./file"; | ||
//// import { C } from "./file" assert { type: "a" }; | ||
//// import { A as D } from "./file" assert { type: "b" }; | ||
//// import { E } from "./file" with { type: "a" }; | ||
//// import { A as F } from "./file" with { type: "b" }; | ||
//// | ||
//// type G = A | B | C | D | E | F; | ||
|
||
verify.organizeImports( | ||
`import { A, type B } from "./file"; | ||
import { C } from "./file" assert { type: "a" }; | ||
import { A as D } from "./file" assert { type: "b" }; | ||
import { E } from "./file" with { type: "a" }; | ||
import { A as F } from "./file" with { type: "b" }; | ||
type G = A | B | C | D | E | F;`); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
////import { A } from "./a"; | ||
////import { C } from "./a" assert { type: "a" }; | ||
////import { Z } from "./z"; | ||
////import { A as D } from "./a" assert { type: "b" }; | ||
////import { E } from "./a" with { type: "a" }; | ||
////import { F } from "./a" assert { type: "a" }; | ||
////import { B } from "./a"; | ||
//// | ||
////export type G = A | B | C | D | E | F | Z; | ||
|
||
verify.organizeImports( | ||
`import { A, B } from "./a"; | ||
import { C, F } from "./a" assert { type: "a" }; | ||
import { A as D } from "./a" assert { type: "b" }; | ||
import { E } from "./a" with { type: "a" }; | ||
import { Z } from "./z"; | ||
export type G = A | B | C | D | E | F | Z;`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
////import { A } from "./a"; | ||
////import { C } from "./a" assert { type: "a" }; | ||
////import { Z } from "./z"; | ||
////import { A as D } from "./a" assert { type: "b" }; | ||
////import { E } from "./a" assert { type: /* comment*/ "a" }; | ||
////import { F } from "./a" assert {type: "a" }; | ||
////import { Y } from "./a" assert{ type: "b" /* comment*/}; | ||
////import { B } from "./a"; | ||
//// | ||
////export type G = A | B | C | D | E | F | Y | Z; | ||
|
||
verify.organizeImports( | ||
`import { A, B } from "./a"; | ||
import { C, E, F } from "./a" assert { type: "a" }; | ||
import { A as D, Y } from "./a" assert { type: "b" }; | ||
import { Z } from "./z"; | ||
export type G = A | B | C | D | E | F | Y | Z;`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
////import { A } from "./a" assert { foo: "foo", bar: "bar" }; | ||
////import { B } from "./a" assert { bar: "bar", foo: "foo" }; | ||
////import { D } from "./a" assert { bar: "foo", foo: "bar" }; | ||
////import { E } from "./a" assert { foo: 'bar', bar: "foo" }; | ||
////import { C } from "./a" assert { foo: "bar", bar: "foo" }; | ||
////import { F } from "./a" assert { foo: "42" }; | ||
////import { Y } from "./a" assert { foo: 42 }; | ||
////import { Z } from "./a" assert { foo: "42" }; | ||
//// | ||
////export type G = A | B | C | D | E | F | Y | Z; | ||
|
||
|
||
verify.organizeImports( | ||
`import { A, B } from "./a" assert { foo: "foo", bar: "bar" }; | ||
import { C, D, E } from "./a" assert { bar: "foo", foo: "bar" }; | ||
import { F, Z } from "./a" assert { foo: "42" }; | ||
import { Y } from "./a" assert { foo: 42 }; | ||
export type G = A | B | C | D | E | F | Y | Z;`); |