-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
🐛 useExhaustiveDependencies
: allow effects with no dependency arrays
#608
Comments
@nstepien can you share a reproduction with eslint hooks rule? |
https://stackblitz.com/edit/node-pxeyhl?file=src%2Findex.js |
@ematipico @msdlisper |
|
I have a question, is the final standard for our lint rules ESLint? For example, I think it's better to give hints for this rule, but ESLint does not report errors |
Generally, we should not emit false positive errors compared to the eslint rule, but emitting more information is a nice addendum that is always more than welcome. Some members of the community suggested splitting the rule in two: #630 |
Hey, I can work on this and probably #651 after 😄 |
Environment information
https://biomejs.dev/playground/?indentStyle=space"eStyle=single&trailingComma=none&code=aQBtAHAAbwByAHQAIAB7ACAAdQBzAGUARQBmAGYAZQBjAHQALAAgAHUAcwBlAEwAYQB5AG8AdQB0AEUAZgBmAGUAYwB0ACAAfQAgAGYAcgBvAG0AIAAnAHIAZQBhAGMAdAAnADsACgAKAGYAdQBuAGMAdABpAG8AbgAgAHUAcwBlAEMAdQBzAHQAbwBtAEgAbwBvAGsAKAB2AGEAbAB1AGUAOgAgAHUAbgBrAG4AbwB3AG4AKQAgAHsACgAgACAAdQBzAGUARQBmAGYAZQBjAHQAKAAoACkAIAA9AD4AIAB7AAoAIAAgACAAIABjAG8AbgBzAG8AbABlAC4AbABvAGcAKAB2AGEAbAB1AGUAKQA7AAoAIAAgAH0AKQA7AAoACgAgACAAdQBzAGUATABhAHkAbwB1AHQARQBmAGYAZQBjAHQAKAAoACkAIAA9AD4AIAB7AAoAIAAgACAAIABjAG8AbgBzAG8AbABlAC4AbABvAGcAKAB2AGEAbAB1AGUAKQA7AAoAIAAgAH0AKQA7AAoAfQAKAA%3D%3D
What happened?
Effect hooks with no dependency arrays are valid, in some cases we do want to run the effect on every render, or avoiding re-runs isn't important enough to add the array.
Expected result
Biome shouldn't flag these as issues.
Although maybe it could be a separate rule to enforce all effects to have a dependency arrays.
I don't know if anyone would be interested.
Code of Conduct
The text was updated successfully, but these errors were encountered: