Skip to content

TypeScript 4.0 Syntax Support #2260

Closed
Closed
@bradzacher

Description

@bradzacher

https://devblogs.microsoft.com/typescript/announcing-typescript-4-0-beta/

Variadic Tuple Types (Supported)

type Strings = [string, string];
type Numbers = number[]

// [string, string, ...Array<number | boolean>]
type Unbounded = [...Strings, ...Numbers, boolean];

This is already supported at the AST level - this is a type functionality change only.

Labelled Tuple Elements (Supported #2378)

type Foo = [first: number, second?: string, ...rest: any[]];

This requires AST updates.

Short-Circuiting Assignment Operators (Supported #2307)

// "Or Or Equals" (or, the Mallet operator :wink:)
a ||= b;

// "And And Equals"
a &&= b;

// "QQ Equals"
a ??= b;

This requires AST updates.
AST: estree/estree#212

unknown on catch Clause Bindings (Supported #2306)

try {
    // ...
}
catch (e: unknown) {
    // ...
}

This requires AST updates

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureNew TypeScript VersiondependenciesIssue about dependencies of the packagepackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions