Typescript team announces the availability of TypeScript 4.6. TypeScript is a language that builds on JavaScript and adds syntax for types. Types help describe what kinds of values you’re working with, giving your code better readability by telling the editor about any mistakes made in it before they become errors! You won’t need to worry much when using this tool because not only does TypeScript check out all possible errors but also gives many excellent features like completions so there’s no excuse not use them anymore.
In their beta version, TypeScript developers missed documenting two great features – control flow analysis for destructured discriminated unions and the addition of es2022 output target. They also made an additional noteworthy change since their beta – removing void 0 arguments in react-jsx mode. All these changes are available in the TypeScript 4.6.
The RC (Release Candidate) team finally captured the community’s suggestions for mismatched JSDoc parameter names, and these changes will be included in this update of TypeScript 4.6.
List of changes in TypeScript 4.6
- Allowing Code in Constructors Before
super()
- Control Flow Analysis for Destructured Discriminated Unions
- Improved Recursion Depth Checks
- Indexed Access Inference Improvements
- Control Flow Analysis for Dependent Parameters
--target es2022
- Removed Unnecessary Arguments in
react-jsx
- JSDoc Name Suggestions
- More Syntax and Binding Errors in JavaScript
- TypeScript Trace Analyzer
- Breaking Changes
To start using TypeScript, you can get it through NuGet or use npm with this command:
npm install typescript
References:
- https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/
- https://devblogs.microsoft.com/typescript/announcing-typescript-4-6-rc/