DEV Community

Discussion on: Help Setting Up VSCode Formatting

mdarrik profile image
Darrik Moberg

What are your default formatter settings for vetur? I'm wondering if it's vetur defaults fighting with your setup, and that's why it worked until you changed your defaults above.

Thread Thread
twigman08 profile image
Chad Smith Author

The Vetur default formatter settings are set to everything being prettier, except for Sass, and Stylus, which are set to sass-formatter and stylys-formatter respectively.

Then I also have vetur.format.enable set to true.

What now has me confused is that I did try the formatter settings mentioned earlier, saw it was causing conflicts so I uninstalled the extensions and removed those settings, and it is still causing conflicts. So I ended up getting really confused as to what could be happening now even after changing the settings back to what I had.

Thread Thread
killshot13 profile image
Michael R. • Edited on

I'm a little late to the convo but just came across this and it popped into my head... what is the value of editor.defaultFormatter in your VS Code settings.json by itself, assuming it is defined?

Because according to the docs, whatever formatter is thus defined will override all other directives in the event of a conflict, assuming no language specific constraints.

Editor: Default Formatter
Defines a default formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter.

I may be wrong, but I've always understood that to mean if defined, that configuration will have the last word no matter what.

Thread Thread
terabytetiger profile image
Tyler V. (he/him)

Well this is a really good thing to be aware of - mine is set to none (and working).

I'll also note that recently I had an issue where when copying my prettierrc and eslintrc.js files from one VS Code window to a new project's window required a restart (Code & Yarn) before it picked up with changes properly.

Thread Thread
killshot13 profile image
Michael R.

Well that's good at least you got it working. I've had similar issues in the past, especially with mono-repos and also trying to integrate Yarn v2/v3.