millermedeiros / esformatter

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

`ParameterComma` not working while having destructuring in `function` arguments #468

Open leftstick opened 7 years ago

leftstick commented 7 years ago

Let's say we have following configuration:

{
    "whiteSpace": {
        "after": {
            "ParameterComma" : 1
        }
    }
}

When coding as below:

export const fetchArticles = function(context,       query) {
    console.log('formating incorrect');
};

the multiple spaces before query will be replaced with only one space. Which is my expectation

And if i have destructuring instead of context in the arguments like below:

export const fetchArticles = function({dispatch, state},       query) {
    console.log('formating incorrect');
};

nothing happens, the multiple spaces remains. Which is not my expectation