redline
HighError handlingpromise-catch-noop

Rejection swallowed

Rejection swallowed. .catch(() => {}) throws the error away. When this fails, nothing will say so.

This is how the comment reads inline, under the flagged line.

Why it matters

An empty .catch turns every failure into silent success. The bug shows up later, far from the cause, with no log.

What to do

Let it reject, handle the specific error you expect, or log and rethrow.

Examples

Flagged
save(user).catch(() => {});
Better
await save(user); // the caller decides what a failure means

What it catches

It reads a pattern on each line, aware of strings and comments. Languages: TypeScript and JavaScript. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

save(x).catch(() => {});
load().catch(() => null)
p.catch(noop)

Left alone

save(x).catch((e) => report(e));

Research

Empty catch, `except: pass`, `.catch(() => {})`, and catch blocks that only log. The failure disappears from the person who could fix it.

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "promise-catch-noop"
    ],
    "severity": {
      "promise-catch-noop": "low"
    }
  }
}

Read the source or report a false positive.