Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule: Disallow unnecessary catch clauses (no-useless-catch) #1312

Closed
feross opened this issue Jul 5, 2019 · 0 comments

Comments

@feross
Copy link
Member

commented Jul 5, 2019

https://eslint.org/docs/rules/no-useless-catch

Report pointless catch blocks like this:

try {
  doSomethingThatMightThrow();
} catch (e) {
  throw e;
}

They either indicate that there's extra code that can be removed, or more usefully, that the user intended to do something before re-throwing the error but forgot to do that.

0% ecosystem impact, so this is an easy rule to enable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.