File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ namespace ts.OrganizeImports {
20
20
compareModuleSpecifiers ( group1 [ 0 ] . moduleSpecifier , group2 [ 0 ] . moduleSpecifier ) ) ;
21
21
22
22
const newImportDecls = flatMap ( sortedImportGroups , importGroup =>
23
- coalesceImports ( removeUnusedImports ( importGroup ) ) ) ;
23
+ getExternalModuleName ( importGroup [ 0 ] . moduleSpecifier )
24
+ ? coalesceImports ( removeUnusedImports ( importGroup ) )
25
+ : importGroup ) ;
24
26
25
27
const changeTracker = textChanges . ChangeTracker . fromContext ( { host, formatContext } ) ;
26
28
@@ -60,7 +62,7 @@ namespace ts.OrganizeImports {
60
62
* @param importGroup a list of ImportDeclarations, all with the same module name.
61
63
*/
62
64
export function coalesceImports ( importGroup : ReadonlyArray < ImportDeclaration > ) {
63
- if ( importGroup . length === 0 || getExternalModuleName ( importGroup [ 0 ] . moduleSpecifier ) === undefined ) {
65
+ if ( importGroup . length === 0 ) {
64
66
return importGroup ;
65
67
}
66
68
You can’t perform that action at this time.
0 commit comments