-
-
Notifications
You must be signed in to change notification settings - Fork 441
FR: Add a setting to switch prettyhtml to Prettier 2.x for <template>
#672
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
Comments
I think we should respect the user's code and keep least invasive by default, so I chose other formatters instead of Prettier on html, pug, js, ts after compared. (Prettier is designed on the opposite principle) In addition, instant availability is more important than maintenance. And prettyhtml is a mature enough project. |
Ok I understand the design philosophy. I will update the issue to reflect it as a F.R. instead and we can close when we create the plugin system to change the default formatter to another. |
<template>
formatting.<template>
@mesqueeb Uhm... do I understand something wrong here? I'm the author or |
@Shinigami92 I'm not mean Prettier not good, but it will "modify as much as possible to make the code look better", and my requirement is "to keep the original code as much as possible and only make necessary changes". On the other hand, I also deliberately to not choose Prettier, because Prettier already has its own formatting extension. I hope users who like to extreme format the code to use Prettier's extension instead of focusing all their attention on an "all-rounder" Vue Extension. IMO this is better for Prettier ecology. (also to ESLint) |
@Shinigami92 Do you know how to set up Prettier to format |
No, I use explicite scss files, maybe subscribe this one: prettier/prettier#11747 |
Do you have any goal for an amount of monetary support that would allow you to work on this feature?
-- The reason I'm really looking forward to this feature request is because until now we have used Vetur with Prettier formatting for the I tried making the team switch to Volar for better TS support now we use Vue 3, but it causes all sorts of issues because the prettyhtml formatter is really different from what we had until now. Just one example of what happens in most of our files by letting Volar format the vue file: |
@mesqueeb In our team we are just using |
@sheremet-va and Prettier won't lint the style section at all because we use sass.... You can also check this prettier thread, they're not even interested in supporting sass: 😭 |
@mesqueeb Oh, I see, we are using Usually if I can't find a proper solution, I write my own VS Code plugin, |
@sheremet-va yeah 😄 but Would you be able to help me write a VSCode plugin that either
We can probably sponsor some of the development from our company if I request. |
@mesqueeb I can try doing something like that on the weekends if you'l remind me. I'm on discord as |
@johnsoncodehk thanks so much for all your hard work!! I'm gonna try the new configuration to switch prettyhtml for prettier. |
@mesqueeb it's not release yet. :) |
is there an easy way to setup VSCode with Volar to auto-format Prettier 2.x for HTML & Script, but use We use Prettier 2.x now to format the entire vue file, but it can't format the SASS for us now. I was hoping Volar could perhaps take care of that. (we don't wanna use volar's default prettierHTML though) I looked here: #1027 |
Feature Request:
<template>
original issue below:
prettyhtml is pretty much unmaintained and they have a notice on their README like so:

I think it would be better if Volar uses Prettier for the template section of a Vue file by default.
Is there a specific reason Volar chose prettyhtml over Prettier as the default HTML formatter?
Currently the only workaround is to set Prettier to completely format Vue files.
But that's not really an option because then we loose the proper sass-formating for the
style lang=sass
section of a Vue file. (sass formatting is something that Prettier can't do natively)The text was updated successfully, but these errors were encountered: