Skip to content

Commit 1761a67

Browse files
authored
perf: ensure compiler options affecting semantic diagnostics get included in build info (microsoft#53423)
1 parent 1df5717 commit 1761a67

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
11011101
name: "allowImportingTsExtensions",
11021102
type: "boolean",
11031103
affectsSemanticDiagnostics: true,
1104+
affectsBuildInfo: true,
11041105
category: Diagnostics.Modules,
11051106
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
11061107
defaultValueDescription: false,

src/testRunner/unittests/config/commandLineParsing.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,14 @@ describe("unittests:: config:: commandLineParsing:: parseBuildOptions", () => {
245245
assertParseResult("errors on invalid excludeFiles", ["--excludeFiles", "**/../*"]);
246246
});
247247
});
248+
249+
describe("unittests:: config:: commandLineParsing:: optionDeclarations", () => {
250+
it("should have affectsBuildInfo true for every option with affectsSemanticDiagnostics", () => {
251+
for (const option of ts.optionDeclarations) {
252+
if (option.affectsSemanticDiagnostics) {
253+
// semantic diagnostics affect the build info, so ensure they're included
254+
assert(option.affectsBuildInfo ?? false, option.name);
255+
}
256+
}
257+
});
258+
});

0 commit comments

Comments
 (0)