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: object-property-newline end location (refs #12334) #13399

Merged
merged 3 commits into from Jun 19, 2020

Conversation

anikethsaha
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an 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 changes did you make? (Give an overview)

removed the .start of the reporting location to include both start and end as well.

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

Currently, the location of the key is being reported (both in master and in this PR)
Will it make sense to report the leading whitespace?

like this

image

by replacing the loc

loc: {
   start: comma.loc.end,
  end: firstTokenOfCurrentProperty.loc.start
}

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jun 6, 2020
@anikethsaha anikethsaha force-pushed the fixes-12334-object-newline-property branch from d7478ed to 5acc7cb Compare June 6, 2020 15:43
@anikethsaha anikethsaha changed the title Update: object-property-newline end location (ref #12334) Update: object-property-newline end location (refs #12334) Jun 6, 2020
@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jun 11, 2020
kaicataldo
kaicataldo previously approved these changes Jun 11, 2020
@kaicataldo kaicataldo dismissed their stale review June 11, 2020 17:43

Change of heart!

@kaicataldo
Copy link
Member

I think reporting the whitespace as suggested above makes more sense, personally!

@anikethsaha
Copy link
Member Author

Cool, I will change that 👍

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

The change itself looks fine. Can you please add a test?

@anikethsaha
Copy link
Member Author

cool

Copy link
Member

@nzakas nzakas 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!

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

LGTM, and thanks for knocking another one of these rules out, @anikethsaha!

I noticed that just one of the tests hadn't yet had endLine/endColumn added, so I pushed a quick commit to add those to save you time.

While the suggestion to report the whitespace before the key rather than the key itself would be neat, it could drastically complicate the implementation due to potential placement of the comma, so I think warning on the key as we've been doing (now with an end location) is perfectly adequate.

@anikethsaha
Copy link
Member Author

I noticed that just one of the tests hadn't yet had endLine/endColumn added, so I pushed a quick commit to add those to save you time.

Thanks a lot 💯

@nzakas nzakas merged commit ee2fc2e into eslint:master Jun 19, 2020
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 17, 2020
@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 Dec 17, 2020
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

Successfully merging this pull request may close these issues.

None yet

4 participants