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

fix Issue2041 #2063

Closed gpiress closed 8 years ago

gpiress commented 8 years ago

requireSpaceBeforeKeywords

Added a new value option for the rule, an Object with an allExcept property, to inform which keywords shouldn't be targeted by the rule.

Fixes issue #2041, as asked by user radek-holy

I went for the extra value approach as indicated in the issue, because I thought it would be more of a general approach that can be used across other rules and to behave similar as all other rules.

markelog commented 8 years ago

We can leave allExcept, but i think function should be there by default, what do you think?

gpiress commented 8 years ago

Ok, I believe we can leave the function keyword as a default excluded value. =)

Sorry for the delay in seeing this message.

gpiress commented 8 years ago

Okay, just to clarify, this is the behaviour as it is in this pull request:

This way, it by default doesn't check for the function keyword, but it is possible to do so through the allExcept version of the rule.

Is it as expected?

markelog commented 8 years ago

Awesome, thank you!