Our extension uses VSCode's format on save
setting.
However, our extension somehow prevents prettier
to run - when a file is saved, our extension is fired, but the prettier
isn't.
I assume that prettier uses the same setting, and that our extension is registered/fired before it.
Is there a way to not prevent prettier
from running?
Automatically Format Document on VS Code Using PrettierOpen the VS Code Settings menu by tapping “Command + ,(comma)” if you use a Mac. Click on “Control + ,(comma)”, if you are a Windows user. Go to the search bar and input “Editor: Format on Save.” Ensure it has a checkmark.
Usage. To automatically format the file on save, In Visual Studio Code, press Control + Shift + P or Command + Shift + P (Mac) to open the command palette and type setting and then select Preferences: Open User Settings option. Search for format on save setting and check the checkbox.
Try it, it's working for me, and make sure esbenp.prettier-vscode
is installed.
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With