-
-
Notifications
You must be signed in to change notification settings - Fork 887
Labels
Description
What version of Oxlint are you using?
0.15.15
What command did you run?
oxlint ./src
What does your .oxlintrc.json config file look like?
What happened?
For this code:
import { useCallback, useEffect } from "react";
function Component({ foo }) {
const log = useCallback(() => {
console.log(foo);
}, [foo]);
useEffect(() => {
log();
}, []);
}no warning is emitted.
Both react-hooks/exhaustive-deps from eslint-plugin-react-hooks and lint/correctness/useExhaustiveDependencies from biome emit a warning:
react-hooks/exhaustive-deps:
/home/berni/Documents/src/test/linters/src/index.js
9:8 warning React Hook useEffect has a missing dependency: 'log'. Either include it or remove the dependency array react-hooks/exhaustive-deps
✖ 1 problem (0 errors, 1 warning)
lint/correctness/useExhaustiveDependencies:
./src/index.js:7:5 lint/correctness/useExhaustiveDependencies ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This hook does not specify all of its dependencies: log
5 │ console.log(foo);
6 │ }, [foo]);
> 7 │ useEffect(() => {
│ ^^^^^^^^^
8 │ log();
9 │ }, []);
ℹ This dependency is not specified in the hook dependency list.
6 │ }, [foo]);
7 │ useEffect(() => {
> 8 │ log();
│ ^^^
9 │ }, []);
10 │ }
ℹ Either include it or remove the dependency array
Checked 1 file in 1396µs. No fixes applied.
Found 1 error.
lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Some errors were emitted while running checks.
Reactions are currently unavailable
{ "$schema": "./node_modules/oxlint/configuration_schema.json", "rules": { "react/exhaustive-deps": "warn", "no-unused-vars": "off" }, "env": { "builtin": true, "browser": true }, "ignorePatterns": ["dist/**", "out/**", "node_modules/**"] }