Stop deleting empty named import lists

Fixes #23892
This commit is contained in:
Andrew Casey 2018-05-10 17:32:49 -07:00
parent 2be6aaf813
commit 7281bb7510
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";