react/fixtures/eslint-v9/eslint.config.ts
lauren 848e0e3a4f
[eprh] Update plugin config to be compatible with flat and legacy (#34762)
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).
2025-10-07 16:23:56 -04:00

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',
},
},
]);