Chapter 1 · Practice 5 of 6
Move to TypeScript 7 by clearing the 6.0 deprecations first
Why it matters
TypeScript 7.0 is the compiler ported to Go. The TypeScript team reports typical full builds 8 to 12 times faster than 6.0 on large projects, lower peak memory in every project they measured, and the time to the first error in the editor on the VS Code codebase falling from about 17.5 seconds to under 1.3 seconds. The type checking logic matches TypeScript 6.0, so the upgrade is mostly about configuration.
A safe path:
- Upgrade to TypeScript 6.0 and fix every deprecation warning. Options like
baseUrl,target: es5,downlevelIteration,moduleResolution: nodeandesModuleInterop: falseare hard errors in 7.0. - Set
typesandrootDirexplicitly, as 6.0 recommends. - Install TypeScript 7 with
npm install -D typescriptand runnpx tsc. - Check the tools that use TypeScript's programmatic API. TypeScript 7.0 ships without one, so tools such as typescript-eslint keep running on 6.0. The team recommends installing
@typescript/typescript6through an npm alias for them.
Projects that rely on Vue, Svelte, Astro, MDX or Angular template checking should stay on TypeScript 6.0 for editor features until those integrations support 7.
Do
- Fix all TypeScript 6.0 deprecation warnings before installing 7.0
- Replace
baseUrlprefixes withpathsentries relative to the project root - Keep TypeScript 6 installed under an alias for tools that need the compiler API
Avoid
- Hiding 6.0 deprecations with
ignoreDeprecationsand forgetting them: 7.0 removes those options