Skip to content

fix(linter/no-unused-private-class-members): fix false positive with await expression#13249

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/08-21-fix_linter_no-unused-private-class-members_fix_false_positive_with_await_expression
Aug 21, 2025
Merged

fix(linter/no-unused-private-class-members): fix false positive with await expression#13249
graphite-app[bot] merged 1 commit intomainfrom
c/08-21-fix_linter_no-unused-private-class-members_fix_false_positive_with_await_expression

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Aug 21, 2025

fixes #11039

@camc314 camc314 marked this pull request as ready for review August 21, 2025 12:03
@github-actions github-actions bot added the A-linter Area - Linter label Aug 21, 2025
Copilot AI review requested due to automatic review settings August 21, 2025 12:03
@github-actions github-actions bot added the C-bug Category - Bug label Aug 21, 2025
Copy link
Contributor Author

camc314 commented Aug 21, 2025


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.

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 PR fixes a false positive in the no-unused-private-class-members linter rule where private class members used within await expressions were incorrectly flagged as unused.

  • Added AstKind::AwaitExpression(_) to the list of expression types that delegate to parent context in is_value_context function
  • Added test cases to verify the fix works correctly for both passing and failing scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs Added AwaitExpression handling and test cases for the fix
crates/oxc_linter/src/snapshots/eslint_no_unused_private_class_members.snap Updated snapshot to include expected failure case for unused awaited member

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Aug 21, 2025 — with Graphite App
Copy link
Contributor Author

camc314 commented Aug 21, 2025

Merge activity

@camc314 camc314 force-pushed the c/08-21-fix_linter_no-unused-private-class-members_fix_false_positive_with_await_expression branch from 290b3f5 to 334cd0c Compare August 21, 2025 12:07
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 21, 2025

CodSpeed Instrumentation Performance Report

Merging #13249 will not alter performance

Comparing c/08-21-fix_linter_no-unused-private-class-members_fix_false_positive_with_await_expression (a1b52c8) with main (8b1e022)1

Summary

✅ 34 untouched benchmarks

Footnotes

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

@graphite-app graphite-app bot force-pushed the c/08-21-fix_linter_no-unused-private-class-members_fix_false_positive_with_await_expression branch from 334cd0c to a1b52c8 Compare August 21, 2025 12:12
@graphite-app graphite-app bot merged commit a1b52c8 into main Aug 21, 2025
24 checks passed
@graphite-app graphite-app bot deleted the c/08-21-fix_linter_no-unused-private-class-members_fix_false_positive_with_await_expression branch August 21, 2025 12:16
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 21, 2025
This was referenced Aug 26, 2025
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.

oxlint: false positive for no-unused-private-class-members rule

2 participants