0

I have a Vue project. When I go into my VS Code settings, I see an extension called "Vetur". I believe Vetur is what takes care of all code formatting for me. Under settings, when I click into Vetur, it gives me a list of different formatters for JS, CSS, HTML, etc. as they appear within Vue files. Here's a picture:

Picture of Vetur settings

The default formatter set for most things is something called prettier.

However, when I go into settings (which takes me to a file called settings.json), I don't see the word "prettier" there at all! Instead, I see a bunch of settings for other formatters that weren't selected (such as js-beautify-html), and the closest thing to the word "prettier" is the word "prettyhtml".

In the dropdown list for HTML, I do see an option for "prettyhtml", but it warns me that it's deprecated. Here's a screenshot: prettyhtml shown as a dropdown option but says it's deprecated.

When I go into this settings.json, I see this part:

    "vetur.format.defaultFormatterOptions": {

        "js-beautify-html": {
            "wrap_attributes": "force-expand-multiline"
        },
        "prettyhtml": {
            "printWidth": 100,
            "singleQuote": false,
            "wrapAttributes": false,
            "sortAttributes": false
        }
    }

Is "prettyhtml" the same thing as "prettier"?

If not, then why doesn't anything appear in settings.json for "prettier"? There are exactly zero string matches for the word "prettier" in settings.json.

This is all very confusing! Thanks.

aria
  • 11
  • 3
  • PrettyHTML and Prettier are different projects with different maintainers. The PrettyHTML maintainers recommend using Prettier now because it has HTML support. I'm not familiar with Vetur but wouldn't you be able to add Prettier manually in your `settings.json`? (stan stayc) – Zac Anger Jan 09 '23 at 04:17
  • From the Vetur repo I see that it's [not well maintained](https://github.com/vuejs/vetur/issues/3476) and has a lot of open issues, so there may also be a problem with that extension. – Zac Anger Jan 09 '23 at 04:21

0 Answers0