jsx-eslint/eslint-plugin-react

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

Open

#1625 aperta il 24 dic 2017

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (2797 fork)batch import
enhancementhelp wanted

Metriche repository

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

Descrizione

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.

Guida contributor