jscs-dev / node-jscs

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

Special case for "typeof" in requireSpaceBeforeKeywords #2097

Closed sholladay closed 8 years ago

sholladay commented 8 years ago

There are some common exceptions for people who otherwise really want spaces before their keywords.

if (typeof x === 'foo') {

}

Currently, that code fails when using requireSpaceBeforeKeywords : true. At the moment, the only alternative is to specify every other keyword as an array. Maybe the allExcept pattern is appropriate here?

markelog commented 8 years ago

Sounds good!

gpiress commented 8 years ago

I think this issue is solved by the pull request https://github.com/jscs-dev/node-jscs/pull/2063. It creates the allExcept value for this very rule =).

markelog commented 8 years ago

Yay!