intermediate

Practical TypeScript

Strict mode, inference, unknown, any, never, satisfies, augmentation, and application typing.

Practical TypeScript is about making unsafe states hard to write. Strict compiler options surface nullability, implicit `any`, and weak function types at compile time. `unknown`, `any`, and `never` define trust boundaries and exhaustive control flow. `satisfies` validates shapes without widening literals. Module augmentation extends third-party types intentionally. Application typing connects static types to runtime validation at API, React, and service boundaries.

Checklist:

  • Keep strict mode enabled in new codebases.
  • Parse external data from unknown.
  • Complement static types with runtime validation.