mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Component commits:b6754e401bAdd test showing how setting strict is not preserved in tsbuildinfo Test for #44305d3b479e5baHandle strict flag when writing tsbuildinfo Fixes #44305cee9f40fd9Apply suggestions from code review Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
This commit is contained in:
co-authored by
Sheetal Nandi
parent
b60901da4f
commit
60f6d7bb34
@@ -851,8 +851,14 @@ namespace ts {
|
||||
const { optionsNameMap } = getOptionsNameMap();
|
||||
|
||||
for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) {
|
||||
const optionInfo = optionsNameMap.get(name.toLowerCase());
|
||||
if (optionInfo?.affectsEmit || optionInfo?.affectsSemanticDiagnostics || name === "skipLibCheck" || name === "skipDefaultLibCheck") {
|
||||
const optionKey = name.toLowerCase();
|
||||
const optionInfo = optionsNameMap.get(optionKey);
|
||||
if (optionInfo?.affectsEmit || optionInfo?.affectsSemanticDiagnostics ||
|
||||
// We need to store `strict`, even though it won't be examined directly, so that the
|
||||
// flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
|
||||
optionKey === "strict" ||
|
||||
// We need to store these to determine whether `lib` files need to be rechecked.
|
||||
optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
|
||||
(result ||= {})[name] = convertToReusableCompilerOptionValue(
|
||||
optionInfo,
|
||||
options[name] as CompilerOptionsValue,
|
||||
|
||||
@@ -564,6 +564,8 @@ namespace ts {
|
||||
{
|
||||
name: "strict",
|
||||
type: "boolean",
|
||||
// Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
|
||||
// The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Strict_Type_Checking_Options,
|
||||
description: Diagnostics.Enable_all_strict_type_checking_options
|
||||
|
||||
@@ -400,5 +400,23 @@ declare global {
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
verifyTscSerializedIncrementalEdits({
|
||||
scenario: "incremental",
|
||||
subScenario: "when project has strict true",
|
||||
commandLineArgs: ["-noEmit", "-p", `src/project`],
|
||||
fs: () => loadProjectFromFiles({
|
||||
"/src/project/tsconfig.json": JSON.stringify({
|
||||
compilerOptions: {
|
||||
incremental: true,
|
||||
strict: true,
|
||||
},
|
||||
}),
|
||||
"/src/project/class1.ts": `export class class1 {}`,
|
||||
}),
|
||||
incrementalScenarios: noChangeOnlyRuns,
|
||||
baselinePrograms: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user