mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 01:33:08 -05:00
Mark allowArbitraryExtensions as affectsProgramStructure (#52437)
This commit is contained in:
@@ -1221,7 +1221,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
|
||||
{
|
||||
name: "allowArbitraryExtensions",
|
||||
type: "boolean",
|
||||
affectsModuleResolution: true,
|
||||
affectsProgramStructure: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,
|
||||
defaultValueDescription: false,
|
||||
|
||||
@@ -273,6 +273,48 @@ describe("unittests:: tsc-watch:: program updates", () => {
|
||||
]
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario,
|
||||
subScenario: "Updates diagnostics when '--allowArbitraryExtensions' changes",
|
||||
commandLineArgs: ["-w", "-p", "/tsconfig.json"],
|
||||
sys: () => {
|
||||
const aTs: File = {
|
||||
path: "/a.ts",
|
||||
content: "import {} from './b.css'"
|
||||
};
|
||||
const bCssTs: File = {
|
||||
path: "/b.d.css.ts",
|
||||
content: "declare const style: string;"
|
||||
};
|
||||
const tsconfig: File = {
|
||||
path: "/tsconfig.json",
|
||||
content: JSON.stringify({
|
||||
compilerOptions: { allowArbitraryExtensions: true },
|
||||
files: ["/a.ts"],
|
||||
})
|
||||
};
|
||||
return createWatchedSystem([libFile, aTs, bCssTs, tsconfig]);
|
||||
},
|
||||
edits: [
|
||||
{
|
||||
caption: "Disable allowArbitraryExtensions",
|
||||
edit: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({
|
||||
compilerOptions: { allowArbitraryExtensions: false },
|
||||
files: ["/a.ts"],
|
||||
})),
|
||||
timeouts: sys => sys.checkTimeoutQueueLengthAndRun(1)
|
||||
},
|
||||
{
|
||||
caption: "Enable allowArbitraryExtensions",
|
||||
edit: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({
|
||||
compilerOptions: { allowArbitraryExtensions: true },
|
||||
files: ["/a.ts"],
|
||||
})),
|
||||
timeouts: sys => sys.checkTimeoutQueueLengthAndRun(1),
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario,
|
||||
subScenario: "updates diagnostics and emit for decorators",
|
||||
|
||||
Reference in New Issue
Block a user