Skip to content

fix: allow un-called async util references #1061

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

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

Conversation

puglyfe
Copy link
Contributor

@puglyfe puglyfe commented Aug 8, 2025

Checks

Changes

This prevents false positives for the case where async utils are referenced but not called. This matches the behavior in both await-async-events and await-async-queries. await-async-events explicitly tests for this behavior here and here. await-async-queries doesn't explicitly test for this, but follows a similar implementation of only processing CallExpression nodes rather than CallExpression Identifier nodes.

  • Allow un-called references in await-async-utils
  • Add tests to await-async-queries to prevent regressions in existing behavior

Context

fixes #1060

@@ -113,6 +113,11 @@ ruleTester.run(RULE_NAME, rule, {
testingFramework: '@marko/testing-library',
}),

// async queries not called are valid
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this behavior already existed - just codifying it via test.

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@079043b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1061   +/-   ##
=======================================
  Coverage        ?   96.44%           
=======================================
  Files           ?       50           
  Lines           ?     2698           
  Branches        ?     1115           
=======================================
  Hits            ?     2602           
  Misses          ?       96           
  Partials        ?        0           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Belco90 Belco90 self-requested a review August 11, 2025 07:01
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.

Good catch! LGTM, but you need to increase the code coverage a bit to make codecov happy 😅

@puglyfe puglyfe requested a review from Belco90 August 11, 2025 14:52
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.

await-async-utils flags un-called function references
2 participants