-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
format *.vue style like unocss/tailwindcss hover:bg-red-400 got blank space #1448
Comments
This is https://github.com/microsoft/vscode-css-languageservice behavior we can't fix, but you can change css formatter to prettier by https://github.com/johnsoncodehk/volar-plugins/tree/master/packages/prettier. |
I'm also facing this issue, is there a configuration option or way to use prettier globally versus within a single project? |
same +1 how to use prettier only format css code in .vue file? or can i use stylelint to fix? i don't like prettier plug to format vue template.. |
+1 |
1 similar comment
+1 |
Any fix? |
@wlkns You can feature request for it. @leosin You can make you own stylelint plugin by volar langauge service plugin API. And you can push it to https://github.com/johnsoncodehk/volar-plugins if you want. |
Is there any workaround at the moment? This is really breaking development. |
i tried the volar plugin - didnt work - this did ->
"[css]": {
"editor.formatOnSave": true,
"diffEditor.codeLens": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
} To get to this settings file:
To make sure this is working:
|
"CSS › Format: Enable" |
I don't find that
works 'cause it only applies to .css files. Like the OP I need it to apply to the CSS in .vue files. Switching .vue files to use prettier as the default formatter works but I really don't like how it formats templates... |
Anyone has solution to avoid the auto space inside the .vue file? |
Is there any workaround at the moment? This is really breaking development. |
The solution is to install prettier within the project itself with the tailwind prettier plugin. This seems to have worked for me. |
@wlkns thanks, if I understand you correctly that would be another workaround, no solution. Vetur didn't have this issue so in this case Volar is one step back. |
The results here are consistent with formatting .scss in VSCode, I suggest you open an issue with https://github.com/microsoft/vscode-css-languageservice. |
OK thank you for the suggestion, I’ve just done that.
I hope it will be resolved soon…
A lot of people have problems with this issue as I seen on the internet.
Best regards,
Mit freundlichen Grüßen,
Met vriendelijke groet,
Raymond Verbruggen
FOCUSSING
Mispel 8
7621 WB Borne
Netherlands
+31 6 250 500 69
***@***.***> ***@***.***
<http://www.focussing.nl/> www.focussing.nl
Van: Johnson Chu ***@***.***>
Verzonden: zondag 19 februari 2023 22:53
Aan: vuejs/language-tools ***@***.***>
CC: Raymond Verbruggen ***@***.***>; Comment ***@***.***>
Onderwerp: Re: [vuejs/language-tools] format *.vue style like unocss/tailwindcss hover:bg-red-400 got blank space (Issue #1448)
Either implement a working built-in formatter or leave it out completley.
The results here are consistent with formatting .scss in VSCode, I suggest you open an issue with https://github.com/microsoft/vscode-css-languageservice.
—
Reply to this email directly, view it on GitHub <#1448 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGL7MGBI4QKNLY7IFGTYN3LWYKI2DANCNFSM5YTHEKGQ> .
You are receiving this because you commented. <https://github.com/notifications/beacon/AGL7MGDOMV3B62G7LFPZFGTWYKI2DA5CNFSM5YTHEKG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOKWMT46Y.gif> Message ID: ***@***.*** ***@***.***> >
|
same +1 inside .vue style, have any solution? |
It seems to have been fixed in the upstream, could this issue get looked into? |
My suggestion is not to use Volar's built-in formatter. You can install the prettier extension in vscode and set |
I checked with VSCODE version 1.80.0 (june 2023) and Volar extension version 1.8.4 (5 days ago) and the issue is NOT FIXED |
@focussing This bug hasn't been fixed in vscode yet (they didn't update the dependencies and create a new release). Once this issue is resolve in upstream, we can upgrade dependencies to fix this problem. |
@so1ve I used your suggestion to use Prettier because it takes too long to have it done right in Volar/Code. |
The text was updated successfully, but these errors were encountered: