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: change reporting location for curly rule (refs #12334) #14766

Merged
merged 6 commits into from Jul 30, 2021

Conversation

@snitin315
Copy link
Contributor

@snitin315 snitin315 commented Jul 4, 2021

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)

Refers #12334

Fixes #13282

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

No

@snitin315 snitin315 changed the title Update: change reporting location for curly rule Update: change reporting location for curly rule (refs #12334) Jul 4, 2021
@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Jul 12, 2021

Now I think that highlighting the body/consequent/alternate node would make the most sense, as that's the part of the code that should be fixed. The rule reports "Expected '{' after 'while' condition.", but the whole body should be wrapped in a block. A similar rule arrow-body-style reports body.loc as the error location.

@snitin315
Copy link
Contributor Author

@snitin315 snitin315 commented Jul 13, 2021

Makes sense, I will update 👍

@snitin315
Copy link
Contributor Author

@snitin315 snitin315 commented Jul 17, 2021

@mdjermanovic updated 👍🏻

@snitin315 snitin315 requested a review from mdjermanovic Jul 17, 2021
lib/rules/curly.js Outdated Show resolved Hide resolved
Copy link
Member

@mdjermanovic mdjermanovic left a comment

LGTM, thanks!

@btmills btmills merged commit faecf56 into master Jul 30, 2021
14 checks passed
@btmills btmills deleted the update/curly-report-location branch Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants