Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Added semicolon in front of template string #206

Closed
lehni opened this issue Apr 29, 2021 · 2 comments · Fixed by #209
Closed

Bug: Added semicolon in front of template string #206

lehni opened this issue Apr 29, 2021 · 2 comments · Fixed by #209
Labels
framework: Vue Related to the framework Vue type: bug Functionality that does not work as intended/expected

Comments

@lehni
Copy link
Collaborator

lehni commented Apr 29, 2021

Info

Tool Version
Plugin v1.14.0
Prettier v2.2.1
Framework vue
Node v14.15.4
OS mac

Prettier config

{
  "printWidth": 80,
  "semi": false,
  "singleQuote": true,
  "arrowParens": "avoid",
  "trailingComma": "none",
  "pugSingleQuote": false,
  "pugAttributeSeparator": "none",
  "pugCommentPreserveSpaces": "trim-all",
  "pugWrapAttributesThreshold": 1,
  "pugWrapAttributesPattern": "^(@|v-)"
}

Input

<template lang="pug">
span
  | {{ `USD ${getPrice(shopItem)}` }}
</template>

-->

Output or Error

A semicolon is added in front of the template string.

span
  | {{ ;`USD ${getPrice(shopItem)}` }}

Expected Output

span
  | {{ `USD ${getPrice(shopItem)}` }}
@Shinigami92 Shinigami92 added framework: Vue Related to the framework Vue type: bug Functionality that does not work as intended/expected labels Apr 29, 2021
@lehni lehni changed the title Bug: Bug: Added semicolon in front of template string Apr 29, 2021
@Shinigami92
Copy link
Member

This bug was introduced somewhere in 1.13.5...1.14.0
I think via 2e77531

@SkyaTura Do you want to have a look? Or should I fix it?
A special test for this would be nice 🙂

@lehni
Copy link
Collaborator Author

lehni commented Apr 29, 2021

I'm aware that this is the better way to write this, but the above is still strange:

span
  | USD {{ getPrice(shopItem) }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework: Vue Related to the framework Vue type: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants