Overview
TypeScript rewards restraint. The patterns that survive long-term are the ones that make types easier to read, not harder. This guide collects the handful I reach for again and again.
Highlights
- Discriminated unions over conditional types whenever the data shape allows it
- Branded types for IDs to catch swap-the-arguments bugs at compile time
- satisfies for config objects so you keep both the literal type and the constraint check
Comments