Closed stramel closed 7 years ago
I think this rule doesn't quite fit because technically the JS style guide only allows single line if
statements (i.e. it doesn't allow if (foo) foo++; else doSomething();
.
Though maybe it's better to have something turned on here than not since I think it's not very common to do the example above.
Hmmm you are correct it doesn't but I also don't see a rule to accomplish this with the current eslint configuration.
I think it would be better than not having any rule on it. Is that the only case missed by this rule?
Yeah, I think it's better to have an overly permissive rule than nothing (since nothing is also not correct). What I don't want is something that will incorrectly error on technically valid code.
Can you update your changes to keep the comment and then I'll merge?
@philipwalton I re-added but inline with the new rule and capped the line at 80 chars
Went with
multi-line
based on lighthouse's eslintrc rules.mutli-line
: allow brace-less single-line if, else if, else, for, while, or doThe alternative one would be,
multi
: http://eslint.org/docs/rules/curly#multi