Description
https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-rc/
This issue is just to track all of the new features and their implementation state in this project.
As with all releases, we will not necessarily to support all features until closer to the full release when everything the features are stabilised.
Please be patient.
type
Modifiers on Import and Export Names
import { someFunc, type BaseType } from "./some-module.js";
// ^^^^^^^^^^^^^
type T = 1;
export { type T };
This will require AST changes.
Babel: babel/babel#13802
This will require updates to scope analysis:
This will require updates to rules:
consistent-type-exports
consistent-type-imports
no-shadow
Private Field Presence Checks
class Person {
#name: string;
constructor(name: string) {
this.#name = name;
}
equals(other: unknown) {
return other &&
typeof other === "object" &&
#name in other &&
// ^^^^^^^^^^^^^^
this.#name === other.#name;
}
}
This will require AST changes.
ESTree: https://github.com/estree/estree/blob/master/es2022.md#binaryexpression
Import Assertions
import obj from "./something.json" assert { type: "json" };
This will require AST changes.
ESTree: https://github.com/estree/estree/blob/master/stage3/import-assertions.md
- PR: feat(typescript-estree): support Import Assertions #4074, fix(visitor-keys): add missing import assertion keys #4178
lib.d.ts
Changes
Will require regeneration of @typescript-eslint/scope-manager
types.
Better Editor Support for Unresolved Types
This might break a few tests due to the type printer printing something that isn't any
.
Other changes with no impact to us
- Supporting lib from node_modules
- The
Awaited
Type andPromise
Improvements - Template String Types as Discriminants
--module es2022
- Tail-Recursion Elimination on Conditional Types
- Disabling Import Elision
- Faster Load Time with
realPathSync.native
- New Snippet Completions
- Better Editor Support for Unresolved Types
- Inference Changes from
Awaited
- Compiler Options Checking at the Root of
tsconfig.json
- Restrictions on Assignability to Conditional Types