Configuring Strict Mode
Prerequisites: tsconfig.json in depth
"strict": true in tsconfig.json turns on TypeScript's full set of
stricter checks at once — including strictNullChecks (a value typed
string can never actually be null/undefined unless the type
explicitly says so).
// Without strictNullChecks:
let name: string = null; // allowed — surprising and unsafe
// With strictNullChecks:
let name: string = null; // Type 'null' is not assignable to type 'string'
let name: string | null = null; // fine — explicitly allowed
New projects should enable strict from the start — retrofitting it
onto a large existing codebase later surfaces many errors at once.