VSCode prettier/vue formatting settings don't work properly VSCode prettier/vue formatting settings don't work properly vue.js vue.js

VSCode prettier/vue formatting settings don't work properly


Only advice I can give is stop using Prettier. Trying to make it work with ESlint and Vetur was always pain. Then I found this question (and self answer) here on SO which recommends dropping Prettier and using ESlint not just for linting but also for formatting (needs version >= 6). I'm happy as clam now...


I've been struggling with a similar problem with VSCode's formatting. I also have Prettier, ESLint and Vetur extensions installed. But my code formatting rules were somehow different from my co-worker's (they are using WebStorm by the way).

In my case, the problem was solved by:

  1. Turning off all the Vetur formatters and disabling all formatting capabilities of Vetur.
  2. Enabled ESLint as the formatter.

This seems to have allowed the Prettier extension to look at .eslintrc.js, which the Prettier plugin is setup.

I suggest that you look in on the Prettier extension logs to debug your problem.

On the bottom right corner of VSCode's window, you will see the Prettier extension indicator. Click on this and you can see the logs.enter image description here

Once the logs are shown, you can see where the extension is getting the Prettier configs from, or where the Prettier module is being imported from.


What helped me with this situation, I went into Vetur's extension settings inside VSCode Vetur > Format > Default Formatter: HTML and selected js-beautify-html.