-
-
Notifications
You must be signed in to change notification settings - Fork 778
fix(linter): fix false positive in react/exhaustive deps #10727
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
fix(linter): fix false positive in react/exhaustive deps #10727
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. |
d5099d6 to
1973e48
Compare
WalkthroughThe changes update the React hooks linter by removing "useCallback" from the set of hooks considered stable in the 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (13)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
CodSpeed Instrumentation Performance ReportMerging #10727 will not alter performanceComparing Summary
|
1973e48 to
a7067db
Compare
Merge activity
|
Fix React exhaustive-deps rule to correctly handle useCallback references This PR fixes the `exhaustive-deps` rule to no longer consider `useCallback` as a stable value, which was causing incorrect linting behavior. The change: 1. Removes `useCallback` from the stable value check, as it should not be treated like `useRef` 2. Updates tests to reflect this change by: - Commenting out tests that would cause infinite loops at runtime - Uncommenting a test case that should now pass - Adding a test case for the specific issue reported in #9788 closes #9788 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of React hooks by updating which hooks are recognized as stable, specifically adjusting support for useCallback. - **Tests** - Updated test coverage: disabled tests for unsupported recursive useCallback cases, enabled a nested callback test, and added a new test case related to a known issue. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
a7067db to
c9575f6
Compare

Fix React exhaustive-deps rule to correctly handle useCallback references
This PR fixes the
exhaustive-depsrule to no longer consideruseCallbackas a stable value, which was causing incorrect linting behavior. The change:useCallbackfrom the stable value check, as it should not be treated likeuseRefcloses #9788