mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(51072): ts.preProcessFile finds import in template string after conditional expression with template strings (#51082)
This commit is contained in:
1 parent
ad56b5ca56
commit
d0bfd8caed
2 files changed
+17
-2
No files matched your search
@@ -205,6 +205,22 @@ describe("unittests:: services:: PreProcessFile:", () => {
|
||||
/* eslint-enable no-template-curly-in-string */
|
||||
});
|
||||
|
||||
it("Ignores imports in template strings", () => {
|
||||
/* eslint-disable no-template-curly-in-string */
|
||||
test("a ? `&${a}` : `#${b}`;\n\n `import(\"${moduleSpecifier}\").${id}`;",
|
||||
/*readImportFile*/ true,
|
||||
/*detectJavaScriptImports*/ true,
|
||||
{
|
||||
referencedFiles: [],
|
||||
typeReferenceDirectives: [],
|
||||
libReferenceDirectives: [],
|
||||
importedFiles: [],
|
||||
ambientExternalModules: undefined,
|
||||
isLibFile: false
|
||||
});
|
||||
/* eslint-enable no-template-curly-in-string */
|
||||
});
|
||||
|
||||
it("Correctly returns imports after a template expression", () => {
|
||||
/* eslint-disable no-template-curly-in-string */
|
||||
test("`${foo}`; import \"./foo\";",
|
||||
|
||||
Reference in new issue
Block a user