Back to Blog
Engineering

Migrating 200K Lines of JavaScript to TypeScript: A Survival Guide

The two-year journey of migrating our entire frontend from JavaScript to TypeScript — the strategy, the tooling, and the bugs we caught.

F
Frontend Team · Engineering
October 20, 202510 min read
Migrating 200K Lines of JavaScript to TypeScript: A Survival Guide

We did not start with TypeScript. Our frontend was 200,000 lines of plain JavaScript with JSDoc comments pretending to be type annotations. Migration was inevitable — here is how we did it without stopping feature development.

The Strategy

  • Started with strict: false and gradually tightened
  • Migrated shared libraries and utilities first
  • New code must be TypeScript — no exceptions
  • Automated codemods for common patterns (PropTypes → interfaces)
  • Dedicated "TypeScript Friday" — one day per sprint for migration work

What TypeScript Caught

During migration we found and fixed over 400 latent bugs — null reference errors, wrong function argument orders, impossible state combinations, and stale API response types. Many of these had been causing intermittent production issues for months.