-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
💅 Lost ability to lint React hooks from specific namespace #1931
Comments
Is this still a problem if you configure It doesn’t allow you to specify a namespace, but I think it might allow linting it from any source. |
Yes it's still a problem even when configuring the options. Adding |
Got it. If we changed that behavior, would it solve the problem for you? Or do you think adding configurable namespaces would still be better? |
Changing that behavior would be great, thanks! The most important thing is that hooks including the custom namespace are also linted (in addition to hooks from custom paths). For example, both uses of
However, when we use the custom namespace, neither use of
To solve the problem the second two uses of |
@arendjr Thank you for the help and fix for this! |
@catherinelasersohn please be aware there is still a downside to the current implementation, which is that hooks with stable return values aren’t being recognized as stable either yet when they’re being imported from other places. For instance normally, you don’t need to specify setters from |
@arendjr Thanks for clarifying and for the stable hook fix as well! |
Environment information
Rule name
useExhaustiveDependencies
Playground link
https://biomejs.dev/playground/?code=aQBtAHAAbwByAHQAIAAqACAAYQBzACAAUgBlAGEAYwB0AFIAZQBlAHgAcABvAHIAdAAgAGYAcgBvAG0AIAAiAHIAZQBhAGMAdABfAHIAZQBlAHgAcABvAHIAdAAiADsACgBpAG0AcABvAHIAdAAgACoAIABhAHMAIABSAGUAYQBjAHQAIABmAHIAbwBtACAAIgByAGUAYQBjAHQAIgA7AAoACgAKAC8ALwAgAFQAaABpAHMAIABpAHMAIABsAGkAbgB0AGUAZAAgAGEAcwAgAGUAeABwAGUAYwB0AGUAZAAKAGYAdQBuAGMAdABpAG8AbgAgAGMAbwBtAHAAbwBuAGUAbgB0ACgAKQAgAHsACgAgACAAIAAgAGwAZQB0ACAAYQAgAD0AIAAxADsACgAgACAAIAAgAFIAZQBhAGMAdABSAGUAZQB4AHAAbwByAHQALgB1AHMAZQBFAGYAZgBlAGMAdAAoACgAKQAgAD0APgAgAHsACgAgACAAIAAgACAAIAAgACAAYwBvAG4AcwBvAGwAZQAuAGwAbwBnACgAYQApADsACgAgACAAIAAgAH0ALAAgAFsAXQApADsACgAgACAAIAAgAFIAZQBhAGMAdAAuAHUAcwBlAEUAZgBmAGUAYwB0ACgAKAApACAAPQA%2BACAAewAKACAAIAAgACAAIAAgACAAIABjAG8AbgBzAG8AbABlAC4AbABvAGcAKABhACkAOwAKACAAIAAgACAAfQAsACAAWwBdACkAOwAKAH0A
Expected result
If
react_reexport
is a file that exportsuseEffect
from React, I'd expect the linter to also catch the useExhaustiveDependencies error forReactReexport.useEffect
(as it does forReact.useEffect
when we import fromreact
directly).The eslint equivalent
exhaustive-deps
has the ability to specify additional namespaces from which we can import and lint hooksCode of Conduct
The text was updated successfully, but these errors were encountered: