deno.com

jsx-void-dom-elements-no-children

NOTE: this rule is included the following rule sets:recommendedreactjsxfresh
Enable full set in deno.json:
{
  "lint": {
    "tags": ["recommended"] // ...or "react", "jsx", "fresh"
  }
}
Enable full set using the Deno CLI:
deno lint --tags=recommended
# or ...
deno lint --tags=react
# or ...
deno lint --tags=jsx
# or ...
deno lint --tags=fresh

Ensure that void elements in HTML don't have any children as that is not valid HTML. See Void element article on MDN for more information.

Invalid:

<br>foo</br>
<img src="a.jpg">foo</img>

Valid:

<br />
<img src="a.jpg" />

Did you find what you needed?

Privacy policy