Skip to content

Comments

feat(linter/no-unused-vars): support ignoreUsingDeclarations option#14632

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/10-15-feat_linter_no-unused-vars_support_ignoreusingdeclarations_option
Oct 15, 2025
Merged

feat(linter/no-unused-vars): support ignoreUsingDeclarations option#14632
graphite-app[bot] merged 1 commit intomainfrom
c/10-15-feat_linter_no-unused-vars_support_ignoreusingdeclarations_option

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Oct 15, 2025

fixes #14628

@github-actions github-actions bot added the A-linter Area - Linter label Oct 15, 2025
@camc314 camc314 marked this pull request as ready for review October 15, 2025 15:38
Copilot AI review requested due to automatic review settings October 15, 2025 15:38
Copy link
Contributor Author

camc314 commented Oct 15, 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.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Oct 15, 2025
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 adds support for the ignoreUsingDeclarations option to the no-unused-vars ESLint rule. This option allows unused variables declared with using or await using (explicit resource management) to be ignored, which is useful when the primary purpose is the disposal side effect rather than using the resource itself.

Key changes:

  • Added the ignoreUsingDeclarations boolean option to the rule configuration
  • Implemented logic to skip linting unused variables when they are using declarations and the option is enabled
  • Added comprehensive tests covering both using and await using declarations

Reviewed Changes

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

Show a summary per file
File Description
crates/oxc_linter/src/rules/eslint/no_unused_vars/options.rs Added ignore_using_declarations field to options struct with documentation and parsing logic
crates/oxc_linter/src/rules/eslint/no_unused_vars/allowed.rs Implemented the core logic to ignore using declarations when option is enabled
crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs Added tests for the new option with both using and await using cases
crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/eslint.rs Extended test coverage with additional test cases for using declarations
crates/oxc_linter/src/snapshots/eslint_no_unused_vars@oxc-vars-using.snap Updated test snapshots showing expected warnings for await using
crates/oxc_linter/src/snapshots/eslint_no_unused_vars@eslint.snap Updated comprehensive test snapshots with new test cases

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 15, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the c/10-15-feat_linter_no-unused-vars_support_ignoreusingdeclarations_option branch from ac92eb1 to 9cd7a67 Compare October 15, 2025 15:43
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 15, 2025

CodSpeed Performance Report

Merging #14632 will not alter performance

Comparing c/10-15-feat_linter_no-unused-vars_support_ignoreusingdeclarations_option (9cd7a67) with main (84b2605)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

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

  2. 33 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.

@graphite-app graphite-app bot merged commit 9cd7a67 into main Oct 15, 2025
20 checks passed
@graphite-app graphite-app bot deleted the c/10-15-feat_linter_no-unused-vars_support_ignoreusingdeclarations_option branch October 15, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: support of ignoreUsingDeclarations option in no-unused-vars

1 participant