TypeScript 7 migration: the native Go compiler

Authors
  • avatar
    Name
    Hamza Rahman
Published on
-
10 mins read

This guide walks through moving a JavaScript or TypeScript project to the native TypeScript 7 compiler, while keeping TypeScript 6 installed for the tools that still depend on its JavaScript API. You get a faster tsc without breaking ESLint or your framework.

Checked on December 4, 2026 against typescript 7.0.2 (stable), 7.1.0-beta, @typescript/typescript6 6.0.2 (which runs TypeScript 6.0.3) and typescript-eslint 8.74.0, on Node v25.2.1 and npm 11.6.2.

Where things stand

  • TypeScript 7.0 is stable. It was announced on July 8, 2026, and npm install -D typescript now installs 7.0.2.
  • The binary is tsc. The old preview package, @typescript/native-preview, used tsgo. Nightlies now ship as typescript@next.
  • Development moved back to microsoft/TypeScript. The typescript-go README says that staging repo is closed.
  • TypeScript 6.0 is the bridge release, and the last line with the JavaScript compiler API. It warns about the options that TypeScript 7 rejects.
  • TypeScript 7.1 is in beta, published October 20. It brings the new programmatic API. The iteration plan targeted a release candidate on December 1 and a stable release later in December, but as of December 4, 2026 npm has neither. The newest 7.1 builds there are 7.1.0-beta and the 7.1.0-dev.20261202.1 nightly.

Should you switch now

Your projectRecommendation
Node or React code checked with tsc --noEmitSwitch
Same, plus typescript-eslintSwitch, with TypeScript 6 installed alongside
AngularTypeScript 7 for CLI checks, 6 for the editor and Angular compiler
Vue, Svelte, Astro, MDXStay on 6 for now
Your own code calls ts.createProgramStay on 6 for that code, test 7.1 beta separately
You emit ES5, AMD, UMD or SystemJSChange the output pipeline first

The framework rows follow the TypeScript team's guidance. Angular and Volar-based tools embed the compiler through an API that 7.0 does not have.

Step 1: clean up on TypeScript 6

Upgrade to 6 first. Its errors explain the changes, and you can fix them one at a time.

npm install -D typescript@6
npx tsc --noEmit --stableTypeOrdering

Remove ignoreDeprecations from tsconfig.json before you run it. The TypeScript team says code that compiles cleanly on 6.0 with stableTypeOrdering on and no ignoreDeprecations should compile identically on 7.0.

Step 2: fix tsconfig

These defaults changed in 6.0 and carry into 7.0:

OptionNew default
stricttrue
moduleesnext
targetlatest stable ECMAScript year
types[]
rootDirthe folder that holds tsconfig.json
noUncheckedSideEffectImportstrue

types and rootDir cause the most confusion. Missing types shows up as Cannot find name 'process'. Missing rootDir shows up as files emitted to dist/src/index.js instead of dist/index.js.

This older config shows what fails on TypeScript 7.0.2:

{
  "compilerOptions": {
    "target": "es5",
    "module": "amd",
    "moduleResolution": "node",
    "baseUrl": "./src",
    "paths": { "@lib/*": ["lib/*"] },
    "esModuleInterop": false,
    "downlevelIteration": true,
    "ignoreDeprecations": "6.0"
  }
}

Even with ignoreDeprecations set, the removed options are hard errors. Excerpt:

error TS5108: Option 'target=ES5' has been removed.
error TS5108: Option 'module=AMD' has been removed.
error TS5108: Option 'moduleResolution=node10' has been removed.
error TS5102: Option 'baseUrl' has been removed.
error TS5108: Option 'esModuleInterop=false' has been removed.
error TS5102: Option 'downlevelIteration' has been removed.

This replacement passes on both TypeScript 6.0.3 and 7.0.2. It assumes a Node project with @types/node installed:

{
  "compilerOptions": {
    "target": "es2022",
    "module": "nodenext",
    "rootDir": "./src",
    "outDir": "./dist",
    "types": ["node"],
    "paths": { "@lib/*": ["./src/lib/*"] }
  },
  "include": ["src"]
}

If a bundler builds your app, use "module": "esnext" with "moduleResolution": "bundler" instead. Note the ./ prefix in paths: without baseUrl, non-relative targets fail with TS5090.

Step 3: check the remaining breakages

  • tsc src/index.ts fails with TS5112 when a tsconfig.json is present. Add --ignoreConfig if you meant to skip it.
  • module Foo {} namespaces must become namespace Foo {}. declare module 'x' is unaffected.
  • Import assertions (assert { type: 'json' }) fail with TS2880. Use import attributes (with { type: 'json' }).
  • outFile was removed in 6.0. Use a bundler.
  • JavaScript files checked through JSDoc lose some Closure-era patterns, including @enum, postfix ! and function(string): void. The full list is in the release post.
  • Template literal inference now splits by Unicode code point. This compiles on 7.0.2 and fails on 6.0.3:
type HeadTail<S> = S extends `${infer H}${infer T}` ? [H, T] : never
const r: HeadTail<'😀abc'> = ['😀', 'abc']
export { r }

Step 4: install both versions side by side

Plenty of tools import typescript and call its API. In 7.0 that import gives you only version information:

const ts = require('@typescript/native') // alias for typescript@7.0.2
console.log(typeof ts.createProgram) // undefined

Installing typescript-eslint 8.74.0 next to TypeScript 7.0.2 as typescript fails with ERESOLVE, because its peer range is >=4.8.4 <6.1.0. Bypassing the peer check doesn't help: ESLint then exits with typescript-eslint does not support TS 7.0.

The TypeScript team's fix is a pair of npm aliases. Tools that import typescript get 6, and tsc is 7:

{
  "devDependencies": {
    "@typescript/native": "npm:typescript@^7.0.2",
    "typescript": "npm:@typescript/typescript6@^6.0.2"
  }
}
npx tsc -v
# Version 7.0.2
npx tsc6 -v
# Version 6.0.3

With these aliases in place, typescript-eslint installs and lints normally. The workspace tsserver binary also still comes from TypeScript 6. Two things to watch:

  • Keep the @typescript/native name. Renaming it to typescript-7 makes npx tsc -v print 6.0.3, because @typescript/typescript6 depends on TypeScript 6 (as @typescript/old), which has a tsc binary of its own. Print npx tsc -v in CI so you notice a collision.
  • pnpm with strict peer dependencies can reject stable 7.0.2 under this alias, because recent typescript-eslint parsers want a 7.1 prerelease there. That is an open issue. npm installs it without complaint.

Check each tool's peer range

Peer ranges on npm as of December 4, 2026 show what each tool accepts:

PackageVersionTypeScript range
typescript-eslint8.74.0>=4.8.4 <6.1.0
ts-jest29.4.15>=4.3 <7
svelte-check4.7.9^5.0.0 || ^6.0.0
@astrojs/check0.9.12^5.0.0 || ^6.0.0
@angular/compiler-cli22.3.2>=6.0 <6.1

typescript-eslint has an experimental 7.1 backend. It needs TypeScript 6 alongside a 7.1 nightly (7.1.0-dev.20261009.1 or newer, so not 7.0.2), Node 20.19 or 22.12 and up, and projectService instead of parserOptions.project.

Check any other tool with:

npm view ts-jest peerDependencies.typescript

A permissive range such as * doesn't prove the tool works on TypeScript 7, so run it on your project before you upgrade.

Step 5: run old and new in CI

Make TypeScript 7 the required check. Keep 6 as a comparison for a few weeks:

{
  "scripts": {
    "typecheck": "tsc --noEmit",
    "typecheck:6": "tsc6 --noEmit --stableTypeOrdering"
  }
}
# .github/workflows/typecheck.yml
name: typecheck
on: [push, pull_request]
jobs:
  typecheck:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        script: ['typecheck', 'typecheck:6']
    continue-on-error: ${{ matrix.script == 'typecheck:6' }}
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 24
      - run: npm ci
      - run: npx tsc -v
      - run: npm run ${{ matrix.script }}

If your project uses references, run tsc -b instead.

TypeScript 7 uses four type-checker workers by default. On small runners, try --checkers 1 or --checkers 2. For debugging, --singleThreaded also makes parsing and emit single-threaded. The release post says that varying --checkers can, in rare cases, surface order-dependent results, and that a fixed number across environments helps everyone get the same ones.

Type-check time, old and new

The test project is Hono at commit 717dc17, with its locked dependencies (about 920 MB) and the two compilers in a folder next to it:

git clone https://github.com/honojs/hono
cd hono
git checkout 717dc17
npx pnpm@12.6.0 install --frozen-lockfile

mkdir ../stable
cd ../stable
npm init -y
npm install -D @typescript/native@npm:typescript@7.0.2 typescript@npm:@typescript/typescript6@6.0.2
cd ../hono

Its tsconfig.build.json covers 364 files including libraries. Hono is locked to TypeScript 6.0.3, so the config needs no edits. Turning off composite and incremental makes every run cold:

../stable/node_modules/.bin/tsc6 -p tsconfig.build.json --noEmit --composite false --incremental false
../stable/node_modules/.bin/tsc -p tsconfig.build.json --noEmit --composite false --incremental false

The 7.1.0-beta row uses the same command with typescript@7.1.0-beta installed in a separate folder.

These numbers come from one Linux machine (11th Gen Intel i5-1145G7, 8 threads, 15 GB RAM). Each compiler got one unmeasured warm-up, then 10 interleaved runs, timed as wall-clock time around the process. Other work was running on the machine during the run (1-minute load average 14.1 at the start and 11.8 at the end), so an idle machine would give lower absolute times.

CompilerMedian of 10 runsMin to max
tsc6 6.0.34.84s3.98 to 7.11s
tsc 7.0.21.21s0.90 to 1.98s
tsc 7.0.2 --checkers 11.44s1.07 to 2.11s
tsc 7.0.2 --singleThreaded1.37s1.16 to 2.23s
tsc 7.1.0-beta0.82s0.74 to 1.98s

TypeScript 7.0.2 was about 4 times faster than 6.0.3 on this project. Treat the ordering of 6 against 7 as the result: the slowest 7.0.2 run (1.98s) still took half the time of the fastest 6.0.3 run (3.98s). The gaps between the 7.x rows are small next to their spread.

The TypeScript team's own figures use larger codebases, for example 125.7s to 10.6s on VS Code. They describe typical full-build speedups of 8x to 12x. Measure your project before you plan around either set.

Both 6.0.3 and 7.0.2 reported zero errors on Hono. The 7.1 beta reported two new TS7031 errors in src/helper/css/index.ts, while the December 2, 2026 nightly reported none. That is a reason to test a beta in a separate job, not as your required check.

Editors

TypeScript 7 includes a language server built on LSP. In VS Code, install the TypeScript 7 extension. Then run TypeScript: Enable TypeScript 7 from the command palette, or use the setting from the extension README:

{
  "js/ts.experimental.useTsgo": true
}

To use a TypeScript package from your workspace, the README also lists js/ts.tsdk.path. With the aliases from step 4, node_modules/typescript is TypeScript 6, so the README's example path doesn't point at TypeScript 7.

Visual Studio picks TypeScript 7 based on your workspace, according to the release post. The team recommends TypeScript 7 only where language server plugins are not required, so disable it if you rely on one.

If you use the compiler API

TypeScript 7.0 has no stable programmatic API, only typescript/unstable/* entry points. TypeScript 7.1 replaces the single ts object with separate entry points such as typescript/sync, typescript/async, typescript/ast and typescript/fs. It's a new API, so code built on the old ts object needs a port.

This runs on 7.1.0-beta and prints the diagnostics for one file:

import { API } from 'typescript/sync'

const api = new API()
const parsed = api.parseCommandLine(['bad.ts', '--noEmit', '--strict'])
const program = api.createProgram(parsed.fileNames, parsed.options)

for (const d of program.getSemanticDiagnostics()) {
  console.log(d.code, d.text)
}

program.dispose()
api.close()
// 2322 Type 'string' is not assignable to type 'number'.

Dispose programs explicitly, or use using, because the data lives on the Go side. The 7.1 beta also adds content mappers, a plugin point for formats such as .vue and .svelte.

When to use this

Switch now if tsc is your type checker and the aliases cover your other tools. Stay on 6 if your framework embeds the compiler, and look again when 7.1 is stable. If your own tools call the API, start a port against the beta but keep 6 in production.

If you run TypeScript files directly in Node, tsc is only your type checker, and Run TypeScript in Node.js without a build step covers that setup. For the other half of a frontend upgrade, see the Vite 8 and Rolldown upgrade guide.

References