-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore: update eslint-plugin-react-hooks plugin #8405
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website @nodejs/web-infra Please review the changes when you have a chance. Thank you! 🙏 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8405 +/- ##
==========================================
+ Coverage 73.68% 73.70% +0.01%
==========================================
Files 107 107
Lines 9155 9161 +6
Branches 309 311 +2
==========================================
+ Hits 6746 6752 +6
Misses 2407 2407
Partials 2 2 ☔ View full report in Codecov by Sentry. |
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.
Pull request overview
This PR upgrades the eslint-plugin-react-hooks package from version 5.2.0 to 7.0.1 and addresses new lint violations introduced by the updated plugin. The upgrade brings stricter React Hooks rules that improve code quality by catching potential bugs related to hooks usage, particularly around state initialization and ref handling.
Key Changes:
- Updated
eslint-plugin-react-hooksfrom ^5.2.0 to ^7.0.1 in both apps/site and packages/ui-components - Modified ESLint configuration to use the new flat config format for the plugin
- Fixed state initialization in
useMediaQueryto prevent hydration mismatches - Added explicit lint suppression for intentional ref pattern in
navigationStateProvider
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated dependency resolution for eslint-plugin-react-hooks to version 7.0.1 |
| apps/site/package.json | Bumped eslint-plugin-react-hooks version specifier to ^7.0.1 |
| packages/ui-components/package.json | Bumped eslint-plugin-react-hooks version specifier to ^7.0.1 |
| apps/site/eslint.config.js | Updated to use default import and flat config format for react-hooks plugin |
| packages/ui-components/eslint.config.js | Updated to use default import and flat config format for react-hooks plugin |
| apps/site/providers/navigationStateProvider.tsx | Added eslint-disable comment for intentional ref.current usage in context |
| apps/site/hooks/react-client/useMediaQuery.ts | Fixed useState initialization to match server-side rendering state |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Updates
eslint-plugin-react-hooksversion and fixes some new issuesValidation
Lint is working
Related Issues
Related to #8400
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.