Skip to content

Conversation

@eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Aug 25, 2025

Summary

#34176 introduced @babel/plugin-proposal-private-methods:

import PluginProposalPrivateMethods from '@babel/plugin-proposal-private-methods';

However, the declared dependencies of eslint-plugin-react-hooks weren't updated.

This mostly worked for package managers that hoist everything but breaks when node_modules are strictly isolated to the set of declared dependencies.

I declared the used dependency in this PR. Could also be possible to use the transform directly.

Fixes

Oops! Something went wrong! :(

ESLint: 9.12.0

Error: Failed to load plugin 'react-hooks' declared in '--config » ./.eslintrc.json': Cannot find module '@babel/plugin-proposal-private-methods'
Require stack:
- ~/node_modules/.pnpm/eslint-plugin-react-hooks@0.0.0-experimental-6de32a5a-20250822_eslint@9.12.0/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js

Test plan

@eps1lon eps1lon requested a review from josephsavona August 25, 2025 09:02
@meta-cla meta-cla bot added the CLA Signed label Aug 25, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Aug 25, 2025
@react-sizebot
Copy link

Comparing: 9eede45...63feb94

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 530.18 kB 530.18 kB = 93.39 kB 93.39 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 655.82 kB 655.82 kB = 115.31 kB 115.31 kB
facebook-www/ReactDOM-prod.classic.js = 675.59 kB 675.59 kB = 118.54 kB 118.54 kB
facebook-www/ReactDOM-prod.modern.js = 666.02 kB 666.02 kB = 116.87 kB 116.87 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 63feb94

@eps1lon eps1lon marked this pull request as ready for review August 25, 2025 09:08
Copy link
Member

@poteto poteto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

"@babel/core": "^7.24.4",
"@babel/parser": "^7.24.4",
"@babel/plugin-transform-private-methods": "^7.24.4",
"@babel/plugin-proposal-private-methods": "^7.18.6",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this package seems deprecated. rather than update the package here, could you try updating react/packages/eslint-plugin-react-hooks/src/shared/RunReactCompiler.ts to use @babel/plugin-transform-private-methods instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I didn't know. Though this was attempted before and reverted in #31665 so I don't think that's safe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right good catch

@eps1lon eps1lon merged commit 67e743f into facebook:main Aug 25, 2025
250 checks passed
@eps1lon eps1lon deleted the sebbie/fix-lint-plugin-deps branch August 25, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants