TypeScript 6.0 beta: new defaults, many deprecations and the bridge to TypeScript 7
On February 11, Microsoft published the TypeScript 6.0 beta. It is worth being clear that this is a beta, not the final release, but it already shows what is coming. And what is coming is a transition release: according to the announcement, 6.0 is meant to be the last release based on the current JavaScript codebase. TypeScript 7.0 will be built on a native compiler written in Go. Version 6.0 exists, in large part, to prepare projects for that jump.
To try it:
npm install -D typescript@beta
The new defaults
The change that will show up most in real projects is the switch in compiler defaults:
strictbecomestrue;modulebecomesesnext;targetbecomes the latest ECMAScript version, currentlyes2025;noUncheckedSideEffectImportsbecomestrue;libReplacementbecomesfalse;typesbecomes[];rootDirbecomes the directory containingtsconfig.json.
The types default is the one most likely to break builds. Previously, TypeScript automatically included installed @types packages; now many projects will need to explicitly declare something like "types": ["node"]. If your project suddenly cannot find process or Buffer, this is why.
Making strict the default is, in my opinion, the right change and an overdue one. Almost every new project already turns on strict; now the zero-config behavior reflects how TypeScript is actually used.
New features
Some practical additions:
- Subpath imports with
#/work withmoduleResolutionnode20,nodenextandbundler. --moduleResolution bundlercan be combined with--module commonjs, which helps projects that still emit CommonJS but use a bundler.--stableTypeOrderingmakes type ordering match TypeScript 7.0, to make comparisons easier during migration. The announcement warns that the flag can slow type-checking by up to 25% and is not meant as a permanent setting.es2025astargetandlib, with types such asRegExp.escape.- Temporal types via
esnextortemporal.esnext(the proposal is at stage 3). getOrInsertandgetOrInsertComputedonMapandWeakMap, in theesnextlib.- The contents of
dom.iterableanddom.asynciterableare now part ofdom; those two lib files are now empty.
The deprecation list
This is the heart of 6.0. Deprecated or removed:
target: es5and--downlevelIteration;--moduleResolution node(node10) andclassic(removed);--moduleamd,umdandsystemjs;baseUrlandoutFile(the latter removed);- setting
esModuleInteroporallowSyntheticDefaultImportstofalse, andalwaysStrict: false; - the
modulekeyword for namespaces,assertson imports (replaced bywith) and theno-default-libdirective.
CLI behavior changes too: passing files on the command line when a tsconfig.json exists now raises error TS5112. To skip the config, use --ignoreConfig.
You can silence the deprecations in 6.0 with "ignoreDeprecations": "6.0". But that only postpones the problem: TypeScript 7.0 removes these options entirely.
How I would prepare
In practice, 6.0 is a dress rehearsal for 7.0. My suggestion:
- Install the beta on a branch and run type checking without
ignoreDeprecations, to see the real list of problems. - Declare
typesexplicitly intsconfig.json. - Replace
baseUrlwith subpath imports or relativepaths, and move offmoduleResolution node. - If you still depend on
es5oroutFile, start planning your exit now, because there will be no version 7 with them.
My take
TypeScript 6.0 is a release few people will find exciting, and that is fine. Its value lies in doing the boring work before the native compiler arrives: cleaning up legacy options, aligning defaults with real-world usage and offering tools like --stableTypeOrdering to compare results. Teams that treat 6.0 as the moment to tidy up their tsconfig will have a smooth migration to 7.0. Teams that just flip ignoreDeprecations and move on will pay the bill later, with interest.