jsx-no-children-prop
NOTE: this rule is included the following rule sets:
recommendedreactjsxfreshEnable full set in
deno.json:{
"lint": {
"rules": {
"tags": ["recommended"] // ...or "react", "jsx", "fresh"
}
}
}Enable full set using the Deno CLI:
deno lint --rules-tags=recommended # or ... deno lint --rules-tags=react # or ... deno lint --rules-tags=jsx # or ... deno lint --rules-tags=fresh
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the
include or exclude array in deno.json:{
"lint": {
"rules": {
"include": ["jsx-no-children-prop"],
"exclude": ["jsx-no-children-prop"]
}
}
}Pass children as JSX children instead of as an attribute.
Invalid:
<div children="foo" />
<div children={[<Foo />, <Bar />]} />
Valid:
<div>foo</div>
<div><Foo /><Bar /></div>