jsx-eslint/eslint-plugin-react

Rule proposal: prevent object literal spreads

Open

#2,217 opened on Mar 26, 2019

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (2,797 forks)batch import
help wantednew rule

Repository metrics

Stars
 (8,630 stars)
PR merge metrics
 (Avg merge 1d 17h) (3 merged PRs in 30d)

Description

In JSX it's possible to write:

<Foo {...{a: 1, b: 2}} />

instead of

<Foo a={1} b={2} />

The former is valid JSX but (to React eyes) hard to read. It would be good to lint against it (it may be autofixable too, not sure about edge cases).

Contributor guide