diff --git a/src/printer.js b/src/printer.js index f809cdb3..420e8726 100644 --- a/src/printer.js +++ b/src/printer.js @@ -354,11 +354,11 @@ function genericPrintNoParens(path, options, print, args) { parent.type === "ObjectProperty" || parent.type === "Property"; - const logicalSubExpressionExists = n.left.type === "LogicalExpression"; + const logicalSubExpression = n.left.type === "LogicalExpression"; if ( shouldNotIdent || - (shouldInlineLogicalExpression(n) && n.left.type !== n.type) || + (shouldInlineLogicalExpression(n) && !logicalSubExpression) || (!shouldInlineLogicalExpression(n) && shouldIdentIfInlining) ) { return group(concat(parts));