jscs-dev/node-jscs

requireSpaceBetweenArguments doesn't work in constructor of es6.

xiadengping opened this issue · 4 comments

I have set requireSpaceBetweenArguments in .jscsrc file,

"requireSpaceBetweenArguments": true,

This is a test code,

"use strict";
class A {
    constructor(a,b) {
        console.log(a,b);
    }
}

jscs can only find line4 is invalid, shows "Missing space between , and b", but line3 is also invalid.

This rule applicable only for call expressions, see - http://jscs.info/rule/requireSpaceBetweenArguments since those are not arguments those are parameters.

You want validateParameterSeparator

Hm, but apparently validateParameterSeparator doesn't notice class methods :/

Thanks :)

He!p