
Also, Microsoft has extended its deprecation of import assertion syntax (i.e. import ... assert {...}) to import() calls like import(..., { assert: {...}}).
With the general release, Microsoft also has updated the DOM types to reflect the latest web standards, including some adjustments to the Temporal APIs. Other capabilities featured in TypeScript 6.0 include:
- There is less context sensitivity on
this-less functions. Ifthisis never actually used in a function, then it is not considered contextually sensitive, which means these functions will be seen as higher priority when it comes to type inference. - A new flag has been introduced, called
–stableTypeOrdering, which is intended to assist with TypeScript 6.0 migrations to Version 7.0. - TypeScript 6.0 adds support for the
es2025option for bothtargetandlib. Although there are no new JavaScript language features in ES2025, this new target adds new types for built-in APIs and moves a few declarations fromesnextintoes2025. - The contents of
lib.dom.iterable.d.tsandlib.dom.asynciterable.d.tsare included inlib.dom.d.ts. Developers still can referencedom.iterableanddom.asynciterablein a configuration file’s"lib"array, but they are now just empty files. TypeScript’sliboption lets users specify which global declarations a target runtime has. - In TypeScript 6.0, using
modulewherenamespacewas expected is now a hard deprecation. This change was necessary becausemoduleblocks are a potential ECMAScript proposal that would conflict with the legacy TypeScript syntax.
The foundation of TypeScript 7.0, meanwhile, is set to be a compiler and language service written in Go that takes advantage of the speed of native code and shared-memory multi-threading. Version 7.0 is “extremely close to completion,” Rosenwasser said. It can be tried out from the Visual Studio Code editor or installed via NPM. “In fact, if you’re able to adopt TypeScript 6.0, we encourage you to try out the native previews of TypeScript 7.0,” Rosenwasser said.

