-
-
Notifications
You must be signed in to change notification settings - Fork 839
fix(linter): useExhaustiveDependencies multiple fixes (fixes #3080, fixes #4248, fixes #5914, fixes #8427, fixes #8484, fixes #3685, fixes #3512, fixes #7982)
#8767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pressions specified to hooks, fixes biomejs#7982
…esult destructuring, fixes biomejs#3512
… expression wrappers, fixes biomejs#3685
…d/array index resolution, variable references, fixes biomejs#5914, fixes biomejs#8427, fixes biomejs#8484
…ferences, fixes biomejs#3080, fixes biomejs#4248
🦋 Changeset detectedLatest commit: 96a5437 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
useExhaustiveDependencies multiple fixes (closes #3080, closes #4248, closes #5914, closes #8427, closes #8484, closes #3685, closes #3512, closes #7982)
WalkthroughRefactors the useExhaustiveDependencies lint rule to improve dependency detection. Adds an expression-candidate abstraction, deeper expression unwrapping, and stability-checking helpers with recursion limits. Introduces functions to collect candidate expressions and resolve relevant captures (including from inlined closures and identifiers), replaces capture-based logic with candidate-driven analysis, and updates react hook stability APIs. Adds tests and changelog entries; several internal helpers, enums and public-ish utilities were added or made public to support the new analysis. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (10)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.rs📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
🧠 Learnings (20)📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2025-10-03T12:28:56.788ZApplied to files:
📚 Learning: 2025-11-24T18:05:27.810ZApplied to files:
📚 Learning: 2025-11-24T18:05:27.810ZApplied to files:
📚 Learning: 2025-11-24T18:05:27.810ZApplied to files:
📚 Learning: 2025-11-24T18:05:27.810ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2025-11-24T18:06:03.545ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2025-12-22T09:26:56.943ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2025-11-24T18:05:42.356ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2025-11-24T18:05:42.356ZApplied to files:
📚 Learning: 2025-11-24T18:05:20.371ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
📚 Learning: 2026-01-02T14:58:16.536ZApplied to files:
🧬 Code graph analysis (1)crates/biome_js_analyze/src/react/hooks.rs (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
🔇 Additional comments (18)
✏️ Tip: You can disable this entire section by setting 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. Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
dyc3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very comprehensive! Just a couple notes.
Summary
A number of fixes (some of them cross-dependent) for
useExhaustiveDependencies:Fixed #7982:
useExhaustiveDependenciesnow properly handles callback expressions with typeassertions.
Fixed #3512:
useExhaustiveDependenciesnow properly handles nested destructuring patternsfrom hook results.
Fixed #3685:
useExhaustiveDependenciesnow properly handles transparent expressionwrappers like non-null assertions and type assertions in dependency comparisons.
Fixed #5914:
useExhaustiveDependenciesnow properly handles variables declared in the samestatement.
Fixed #8427:
useExhaustiveDependenciesnow properly resolves variable references to detectcaptured dependencies.
Fixed #8484:
useExhaustiveDependenciesnow properly handles member access on stable hookresults.
Fixed #3080:
useExhaustiveDependenciesnow properly analyzes captures within referencedfunctions passed to hooks.
Fixed #4248:
useExhaustiveDependenciesnow correctly handles function props passed ascallbacks.
Test Plan
Tests are included.
Docs
Changeset is included.