TypeScript 7 Compiler & Upgrading
TypeScript 7.0, released on 8 July 2026, is the biggest change to the compiler in TypeScript's history, while the language you write stayed almost the same. The compiler was rewritten in the Go programming language and now runs as a native program that uses several CPU cores at once. Microsoft reports full builds typically 8 to 12 times faster than TypeScript 6.0, and editors respond much sooner in large projects.
You saw a summary of the new defaults in Install TypeScript & Set Up. This lesson is for the day you are asked to upgrade a real project at work: what changed under the hood, the new command-line flags, what still needs TypeScript 6, and a safe, step-by-step path from an older codebase.
What "native" means for you
Before 7.0, tsc was a JavaScript program running on Node.js. Now npm install -D typescript downloads a small platform-specific package with a native executable (on Windows it is tsc.exe inside @typescript/typescript-win32-x64), and the tsc command starts it. You still run it the same way:
npm install -D typescript
npx tsc --version
npx tsc --noEmitVersion 7.0.2
Because the compiler can now share memory between threads, type checking runs in parallel. Three new flags control this:
| Flag | What it does |
|---|---|
--checkers <n> | Number of type-checker workers per project. The default is 4. More can be faster on machines with many cores, at the cost of memory. |
--builders <n> | With tsc --build, how many referenced projects are built at the same time. It multiplies with --checkers. |
--singleThreaded | Uses one checker and does parsing and emitting on one thread. Useful for debugging, for comparing results, and on small CI machines. |
--watch mode was also rebuilt on a new native file watcher, so it uses far fewer resources than the old polling approach.
Your type errors should not change. The team states that code which compiles cleanly on TypeScript 6.0 should compile the same way on 7.0. The one deliberate difference is ordering: types inside unions may print in a different (but now always stable) order in error messages and declaration files.
What still needs TypeScript 6
TypeScript 7.0 does not include a programmatic API, the JavaScript functions that other tools call to ask the compiler about your code. A new, different API is planned for 7.1. Until your tools support it, anything that does import ts from "typescript" needs TypeScript 6. Common examples are typescript-eslint's type-aware rules and the template tooling for Vue, Angular, Svelte, Astro and MDX.
The team publishes TypeScript 6 under a second name, @typescript/typescript6, which provides a tsc6 command and the old API. With npm aliases, both versions live in one project: tools that import typescript get version 6, while the tsc command comes from version 7:
{
"devDependencies": {
"typescript": "npm:@typescript/typescript6@^6.0.2",
"@typescript/native": "npm:typescript@^7.0.2"
}
}In VS Code, the TypeScript 7 language service comes as an extension (marketplace ID TypeScriptTeam.native-preview) that takes over from the built-in one when installed. Its command palette has commands to disable and re-enable the TypeScript 7 language server, which is handy if a framework's editor plugin still needs version 6.
The upgrade path: 5.x to 6.0 to 7.0
TypeScript 6.0 (March 2026) was designed as a bridge. It introduced the new defaults and turned every option that 7.0 removes into a deprecation error. So never jump from 5.x straight to 7.0. Here is a typical older tsconfig.json, the kind you will meet in projects started around 2020:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"baseUrl": ".",
"outDir": "dist",
"esModuleInterop": false
},
"include": ["src"]
}Step 1: upgrade to TypeScript 6 and read every deprecation. Running tsc 6.0.3 on that file gives:
tsconfig.json(3,15): error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. tsconfig.json(5,25): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. Visit https://aka.ms/ts6 for migration information. tsconfig.json(6,5): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. Visit https://aka.ms/ts6 for migration information. tsconfig.json(8,24): error TS5107: Option 'esModuleInterop=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
"ignoreDeprecations": "6.0" lets the project build on 6.0 while you work, but it is only a pause button. The same file on TypeScript 7.0 fails with "has been removed" errors (TS5108 and TS5102) and there is no way to silence them.
Step 2: replace each removed option. Use this table:
| Old setting | Replacement |
|---|---|
"target": "es5" | es2015 or later; for very old browsers, let a bundler or Babel transpile further |
"moduleResolution": "node" / "classic" | nodenext for Node.js, bundler with "module": "preserve" for bundled apps |
"baseUrl": "." | Remove it; make every paths entry relative, such as "@app/*": ["./src/*"] |
"esModuleInterop": false, "allowSyntheticDefaultImports": false | Remove; they are always on. Fix default imports of CommonJS packages if any break |
"outFile", "module": "amd" / "umd" / "system" | Use a bundler |
"downlevelIteration" | Remove |
module Foo { } (namespace written with module) | namespace Foo { } |
import x from "./data.json" assert { type: "json" } | with { type: "json" } |
Step 3: set the new defaults on purpose. TypeScript 6 and 7 changed several defaults: strict is now true, types is now [], module defaults to esnext, and rootDir is the folder of tsconfig.json. An old project that relied on the old defaults should say what it wants, for example "types": ["node"] and "rootDir": "./src". The upgraded config, which builds cleanly on both 6.0 and 7.0:
{
"compilerOptions": {
"target": "es2022",
"module": "nodenext",
"rootDir": "./src",
"outDir": "dist",
"paths": { "@app/*": ["./src/*"] },
"types": ["node"]
},
"include": ["src"]
}If turning on strict creates hundreds of errors, set "strict": false for now and tighten later, as described in Strict tsconfig Options. That is a separate project from the version upgrade.
Step 4: compare 6.0 and 7.0 results. TypeScript 6.0 has a --stableTypeOrdering flag that makes it order types the way 7.0 does. If 7.0 shows a different error than 6.0, run 6.0 with this flag to check whether only the ordering changed. The flag can slow 6.0 down noticeably, so use it for comparison only.
Step 5: switch to 7.0 and update tooling. Install typescript@7, use the alias setup above for tools that need the API, and run your full build and tests. In CI, pin the exact version (for example 7.0.2) so every machine checks code the same way.
JavaScript projects with JSDoc
If your project type-checks .js files with JSDoc comments (see Migrating JavaScript to TypeScript), expect more changes. TypeScript 7 analyses JavaScript files much more like .ts files. For example, a value can no longer be used as a type in JSDoc (write typeof value), @enum is no longer special, Closure-style function types are not supported, and type aliases must use the @typedef tag. The team's release notes link to a full list of these changes; read it before upgrading a large JSDoc codebase.
Common mistakes
- Jumping from 5.x straight to 7.0. You lose 6.0's clear deprecation messages. Go through 6.0 first.
- Leaving
ignoreDeprecationsin the config. It hides the problems that 7.0 will turn into hard errors. - Uninstalling TypeScript 6 while a linter still needs it. Type-aware lint rules will fail to load. Use the npm alias setup.
- Raising
--checkerson a small CI machine. More workers need more memory; on a 2-core runner the default or--singleThreadedmay be faster. - Mixing a version upgrade with a strictness upgrade. Do them as separate pull requests so reviews stay small.
Key points
- TypeScript 7.0 (8 July 2026) is a native rewrite in Go: same language, much faster builds and editor responses.
--checkers,--buildersand--singleThreadedcontrol parallel work; the default is 4 checkers.- 7.0 has no programmatic API; tools that import
typescriptuse@typescript/typescript6through an npm alias until 7.1's new API. - Upgrade through 6.0: fix every deprecation, set new defaults (
types,rootDir,strict) explicitly, then switch to 7.0. - Removed options such as
target: es5,baseUrlandmoduleResolution: nodecannot be silenced in 7.0.
Exercise
A Rohtak college ERP project has this config: { "compilerOptions": { "target": "es5", "moduleResolution": "node", "baseUrl": "./", "paths": { "@lib/*": ["src/lib/*"] }, "outFile": "bundle.js" } }. It is bundled with Vite. Rewrite it so it works on TypeScript 7.0, and write one sentence per change explaining why.
Show solution
{
"compilerOptions": {
"target": "es2022",
"module": "preserve",
"moduleResolution": "bundler",
"paths": { "@lib/*": ["./src/lib/*"] },
"noEmit": true
},
"include": ["src"]
}target moves to es2022 because es5 was removed. moduleResolution: "node" was removed; a Vite project uses module: "preserve" with bundler resolution. baseUrl was removed, so the paths entry now starts with ./ and is resolved from the config file. outFile was removed and Vite already bundles the code, so TypeScript only checks types with noEmit.
Quick Quiz
1. What is the main change in TypeScript 7.0?
The language is essentially the same; the compiler is a new native implementation.
2. Why might a project still install TypeScript 6 next to TypeScript 7?
7.0 ships without an API; a new one is planned for 7.1.
3. What does "ignoreDeprecations": "6.0" do in TypeScript 7.0?
It only silences deprecation errors in 6.0, as a temporary step.
4. What replaces "baseUrl": "." with "paths": { "@app/*": ["src/*"] }?
In 7.0, paths entries are resolved relative to the configuration file.
Learn TypeScript with a mentor
Free lessons get you started. Our Full Stack Web Development training adds real projects and code reviews from working developers.
- Project-based learning
- Mentor code reviews
- Free counselling call
