Skip to content

Prettier v3.4 adds parens around statement in v-on #16885

@ntnyq

Description

@ntnyq

Prettier 3.4.0
Playground link

--parser vue

Input:

<template>
  <button @click="isFoobar = !isFoobar">Click</button>
</template>

Output:

<template>
  <button @click="(isFoobar = !isFoobar)">Click</button>
</template>

Expected output:

<template>
  <button @click="isFoobar = !isFoobar">Click</button>
</template>

Why?

There is no need to add parens around the statement.

So we should left it as it is.

v3.4 docs doesn't mention this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:vueIssues affecting Vuelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions