← all blogs

September 9, 2026

Notes on TypeScript Strict Mode

The strict compiler flags I actually turn on, and the habits they force.

  • typescript
  • tooling
A soft pastel gradient banner

strict: true is the floor, not the ceiling. A few extra flags catch most of the bugs I used to find in production.

Flags worth turning on

  • noUncheckedIndexedAccess — array and record access becomes T | undefined.
  • exactOptionalPropertyTypesundefined stops sneaking into optional keys.
  • noImplicitOverride and noFallthroughCasesInSwitch — cheap correctness.

The habit it forces

You stop guessing. If a value can be missing, the types say so, and you handle it at the edge instead of at the crash.

const first = items[0];
if (!first) return; // now required, and now obvious