Microsoft 11955 Published by

Microsoft’s TypeScript 6.0.1 RC arrives with a handful of configuration shifts that let existing projects keep compiling while preparing for the upcoming native Go‑based compiler in TS 7.0. The RC is pulled into a project by running npm install -D typescript@rc, and then a few tsconfig tweaks—such as setting "strict": false if sloppy code was previously tolerated, "module": "commonjs" when ESM isn’t the target, or specifying "types": ["node"] to avoid phantom “cannot find name” errors—eliminate most of the new error wall. The compiler now warns that baseUrl and legacy module resolution flags are deprecated; removing baseUrl and prefixing paths entries restores old alias behaviour without extra config. Enabling the experimental --stableTypeOrdering flag makes union ordering match how TypeScript will order them in 7.0, helping with declaration file comparison and surfacing inference differences that may require explicit type arguments or annotations to fix.



Upgrading to TypeScript 6.0.1 RC Without Breaking Your Build

If the latest TypeScript release candidate has just dropped into your npm registry, this quick guide shows how to pull it in and tweak a few config bits so that your code keeps compiling instead of throwing a mountain of new errors.

Installing the Release Candidate

Running npm install -D typescript@rc pulls down the RC tarball. If you’re using Yarn, the equivalent is yarn add -D typescript@rc. The package name stays the same; only the tag changes to “rc” so that npm keeps the regular stable version separate.

Adjusting tsconfig for 6.0

The biggest shift in 6.0 is that several options now default to values that match most modern projects, and a few are no longer valid at all.
Because strict is true by default, any code that previously relied on implicit any will suddenly surface type errors unless you explicitly set "strict": false.
The module system defaults to ESNext; if your project still targets CommonJS, add "module": "commonjs".
Target has moved to the most recent ECMAScript spec—currently es2025. If you need an older emit, pick a specific target like es2019.
Finally, the compiler no longer auto‑adds every @types package it can find; setting "types": ["node"] or whatever libraries your code uses keeps the build fast and avoids phantom errors.

Common Pitfalls and How to Fix Them

A frequent hiccup surfaces when a monorepo that used path aliases with a baseUrl suddenly reports “Cannot find module …”. The new compiler treats baseUrl as a lookup root, so dropping it and prefixing the paths entry (e.g. "@app/*": ["./src/app/*"]) restores the old behaviour without any extra configuration.

Another scenario occurs when you run tsc src/index.ts while a tsconfig.json sits in the same folder. In 6.0 the compiler throws TS5112, telling you that file arguments override the config unless you pass --ignoreConfig. That flag is handy for quick scripts or one‑off compilations where you want to avoid touching your project’s configuration.

If after an upgrade you see a flurry of “Cannot find name 'process'” errors, it usually means the implicit inclusion of all @types packages has been disabled. Adding "types": ["node"] (or adding whatever global types you use) solves the issue in a single line.

Using New Flags for Migration

The --stableTypeOrdering flag was introduced to make 6.0’s union and property ordering match how TypeScript will order them in 7.0. This is useful when you’re doing output comparisons or writing tests that depend on declaration file order. Enabling it can surface inference differences: a union that used to be inferred as 100 | 500 might now come out as 500 | 100. If that triggers an error, inserting an explicit type argument (e.g. <number>) or annotating a variable often restores the expected behaviour.

The new es2025 library brings in helpers such as RegExp.escape and the Temporal API types, which you can use immediately with "lib": ["esnext"]. For instance:

const escaped = RegExp.escape("foo+bar");
Deprecated Features You Might Encounter
  • The target: es5 option is gone; migrate to a newer target or run a separate transpiler if you really need ES5 output.
  • --downlevelIteration has no effect now that es5 output is deprecated, and the flag will emit an error if present.
  • The old moduleResolution: node alias (also called node10) is removed; switch to nodenext or bundler.
  • Any use of the legacy module keyword inside a namespace declaration now errors—switch to the proper namespace syntax.
  • Import assertions (import … asserts { type: "json" }) are no longer supported; use import attributes instead (with { type: "json" }).

Most of these changes can be addressed with a quick search and replace, but keeping an eye on the deprecation warnings during your next build will help avoid surprises when 7.0 lands.

Wrap‑Up

With those handful of configuration tweaks in place, you should be able to run tsc against your existing codebase without the compiler throwing a wall of new errors. Keep the RC under version control and test as early as possible; that way any remaining quirks are caught before the full release arrives.

Release TypeScript 6.0.1 RC

For release notes, check out the release announcement blog post.

Release TypeScript 6.0.1 RC · microsoft/TypeScript