Skip to content

TypeScript 4.0 Syntax Support #2260

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy