prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Prettier doesn't currently support breaking the closing html tag to a new line if there's no content

Open wingedsmith opened this issue 6 months ago • 0 comments
trafficstars

Got the prettier set up almost perfectly! The only remaining problem is that prettier does not breaking the closing html tag to a new line if it is empty. Just add any text or tag inside and everything works perfectly.

minimum config:

{
  "bracketSameLine": true,
  "singleAttributePerLine": true,
  "htmlWhitespaceSensitivity": "ignore"
}

expectation:

<div
  class="some-class"
  data-placeholder="some data">
</div>

reality:

<div
  class="some-class"
  data-placeholder="some data"></div>

wingedsmith avatar May 15 '25 16:05 wingedsmith