jsx-eslint/eslint-plugin-react

[jsx-key]: report on `yield`

开放

#352 创建于 2015年12月7日

 (2 条评论) (1 个反应) (0 位负责人)JavaScript (2,731 个派生)batch import
enhancementhelp wantedrule

仓库指标

星标
 (9,293 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南