I'm trying to enable the Prettier extension to format JSX code when document is saved in VS Code, but after installing the extension does not work for me. I've tried to fix using the ways listed below:
Press Control + Shift + P or Command + Shift + P (Mac) to open the command palette and type 'format document' and then select Format Document option.
Then you will be asked to select the default formatter Select prettier formatter from the options list You're done
Enable Prettier as default formatter in VS Code settings:
Settings > Default formatter > Prettier
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