Merge pull request #24047 from amcasey/GH23892

Stop deleting empty named import lists
This commit is contained in:
Andrew Casey 2018-05-10 19:11:05 -07:00 committed by GitHub
commit b7e5f0807b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View file

@ -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);

View file

@ -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);

View file

@ -0,0 +1,7 @@
// ==ORIGINAL==
import { } from "lib";
// ==ORGANIZED==
import { } from "lib";