Skip to content

Commit

Permalink
Update: no-constant condition now requires direct parent to be binary…
Browse files Browse the repository at this point in the history
… expression
  • Loading branch information
tickct committed Dec 24, 2019
1 parent 8fb1bdb commit 3bf864d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rules/no-constant-condition.js
Expand Up @@ -103,10 +103,10 @@ module.exports = {
return true;

case "ArrayExpression": {
if (!(node.parent.operator === "+")) {
return true;
if (node.parent.operator === "+" && node.parent.type === "BinaryExpression") {
return node.elements.every(element => isConstant(element, false));
}
return node.elements.every(element => isConstant(element, false));
return true;
}

case "UnaryExpression":
Expand Down

0 comments on commit 3bf864d

Please sign in to comment.