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
max-statements-per-line
error should indicate how many statements it found
#6287
Comments
I think this could really help with debugging, both for end users and for us if someone reports a bug with the rule. I'm 👍 on this. |
I'm looking into implementing this, and running into difficulty because the current code reports as soon as it finds the "max + 1"th statement on the line - ie, it doesn't count all statements in the entire line before erroring out. |
@ljharb Thanks for looking into this! Are you still working on this? @eslint/eslint-team Would anyone like to champion this change? I'm 👍 but don't feel like I have the bandwidth to champion another issue at the moment. |
I've still got a branch in-progress, but I fear it's beyond my skill atm. I can keep giving it a shot tho! |
I count three 👍s so we still need a champion here. |
I'll champion, marking as accepted. @ljharb can you push that in-progress branch somewhere? I might have an idea for how to report after all have been counted rather than just max + 1... |
Thanks, that did it. PR incoming. |
What version are you using?
2.11.0
What did you do?
Set
max-statements-per-line
to $N, and lint a line that had > $N statements on it.What happened?
Got "This line has too many statements. Maximum allowed is $N"
What did you expect to happen?
When N is 1, I'd expect "This line has 2 statements. Maximum allowed is 1"
The text was updated successfully, but these errors were encountered: