prefer-catch
Configuration
rslint.config.ts
Prefer .catch() over .then(null, fn) or .then(a, b) for error handling.
Rule Details
A .then() call with two arguments can obscure that an error handler is present.
The second argument also only catches rejections from earlier in the chain — not
from the first argument — so .catch() is both clearer and semantically preferred.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Differences from ESLint
Fixed an upstream autofix bug: x.then(a, b, c) now fixes to x.catch(b).then(a, c) instead of x.catch(b).then(ac).