jsx-eslint/eslint-plugin-react

Rule proposal: prevent object literal spreads

Open

#2.217 geöffnet am 26. März 2019

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.797 Forks)batch import
help wantednew rule

Repository-Metriken

Stars
 (8.630 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 17h) (3 gemergte PRs in 30 T)

Beschreibung

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