Merge pull request #24047 from amcasey/GH23892
Stop deleting empty named import lists
This commit is contained in:
commit
b7e5f0807b
|
@ -243,6 +243,15 @@ D();
|
|||
import { F1, F2 } from "lib";
|
||||
import * as NS from "lib";
|
||||
import D from "lib";
|
||||
`,
|
||||
},
|
||||
libFile);
|
||||
|
||||
testOrganizeImports("Unused_Empty",
|
||||
{
|
||||
path: "/test.ts",
|
||||
content: `
|
||||
import { } from "lib";
|
||||
`,
|
||||
},
|
||||
libFile);
|
||||
|
|
|
@ -198,7 +198,9 @@ namespace ts.OrganizeImports {
|
|||
: namedImports[0];
|
||||
|
||||
const newNamedImports = sortedImportSpecifiers.length === 0
|
||||
? undefined
|
||||
? newDefaultImport
|
||||
? undefined
|
||||
: createNamedImports(emptyArray)
|
||||
: namedImports.length === 0
|
||||
? createNamedImports(sortedImportSpecifiers)
|
||||
: updateNamedImports(namedImports[0].importClause.namedBindings as NamedImports, sortedImportSpecifiers);
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// ==ORIGINAL==
|
||||
|
||||
import { } from "lib";
|
||||
|
||||
// ==ORGANIZED==
|
||||
|
||||
import { } from "lib";
|
Loading…
Reference in a new issue