0

I have prettier installed. I can format the code by right-clicking the file and clicking the "format document", but I can't use Ctrl + S to format the code. I also set prettier as the default formatter.

"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
}

Anyone have any idea on how to fix this?

NbNb
  • 11
  • 2
  • 1
    I encountered this problem on certain types of files where a second possible formatter was found, for example react files in an create-react-app project. Setting prettier as default formatter for this type of file helped. So hence my question: do you have this problem on all files or just a specific type of file? – Rhayene Jul 12 '21 at 14:11
  • I just solved my problem. I checked the shortcuts, my ctrl+s was also bound with the "save without formatting". I removed the keybinding and then it works!!! – NbNb Jul 12 '21 at 14:49

0 Answers0