Closed makbol closed 7 years ago
Can you please elaborate, and be specific?
Hello @philipwalton. I wanted to point out there's disabled rule keyword-spacing
which
enforce consistent spacing before and after keywords
in line 202 whereas, in style guide we read
Use of horizontal whitespace depends on location, and falls into three broad categories: leading (at the start of a line), trailing (at the end of a line), and internal. Leading whitespace (i.e., indentation) is addressed elsewhere. Trailing whitespace is forbidden.
Beyond where required by the language or other style rules, and apart from literals, comments, and JSDoc, a single internal ASCII space also appears in the following places only.
- Separating any reserved word (such as
if
,for
, orcatch
) from an open parenthesis ((
) that follows it on that line- ...
Therefore I could write like:
if(condition){
// ...
}
it won't be pointed by linter but according to style guide it's not correct. I catch this particular case but I think there might be more.
Thanks, I actually don't remember now why that rule wasn't set.
On initial read, it seems like it should be set to:
'keyword-spacing': 2, // defaults to {before: true, after: true}
Does that look right to you?
Sorry, I forgot to do this. Fixed via e24704c7df378d35aeaeb49dad1a29ebd06c1d6c. I'll cut a new version shortly.
Example: disabled keyword-spacing vs. 4.6.2 Horizontal whitespace