Skip to content

Arrow function parameters containing comment has parens removed incorrectly #533

@jakebailey

Description

@jakebailey

Describe the bug

dprint-plugin-typescript version: 0.85.0

Input Code

client
    .send(lookup)
    .then((
        resp, // $ExpectType Batch<Lookup>
    ) => console.log(resp))
    .catch((
        err, // $ExpectType any
    ) => console.error(err));

Config:

{
  "arrowFunction.useParentheses": "preferNone"
}

Expected Output

client
    .send(lookup)
    .then((
        resp, // $ExpectType Batch<Lookup>
    ) => console.log(resp))
    .catch((
        err, // $ExpectType any
    ) => console.error(err));

(or something)

Actual Output

client
    .send(lookup)
    .then(resp // $ExpectType Batch<Lookup>
     => console.log(resp))
    .catch(err // $ExpectType any
     => console.error(err));

Hit roughly 4 times in testing DT with dprint.

Metadata

Metadata

Assignees

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