jsx-eslint/eslint-plugin-react

[jsx-key]: report on `yield`

Open

#352 aperta il 7 dic 2015

Vedi su GitHub
 (2 commenti) (1 reazione) (0 assegnatari)JavaScript (2797 fork)batch import
enhancementhelp wantedrule

Metriche repository

Star
 (8630 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Seems like yield <Component x={y}/> should be reported by jsx-key if there is no key prop.

This is valid:

for (let [idx, datum] of data.entries()) {
  yield (<MyComponent datum={datum} key={idx} />)
}

This is reported:

for (let [idx, datum] of data.entries()) {
  yield (<MyComponent datum={datum} />) // msg: need `key` prop
}

I can knock this out, if it makes sense.

(cc #332 as it will likely conflict with this if completed concurrently.)

Guida contributor