diff --git a/lib/rules/no-constant-condition.js b/lib/rules/no-constant-condition.js index 744b8c6245f..58691b6da6d 100644 --- a/lib/rules/no-constant-condition.js +++ b/lib/rules/no-constant-condition.js @@ -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":