The TypeScript Tightrope: When Strict Types Help and When They Hurt | Cave Motions
Engineering April 5, 2026 8 min read

The TypeScript Tightrope: When Strict Types Help and When They Hurt

A pragmatic guide to wielding TypeScript's type system without letting it wield you - from a team that's shipped thousands of hours of TS.

The TypeScript Tightrope: When Strict Types Help and When They Hurt

TypeScript has won. In 2026, it's the default for new frontend projects, and its adoption in backend Node.js codebases is nearly universal. The type safety is real, the tooling is excellent, and the ecosystem has standardized around it. But after years of building large TypeScript codebases, we've learned that more types don't always mean better code. The trick is knowing where strictness pays off and where it becomes ceremony.

The Strictness Spectrum

TypeScript's strict mode is not a binary - it's a spectrum of individual flags. The default recommendation is "turn everything on" (strict: true), but in practice, different strictness levels make sense at different boundaries:

  • API boundaries: Strictest. The interfaces between services, the shapes of API responses, the contracts between modules - type these exhaustively. A wrong type here is a production incident.
  • Internal implementation: Flexible. Inside a well-tested module, verbose type annotations often add noise without adding safety. Let inference work. If the tests pass and the external type contract holds, the internal types have done their job.
  • Prototyping: Permissive. When you're exploring a design, fighting the type checker slows down the feedback loop. Use as assertions, any escape hatches, and focus on getting something working. Tighten types once the shape stabilizes.

Patterns We've Adopted

After years of shipping TypeScript, here are the patterns that have stuck:

  • Branded types for IDs: A UserId is not a string. Branded types prevent passing the wrong ID to the wrong function - one of the most common and hardest-to-spot bugs in large systems.
  • Discriminated unions for state: Every async operation has three states (loading, success, error). Model them explicitly with a status discriminant rather than checking for the presence or absence of data.
  • satisfies over annotations: The satisfies keyword lets you validate a value against a type without widening it. Your config objects, route definitions, and lookup tables keep their exact literal types - better autocomplete, safer refactors.
  • Zod for runtime boundaries: TypeScript types disappear at runtime. For anything crossing the network (API responses, form inputs, localStorage), validate with Zod schemas. The Zod type inference means you write the schema once and get both runtime validation and static types.

Ready to build something? Let's talk.

Whether you need a custom platform, a website refresh, or AI automation — we're the Kampala team that delivers.

Start a project