"strict": true in tsconfig.json is the single highest-ROI change you can make to a TypeScript project.
When we migrated Agillo's codebase to strict mode, we found 347 potential null reference errors that had been silently lurking. Some were in payment processing code.
The migration strategy:
- Enable strict mode
- Add // @ts-expect-error to every new error (scripted)
- Fix 10-20 errors per sprint
- Track progress with a simple error count script
The strict flags that matter most:
- strictNullChecks — eliminates "cannot read property of undefined"
- noImplicitAny — forces you to think about types
- strictFunctionTypes — catches callback type mismatches
After 3 months of incremental fixes, we hit zero ts-expect-error comments. Bug reports from QA dropped 60% in the following quarter.
The code is more verbose, yes. But verbose and correct beats concise and broken.