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?
This rule incorrectly flags stable const value.
test.tsx
const Component = () => {
const DATA = 'test' as const;
const data = React.useMemo(() => DATA, []);
return <div>{data}</div>;
};
Output:
× react-hooks(exhaustive-deps): React Hook useMemo has a missing dependency: 'DATA'
╭─[test.tsx:3:44]
2 │ const DATA = 'test' as const;
3 │ const data = React.useMemo(() => DATA, []);
· ──┬─ ──
· ╰── useMemo uses `DATA` here
4 │ return <div>{data}</div>;
╰────
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?
This rule incorrectly flags stable const value.
test.tsx
Output: