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

no-multiple-empty-lines: Adjust reported loc #12594

Merged
merged 1 commit into from Dec 20, 2019

Conversation

Turbo87
Copy link
Contributor

@Turbo87 Turbo87 commented Nov 23, 2019

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:

console.log('foo');




console.log('foo');

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 consideration

Is there anything you'd like reviewers to focus on?

nothing in particular

@jsf-clabot
Copy link

jsf-clabot commented Nov 23, 2019

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Nov 23, 2019
@kaicataldo kaicataldo added bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Nov 25, 2019
@kaicataldo
Copy link
Member

Can you add a test that would have failed before but would pass now?

@Turbo87
Copy link
Contributor Author

Turbo87 commented Nov 25, 2019

@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.
@kaicataldo
Copy link
Member

I'll champion this!

@kaicataldo
Copy link
Member

As per our process, we'll need to reach consensus by having support from three other team members. Thanks for contributing!

@Turbo87
Copy link
Contributor Author

Turbo87 commented Dec 19, 2019

@kaicataldo is there anything I can do to get more eyes on this? :)

@kaicataldo
Copy link
Member

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.

@kaicataldo kaicataldo 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 Dec 19, 2019
@kaicataldo
Copy link
Member

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!

@kaicataldo kaicataldo merged commit 272e4db into eslint:master Dec 20, 2019
@kaicataldo
Copy link
Member

Thanks for contributing to ESLint!

@Turbo87
Copy link
Contributor Author

Turbo87 commented Dec 20, 2019

no, no, thank you for maintaining it! :)

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 bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants