CLI:
Version: 1.7.0
Color support: true
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
BIOME_LOG_DIR: unset
NO_COLOR: unset
TERM: "xterm-256color"
JS_RUNTIME_VERSION: "v20.5.1"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "yarn/3.6.3"
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: false
VCS disabled: true
Linter:
Recommended: true
All: false
Rules: a11y/useKeyWithClickEvents = "off"
correctness/noUnusedImports = "error"
correctness/useHookAtTopLevel = "error"
suspicious/noExplicitAny = "off"
Workspace:
Open Documents: 0
lint/correctness/useExhaustiveDependencies
Biome should recognize dependencies no matter whether they are specified before or after the hook that depends on them.
Biome handles this correctly:
export const WithFoo = ({ children }: { children: React.ReactNode }) => {
const [foo, setFoo] = useState("");
const isBar = useCallback(() => foo.startsWith("bar"), [foo]);
const barify = useCallback(() => {
if (!isBar()) setFoo("bar");
}, []);
return (
<FooContext.Provider value={{ foo, isBar, barify }}>
{children}
</FooContext.Provider>
);
};
In the above, Biome correctly warns that barify
does not specify it's dependency on isBar
. However, if I reverse the order of the two functions, Biome produces no warning.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too