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
Closed

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

feross opened this issue Jul 5, 2019 · 0 comments

Comments

@feross
Copy link
Member

feross 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.

@feross feross added this to the standard v13 milestone Jul 5, 2019
@feross feross closed this as completed Jul 6, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

1 participant