mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
fix(41244): ignore synthesized imports (#41267)
This commit is contained in:
@@ -1827,7 +1827,9 @@ namespace ts {
|
||||
return preferences.quotePreference === "single" ? QuotePreference.Single : QuotePreference.Double;
|
||||
}
|
||||
else {
|
||||
const firstModuleSpecifier = sourceFile.imports && find(sourceFile.imports, isStringLiteral);
|
||||
// ignore synthetic import added when importHelpers: true
|
||||
const firstModuleSpecifier = sourceFile.imports &&
|
||||
find(sourceFile.imports, n => isStringLiteral(n) && !nodeIsSynthesized(n.parent)) as StringLiteral;
|
||||
return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : QuotePreference.Double;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user