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

fix: prefer-query-by-disappearance error line and column to the beginning of get or find queries #639

Conversation

sjarva
Copy link
Collaborator

@sjarva sjarva commented Sep 1, 2022

Checks

  • I have read the contributing guidelines.
  • If some rule is added/updated/removed, I've regenerated the rules list (npm run generate:rules-list)
  • If some rule meta info is changed, I've regenerated the plugin shared configs (npm run generate:configs)

Changes

  • refactor reporting an error deeper, where the get or find query variants are found
  • refactor some function names to convey that they also check/report the error, not just return boolean based on if an error should be reported
  • update unit tests to have correct error line and column

Context

Closes #600

Refactor reporting an error deeper, where the get/find query variants are found.
Refactor function names to convey that they also check/report the error.
Update unit tests.
Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

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

Hi @sjarva! Thanks for your first contribution.

LGTM, just a small change request so the purpose of one of the function is clearer.

lib/rules/prefer-query-by-disappearance.ts Outdated Show resolved Hide resolved
lib/rules/prefer-query-by-disappearance.ts Show resolved Hide resolved
Make function name and JSDoc comment more clear
@sjarva
Copy link
Collaborator Author

sjarva commented Sep 3, 2022

Thanks for the review @Belco90 😊 I replied to your change request, hope that the function name and JSDoc comment are better now 🤞

@sjarva sjarva requested a review from Belco90 September 3, 2022 18:14
Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

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

Amazing, merging now!

@Belco90 Belco90 merged commit df3d647 into testing-library:main Sep 3, 2022
@Belco90
Copy link
Member

Belco90 commented Sep 3, 2022

@all-contributors please add @sjarva for code and test

@allcontributors
Copy link
Contributor

@Belco90

I've put up a pull request to add @sjarva! 🎉

@github-actions
Copy link

github-actions bot commented Sep 3, 2022

🎉 This PR is included in version 5.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sjarva sjarva deleted the pr/prefer-query-by-disappearance-error-location branch September 7, 2022 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: prefer-query-by-disappearance reports error in an incorrect part of the code
2 participants