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
no-multiple-empty-lines: Adjust reported loc
#12594
Conversation
731672d
to
656748f
Compare
Can you add a test that would have failed before but would pass now? |
656748f
to
1491368
Compare
@kaicataldo done, thanks for the review :) |
The `+ 1` was from a time where we warned about anything with more than one empty line, but since then the rule has become configurable. We should put the warning on the first line that breaks this rule, instead of on the second empty line.
1491368
to
1c5abc6
Compare
I'll champion this! |
As per our process, we'll need to reach consensus by having support from three other team members. Thanks for contributing! |
@kaicataldo is there anything I can do to get more eyes on this? :) |
I actually think this should be treated as a bug fix. Will mark as accepted since I was able to verify this behavior (see example in demo. |
Will leave this open for another day or two to make sure there aren't any objections from the team and, if not, will merge then. Thanks for your patience! |
Thanks for contributing to ESLint! |
no, no, thank you for maintaining it! :) |
The
+ 1
was from a time where we warned about anything with more than one empty line, but since then the rule has become configurable. We should put the warning on the first line that breaks this rule, instead of on the first empty line.What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[x] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What rule do you want to change?
no-multiple-empty-lines
Does this change cause the rule to produce more or fewer warnings?
It should produce the same number of warnings as before
How will the change be implemented? (New option, new default behavior, etc.)?
New default behavior as it should probably be considered a bug fix
Please provide some example code that this change will affect:
What does the rule currently do for this code?
it warns on all empty lines
What will the rule do after it's changed?
it warns only on the empty lines that breaks the rule (which is the third empty line for the default configuration)
What changes did you make? (Give an overview)
I adjusted the
loc
of the rule report to take the rule configuration into considerationIs there anything you'd like reviewers to focus on?
nothing in particular