Comments (10)
ESLint v9 support will be done in #28773
from react.
Eslint officially released v9.0.0 today. However, the eslint-plugin-react-hooks
plugin still restricts eslint to v8 in the peerDependencies
list, so nobody who uses the plugin can download v9 without breaking dependency resolution.
Hope you'll add support for v9 soon!
from react.
Note that even wiring up the plugin manually doesn't enable it to work with the now-released ESLint 9: the plugin currently uses APIs like context.getSource
which don't exist any more (eslint/eslint#17520), so there'll need to be some upgrade work.
e.g.
from react.
What would be involved in creating such a wrapper?
It's not too much work (famous last words, I know). In theory the plugin should be able to get away with exporting an object containing configs
, meta
, and rules
. https://eslint.org/docs/latest/extend/plugin-migration-flat-config#adding-plugin-meta-information shows a very minimal object.
make more sense to file a PR and then see how it'll look?
π
We're only on ESLint 7 though so I guess we need to upgrade that first to test.
Yeah it feels like it'd probably be cleanest to upgrade to ESLint 8 first, just in case any breaking changes impact the plugin.
from react.
@eps1lon how far away from merge/release is this update to support eslint v9?
from react.
Thank you for reaching out. What would be involved in creating such a wrapper? Does it make more sense to file a PR and then see how it'll look?
We're only on ESLint 7 though so I guess we need to upgrade that first to test.
from react.
Should we raise a separate issue for v9 API support?
from react.
Should we raise a separate issue for v9 API support?
Currently under discussion in jsx-eslint/eslint-plugin-react#3699.
from react.
ESLint v9 support will be done in #28773
Hey @eps1lon, greetings!
I just wanted to ask, is #28773 part of the 4.6.0
release that was published on npm 3 days ago or it's planned for a future release?
I am currently in the process of migrating to flat config, and the plugin is giving me an error.
Oops! Something went wrong! :(
ESLint: 9.1.0
TypeError: context.getSource is not a function
Occurred while linting /home/user/projects/eslint-flat-config-migration/src/index.tsx:8
Rule: "react-hooks/exhaustive-deps"
at visitFunctionWithDependencies (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js:1704:42)
at visitCallExpression (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js:1759:11)
at ruleErrorHandler (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1115:48)
at /home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
at runRules (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1154:40)
If needed, here is a my repository where the issue can be reproduced by running npx eslint src/index.tsx
https://github.com/virtuallyunknown/eslint-flat-config-migration
Relevant files:
https://github.com/virtuallyunknown/eslint-flat-config-migration/blob/master/eslint.config.js
https://github.com/virtuallyunknown/eslint-flat-config-migration/blob/master/configs/react.js
Cheers!
from react.
ESLint v9 support will be done in #28773
Hey @eps1lon, greetings!
I just wanted to ask, is #28773 part of the
4.6.0
release that was published on npm 3 days ago or it's planned for a future release?I am currently in the process of migrating to flat config, and the plugin is giving me an error.
Oops! Something went wrong! :( ESLint: 9.1.0 TypeError: context.getSource is not a function Occurred while linting /home/user/projects/eslint-flat-config-migration/src/index.tsx:8 Rule: "react-hooks/exhaustive-deps" at visitFunctionWithDependencies (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js:1704:42) at visitCallExpression (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js:1759:11) at ruleErrorHandler (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1115:48) at /home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:58 at Array.forEach (<anonymous>) at Object.emit (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:38) at NodeEventGenerator.applySelector (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:297:26) at NodeEventGenerator.applySelectors (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:326:22) at NodeEventGenerator.enterNode (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:340:14) at runRules (/home/user/projects/eslint-flat-config-migration/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1154:40)
If needed, here is a my repository where the issue can be reproduced by running
npx eslint src/index.tsx
https://github.com/virtuallyunknown/eslint-flat-config-migration
Relevant files: https://github.com/virtuallyunknown/eslint-flat-config-migration/blob/master/eslint.config.js https://github.com/virtuallyunknown/eslint-flat-config-migration/blob/master/configs/react.js
Cheers!
got the same error and I turn off the rules about react-hooks...
from react.
Related Issues (20)
- Bug: `Children.map` raises error when passed async server component within client component HOT 4
- Bug: mouse events are bubbled up too far with some pointer-events rules HOT 1
- Bug: Unsupported HTML character references HOT 6
- Bug: React not defined in TypeScript when importing from npm HOT 8
- After using forwardRef in a JSX component, you encounter an error when using it in a TSX component. HOT 1
- [DevTools Bug] Could not find node with id "464" in commit tree HOT 1
- β Phishing Website Warning!!! There are phishing website links in the document. HOT 6
- not showing components in inspect its stuck
- [DevTools Bug]: I can't see the "Profiler" and "Components" in my dev tools HOT 1
- [DevTools Bug]: I can't see the "Profiler" and "Components" in my dev tools HOT 2
- Bug: Event handling with portals is broken
- Feature Request: useOnLoadEffect() -> empty dependency array useEffect wrapper
- Larger files upload rejection message instead of net::ERR_CONNECTION_RESET
- Bug: yo HOT 1
- Bug: refObj returned from useRef is not sealed
- Bug: Input of type number is incrementing/decrementing on mouse scroll
- Bug: render time differ depending on load
- How can I force update a class component in SyncLane? Can we permanently expose runWithPriority API? HOT 13
- Bug: StrictMode is not preventing side effects HOT 2
- [DevTools Bug]: After updating to version 5.1 the Dev tools fails to inspect elements
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.