jsx-eslint/eslint-plugin-react

no-array-index-key not triggered when spreading props

Open

#1,625 建立於 2017年12月24日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)JavaScript (8,630 star) (2,797 fork)batch import
enhancementhelp wanted

描述

There's no warning or error when doing something like this:

people.map(({ name, email }, key) => {
  const props = {
    key,
    name,
    email,
  };

  return <Person {...props} />;
});

I realize this is a bit of an edge case, but maybe we can find a way to catch these uses as well.

貢獻者指南