jsx-eslint/eslint-plugin-react

[jsx-key]: report on `yield`

Open

#352 geöffnet am 7. Dez. 2015

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (2.797 Forks)batch import
enhancementhelp wantedrule

Repository-Metriken

Stars
 (8.630 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide