Skip to content

fix(linter/no-await-in-loop): add support for await using#17947

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-12-fix_linter_no-await-in-loop_add_support_for_await_using_
Jan 14, 2026
Merged

fix(linter/no-await-in-loop): add support for await using#17947
graphite-app[bot] merged 1 commit intomainfrom
01-12-fix_linter_no-await-in-loop_add_support_for_await_using_

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Jan 13, 2026

Updating this rule to account for an await using in the loop and in the loop condition. I did use Copilot to help update this rule based on the original source and then edited afterwards for style.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Jan 13, 2026
Copy link
Member Author

camchenry commented Jan 13, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 13, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 41 skipped benchmarks1


Comparing 01-12-fix_linter_no-await-in-loop_add_support_for_await_using_ (088e6c1) with main (6b29bd1)2

Open in CodSpeed

Footnotes

  1. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (e795a0a) during the generation of this report, so 6b29bd1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@camchenry camchenry marked this pull request as ready for review January 13, 2026 04:20
@camchenry camchenry requested a review from camc314 as a code owner January 13, 2026 04:20
Copilot AI review requested due to automatic review settings January 13, 2026 04:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for detecting await using declarations in the no-await-in-loop ESLint rule. The rule previously detected await expressions and for await...of statements inside loops, and now also detects await using declarations which are problematic in the same way.

Changes:

  • Added handling for await using variable declarations in loops
  • Updated the is_looped function to accept a node parameter instead of just a span, enabling detection of await using in for-in/of loop conditions
  • Added test cases covering await using in while loops, for loops, and for-of loops

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs Added support for detecting await using declarations in loops, including handling for loop bodies and for-in/of left positions
crates/oxc_linter/src/snapshots/eslint_no_await_in_loop.snap Added test snapshots for three new test cases covering await using in different loop contexts
crates/oxc_linter/src/generated/rule_runner_impls.rs Added VariableDeclaration to the NODE_TYPES bitset for the rule

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camc314 camc314 self-assigned this Jan 14, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 14, 2026
Copy link
Contributor

camc314 commented Jan 14, 2026

Merge activity

Updating this rule to account for an `await using` in the loop and in the loop condition. I did use Copilot to help update this rule based on the original source and then edited afterwards for style.
@graphite-app graphite-app bot force-pushed the 01-12-fix_linter_no-await-in-loop_add_support_for_await_using_ branch from 088e6c1 to ad02e03 Compare January 14, 2026 11:41
@graphite-app graphite-app bot merged commit ad02e03 into main Jan 14, 2026
20 checks passed
@graphite-app graphite-app bot deleted the 01-12-fix_linter_no-await-in-loop_add_support_for_await_using_ branch January 14, 2026 11:46
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants