Skip to content

bug: Combining function bindings with comments causes unnecessary parentheses to be inserted #500

@baseballyama

Description

@baseballyama
<Foo
  bind:value={
    // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- ignore
    () => bar ?? '',
    (v) => {
      bar = v;
    }
  }
/>

Formatting the above code results in the following code.

<Foo
  bind:value={
    // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- ignore
    (() => bar ?? '',
    (v) => {
      bar = v;
    }
  }
/>

I believe parentheses before () => bar ?? '' is unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions