feat(linter/no-unused-vars): support ignoreUsingDeclarations option#14632
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
There was a problem hiding this comment.
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
ignoreUsingDeclarationsboolean 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
usingandawait usingdeclarations
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.
Merge activity
|
ac92eb1 to
9cd7a67
Compare
CodSpeed Performance ReportMerging #14632 will not alter performanceComparing Summary
Footnotes
|

fixes #14628