1

My .jscsrc file looks like below

{
    "preset": "wikimedia",
    "requireSpacesInsideArrayBrackets": null,
    "validateIndentation": 4,
    "disallowMultipleVarDecl": true,
    "disallowSpaceAfterObjectKeys": "ignoreMultiLine",
    "disallowSpacesInsideParentheses": { "only": [ "{", "}" ] }
}

But on running jscs over my code, it throws the following error in console

Missing space after opening round bracket at js/app.js :
    29 |                            windowScrollTimeout = null;
    30 |                            if (currentTopOffet < prevTopOffset) {
    31 |                                $('header').removeClass('mobile-hide');
----------------------------------------------------------------^

I also tried setting the value of disallowSpacesInsideParentheses to true but still no change in results. Any idea what I am doing wrong? Or is it that I am trying to solve my problem using wrong rule? Can somebody point me to the right rule set?

Thanks

Jigar Jain
  • 1,447
  • 1
  • 15
  • 38

1 Answers1

0

Checking the source for disallowSpacesInsideParentheses, that rule won't throw the error you're seeing. It seems that your rule is conflicting with the wikimedia presets rule:

"requireSpacesInsideParentheses": "all"

requireSpacesInsideParentheses seems to be the culprit, not any rule you've set, as it's the only rule which will throw that error. To overwrite the preset rule, according to the docs you'll need to set the rule to null in your .jscsrc file.

"requireSpacesInsideParentheses": "null"

Nick Bartlett
  • 4,865
  • 2
  • 24
  • 37