Skip to content

Commit 2b9f076

Browse files
committed
move operator check to AST selector
1 parent f3760b8 commit 2b9f076

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/rules/jsx-no-leaked-zero.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,8 @@ module.exports = {
8181
}
8282

8383
return {
84-
'JSXExpressionContainer > LogicalExpression'(node) {
84+
'JSXExpressionContainer > LogicalExpression[operator="&&"]'(node) {
8585
const leftSide = node.left;
86-
if (node.operator !== '&&') {
87-
return;
88-
}
89-
9086
if (VALID_LEFT_SIDE_EXPRESSIONS.includes(leftSide.type)) {
9187
return;
9288
}

0 commit comments

Comments
 (0)