Update, i just find the solution if anyone is having the same problem i have to add the following lines to user setting json
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Answer from Diegohp141 on Stack Overflowprettier - problems with code formatting on save in vscode - Stack Overflow
I have done all kinds of things but my prettier does not format on save.
Prettier format on save is not working
Yeah i am having the same issue ๐, idk why its happening, that's why just do ctrl+shift+p and format document and you got your document formated! ๐
More on reddit.comWhat's your approach to auto-formatting your project in VS Code?
Videos
Update, i just find the solution if anyone is having the same problem i have to add the following lines to user setting json
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Press Ctrl+shift+p and type Preferences: Open User Settings (JSON). In that json file add the following line and save. This should enable so vscode formats the code each time you save.
{
"editor.formatOnSave": true
}
Hi, I don't know why since I have updated VS code Prettier stops to work, I have also tried to setup Prettier as default formatter but nothing changes. Any idea how to fix it? Thanks
ยป npm install eslint