TypeScript 5.7 introduces enhanced error reporting, relative path rewriting, and more
Microsoft has announced the release of TypeScript 5.7, the latest iteration of its widely-used JavaScript-based programming language. This version introduces several enhancements, including improved error reporting for uninitialized variables and a new compiler option, --rewriteRelativeImportExtensions. This option allows developers to write TypeScript code that can be executed directly and later compiled into JavaScript by rewriting import paths with the correct JavaScript extensions.
TypeScript 5.7 also extends support to target ECMAScript 2024 runtimes with the --target es2024 option, enabling the use of the new --lib es2024 library features. This update includes moving Atomics.waitAsync from --lib es2022 to --lib es2024.
The update improves the process of finding tsconfig.json files in editors using TSServer. Instead of stopping at the first tsconfig.json found, the editor now continues to search up the directory tree, offering more flexibility in project organization and configuration.
Additionally, when importing from a JSON file under the --module nodenext setting, TypeScript 5.7 enforces specific rules to minimize runtime errors. The release also includes enhancements such as faster project ownership checks in editors for composite projects, support for V8 compile caching in Node.js, and various bug fixes and behavioral changes.