ErrorsError handling
errors/no-useless-catch-boundaries
Remove catch boundaries that merely rethrow the same error without recovery, cleanup, reporting, translation, or context.
01 Examples
TypeScript
try { return await load(); } catch (error) { throw error; }Finding
Disallow catch handlers that add no behavior.
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-useless-catch-boundaries": "warn"- Package
@scruple/errors- Default threshold
- Plugin default
- Minimum confidence
- Plugin default