Skip to content

Commit

Permalink
handle optional catch bindings in no-useless-catch
Browse files Browse the repository at this point in the history
When optional catch bindings are used, `node.param` is `null`.
  • Loading branch information
cjihrig committed Dec 23, 2018
1 parent 0b81fc2 commit 08417f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/rules/no-useless-catch.js
Expand Up @@ -27,6 +27,7 @@ module.exports = {
return {
CatchClause(node) {
if (
node.param &&
node.param.type === "Identifier" &&
node.body.body.length &&
node.body.body[0].type === "ThrowStatement" &&
Expand Down

0 comments on commit 08417f6

Please sign in to comment.