millermedeiros / esformatter

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

Incorrect indent in an assignment with || operator #380

Closed seoker closed 8 years ago

seoker commented 8 years ago

Hi,

My indent config is exactly the same as the default setting. I have an assign statement like this (assume my inden is 4 spaces):

// expect
let property = property || {
    name: '111'
}

Unfortunately, the results seems incorrect:

// actual
let property = property || {
        name: '111'
    }

Another incorrect case:

// expect
let property
property = property || {
    name: '111'
}
// actual
let property
property = property || {
        name: '111'
}

Is this a bug or I need to adjust some of my settings? Thanks!