Rule for disallowing calling catch without any argument
sonnyp opened this issue · comments
I would like to suggest a rule to prevent calling the promise catch
method without any argument. It works "differently" than the catch
block and it might lead to bugs when one expects the rejection to be ignored.
Demonstration
async function iReject() {
throw 'foobar';
}
(async () => {
try {
await iReject();
} catch {
// fine
}
// fine
await iReject().catch(() => {});
// throws
await iReject().catch();
})();