How do you do a JavaScript to TypeScript migration without stopping work?
Do a JavaScript to TypeScript migration one file at a time. Turn on allowJs so TypeScript reads your existing files, rename one file to .ts, fix what it finds, and raise strictness step by step. The team keeps shipping the whole time.
TypeScript 7.0, the native compiler, makes strict mode the default and turns 6.0 deprecations into hard errors. Full builds of the VS Code codebase went from 125.7 seconds to 10.6 seconds.
From my work
On Itmatched we moved the backend from Node.js 10 to Node.js 16 and TypeScript, an Express REST API on Couchbase, and moved the front end to the latest Angular. It took about 6 months, with a new UI and a new architecture at the same time. There was no downtime because the product was not in production yet. Once the legacy code was fixed, the client started asking for gift cards, promotions and analytics pages. I pushed back: ship the MVP first, add the rest after launch. They agreed, and we went to production on time.
For one client I reviewed a codebase I rated 8 out of 10, with good separation of concerns, but all plain JavaScript. For a project that size, some types, or even just JSDoc, would have made it a 10.
Why teams move
Types catch the bugs that come from changing one file and forgetting the five that call it. On a small codebase you can live without them. On a big one, the code stays clean only as long as every developer is careful, and that never lasts.
Steps for a JavaScript to TypeScript migration
- Add a tsconfig with allowJs and a separate outDir, so TypeScript reads .js files and never writes over your source.
- Decide on stricter flags now, before you touch files. The handbook says it is easier to turn them on early.
- Rename one .js file to .ts. It will find more errors than you hoped. Treat them like red squiggles in a document: the code still compiles.
- Turn on noImplicitAny, then strictNullChecks, as the typed part grows. The second is the one that finds real bugs.
- Files you can’t convert yet can still be checked: add // @ts-check and JSDoc types to a plain .js file.
What TypeScript 7 and Node change in 2026
- TypeScript 7.0 (July 2026) has strict on by default. Microsoft recommends moving to 6.0 first, because 7.0 turns its deprecations into errors.
- Node.js runs .ts files directly: type stripping is on by default since Node 22.18 and 23.6, and stable since 24.12 and 25.2. It only strips types and checks nothing, and it does not support enums or runtime namespaces. Keep tsc in CI.
What drives the effort
- How dynamic the code is. Objects built up key by key and functions that return different shapes take the longest.
- Libraries without types. You write the declarations yourself, or you type them as any and promise to come back.
- How strict you want to end up. "Compiles with allowJs" and "strict everywhere" are very different budgets.
Read next
Sources
- TypeScript handbook, migrating from JavaScript, read 17 Nov 2026
- TypeScript handbook, JS projects utilizing TypeScript, read 17 Nov 2026
- Microsoft TypeScript blog, announcing TypeScript 7.0, 8 Jul 2026
- Node.js docs, modules: TypeScript, read 17 Nov 2026