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

Update: indentation of comment followed by semicolon (fixes #12232) #12243

Merged
merged 1 commit into from Sep 14, 2019

Conversation

kaicataldo
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

fixes #12232

What changes did you make? (Give an overview)
This PR adds additional logic for comments that precede a line that begins with a semicolon. The current behavior (indenting 1 level) exists because the comment is treated as a child of the node on the previous line.

Is there anything you'd like reviewers to focus on?
Nothing in particular!

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Sep 8, 2019
@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly indent Relates to the `indent` rule and removed triage An ESLint team member will look at this issue soon labels Sep 8, 2019
@kaicataldo kaicataldo force-pushed the fixes-12232 branch 5 times, most recently from d5c72b2 to 05db44c Compare September 9, 2019 01:45
@platinumazure
Copy link
Member

@kaicataldo Thanks for contributing!

As this is a bug fix which adds new warnings in some circumstances, could you please update the commit summary tag to "Update"? Thanks!

@kaicataldo
Copy link
Member Author

kaicataldo commented Sep 9, 2019

Sure thing! I was thinking of this as a semver-patch change because it should have the same number of warnings - it’s just enforcing a different indentation.

@kaicataldo kaicataldo changed the title Fix: indentation of comment followed by semicolon (fixes #12232) Update: indentation of comment followed by semicolon (fixes #12232) Sep 9, 2019
@kaicataldo
Copy link
Member Author

Huh, looks like the commit message check is now checking the last commit rather than the first. I'll squash my commits.

@kaicataldo kaicataldo added the enhancement This change enhances an existing feature of ESLint label Sep 9, 2019
@platinumazure
Copy link
Member

The commit-message check looks at the commit message if there is only one commit, otherwise it looks at the PR title. At least, that's what is supposed to happen.

Did your experience not match that?

@kaicataldo
Copy link
Member Author

I’m not sure, to be honest! It was passing the commit message check and then started failing after I force pushed my changes with a third commit. Either way, looks like it’s fine now!

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! I'd like another set of eyes on this before merging.

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

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 enhancement This change enhances an existing feature of ESLint indent Relates to the `indent` rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive indent error for comment line before line started from semicolon
4 participants