Mina Sameh — Software Engineer (React Native, TypeScript, AI)

Mina Sameh

The Case for TypeScript Strict Mode

Strict mode catches bugs before they reach production. Here's how to migrate without losing your mind.

·

"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:

  1. Enable strict mode
  2. Add // @ts-expect-error to every new error (scripted)
  3. Fix 10-20 errors per sprint
  4. 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.