Skip to content

as in array destructuring is printed wrong (babel-ts only) #10635

@thorn0

Description

@thorn0

This is valid TypeScript, but Prettier corrupts it. AST isn't aligned with typescript-estree.

Prettier pr-10416
Playground link

--parser babel-ts

Input:

[a as any] = x;

Output:

[a: any] = x;

Originally posted by @thorn0 in #10416 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty:easyIssues that should be easy to fix. Resolve me on the train to work!help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions