Prettier Not Formatting Code Automatically
Format on save with prettier takes eternity
Why does Prettier not format code in VS Code?
I have done all kinds of things but my prettier does not format on save.
Videos
- Select
File -> Preferences -> Settings(Ctrl+comma) and search formformatter - Set Prettiers as Default formatter.

If above does not work:
ctrl+shift+p > Format Document With... > Configure Default Formatter... > Prettier - Code formatter
This also work with ctrl+shift+I
If doing what @Simin Maleki mentioned does not solve it for you, there is a chance that your default formatter is not set:
File > Preferences > Settings > Search for "default formatter"
Make sure your Editor: Default Formatter field is not null but rather Prettier - Code formatter (esbenp.prettier-vscode) and that all the languages below are ticked. This fixed my issue.
STEP BY STEP WALKTHROUGH

Also make sure that your format on save is enabled:

I got back to VScode after few months, and now Prettier is not working for me. I have tried saving the setting manually as well, but it is not working.
Prettier ver - 5.8.0
VScode ver - 1.52.1
Please help.!
Thankyou.
In VSCode, hit CTRL + SHIFT + P, write Preferences: Open User Settings (JSON) and hit enter, it will open up your settings.json:
Make sure prettier is your default formatter:
"editor.defaultFormatter": "esbenp.prettier-vscode"
you can set it for specific languages e.g: for typescript:
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
TLDR; Settings > Prettier Require Config: false / unchecked
I tried these and it still wasn't working. I noticed that at the bottom of my VS Code my Prettier wasn't showing a checkmark next to it. Clicked on "Prettier" at the bottom of the screen and it said it was skipping the file because there was not a require config set to true.
Solution was in this thread here: Prettier extension is not working in vs code Require config set to true
In Cursor, “format on save” (auto prettier) isn’t working for me.
It was working fine until yesterday, but after updating the Cursor editor, it seems to have stopped.
What’s weird is that in VS Code, it works perfectly on the same project/settings.
Is anyone else experiencing this, or is it just me?