jscs-dev / node-jscs

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

Exception with combination rules #2264

Closed burashka closed 8 years ago

burashka commented 8 years ago

If run jscs with the config:

{
    "requirePaddingNewLineAfterVariableDeclaration": true,
    "requireSpaceAfterKeywords": [
        "function"
    ],
    "requireSpaceBeforeBinaryOperators": [
        "!=="
    ]
}

then throw excaption:

TypeError: Cannot read property 'replace' of undefined
    at renderLine (/usr/lib/node_modules/jscs/lib/errors.js:266:16)
    at Object.Errors.explainError (/usr/lib/node_modules/jscs/lib/errors.js:197:13)
    at /usr/lib/node_modules/jscs/lib/reporters/console.js:16:36
    at Array.forEach (native)
    at /usr/lib/node_modules/jscs/lib/reporters/console.js:14:35
    at Array.forEach (native)
    at Object.module.exports [as writer] (/usr/lib/node_modules/jscs/lib/reporters/console.js:9:22)
    at /usr/lib/node_modules/jscs/lib/cli.js:149:18
    at Array.<anonymous> (/usr/lib/node_modules/jscs/node_modules/vow/lib/vow.js:712:56)
    at Immediate.callFns [as _onImmediate] (/usr/lib/node_modules/jscs/node_modules/vow/lib/vow.js:23:35)

If add "," to "requireSpaceBeforeBinaryOperators" - not exception; if remove "requireSpaceAfterKeywords" - not exception, if remove "requirePaddingNewLineAfterVariableDeclaration" - not exception.

Run jscs: jscs src -c config/.jscsrc node --version v4.3.1

markelog commented 8 years ago

Need a code example