-
-
Notifications
You must be signed in to change notification settings - Fork 594
Description
Problem
This isn't really much of a problem: complete support for HTML and Vue is planned for Prettier 1.15! 🎉🎉🎉 And to me, it looks really good. See prettier/prettier#5259 for their progress and a link to a preview.
This issue is to hopefully begin implementing opt-in support for these changes so that Vetur will be ready once the new version of Prettier is released.
However, IMHO, the best way to do this is a bit different: once Prettier 1.15 is released, one solution is to simply disable formatting by default, and encourage users to install the official Prettier VS Code extension alongside Vetur. This way, Vetur should still support language-specific formatters for individual script/style/template blocks (ESLint, TSLint, stylus-supremacy, etc.) but users could also switch to using their own language-agnostic, whole-file/unified formatting with Prettier. I think that users can still opt to only format certain languages in Vue files.
This approach has many benefits:
- Prettier now maintains its own formatting support
- Prettier can use unified settings (printWidth, tab style, quotes, etc.) for all languages.
- Users can choose their own version of Prettier
- The BYOF (Bring Your Own Formatter) approach allows Vetur to focus on more important features (intellisense, syntax highlighting, etc.)
- Users who don't like Prettier's opinionated style can still use their own formatters (such as prettyhtml) for individual languages through Vetur (including the current support for using Prettier as a formatter for individual blocks so that users can combine formatters, for example ESLint for JS and Prettier for CSS).
Overall, decoupling Prettier from Vetur will soon be made possible, which is a good change for users and developers alike.
Side note: this may impact (or maybe fix) #543.