Preventing HTML Attribute Wrapping Using Formatting

38 Views Asked by At

I'm having an issue with code formatting, where the attributes of HTML tags are being wrapped to new lines when I format the code. This makes it difficult to read HTML tags. Is there a way to prevent them from being wrapped after formatting?

Ex: the attributes of div are being wrapped

1

There are 1 best solutions below

1
Tejas Throat On

Select Language Mode to JSX in status bar

Enable Format on save in Editor settings

Use https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode