TypeScript 5.8 released

Published by

A new Microsoft news has been published: TypeScript 5.8 released

TypeScript 5.8 released

Microsoft has announced the release of TypeScript 5.8, a language that builds on top of JavaScript by adding syntax for types. It allows for more granular checks for branches within return expressions, which were not documented in the beta post but will remain in TypeScript 5.8. The type system special-cases conditional expressions directly inside return statements, checking against the declared return type of the containing functions. TypeScript 5.8 also supports the require() of ECMAScript modules in the --module nodenext flag, allowing TypeScript to avoid issuing errors on require() calls to ESM files. This feature may be back-ported to older versions of Node.js, but future versions may stabilize the feature under node20. Users of Node.js 22 and newer should use the --module nodenext flag, while library authors and users of older versions should remain on the --module node16 or minor update to the --module node18 flag.

Read more @ NT Compatible