Article
The highest return on TypeScript investment is at boundaries: parse and validate external data once, then trust narrow types inside your domain.
Zod, Valibot, or hand-written guards — pick one pattern and reuse it. The goal is not perfect coverage on day one; it is to make invalid states unrepresentable after the parser.
Inside the app, inference and generics do most of the work. I avoid `any` at the edges and prefer `unknown` plus narrowing when shape is uncertain.