dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

JSX elements with no children don't self close on format

Open marvinhagemeister opened this issue 2 years ago • 2 comments

Describe the bug

JSX elements with no children don't self close on format.

Deno version: 1.37.0

Input Code

const a = <div></div>

Expected Output

const a = <div />

Actual Output

const a = <div></div>

marvinhagemeister avatar Sep 24 '23 07:09 marvinhagemeister

It currently works the way it does because personally I find it annoying when a formatter makes these kind of changes while I'm editing a file. This could be behind an option maybe.

dsherret avatar Sep 24 '23 13:09 dsherret

+1

bluesky452 avatar Dec 24 '23 12:12 bluesky452