Skip to content

Handle import attributes in TS import typeΒ #16072

@ArnaudBarre

Description

@ArnaudBarre

Prettier 3.2.5
Playground link

Input:

type A = import("foo", {with: {type: "json"}})

Output for typescript parser:

type A = import("foo")

Output for babel-ts parser:

SyntaxError: Unexpected token, expected ")" (1:22)

Expected output:

type A = import("foo", { with: { type: "json" } });

Why?

Because we all love spec changes.

I don't know if anyone would need this currently, just found it when trying to understand difference between two AST representations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions