I am trying to format the code but the prettier isn't working fine with VS code. I also tried to reinstall it but the same problem occurs. I am not able to format my html css code with prettier. You can also see the screenshot where the code is not formatted after saving the code.
Follow these steps carefully, and I think it is gonna work. First, make sure you install Prettier from the extensions store:
Then edit the settings.json
file and paste in it the lines below. You can find settings.json
this way:
F1
or Ctrl
+ Shift
+ P
, then type open settings
and choose Open Settings (JSON)
Shift
+ CMD
+ P
, then the same steps as Windows{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
And finally, restart VS Code.