ErrorsError handling
errors/no-swallowed-errors
Catch handlers should propagate or observably report unexpected errors, while intentional recovery and expected-exception fallbacks remain valid.
01 Examples
TypeScript
try { await publish(); } catch { return false; }Finding
Disallow silently suppressed unexpected failures.
02 Enable it
Setup
Install the package, register its plugin factory, then enable the rule.
Install the package
pnpm add -D @scruple/errorsRegister the plugin
In scruple.config.ts, register the factory under the errors namespace used by the rule ID.
import { errors } from "@scruple/errors";
plugins: {
"errors": errors(),
},Enable the rule
"errors/no-swallowed-errors": "warn"- Package
@scruple/errors- Default threshold
- 0.9
- Minimum confidence
- 0.7