-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
🐛 useHookAtTopLevel
: unconditional hook usage flagged as conditionally called
#610
Comments
https://stackblitz.com/edit/node-74lxwb?file=src%2Findex.js,package.json |
This also happens when using function components in objects: const obj = {
Component() {
useState(0);
return ...;
}
} |
I have included fixes for the edge cases in the playground in #1393.
|
@ematipico looks like there's still a bug in the playground link |
cc @arendjr |
Huh, I had not included that one in the test cases, because I didn’t see a failure before, so I figured it must’ve been fixed already. Oh well, this fix shouldn’t be too hard :) |
IIRC it was fixed before, there might be a regression somewhere 🤔 |
I can still see a false-positive in the playground, is it not updated? 🤔 |
Hm, good question. I would suspect so, because if it’s still not fixed I’ll eat my shoe 😂 |
Playground seems fine now? 🤔 |
Nice! Re-closing then, thanks! |
Environment information
https://biomejs.dev/playground/?indentStyle=space"eStyle=single&trailingComma=none&lintRules=all&code=aQBtAHAAbwByAHQAIAB7ACAAYwByAGUAYQB0AGUAQwBvAG4AdABlAHgAdAAsACAAdQBzAGUAQwBhAGwAbABiAGEAYwBrACwAIAB1AHMAZQBDAG8AbgB0AGUAeAB0ACAAfQAgAGYAcgBvAG0AIAAnAHIAZQBhAGMAdAAnADsACgAKAGMAbwBuAHMAdAAgAEMAbwBuAHQAZQB4AHQAIAA9ACAAYwByAGUAYQB0AGUAQwBvAG4AdABlAHgAdAAoAHsAfQApADsACgAKAGUAeABwAG8AcgB0ACAAZgB1AG4AYwB0AGkAbwBuACAAdQBzAGUASwBlAHkAKABrAGUAeQA6ACAAcwB0AHIAaQBuAGcAKQAgAHsACgAgACAAcgBlAHQAdQByAG4AIAB1AHMAZQBDAG8AbgB0AGUAeAB0ACgAQwBvAG4AdABlAHgAdAApAFsAawBlAHkAXQA7AAoAfQAKAAoAZQB4AHAAbwByAHQAIABmAHUAbgBjAHQAaQBvAG4AIAB1AHMAZQBTAHQAdQBmAGYAKAApACAAewAKACAAIAByAGUAdAB1AHIAbgAgAHsACgAgACAAIAAgAGEAYgBjADoAIAB1AHMAZQBDAGEAbABsAGIAYQBjAGsAKAAoACkAIAA9AD4AIABuAHUAbABsACwAIABbAF0AKQAKACAAIAB9ADsACgB9AAoACgBlAHgAcABvAHIAdAAgAGYAdQBuAGMAdABpAG8AbgAgAHUAcwBlAFMAdAB1AGYAZgAyACgAKQAgAHsACgAgACAAcgBlAHQAdQByAG4AIABbAHUAcwBlAEMAYQBsAGwAYgBhAGMAawAoACgAKQAgAD0APgAgAG4AdQBsAGwALAAgAFsAXQApAF0AOwAKAH0ACgA%3D
What happened?
Biome flags these hooks as being conditionally called when they are not.
Expected result
No issues reported.
Code of Conduct
The text was updated successfully, but these errors were encountered: