Skip to content

Commit

Permalink
chore(unbound-method): use early return instead of empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Mar 6, 2021
1 parent 23c2502 commit e03855c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rules/unbound-method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const isJestExpectCall = (node: TSESTree.CallExpression) => {

const { matcher } = parseExpectCall(node);

return !toThrowMatchers.includes(matcher?.name ?? '');
if (!matcher) {
return false;
}

return !toThrowMatchers.includes(matcher.name);
};

const baseRule = (() => {
Expand Down

0 comments on commit e03855c

Please sign in to comment.