-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement a rule set for react-hooks
#108
Comments
To shoot the first shot, I would love to go with this kind of ruleset (exact same as react is writing about in the documentations):
Why "warn" only, for exhaustive-deps?Given & Wanted:function FooBar({ foo }) {
useEffect(() => {
if (foo) {
console.log('bar')
}
}, [])
return null
} ESLint
|
I think i will agree with you completely in the first rule. |
@amr3ssam As far as I know, the effect ist the same. Because when the prop The only use case I can think of, where it could be wrong, if there is some case of, when |
what you are saying make sense to be honest because the developer still have as you said the "waring" flag |
I'm totally fine with the second rule just to be used as a warning to tell the developer "hej, there could be an issue". |
Okay, nice. We have a solution. Will create a pull request today or tomorrow, and then let you guys confirm on your projects that everything is fine with it. Thanks 🚀 |
I just saw, that we are in the use of the react-hooks plugin for eslint and not specifying any rules for it. Let's change this.
cc: @visualcookie @amr3ssam @chmtt @LoRaetz
This issue is for discussion for now, until we are on the same page, we may need someone to implement this feature.
The text was updated successfully, but these errors were encountered: