Skip to content

Unstable Vue formatting / semicolon issue #5406

@lydell

Description

@lydell

Prettier 1.15.1
Playground link

--parser vue

Input:

<template>
  <p @click="() => {console.log(test)}">
    test
    </p>
</template>

Output:

<template>
  <p
    @click="
      () => {
        console.log(test);
      }
    "
  >
    test
  </p>
</template>

Second Output:

<template>
  <p
    @click="
      () => {
        console.log(test);
      };
    "
  >
    test
  </p>
</template>

Expected behavior:

  1. Stable formatting
  2. According to feat: support HTML/Vue/Angular #5259 (comment) the semicolon after the } is not allowed.

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.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions