-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
bug: eslint-plugin-react-hooks throws TypeError: context.getSource is not a function #984
Comments
@EuanMorgan definitely not a solution, but as a temporary fix:
disabled that rule so i could at least run my linter in CI... I believe this was introduced with #969. |
@adamspotlite The issue seems to be with the entire react-hooks eslint not just the exhaustive deps rule |
I also have the same issue.
I think so too. Eslint 9 is not ready for nextJS. eslint peerDependency in eslint-config-next is ^8.0.0 instead of ^9.0.0. Eslint 9.0.0 has a breaking change. For now, changing Eslint version to ^8.56.0 seems to fix it |
The issue seems to have been resolved in the canary release of However, using some rules from |
Yeah, for now I just ran |
Fixed in 19a823e |
Just for visibility, I'm on |
Are you using the beta channel of the react-hooks plugin? |
hmmm, i don't believe so. I followed 19a823e and just bumped versions. What needs to be done? |
That commit did bump version to beta. Should work ootb |
still occuring to me |
I have it too
|
|
Hoping on the train too, just to provide extra context. Not sure why, in one of my public projects, it works fine. But in another private project, with the same For now, using the |
Solution can be found here TL;DRadd import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import { fixupPluginRules } from "@eslint/compat";
/** @type {import('eslint').Linter.FlatConfig}*/
export default [
{
plugins: {
react: reactPlugin,
"react-hooks": fixupPluginRules(reactHooksPlugin),
},
rules: {
...reactHooksPlugin.configs.recommended.rules,
},
},
]; |
Any idea how to do that on old (not flat) config? |
* inertia - remove redux and use inertia instead * inertia - add maryland svg, fix census query * inertia - fix notification subscriptions create/destroy, fix census lookup of congressional districts * inertia - add maryland svg, fix census query, add unique index to bill.external_id * inertia - fix rspec, get new tapioca dsl + gems * inertia - rspec test ruby version * inertia - typescript and eslint gh actions * inertia - rspec action * inertia - fix eslint - https://github.com/t3-oss/create-t3-turbo/issues/984\#issuecomment-2210934687 * inertia - add ssl certs for github + address some sonar issues
Provide environment information
Describe the bug
Apologies if this is an upstream issue but the eslint-plugin-react-hooks isn't working with the current V9 setup.
In the ESLint console you can see the following error:
Link to reproduction
N/A
To reproduce
eslint-plugin-react-hooks
rulee.g. In
CreatePostForm
write a useEffect likeAdditional information
No response
The text was updated successfully, but these errors were encountered: