Skip to content

fix(linter): useExhaustiveDependencies proper rest parameters handling, fixes #8967#9033

Merged
mdevils merged 1 commit intobiomejs:mainfrom
mdevils:fix/issue-8967
Feb 12, 2026
Merged

fix(linter): useExhaustiveDependencies proper rest parameters handling, fixes #8967#9033
mdevils merged 1 commit intobiomejs:mainfrom
mdevils:fix/issue-8967

Conversation

@mdevils
Copy link
Contributor

@mdevils mdevils commented Feb 11, 2026

Summary

Fixed #8967. useExhaustiveDependencies no longer reports false positives for variables destructured from a rest pattern.

Test Plan

Test is included.

Docs

Changeset is included.

@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 402658a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Feb 11, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

This pull request fixes false positives in the useExhaustiveDependencies lint rule when variables are destructured from rest patterns. Changes include updates to the get_single_pattern_member function to recognise REST and SHORTHAND properties within object binding patterns, and modifications to the GetSinglePatternMemberResult::Member enum variant to wrap the member result in an Option type. A test case is added to verify the fix handles rest pattern destructuring correctly.

Possibly related PRs

Suggested labels

A-Linter, L-JavaScript

Suggested reviewers

  • ematipico
  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR successfully addresses issue #8967 by modifying pattern matching logic to properly handle rest parameters, preventing false positives in exhaustive dependency checks.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the useExhaustiveDependencies rule's handling of rest patterns, with supporting test and changeset files.
Title check ✅ Passed The title directly and accurately describes the main change: fixing the useExhaustiveDependencies rule's handling of rest parameters to resolve issue #8967.
Description check ✅ Passed The description is clearly related to the changeset, explaining that the PR fixes issue #8967 by correcting how useExhaustiveDependencies handles rest pattern destructuring.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 11, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 95 skipped benchmarks1


Comparing mdevils:fix/issue-8967 (402658a) with main (8ef9d1d)

Open in CodSpeed

Footnotes

  1. 95 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.

@mdevils mdevils changed the title fix(linter): useExhaustiveDependencies propert rest parameters hand… fix(linter): useExhaustiveDependencies proper rest parameters hand… Feb 11, 2026
@mdevils mdevils changed the title fix(linter): useExhaustiveDependencies proper rest parameters hand… fix(linter): useExhaustiveDependencies proper rest parameters handling, fixes #8967 Feb 11, 2026
@mdevils mdevils merged commit 0628e0a into biomejs:main Feb 12, 2026
22 checks passed
@github-actions github-actions bot mentioned this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 useExhaustiveDependencies rule false positive

3 participants