What version of Oxlint are you using?
1.68.0
What command did you run?
yarn oxlint -c oxlint.config.mjs
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
import { defineConfig } from 'oxlint';
export default defineConfig({
categories: {
correctness: 'off',
},
plugins: ['react-hooks'],
rules: {
'react-hooks/exhaustive-deps': 'error',
},
});
What happened?
The rule reports state setters as missing dependencies when React is imported under a name other than React (e.g., in tests).
test.tsx:
const ReactActual = jest.requireActual('react');
const Component = ({ filter }) => {
const [data, setData] = ReactActual.useState(filter);
ReactActual.useEffect(() => {
setData(filter);
}, [filter]);
return <div>test</div>;
};
Output:
× react-hooks(exhaustive-deps): React Hook useEffect has a missing dependency: 'setData'
╭─[test.tsx:6:8]
4 │ ReactActual.useEffect(() => {
5 │ setData(filter);
· ───┬───
· ╰── useEffect uses `setData` here
6 │ }, [filter]);
· ────────
7 │ };
╰────
help: Either include it or remove the dependency array.
What version of Oxlint are you using?
1.68.0
What command did you run?
yarn oxlint -c oxlint.config.mjsWhat does your
.oxlintrc.json(oroxlint.config.ts) config file look like?What happened?
The rule reports state setters as missing dependencies when React is imported under a name other than React (e.g., in tests).
test.tsx:
Output: