jsx-eslint/eslint-plugin-react

Rule proposal: prevent object literal spreads

Offen

#2.217 geöffnet am 26.03.2019

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.733 Forks)batch import
help wantednew rule

Repository-Metriken

Stars
 (9.292 Sterne)
PR-Merge-Metriken
 (Keine gemergten 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