jsx-eslint/eslint-plugin-react

Rule proposal: prevent object literal spreads

Ouverte

#2 217 ouverte le 26 mars 2019

 (1 commentaire) (0 réaction) (0 personne assignée)JavaScript (2 733 forks)batch import
help wantednew rule

Métriques du dépôt

Stars
 (9 292 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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

Guide contributeur