import globals from 'globals'; import a11y from 'eslint-plugin-jsx-a11y'; import react from 'eslint-plugin-react'; import reactHooks from 'eslint-plugin-react-hooks'; import { baseConfig } from './base.js'; /** @type {import("eslint").Linter.Config[]} */ export const reactConfig = [ ...baseConfig, { files: ['**/*.{ts,tsx}'], ...react.configs.flat.recommended, languageOptions: { ...react.configs.flat.recommended.languageOptions, globals: { ...globals.browser, ...globals.serviceworker }, }, settings: { react: { version: 'detect' } }, }, { files: ['**/*.{ts,tsx}'], plugins: { 'react-hooks': reactHooks, 'jsx-a11y': a11y }, rules: { ...reactHooks.configs.recommended.rules, ...a11y.flatConfigs.recommended.rules, 'react/react-in-jsx-scope': 'off', 'react/prop-types': 'off', 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }], 'react/self-closing-comp': 'error', }, }, ]; export default reactConfig;