Back to feed
linkedin·Mar 4, 2026

TypeScript 5 Patterns That Changed How I Write Code

Template literal types, const type parameters, and satisfies — these aren't just language features. They're a fundamentally different way to think about type safety at the boundaries of your system.

MC
Marcus Chen

Template literal types, const type parameters, and satisfies — these aren't just language features. They're a fundamentally different way to think about type safety at the boundaries of your system.

I've been refactoring a large codebase to take advantage of TypeScript 5's newer features, and the results have been transformative.

Template Literal Types for API Routes

Instead of typing routes as string, we now express them as /api/${Resource}/${string}. This catches an entire class of typo bugs at compile time and makes our API layer self-documenting.

The `satisfies` Operator

Before satisfies, we had to choose between precise types and good inference. Now we can have both. Define your config object with full autocompletion, then validate it against a schema type — all without losing the literal types.

Const Type Parameters

Generic functions that infer readonly tuples by default? This is huge for builder patterns and configuration APIs where you want the compiler to remember the exact values passed in.

The theme across all of these is the same: push more validation to compile time, catch more bugs before they ship, and make the type system work *for* you rather than against you.