Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 693 Bytes

prefer-optional-catch-binding.md

File metadata and controls

32 lines (22 loc) · 693 Bytes

Prefer omitting the catch binding parameter

💼 This rule is enabled in the ✅ recommended config.

🔧 This rule is automatically fixable by the --fix CLI option.

If the catch binding parameter is not used, it should be omitted.

Fail

try {} catch (notUsedError) {}
try {} catch ({message}) {}

Pass

try {} catch {}
try {} catch (error) {
	console.error(error);
}