In my Nuxt application where ESlint and Prettier are installed and enabled, I switched to Visual Studio Code.
When I open a .vue file and press CMD+ Shift + P and choose Format Document, my file does not get formatted at all.
My .prettierrc settings:
{
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
I have so many source code lines, so I cannot format them manually. What am I doing wrong?
How I've sorted it after having super huge frustrations with Prettier stopping working in VSCode.
VS Code
-> View
-> Command Palette
, and type: Format Document With
Configure Default Formatter...
and then choose Prettier - Code formatter
.This sorted the problem for me magically.
Depending on your case this might help you...
I did configure Prettier as std formatter in settings but it just would not work. This worked. Made my day!
Same here, but I had to de-select my default formatter and then perform the action you mention again for this to work.
Not sure where to find
Configure Default Formatter
but I used File->Settings->Text Editor->Default FormatterWhen I select the default formatter as Prettier, it formats that file but after that it does not work on save. I have my save option checked but still. I had to select the default formatter again and again. Any Solution
@HimanshuTariyal This should work for you, but feel free to check out my solution: stackoverflow.com/a/64273353/4298115