Skip to content

Feature: warn for returned promises that swallow errors #128

Open
@dbkaplun

Description

Hello,

It would be great if promises in this form triggered a warning:

function foo() {
  return bar()
    .then(...)
    .catch((err) => {
      console.error(err);
    });
}

Rather than trying to prevent the user from swallowing errors entirely, the goal is to ensure errors are only swallowed intentionally:

function foo() {
  return bar()
    .then(...)
    .catch((err) => { // eslint-disable-line promise/no-swallow-error-in-returned-promise
      console.error(err);
    });
}

Thanks for considering!

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions