-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: max-statements-per-line
false positive (fixes #6173, fixes #6153)
#6192
Conversation
LGTM |
By analyzing the blame information on this pull request, we identified @vitorbal, @glenjamin and @alberto to be potential reviewers |
I'm not sure about the name "dangling host type", but this looks much more solid than the old way. I was surprised how little traversal there was in here when I came to do the last patch! |
Maybe "single child allowed" - naming based on the usage rather than the category |
7f3306a
to
0621850
Compare
LGTM |
Thank you, @glenjamin. I updated the variable name. I try to explain more since this PR is a large change. a; if (b) { c; d; }
y;
z; In this case, before, the order is After this PR, the order is if (a)
b;
else
c; In this case, the order is After this PR, it will use the first line of statements for nested statements. So in this case, it will compare between the first lines of the |
Lgtm |
A regression in ESLint causes false positives from the max-statements-per-line rule. So far versions 2.10.0-2.10.2 are affected. See eslint/eslint#6173 The fix (eslint/eslint#6192) has been merged and seems likely to land in 2.10.3. Once that happens we should update our depedency to allow >= the fixed version.
Fixes #6173,
Fixes #6153.
I rewrote the traversal logic of this rule.
Before, it uses a
for
loop in BlockStatement handler.After this PR, it uses ESLint's traversing. So this rule gets addressing nested nodes correctly.