TypeScript strict mode
Answer: You can then turn individual checks off. New TypeScript versions may add checks under this flag, so upgrades can surface new errors.
{ "compilerOptions": { "strict": true } }
What strict covers
strictNullChecksnoImplicitAnystrictFunctionTypesstrictBindCallApplystrictPropertyInitializationnoImplicitThisalwaysStrictuseUnknownInCatchVariables
strictNullChecks matters most
When it is off, null and undefined are effectively ignored, a classic source of runtime crashes. When on, they are distinct types:
const user = users.find(u => u.id === id);
user.name; // error: user is possibly undefined
user?.name; // OK
Adopting on an existing codebase
- Enable
strict.
Claims
- id: C1 claim: The strict flag enables a wide range of type checking behavior. source: S1 evidence: "The strict flag enables a wide range of type checking behavior"
- id: C2 claim: You can turn off individual strict mode family checks. source: S1 evidence: "You can then turn off individual strict mode family checks as needed."
- id: C3 claim: Future versions may add stricter checking under this flag. source: S1 evidence: "Future versions of TypeScript may introduce additional stricter checking under this flag"
- id: C4 claim: When strictNullChecks is false, null and undefined are effectively ignored. source: S2 evidence: "When strictNullChecks is false, null and undefined are effectively ignored by the language."
Sources
- [S1] TypeScript: TSConfig Option: strict. TypeScript (Microsoft). https://www.typescriptlang.org/tsconfig/strict.html . License: CC BY 4.0 (microsoft/TypeScript-Website). Accessed 2026-11-04.
- [S2] TypeScript: TSConfig Option: strictNullChecks. TypeScript (Microsoft). https://www.typescriptlang.org/tsconfig/strictNullChecks.html . License: CC BY 4.0 (microsoft/TypeScript-Website). Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: TypeScript (Microsoft), TypeScript: TSConfig Option: strict, CC BY 4.0 (microsoft/TypeScript-Website); TypeScript (Microsoft), TypeScript: TSConfig Option: strictNullChecks, CC BY 4.0 (microsoft/TypeScript-Website).
Cite this
iinventedlight. 2026. "TypeScript strict mode." iinventedlight Library, iil:note:y43qgmdp, version of 2026-11-04. https://iinventedlight.com/library/notes/typescript-strict-mode/. License: CC-BY-4.0.
@misc{iil_note_y43qgmdp,
author = {{iinventedlight}},
title = {{TypeScript strict mode}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/typescript-strict-mode/},
note = {Permanent ID iil:note:y43qgmdp. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/typescript-strict-mode.md.