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

feat(no-await-sync-queries): add auto-fix #919

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

neriyarden
Copy link
Contributor

@neriyarden neriyarden commented Jul 27, 2024

Checks

Changes

  • Add auto-fix for the no-await-sync-queries rule (remove 'await ' before sync queries)
  • Update tests
  • Update docs

Do we want to remove the async from the test callback when there's no other awaits in it?

Context

Fixes an item in #202

Copy link

codecov bot commented Jul 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.34%. Comparing base (93a6ab9) to head (6120e73).
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #919      +/-   ##
==========================================
+ Coverage   96.23%   96.34%   +0.10%     
==========================================
  Files          44       46       +2     
  Lines        2419     2489      +70     
  Branches     1000     1030      +30     
==========================================
+ Hits         2328     2398      +70     
  Misses         91       91              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@G-Rath G-Rath left a comment

Choose a reason for hiding this comment

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

this looks good but you're assuming there will always be a space after the await which means await(getByIcon('search')) will error.

I'm pretty sure you can fix this by just removing the space, since the fixer doesn't need to care about the styling of the output

@neriyarden
Copy link
Contributor Author

@G-Rath Good catch and thanks for the review 🙂
I removed the space after the await in the fixer and updated the tests.
I also added a test cade for the example you gave (await(getByIcon('search')))

Let me know what you think:)

Copy link
Contributor

@G-Rath G-Rath left a comment

Choose a reason for hiding this comment

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

looks good to me!

@MichaelDeBoey MichaelDeBoey force-pushed the feat-add-autofix-for-no-await-sync-queries branch from d5cb9ee to afdd27a Compare October 17, 2024 22:10
MichaelDeBoey
MichaelDeBoey previously approved these changes Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants