chore(linting): update ESLint to v10, bump lint group deps#8672
chore(linting): update ESLint to v10, bump lint group deps#8672avivkeller wants to merge 1 commit intomainfrom
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 Please review the changes when you have a chance. Thank you! 🙏 |
acf7492 to
23954d9
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8672 +/- ##
==========================================
- Coverage 75.10% 75.09% -0.02%
==========================================
Files 104 103 -1
Lines 9167 9141 -26
Branches 315 316 +1
==========================================
- Hits 6885 6864 -21
+ Misses 2280 2275 -5
Partials 2 2 ☔ View full report in Codecov by Sentry. |
MattIPv4
left a comment
There was a problem hiding this comment.
Not sure I'm overly a fan of this at first glance, it seems like we're losing linting on things like making sure hook calls have the correct dependencies?
Is there reason not to just wait until the existing React plugins are updating for eslint v10?
📦 Build Size ComparisonSummary
Changes➕ Added Assets (29)
➖ Removed Assets (29)
|
That's coming soon.
I don't think they are planning on doing that anytime soon. Let's draft this until either one of the following:
Whichever happens happens, how does that sound? |
|
👍 Sounds reasonable |
|
3.0.0 is out, and the previous plugin still has not updated support for v10. I'll rebase this PR today |
8195469 to
e4f2adf
Compare
|
Just need to fix the egregious lockfile diff... |
e4f2adf to
0dfeac1
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s linting toolchain to ESLint v10 and migrates React linting from eslint-plugin-react/eslint-plugin-react-hooks to @eslint-react/eslint-plugin, along with a set of codebase adjustments to satisfy the new rules (notably around React context usage, hook organization, and a few component refactors).
Changes:
- Bump ESLint (and related lint-group dependencies) and update flat ESLint configs to use
@eslint-react/eslint-plugin. - Refactor React context usage across
apps/site(switch touse(Context)and React 19 provider shorthand) and reorganize hooks intoapps/site/hooks/*. - Minor component cleanups (pagination helper rename, key updates, lint-suppression comment updates).
Reviewed changes
Copilot reviewed 48 out of 52 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui-components/src/Icons/InstallationMethod/N.tsx | Removes an inline comment in the SVG icon. |
| packages/ui-components/src/Containers/Sidebar/index.tsx | Refactors Sidebar away from forwardRef and changes how ref is handled/typed. |
| packages/ui-components/src/Common/Select/index.tsx | Removes useEffect that synced internal state with defaultValue; updates eslint-disable rule name. |
| packages/ui-components/src/Common/Search/Suggestions/index.tsx | Reorders props spread vs key on list items. |
| packages/ui-components/src/Common/BasePagination/index.tsx | Switches pagination elements helper from a hook-like name to a plain function import. |
| packages/ui-components/src/Common/BasePagination/getPageElements.tsx | Renames useGetPageElements to getPageElements. |
| packages/ui-components/src/Common/AvatarGroup/Avatar/index.tsx | Refactors Avatar away from forwardRef. |
| packages/ui-components/package.json | Bumps linting/styling-related dev deps for ui-components. |
| packages/ui-components/eslint.config.js | Migrates React linting config to @eslint-react/eslint-plugin and adjusts rules. |
| package.json | Bumps root lint-related dependencies (ESLint v10, lint-staged, etc.). |
| apps/site/types/server.ts | Updates type import path for useDetectOS. |
| apps/site/providers/releaseProvider.tsx | Switches to React 19 use(Context) and provider shorthand; updates eslint-disable rule names. |
| apps/site/providers/navigationStateProvider.tsx | Uses provider shorthand and renames internal ref var. |
| apps/site/providers/matterProvider.tsx | Updates useDetectOS import path and uses provider shorthand. |
| apps/site/package.json | Bumps lint-related deps for the site app and adds @eslint-react/eslint-plugin. |
| apps/site/layouts/Post.tsx | Switches from useClientContext (server hook) to getClientContext. |
| apps/site/hooks/useSiteNavigation.ts | Adds/moves site navigation hook into top-level hooks/. |
| apps/site/hooks/useScrollToElement.ts | Switches to use(Context), updates eslint-disable rule names, and uses new useScroll. |
| apps/site/hooks/useScroll.ts | Adds a debounced scroll event hook. |
| apps/site/hooks/useMediaQuery.ts | Adds a matchMedia hook. |
| apps/site/hooks/useDetectOS.ts | Adds eslint-disable for set-state-in-effect rule. |
| apps/site/hooks/useClientContext.ts | Switches from useContext to use(Context). |
| apps/site/hooks/server/useScrollToElement.ts | Removes RSC-guard stub. |
| apps/site/hooks/server/useScroll.ts | Removes RSC-guard stub. |
| apps/site/hooks/server/useClientContext.ts | Removes server hook wrapper around getClientContext. |
| apps/site/hooks/server/index.ts | Removes server hooks barrel export. |
| apps/site/hooks/generic/index.ts | Removes generic hooks barrel export. |
| apps/site/hooks/client/index.ts | Removes client hooks barrel export. |
| apps/site/hooks/tests/useScrollToElement.test.jsx | Updates imports/formatting for relocated hook. |
| apps/site/hooks/tests/useMediaQuery.test.mjs | Updates import for relocated hook. |
| apps/site/hooks/tests/useDetectOS.test.mjs | Updates import for relocated hook. |
| apps/site/hooks/tests/useClientContext.test.jsx | Updates import for relocated hook. |
| apps/site/eslint.config.js | Migrates React linting config to @eslint-react/eslint-plugin and adjusts rules. |
| apps/site/components/withSidebarCrossLinks.tsx | Updates hooks imports and switches to getClientContext. |
| apps/site/components/withSidebar.tsx | Updates hooks imports to new hook locations. |
| apps/site/components/withNavBar.tsx | Updates useSiteNavigation import path. |
| apps/site/components/withMetaBar.tsx | Updates hooks imports and adds purity suppression for deterministic date formatting. |
| apps/site/components/withBreadcrumbs.tsx | Updates hooks imports to new hook locations. |
| apps/site/components/EOL/EOLModal.tsx | Updates eslint-disable rule names and adds a new suppression for useMemo. |
| apps/site/components/Downloads/Release/VersionDropdown.tsx | Switches from useContext to use(Context). |
| apps/site/components/Downloads/Release/ReleaseCodeBox.tsx | Switches to use(Context) and adds eslint-disable for dangerouslySetInnerHTML. |
| apps/site/components/Downloads/Release/PrebuiltDownloadButtons.tsx | Switches from useContext to use(Context). |
| apps/site/components/Downloads/Release/PlatformDropdown.tsx | Switches to use(Context) and updates hook import paths / eslint-disable rule names. |
| apps/site/components/Downloads/Release/PackageManagerDropdown.tsx | Switches to use(Context) and updates eslint-disable rule names. |
| apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx | Switches to use(Context) and updates hook import paths / eslint-disable rule names. |
| apps/site/components/Downloads/Release/InstallationMethodDropdown.tsx | Switches to use(Context) and updates eslint-disable rule names. |
| apps/site/components/Downloads/Release/DownloadLink.tsx | Switches from useContext to use(Context). |
| apps/site/components/Downloads/Release/ChangelogLink.tsx | Switches from useContext to use(Context). |
| apps/site/components/Downloads/Release/BlogPostLink.tsx | Switches from useContext to use(Context). |
| apps/site/components/Common/Supporters/index.tsx | Changes React list key from ${name}-${i} to name. |
| apps/site/components/Common/FormattedTime.tsx | Adds purity suppression for deterministic date construction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR updates ESLint to v10, and replaces
eslint-plugin-reactwith@eslint-react/eslint-pluginfor the following reasons:eslint-plugin-reactdoes not support ESLint v10@eslint-react/eslint-pluginis much smaller and much faster (in CI, it's 2m43s vs 3m12s