💅 Biomo throw useExhaustiveDependencies error when variable outside the component is used in useMemo #1781
Closed
1 task done
Labels
A-Linter
Area: linter
L-JavaScript
Language: JavaScript and super languages
S-Bug-confirmed
Status: report has been confirmed as a valid bug
Environment information
Rule name
useExhaustiveDependencies
Playground link
https://biomejs.dev/playground/?code=aQBtAHAAbwByAHQAIAB7ACAAdQBzAGUATQBlAG0AbwAgAH0AIABmAHIAbwBtACAAJwByAGUAYQBjAHQAJwA7AAoAaQBtAHAAbwByAHQAIAB7ACAAQQBjAGMAZQBzAHMAUABvAGwAaQBjAHkATABpAHMAdAAgAH0AIABmAHIAbwBtACAAJwAuAC8AYQBjAGMAZQBzAHMAUABvAGwAaQBjAHkATABpAHMAdAAnADsACgAKAGkAbgB0AGUAcgBmAGEAYwBlACAAQQBjAGMAZQBzAHMAUABvAGwAaQBjAHkARAByAGEAdwBlAHIAUAByAG8AcABzACAAewAKACAAIAByAGUAcwBvAHUAcgBjAGUAOgAgAHMAdAByAGkAbgBnADsACgB9AAoACgBlAHgAcABvAHIAdAAgAGQAZQBmAGEAdQBsAHQAIABmAHUAbgBjAHQAaQBvAG4AIABSAGUAcwBvAHUAcgBjAGUAQwBvAG4AZgBpAGcAdQByAGEAdABpAG8AbgAoAHAAcgBvAHAAcwA6ACAAQQBjAGMAZQBzAHMAUABvAGwAaQBjAHkARAByAGEAdwBlAHIAUAByAG8AcABzACkAIAB7AAoACQBjAG8AbgBzAHQAIAB7ACAAcgBlAHMAbwB1AHIAYwBlACAAfQAgAD0AIABwAHIAbwBwAHMAOwAKAAoACQBjAG8AbgBzAHQAIABvAHAAdABpAG8AbgBzACAAPQAgAHUAcwBlAE0AZQBtAG8AKAAoACkAIAA9AD4AIAB7AAoACQAJAGMAbwBuAHMAdAAgAGMAbwBuAGYAaQBnACAAPQAgAEEAYwBjAGUAcwBzAFAAbwBsAGkAYwB5AEwAaQBzAHQAPwAuAFsAcgBlAHMAbwB1AHIAYwBlAF0AOwAKAAkACQBpAGYAIAAoACEAYwBvAG4AZgBpAGcAKQAgAHIAZQB0AHUAcgBuACAAWwBdADsACgAKACAAIAAgACAAIAAgACAAIAAvAC8AIABTAG8AbQBlACAAYwBhAGwAYwB1AGwAYQB0AGkAbwBuAC4ALgAuAC4ACgAJAAkAcgBlAHQAdQByAG4AIABbAF0ACgAJAH0ALAAgAFsAcgBlAHMAbwB1AHIAYwBlAF0AKQA7AAoACgAJAHIAZQB0AHUAcgBuACAAbgB1AGwAbAA7AAoAfQAKAA%3D%3D
Expected result
useMemo should not include any variable/constant in dependencies array that is declared outside the component of imported from another file.
Throw error:
In above example, only resourse should be in dependency array
Code of Conduct
The text was updated successfully, but these errors were encountered: