mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Fix removal of default import (#25200)
This commit is contained in:
@@ -148,7 +148,7 @@ namespace ts.refactor {
|
||||
}
|
||||
else if (namedBindings.kind === SyntaxKind.NamespaceImport) {
|
||||
// `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";`
|
||||
changes.deleteNode(importingSourceFile, ref);
|
||||
changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) });
|
||||
const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : QuotePreference.Double;
|
||||
const newImport = makeImport(/*default*/ undefined, [makeImportSpecifier(exportName, ref.text)], clause.parent.moduleSpecifier, quotePreference);
|
||||
changes.insertNodeAfter(importingSourceFile, clause.parent, newImport);
|
||||
|
||||
Reference in New Issue
Block a user