perf: ensure compiler options affecting semantic diagnostics get included in build info (#53423)

This commit is contained in:
David Sherret 2023-03-22 12:54:17 -04:00 committed by GitHub
parent 1df5717b12
commit 1761a67ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -1101,6 +1101,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
name: "allowImportingTsExtensions",
type: "boolean",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: Diagnostics.Modules,
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
defaultValueDescription: false,

View File

@ -245,3 +245,14 @@ describe("unittests:: config:: commandLineParsing:: parseBuildOptions", () => {
assertParseResult("errors on invalid excludeFiles", ["--excludeFiles", "**/../*"]);
});
});
describe("unittests:: config:: commandLineParsing:: optionDeclarations", () => {
it("should have affectsBuildInfo true for every option with affectsSemanticDiagnostics", () => {
for (const option of ts.optionDeclarations) {
if (option.affectsSemanticDiagnostics) {
// semantic diagnostics affect the build info, so ensure they're included
assert(option.affectsBuildInfo ?? false, option.name);
}
}
});
});