mcclosa
mcclosa

Reputation: 1455

How to make VS Code recognise HTML syntax in return React

I am using React to build a front end, using the create-react-app package to generate a boilerplate. When going into any js file that has embedded HTML, when I save, the HTML goes all askew, everything compiles correctly, but the formatting looks horribly off. The image below shows how my code looks after save...

enter image description here

I know I could go to my settings and set

"editor.formatOnSave": true

However, I lose formatting on saving on all other files, which I would prefer to have.

Are there any extensions/settings so that when I save a js file with embedded HTML that it formats the HTML code?

Upvotes: 1

Views: 736

Answers (1)

mcclosa
mcclosa

Reputation: 1455

I found the cause of this for anyone that may come across it.

The extension Beautify was causing the code for format incorrectly.

Upvotes: 1

Related Questions