Languages

VS Code - Prettier not formatting HTML tags in JSX

3 points
Asked by:
Maison-Humphries
821

Why Prettier doesn't format HTML tags inside JSX?

1 answer
4 points
Answered by:
Maison-Humphries
821

Try to add the code below in settings.json:

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

The part responsible for HTML tags:

"[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
}

To open settings.json file use Ctrl + Shift + P and Search for "Open Settings (JSON)".

0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join