---
source: https://iinventedlight.com/library/notes/typescript-strict-mode.md
title: "TypeScript strict mode"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (microsoft/TypeScript-Website); prose restates cited source lines"
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: TypeScript"
tags: ['typescript', 'tsconfig', 'strict', 'type-checking']
sources:
  - id: S1
    title: "TypeScript: TSConfig Option: strict"
    publisher: TypeScript (Microsoft)
    url: https://www.typescriptlang.org/tsconfig/strict.html
    accessed: 2026-11-04
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
  - id: S2
    title: "TypeScript: TSConfig Option: strictNullChecks"
    publisher: TypeScript (Microsoft)
    url: https://www.typescriptlang.org/tsconfig/strictNullChecks.html
    accessed: 2026-11-04
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
---
# 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.

```json
{ "compilerOptions": { "strict": true } }
```

## What strict covers

- `strictNullChecks`
- `noImplicitAny`
- `strictFunctionTypes`
- `strictBindCallApply`
- `strictPropertyInitialization`
- `noImplicitThis`
- `alwaysStrict`
- `useUnknownInCatchVariables`

## 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:

```ts
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
- 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).
