Skip to content
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

Closed
ljharb opened this issue May 30, 2016 · 9 comments
Closed
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@ljharb
Copy link
Sponsor Contributor

ljharb commented May 30, 2016

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"

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label May 30, 2016
@platinumazure
Copy link
Member

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.

@platinumazure platinumazure added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels May 30, 2016
@ljharb
Copy link
Sponsor Contributor Author

ljharb commented Jun 16, 2016

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.

@kaicataldo
Copy link
Member

kaicataldo commented Aug 26, 2016

@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.

@ljharb
Copy link
Sponsor Contributor Author

ljharb commented Aug 26, 2016

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!

@nzakas
Copy link
Member

nzakas commented Aug 31, 2016

I count three 👍s so we still need a champion here.

@btmills
Copy link
Member

btmills commented Sep 2, 2016

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...

@btmills btmills added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 2, 2016
@ljharb
Copy link
Sponsor Contributor Author

ljharb commented Sep 2, 2016

@btmills
Copy link
Member

btmills commented Sep 2, 2016

@ljharb thanks! Just left a comment on that wip commit with an idea 🎉

@ljharb
Copy link
Sponsor Contributor Author

ljharb commented Sep 2, 2016

Thanks, that did it. PR incoming.

ljharb pushed a commit to ljharb/eslint that referenced this issue Sep 2, 2016
ljharb added a commit to ljharb/eslint that referenced this issue Sep 3, 2016
ljharb added a commit to ljharb/eslint that referenced this issue Sep 3, 2016
ljharb added a commit to ljharb/eslint that referenced this issue Sep 4, 2016
ljharb added a commit to ljharb/eslint that referenced this issue Sep 5, 2016
@btmills btmills closed this as completed in ff19aa9 Sep 6, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

6 participants