mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
This has been incredibly frustrating as [ESLint's own docs](https://eslint.org/docs/latest/extend/plugins#backwards-compatibility-for-legacy-configs) are clearly wrong (see #34679). This PR uses [eslint-plugin-react's setup](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/index.js) as a reference, where the presets are assigned to `configs.flat` (not documented by eslint).
21 lines
430 B
TypeScript
21 lines
430 B
TypeScript
import {defineConfig} from 'eslint/config';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
|
|
export default defineConfig([
|
|
reactHooks.configs.flat['recommended-latest'],
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
},
|
|
rules: {
|
|
'react-hooks/exhaustive-deps': 'error',
|
|
},
|
|
},
|
|
]);
|