ESLint avertissement ES6 cohérente-le retour de la règle

- Je obtenir une ESLint avertissement:

Devrait renvoyer une valeur d'art de la fin de la flèche de la fonction ( ce qui est conforme-retour)

errors.details.forEach((error) => {
  const errorExists = find(errObj, (item) => {  //<== ESLint warning
    if (item && item.field === error.path && item.location === location) {
      item.messages.push(error.message);
      item.types.push(error.type);
      return item;
    }
  });
  if (!errorExists) {
    errObj.push({
      field: error.path,
      location: error.location,
      messages: [error.message],
      types: [error.type]
    });
  }
});

Cependant si j'insère un retour

  const errorExists = find(errObj, (item) => {    //<== ESLint warning
    if (item && item.field === error.path && item.location === location) {
      item.messages.push(error.message);
      item.types.push(error.type);
      return item;
    }
    return;   //<== inserted return
  });

Alors pas plus d'avertissement sur cette ligne , mais puis-je obtenir 2 avertissements sur le insérée retour ...

Flèche de la fonction attend un retour de la valeur (constante-retour)
Inutile instruction de retour (pas-inutile-retour)
Je ne vois pas comment résoudre correctement ce problème ..
tous les commentaires de bienvenue

Le find callback doit toujours renvoie une valeur booléenne. Ni item ni undefined.

OriginalL'auteur | 2017-05-14