-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Tell us about your environment
- ESLint Version: 6.5.1
- Node Version: 10.16.3
- npm Version: 6.9.0
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
rules: {
keyword-spacing: ["error", {
before: false,
after: true,
overrides: {
else: {after: false},
if: {after: false}
}
}],
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
if(false) {
console.info("will not log");
}else{
console.info("will log");
}
eslint index.js
What did you expect to happen?
before: false
should set it so every keyword requires no spacing before it, as no overrides set it to true
.
What actually happened? Please include the actual, raw output from ESLint.
/path/to/my/file/index.js
3:2 error Expected space(s) before "else" keyword-spacing
Although the before
property appears to work on every other keyword added to the overrides I've tried (if
, for example, works fine using the above config), else
for some reason sets it to true. Explicitly setting before: false
in the else
override appears to be a temporary solution to this bug.
Are you willing to submit a pull request to fix this bug?
I am unsure of how it would be fixed, but I would be willing to submit a PR if I did.