jsx-eslint/eslint-plugin-react

Rule proposal: prevent object literal spreads

Aperta

#2217 aperta il 26 mar 2019

 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (2734 fork)batch import
help wantednew rule

Metriche repository

Star
 (9294 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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).

Guida contributor