Skip to content

Conversation

@araujogui
Copy link
Member

@araujogui araujogui commented Dec 9, 2025

Description

Updates eslint-plugin-react-hooks version and fixes some new issues

Validation

Lint is working

Related Issues

Related to #8400

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@araujogui araujogui requested a review from a team as a code owner December 9, 2025 11:58
Copilot AI review requested due to automatic review settings December 9, 2025 11:58
@araujogui araujogui requested a review from a team as a code owner December 9, 2025 11:58
@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Dec 9, 2025 11:59am

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

👋 Codeowner Review Request

The 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! 🙏

@araujogui araujogui changed the title Chore/update eslint react hooks chore: update eslint-plugin-react-hooks plugin Dec 9, 2025
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.70%. Comparing base (fb4deb8) to head (b58c4d3).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/site/hooks/react-client/useMediaQuery.ts 78.57% 3 Missing ⚠️
apps/site/providers/navigationStateProvider.tsx 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Copilot AI left a 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-hooks from ^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 useMediaQuery to 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants