Vetur: The Prettier bundled in Vetur for Visual Studio Code is out of date.

Created on 13 Nov 2020  路  6Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [ ] I have read through docs
  • [ ] I have read FAQ
  • [x] I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Windows
  • Vetur version: 0.30.1
  • VS Code version: 1.51.1

Problem



Create a Vue file and fill its <style> tag with a CSS rule that includes a background shorthand:

<style>
.a {
    background: #fff url(/a.jpg) 50px calc(100% + 2px) no-repeat
}
</style>

Then format document. The above code would be formatted to:

<style>
.a {
  background: #fff url(/a.jpg)50pxcalc(100% + 2px)no-repeat;
}
</style>

It may have something to do with the fact that the Prettier bundled is out of date. A similar problem used to occur in Glitch:
https://github.com/prettier/prettier/issues/8067

However, quoting the URL can keep the rule above correctly formatted.

Reproducible Case

bug formatting

All 6 comments

This problem isn't out of date prettier,
We use v2.1.2 version with prettier.
but rather when passing the search plugin folder to prettier.
I need time to study the problem.

Hmm, Probably is a esbuild minify problem.
yarn watch is ok.
yarn compile is wrong.

Hmm, Probably is a esbuild minify problem.
yarn watch is ok.
yarn compile is wrong.

But why does it affect the generated code?

Hmm, Probably is a esbuild minify problem.
yarn watch is ok.
yarn compile is wrong.

But why does it affect the generated code?

Reason: https://esbuild.github.io/api/#keep-names

I found a key about this problem.
I fixed it and add a test.

Command 'Vetur: Restart VLS (Vue Language Server)' resulted in an error (command 'vetur.restartVLS' not found)

The Vue Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

Was this page helpful?
0 / 5 - 0 ratings