← All notes

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

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

  1. Enable strict.

Claims

Sources

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

Permanent ID: iil:note:y43qgmdp

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.},
}

Markdown

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.