Closed pixelpax closed 8 years ago
ES6/ES2015 is mostly compatible with previous versions, "ES6" tag in rules docs means it works with new js constructions
OK, well I suppose it isn't a problem with the JavaScript dialect, but the issue remains that when using "requireSpaceBeforeDestructuredValues": true
on jscs 3.0.5, I get the warning: Unknown JSCS option name
and the following code
var foo = {
bar:'bar'
};
Is treated as valid when it should be invalid.
Did you try to reproduce this? If not, would you mind trying it and possibly reopening?
Here is my entire .jscs.json
for reference:
{
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpaceAfterBinaryOperators": [
"=", ",", "+", "-", "/", "*", "+=", "-=",
"*=", "/=", "<", ">", "===", "!==", "<=", ">="
],
"requireSpaceBeforeBinaryOperators": [
"=", "+", "-", "/", "*", "+=", "-=", "*=",
"/=", "<", ">", "===", "!==", "<=", ">="
],
"validateIndentation": 2,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"requireSemicolons": true,
"disallowMultipleSpaces": true,
"requireSpaceBeforeBlockStatements": 1,
"validateQuoteMarks": "'",
"requireSpaceBeforeDestructuredValues": true,
"requireLineFeedAtFileEnd": true,
"jsDoc": {
"checkAnnotations": "closurecompiler",
"checkParamNames": true,
"requireParamTypes": true,
"checkRedundantParams": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": true,
"checkRedundantAccess": true,
"requireNewlineAfterDescription": true
},
"maximumLineLength": 120,
"disallowMultipleLineBreaks": true
}
You say you use latest version of jscs, but this error could only happen when requireSpaceBeforeDestructuredValues
on older versions of jscs in which such rule wasn't introduced
requireSpaceBeforeDestructuredValues
does not seem to parse to a proper JSCS option, documentation says that it's constrained to ES6. I see no reason this shouldn't work in non-ES6 JS.