millermedeiros / esformatter

ECMAScript code beautifier/formatter
MIT License
970 stars 91 forks source link

Indent is lost for literals on new line after a LogicalExpression #421

Closed alavers closed 8 years ago

alavers commented 8 years ago

To repro:

▶ cat test.js
var foo = 'foo' ||
    'foo2';

var bar = bar() ||
    42;

▶ esformatter test.js
var foo = 'foo' ||
  'foo2';

var bar = bar() ||
42;

I believe this problem was introduced with #380 which correctly removes the indent for functions/arrays/objects, but this also removes the indent where we still want it, for literals.