Skip to content

Commit f87f18f

Browse files
committed
chore(unbound-method): use early return instead of empty string
1 parent 336fe30 commit f87f18f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rules/unbound-method.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ const isJestExpectCall = (node: TSESTree.CallExpression) => {
1515

1616
const { matcher } = parseExpectCall(node);
1717

18-
return !toThrowMatchers.includes(matcher?.name ?? '');
18+
if (!matcher) {
19+
return false;
20+
}
21+
22+
return !toThrowMatchers.includes(matcher.name);
1923
};
2024

2125
const baseRule = (() => {

0 commit comments

Comments
 (0)