I write everything in TypeScript. Frontend, backend, scripts, tools. Not because it's trendy, but because it eliminates entire categories of bugs that JavaScript lets through.
An undefined is not a function in production at 3am is a problem TypeScript solves at compile time. A renamed property that breaks 12 files without anyone noticing, TypeScript flags immediately. Typing isn't a constraint, it's a safety net.
On the projects I build, business apps, SaaS, APIs, the cost of a production bug is high. TypeScript drastically reduces that risk.
Compile-time error detection. A missing property, an incompatible type, a forgotten argument. The compiler catches them before the code runs. In JavaScript, these errors arrive in production.
Confident refactoring. Rename an interface, change a return type, restructure a module. The compiler shows every impacted location. In JavaScript, it's find-and-replace hoping you don't miss anything.
Intelligent autocompletion. The editor knows the types, available methods, function signatures. Development is faster because the IDE guides instead of guessing.
Living documentation. TypeScript interfaces describe contracts between code parts. No need for JSDoc or comments. The type is the documentation.
Accelerated onboarding. A new developer on the project understands data structures by reading the types. No need to trace code to understand what a function expects or returns.
Strict mode enabled. strict: true in tsconfig.json. No implicit any, no unhandled null, no silent undefined. Strict mode is non-negotiable.
Interfaces for public contracts. Component props, API DTOs, composable returns. Everything crossing a module boundary is explicitly typed.
Inference everywhere else. TypeScript infers local variable types, function returns, computed values. I don't type what the compiler can deduce on its own.
Zod for runtime validation. TypeScript types disappear at runtime. For external data (APIs, forms, webhooks), Zod validates at execution AND infers types at compilation. One schema for both.
Generics when justified. Generics make code reusable without losing typing. But a useless generic is worse than no generic. I use them for composables, API services and shared utilities.