Prettier is not respecting self closing jsx tags

664 Views Asked by At

In my React project, I need prettier to put each prop/attribute of a jsx component onto a separate line.

If I type this:

<Animal type="fish" size="small"/>

I want prettier to change it to this:

<Animal
  type="fish"
  size="small"
/>

But it is actually forcing everything onto one line. How do I make prettier put each attribute on one line?

I haven't changed any of the default prettier settings, and prettier is the only code formatting extension I have installed.

Thank you

0

There are 0 best solutions below