Skip to content

JSDoc type cast parens are removed #218

@Rich-Harris

Description

@Rich-Harris

When using JSDoc, it's common to do this sort of thing:

const x = /** @type {Foo} */ (a.b).c();

This tells TypeScript that a.b is of type Foo. Prettier will preserve those parentheses when processing JS files, but for whatever reason it fails to do so inside .svelte files, instead turning it into this:

const x = /** @type {Foo} */ a.b.c();

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions