benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.91k stars 347 forks source link

print jsx children on newline when we have a multi-line opening element #1409

Open tim-dev opened 1 month ago

tim-dev commented 1 month ago

Wrapped JSXElements with long JSXOpeningElements used to look like this:

<div 
  attr1="value1"
  attr2="value2"
  attr3="value3">Inner text here
</div>

This changes it to look like:

<div 
  attr1="value1"
  attr2="value2"
  attr3="value3"
>
  Inner text here
</div>