Skip to content

Commit

Permalink
Fix the custom-error-definition rule to support constructors withou…
Browse files Browse the repository at this point in the history
…t a body.
  • Loading branch information
mf-pherlihy committed Nov 26, 2019
1 parent 3554c17 commit b195ebc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rules/custom-error-definition.js
Expand Up @@ -80,6 +80,9 @@ const customErrorDefinition = (context, node) => {
}

const constructorBodyNode = constructor.value.body;
if (!constructorBodyNode) {
return;
}
const constructorBody = constructorBodyNode.body;

const superExpression = constructorBody.find(isSuperExpression);
Expand Down

0 comments on commit b195ebc

Please sign in to comment.