#lazytwitter Can someone write an eslint rule that disallows` braceless if` when:
- newline before the expr
- >1 stmt on the same line
1/
-
-
I think it makes sense to require a newline after single-expression braceless if too. disallowed: if (x) x = 1; y = 2;
-
you mean with indentation level increasing on second line?
-
that's the most likely form of the mistake, but mandatory newline is the broadest solution.
-
jet lagged a bit - mandatory newline where?
-
after the concise guard: if (invalid) return; // statement disallowed here // mandatory newline <rest of function>
-
aha, you mean *two* mandatory newlines!
-
right. A mandatory visual empty space.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.