jsx-props-no-spread-multi
NOTE: this rule is included the following rule sets:
recommended
react
jsx
Enable full set in
deno.json
:{ "lint": { "rules": { "tags": ["recommended"] // ...or "react", "jsx" } } }
Enable full set using the Deno CLI:
deno lint --rules-tags=recommended # or ... deno lint --rules-tags=react # or ... deno lint --rules-tags=jsx
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-props-no-spread-multi"], "exclude": ["jsx-props-no-spread-multi"] } } }
重复同样的表达式通常是一个错误,并且会导致不必要的计算。
无效:
<div {...foo} {...foo} />
<div {...foo} a {...foo} />
<Foo {...foo.bar} {...foo.bar} />
有效:
<div {...foo} />
<div {...foo.bar} a />
<Foo {...foo.bar} />