jsx-eslint/eslint-plugin-react

Rule proposal: prevent object literal spreads

Open

#2217 aperta il 26 mar 2019

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (2797 fork)batch import
help wantednew rule

Metriche repository

Star
 (8630 star)
Metriche merge PR
 (Merge medio 1g 17h) (3 PR mergiate 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