jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

requireSpaceBetweenArguments doesn't work in constructor of es6. #2289

Closed xiadengping closed 8 years ago

xiadengping commented 8 years ago

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.

markelog commented 8 years ago

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

You want validateParameterSeparator

markelog commented 8 years ago

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

xiadengping commented 8 years ago

Thanks :)

666don commented 6 years ago

He!p