Skip to content

TypeScript 4.5 Support #3950

Closed
Closed
@bradzacher

Description

@bradzacher

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:

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

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 and Promise 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureNew TypeScript Versionaccepting prsGo ahead, send a pull request that resolves this issuedependenciesIssue about dependencies of the package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions