Prettier format on save not working in CSS or HTML files

Viewed 1106

I recently installed prettier (V9.0.0) in VS Code and enabled format on save.

This is working in CSS files but doesn't work in JS or HTML files. Has anyone had this problem and fixed it?

Not sure what other context to provide but happy to provide anything else that might be helpful.

Thanks.

1 Answers

This has been discussed in the past. Few things you can try:

  • set prettier as the Default Formatter in Settings . File -> Preferences -> Settings (for Windows) Code -> Preferences -> Settings (for Mac). Search for "Default Formatter".
  • You can also set default Formatter per language
Related