The Prettier bundled in Vetur for Visual Studio Code is out of date.
See original GitHub issue- I have searched through existing issues
- I have read through docs
- I have read FAQ
- 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Prettier - Code formatter - Visual Studio Marketplace
Prettier Formatter for Visual Studio Code. Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code ...
Read more >How to reformat a Vue.js component in VS Code?
Here's what I think the current state of the art is: Use extensions vetur and prettier (specifically, esbenp.prettier-vscode Prettier - Code ...
Read more >How I Resolved Vue.js, VSCode, Vetur, Prettyhtml, and ...
Prettier is out because it always wraps attributes - without a way to disable it. Prettyhtml can disable the attribute wrap, but it...
Read more >Source - GitHub
Bracket pair colorization support for VSCode 1.60+. Thanks to contribution from ... Stop computing outdated diagnostics with CancellationToken.
Read more >Vue.js Single Page Application with ASP.NET MVC 5 - kleypot
Finally, if we run the debugger in Visual Studio, we should see the ... Now we have Vue and webpack working, but our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reason: https://esbuild.github.io/api/#keep-names
I found a key about this problem. I fixed it and add a test.
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.