Skip to content

TypeScript Strict Mode

Medium — good to knowGeneral Dev

ELI5 — The Vibe Check

TypeScript Strict Mode is like putting a hall monitor on your code. No more sneaky 'any' types, no implicit nulls, no 'I'll fix this later' — it catches every shortcut and makes you do it properly. Your future self will thank you.

Real Talk

A tsconfig.json compiler option ('strict': true) that enables a set of stricter type-checking rules including strictNullChecks, noImplicitAny, noImplicitThis, strictBindCallApply, strictPropertyInitialization, and more. It significantly improves code safety and catch potential runtime errors at compile time.

Show Me The Code

// tsconfig.json
{ "compilerOptions": { "strict": true } }

// Without strict: silently allows
function add(a, b) { return a + b; }

// With strict: error! Parameters implicitly have 'any' type
function add(a: number, b: number): number {
  return a + b;
}

When You'll Hear This

"We enabled strict mode on the project and found 200 bugs in existing code." / "Always start a new project with strict mode on — it's way harder to enable later."

Made with passive-aggressive love by manoga.digital. Powered by Claude.