Closed EvHaus closed 9 years ago
That shorthand is technically an object property whose value is a function expression which is why it's evaluated.
We have a test in JSCS core showing that this is the expected behavior: https://github.com/jscs-dev/node-jscs/blob/ca39a8912b4d498432fc92230b8a68f82174cd48/test/specs/rules/disallow-space-after-object-keys.js#L180-L186.
Sounds like you want a new rule value like allExcept: ['functionShorthand']
. I'm not actually sure what the proper name for that "shorthand" version is. @mikesherov would know. We'll substitute "shorthand" with whatever it is.
@globexdesigns Would you mind creating an issue for this in JSCS proper?
Done. Issue opened with JSCS.
Great. Thanks @globexdesigns
After upgrading to 2.0.x, the
disallowSpaceAfterObjectKeys
rule is now throwing a ton of warnings for me which it didn't used to. Sample:It seems that function declarations are now evaluated as object keys.
I want to force a space after the function name and before the parenthesis, but not for objects. ie.
This used to work fine in 1.x.x, but in 2.0.x, something has changed.