TypeScript 4.8, a planned upgrade to Microsoft’s strongly typed JavaScript variant, has reached the release candidate stage. The new version brings correctness and consistency improvements, along with fixes to file watching on Linux and macOS.

The TypeScript 4.8 release candidate (RC) arrived on August 11. The release is due for general availability on August 23. The RC adds support for excluding which files will be considered in auto imports.

The preceding beta release, which published June 21, introduced improvements to consistency and correctness under strictNullChecks. These changes affect how intersection and union types function and are leveraged in how TypeScript narrows types. In one example, unknown is close in spirit to the union type {} | null | undefined because it accepts null, undefined, and any other type. TypeScript now recognizes this and allows assignments from unknown to {} | null | undefined. Changes in TypeScript 4.8 allow for sensible improvements in control flow and type narrowing, Microsoft said. Generic values also get narrowed.