TypeScript Go (tsgo)
TypeScript 7 is a native Go port of the TypeScript compiler (codenamed tsgo). It targets the same language semantics as TypeScript 5/6 but is significantly faster — benchmarks show 10× or more improvement on large codebases.
Install @typescript/native-preview to get the tsgo binary (TypeScript 7
dev preview). Separately, apply the TypeScript 6.0 migration checklist to your
tsconfig.json to avoid deprecation errors when fully upgrading.
Installation
Section titled “Installation”npm i @typescript/native-previewyarn add @typescript/native-previewpnpm add @typescript/native-previewbun add @typescript/native-previewThis installs the tsgo binary. You can expose it as an optional script for
native checks:
{ "scripts": { "typecheck:tsgo": "tsgo --noEmit" }}TypeScript 5.x → 6.0 migration
Section titled “TypeScript 5.x → 6.0 migration”TypeScript 6.0 is the version that bridges the legacy TypeScript 5 compiler and the forthcoming TypeScript 7 (tsgo). Most changes are new defaults and deprecations preparing for 7.0.
Changed default values
Section titled “Changed default values”| Option | TS 5 default | TS 6 default |
|---|---|---|
strict | false | true |
target | ES3 | es2025 |
module | CommonJS | es2022 (resolved from target) |
moduleResolution | node10 | bundler |
rootDir | inferred from source files | . (tsconfig directory) |
types | all @types auto-included | [] (none) |
noUncheckedSideEffectImports | false | true |
libReplacement | true | false |
esModuleInterop | false | true |
Deprecated options
Section titled “Deprecated options”All deprecations in TS 6 become hard removals in TS 7:
| Deprecated option/value | Migration |
|---|---|
target: "es3" / "es5" | target: "es2015" or higher |
downlevelIteration | Remove entirely |
moduleResolution: "node" / "node10" | "nodenext" or "bundler" |
moduleResolution: "classic" | "nodenext" or "bundler" |
module: "amd" / "umd" / "system" / "none" | "esnext", "commonjs", "nodenext" |
baseUrl | Inline value into paths entries |
esModuleInterop: false | Remove (always true) |
allowSyntheticDefaultImports: false | Remove (always true) |
alwaysStrict: false | Remove (always strict) |
outFile | Use a bundler |
module Foo {} namespace syntax | namespace Foo {} |
import ... assert {} import assertions | import ... with {} |
Priority migration checklist
Section titled “Priority migration checklist”Priority 1 — likely breaking for most projects:
- Set
"types": ["node"](or all@typespackages you need) — types are no longer auto-discovered. - Set
"rootDir": "./src"if you were relying on inference (source files in a subdirectory). - Review the new
strict: truedefault — set"strict": falseif not ready.
Priority 2 — common adjustments:
- Set explicit
targetif you need something other thanes2025. - Set explicit
moduleif you need CommonJS output. - Remove
baseUrland inline its value intopathsentries. - Replace
import ... assert {}withimport ... with {}. - Replace
module Foo {}withnamespace Foo {}. - If you have side-effect imports that do not resolve, set
"noUncheckedSideEffectImports": false.
Priority 3 — deprecated options to remove:
Remove downlevelIteration, outFile, alwaysStrict: false, esModuleInterop: false, allowSyntheticDefaultImports: false, and update legacy moduleResolution / module values.
Temporary escape hatch
Section titled “Temporary escape hatch”Add "ignoreDeprecations": "6.0" to tsconfig.json to silence deprecation
warnings while you migrate. This will not work in TypeScript 7.
{ "compilerOptions": { "ignoreDeprecations": "6.0" }}Automated migration tool
Section titled “Automated migration tool”The ts5to6 tool (by a TypeScript
team member) automates the two most disruptive changes — baseUrl removal and
rootDir inference:
npx @andrewbranch/ts5to6 --fixBaseUrl .npx @andrewbranch/ts5to6 --fixRootDir .