jsx-eslint/eslint-plugin-react

[jsx-key]: report on `yield`

オープン

#352 opened on 2015/12/07

 (2 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (2,731 件のフォーク)batch import
enhancementhelp wantedrule

Repository metrics

Stars
 (9,293 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド