TypeScript 6.0 Beta Announced: What's Changing?

3 min read

Originally published in Turkish. Read the original →

TypeScript 6.0 Beta Announced: What's Changing? - cover image
Summary

TypeScript 6.0 Beta has been released. The new version arrives as preparation for the move to TypeScript 7.0 and brings significant changes to module resolution, default settings and many legacy options.

Microsoft has announced TypeScript 6.0 Beta. This release isn't just an update with new features; it is also positioned as a "bridge release" for the move to TypeScript 7.0.

The team had previously announced that with 7.0, the compiler and language service will move to a new Go-based architecture. 6.0 Beta also includes the groundwork for this transition.

To try the beta:

bash
npm install -D typescript@beta

Highlights

1) Less context sensitivity for functions that don't use this

In previous versions, type inference in some method syntax examples could break unexpectedly depending on property order. TypeScript 6.0 handles a function better when this isn't actually used inside it, making type inference more consistent.

Practical result: you will see fewer unnecessary unknown errors caused by the order of methods inside an object literal.

2) Support for subpath imports starting with #/

In line with the change in recent Node.js versions, TypeScript now supports #/-based import mappings.

This support applies in particular to these moduleResolution options:

  • node20
  • nodenext
  • bundler

This makes it possible to write imports closer to the short aliases used in the bundler world.

3) --moduleResolution bundler + --module commonjs can be used together

This combination used to be restricted. With 6.0, a more flexible intermediate migration path opens up, especially for projects that want to move from the old node/node10 resolution to a modern configuration.

4) New flag: --stableTypeOrdering

With parallel type checking in TypeScript 7.0, deterministic type ordering becomes critical. The --stableTypeOrdering flag added in 6.0 brings the internal ordering of types closer to 7.0 behavior.

As a result:

  • Unnecessary differences when comparing 6.0 and 7.0 output are reduced.
  • "Order-related noise" drops, especially in .d.ts generation.

Note: This flag can noticeably increase build time in some projects.

5) The dom library now includes dom.iterable and dom.asynciterable

lib: ["dom"] is now enough for most modern browser scenarios. The dom.iterable or dom.asynciterable entries that used to be added separately are now practically empty/unnecessary.

Important breaking changes in TypeScript 6.0

To prepare for 7.0, 6.0 simplifies many old behaviors. The most critical points:

Changes to defaults

  • strict now defaults to true
  • module defaults to esnext
  • target defaults to the current ECMAScript version (currently es2025)
  • noUncheckedSideEffectImports defaults to true
  • libReplacement defaults to false

rootDir now defaults to the project root

When rootDir isn't set, the folder containing the tsconfig.json file is now used. The previous inference based on the common path has changed.

If your output ends up in an unexpected folder like dist/src/..., the fix is usually:

json
{
  "compilerOptions": {
    "rootDir": "./src"
  }
}

types now defaults to []

Previously, many packages under node_modules/@types could be loaded automatically. 6.0 turns this off and sets the default to an empty array for performance.

A commonly needed example:

json
{
  "compilerOptions": {
    "types": ["node", "jest"]
  }
}

If you want to restore the old behavior:

json
{
  "compilerOptions": {
    "types": ["*"]
  }
}

Deprecated settings / settings on the way to removal

With TypeScript 6.0, the following settings are deprecated or will be removed entirely in 7.0:

  • target: "es5"
  • --downlevelIteration
  • module: "amd" | "umd" | "systemjs"
  • --baseUrl
  • moduleResolution: "classic"
  • esModuleInterop: false
  • allowSyntheticDefaultImports: false
  • alwaysStrict: false
  • outFile
  • The old module Foo {} syntax used instead of namespace
  • The import ... asserts {} syntax (with should be used)
  • ///

Running tsc file.ts in a folder that has a tsconfig.json now produces an error. To deliberately skip this behavior:

bash
tsc --ignoreConfig file.ts

A practical checklist for migrating

A short action plan for teams moving to TypeScript 6.0:

1. Define the types field explicitly in tsconfig.json. 2. If needed, make the rootDir value explicit (such as ./src). 3. Move baseUrl usage into paths with explicit prefixes. 4. Move projects that use moduleResolution: classic to bundler or nodenext. 5. Review the tsc calls in your CI pipeline (check whether you need --ignoreConfig). 6. If you're going to compare against 7.0, try --stableTypeOrdering temporarily.

Toward TypeScript 7.0

The TypeScript team defines 6.0 as a transition release. Some warnings can be suppressed temporarily with "ignoreDeprecations": "6.0"; but since these options will be removed entirely in 7.0, adapting early is the safer choice.

In short: rather than new features, 6.0 Beta brings alignment with the reality of modern JavaScript and a performance-focused simplification.

> Source: The TypeScript team's official "Announcing TypeScript 6.0 Beta" announcement (Daniel Rosenwasser).