deno.com

jsx-props-no-spread-multi

NOTE: this rule is included the following rule sets:recommendedreactjsx
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

Spreading the same expression twice is typically a mistake and causes unnecessary computations.

Invalid:

<div {...foo} {...foo} />
<div {...foo} a {...foo} />
<Foo {...foo.bar} {...foo.bar} />

Valid:

<div {...foo} />
<div {...foo.bar} a />
<Foo {...foo.bar} />

Did you find what you needed?

Privacy policy