Open History to see the last commit
1import pluginReact from '@eslint-react/eslint-plugin'
2import reactHooks from 'eslint-plugin-react-hooks'
3import { defineConfig } from 'oxlint'
4import rootConfig from './root.oxlint.config.ts'
5β
6export default defineConfig({
7 extends: [rootConfig],
8 settings: rootConfig.settings,
9 jsPlugins: [
10 // 'react-hooks' is reserved for Oxlint's native plugin, which lacks the React Compiler rules
11 { name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' },
12 '@eslint-react/eslint-plugin',
13 ],
14 rules: {
15 ...Object.fromEntries(
16 Object.entries(reactHooks.configs.flat.recommended.rules).map(
17 ([name, value]) => [
18 name.replace(/^react-hooks\//, 'react-hooks-js/'),
19 value,
20 ],
21 ),
22 ),
23 ...pluginReact.configs.recommended.rules,
24 'react-hooks-js/exhaustive-deps': 'error',
25 'react-hooks-js/unsupported-syntax': 'error',
26 'react-hooks-js/incompatible-library': 'error',
27 '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible
28 '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible
29 // Covered by 'eslint-plugin-react-hooks'
30 '@eslint-react/error-boundaries': 'off',
31 '@eslint-react/exhaustive-deps': 'off',
32 '@eslint-react/globals': 'off',
33 '@eslint-react/immutability': 'off',
34 '@eslint-react/purity': 'off',
35 '@eslint-react/refs': 'off',
36 '@eslint-react/rules-of-hooks': 'off',
37 '@eslint-react/set-state-in-effect': 'off',
38 '@eslint-react/set-state-in-render': 'off',
39 '@eslint-react/static-components': 'off',
40 '@eslint-react/unsupported-syntax': 'off',
41 '@eslint-react/use-memo': 'off',
42 },
43})