Skip to content

fix(linter): false positve in no-unused-vars - #10470

Merged
graphite-app[bot] merged 1 commit into
mainfrom
c/04-17-fix_linter_false_positve_in_no-unused-vars
Apr 18, 2025
Merged

fix(linter): false positve in no-unused-vars#10470
graphite-app[bot] merged 1 commit into
mainfrom
c/04-17-fix_linter_false_positve_in_no-unused-vars

Conversation

@camc314

@camc314 camc314 commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

fixes #10458

@github-actions github-actions Bot added A-linter Area - Linter C-bug Category - Bug labels Apr 17, 2025

camc314 commented Apr 17, 2025

Copy link
Copy Markdown
Contributor Author

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.

@camc314
camc314 marked this pull request as ready for review April 17, 2025 11:25
@codspeed-hq

codspeed-hq Bot commented Apr 17, 2025

Copy link
Copy Markdown

CodSpeed Instrumentation Performance Report

Merging #10470 will not alter performance

Comparing c/04-17-fix_linter_false_positve_in_no-unused-vars (f0c1eff) with main (a42d85f)

Summary

✅ 36 untouched benchmarks

@Dunqing Dunqing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I do not fully understand how it works, but from the code, it looks like it can be simplified.

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Apr 18, 2025

Dunqing commented Apr 18, 2025

Copy link
Copy Markdown
Member

Merge activity

@graphite-app
graphite-app Bot force-pushed the c/04-17-fix_linter_false_positve_in_no-unused-vars branch from 1ef693b to f0c1eff Compare April 18, 2025 02:26
@graphite-app
graphite-app Bot merged commit f0c1eff into main Apr 18, 2025
@graphite-app
graphite-app Bot deleted the c/04-17-fix_linter_false_positve_in_no-unused-vars branch April 18, 2025 02:29
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Apr 18, 2025
@camc314

camc314 commented Apr 24, 2025

Copy link
Copy Markdown
Contributor Author

from the code, it looks like it can be simplified.

know how?

rust-lang/rust#138528 looks like 1.88, we should be able to use implicit deref ect.

so it'd end up (I think) like:

                    match left {
                        AssignmentTarget::AssignmentTargetIdentifier(id) => {
                            if id.name == name {
                                is_used_by_others = false;
                            } else {
                                 return false; // we can short-circuit
                             }
                         }
                         AssignmentTarget::TSAsExpression(ref TSAsExpression { expression, .. })
                         | AssignmentTarget::TSSatisfiesExpression(ref TSSatisfiesExpression { expression, .. })
                         | AssignmentTarget::TSSatisfiesExpression(ref TSSatisfiesExpression { expression, .. })
                         | AssignmentTarget::TSNonNullExpression(ref TSNonNullExpression { expression, .. })
                         | AssignmentTarget::TSTypeAssertion(ref TSTypeAssertion { expression, .. })
                         if expression.is_member_expression() =>
                         {
                             return false;
                         }
                         

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.

linter: no-unused-vars

3 participants