TypeScript 5.8 Released with Improved Inference and Better JavaScript Ecosystem Interoperability
Briefly

Daniel Rosenwasser, principal product manager at Microsoft, announced TypeScript 5.8, which significantly enhances type inference, particularly for conditional return types. It detects previously undetected type errors, such as mismatched return types in functions. Additionally, this version allows TypeScript to run directly within Node.js 23.6, eliminating the need for prior transpilation, contingent on erasable syntax only. Though developers welcomed these advancements, some expressed frustration over the lack of documentation for earlier typecasting issues, highlighting the mixed reception of the update.
The new release catches the type error: Each branch of the conditional is checked against the declared return type of the containing functions, allowing the type system to catch subtle bugs.
Developers can now run TypeScript without a compilation step. With Node.js 23.6 and the --erasableSyntaxOnly flag, TypeScript runs directly in Node.js without transpilation.
Read at InfoQ
[
|
]