Best Practices

TypeScript Strict Mode Migration: Code Review Strategies for Large Codebases

Tony Dong
June 15, 2025
13 min read
Share:
Featured image for: TypeScript Strict Mode Migration: Code Review Strategies for Large Codebases

Moving a large codebase to TypeScript strict mode is a multi-sprint project. Reviews must guard against regression while steadily ratcheting up compiler guarantees. Use this checklist to evaluate strict-mode migration PRs and keep velocity high.

Clarify Migration Scope

Every PR should state which strict flags are being enabled (strictNullChecks, noImplicitAny, exactOptionalPropertyTypes, etc.). When strict is flipped globally, require a plan that rolls out flags incrementally per package to avoid massive diffs.

Dependency Audit

Reviewers must ensure third-party packages include proper type definitions. Check:

  • New devDependencies like @types/* are version locked.
  • Custom type declarations (.d.ts) live in a shared folder with comments.
  • Any // @ts-ignore or // @ts-expect-error annotations have TODOs.

Code Changes to Review Carefully

  • Introduced non-null assertions (!) that might mask real nullability bugs.
  • Type casts (as) replacing proper type refinements.
  • Utility types that widen domains, undoing strict checks.
  • Refactors in shared components or hooks that can ripple across the app.

Testing Expectations

Beyond unit tests, request compiler runs with tsc --noEmit and build pipelines to ensure strict flags pass in CI. Encourage incremental migrations with guardrails similar to the ones described in monorepo review strategies.

Documentation and Tooling

Have authors update contributor docs explaining new strict requirements, preferred patterns for narrowing types, and lint rules. Integrate ESLint rules (no-explicit-any) and consider using ts-prune to catch unused exports surfaced by stricter type checking.

Telemetry on Migration Progress

Track:

  • Number of // @ts-ignore comments remaining.
  • Files still excluded in tsconfig overrides.
  • Build time impact and bundle size changes.
  • Production incidents detected by new strict checks.

Strict mode migrations demand patience and discipline. With reviews focused on scope, dependency health, and real type safety improvements, you will reach full strict mode without derailing product delivery.

Transform Your Code Review Process

Experience the power of AI-driven code review with Propel. Catch more bugs, ship faster, and build better software.

Explore More

Propel AI Code Review Platform LogoPROPEL

The AI Tech Lead that reviews, fixes, and guides your development team.

SOC 2 Type II Compliance Badge - Propel meets high security standards

Company

© 2025 Propel Platform, Inc. All rights reserved.