--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.tsx --- # Input ```tsx
; ; ;
;
/* comment */; /* comment */
; >; ``` # Diagnostics ``` invalid.tsx:1:1 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. > 1 │
; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 │ ; 3 │ ; i Unsafe fix: Use a SelfClosingElement instead 1 │ ; │ -- --- ``` ``` invalid.tsx:2:1 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. 1 │
; > 2 │ ; │ ^^^^^^^^^^^^^^^^^^^^^^^ 3 │ ; 4 │
; 2 │ - ; 2 │ + ; 3 3 │ ; 4 4 │
; 2 │ ; > 3 │ ; │ ^^^^^^^^^^^^^^^^^^^ 4 │
; 2 2 │ ; 3 │ - ; 3 │ + ; 4 4 │
; 3 │ ; > 4 │
5 │ > 6 │ >
; │ ^^^^^^^ 7 │ 8 │
/* comment */; i Unsafe fix: Use a SelfClosingElement instead 6 │ >
; │ -- --- ``` ``` invalid.tsx:8:1 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. 6 │ >; 7 │ > 8 │
/* comment */; │ ^^^^^^^^^^^^ 9 │ /* comment */
; 10 │ >; i Unsafe fix: Use a SelfClosingElement instead 8 │ ·/*·comment·*/; │ -- --- ``` ``` invalid.tsx:9:15 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. 8 │
/* comment */; > 9 │ /* comment */
; │ ^^^^^^^^^^^^ 10 │ >; i Unsafe fix: Use a SelfClosingElement instead 9 │ /*·comment·*/·; │ -- --- ``` ``` invalid.tsx:10:1 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. 8 │
/* comment */; 9 │ /* comment */
; > 10 │ >; │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Use a SelfClosingElement instead 8 8 │
/* comment */; 9 9 │ /* comment */
; 10 │ - >; 10 │ + ·/>; ```