Files
payloadcms/packages/eslint-config/configs/react/index.mjs

41 lines
869 B
JavaScript

import reactRules from './rules/react.mjs'
import reactA11yRules from './rules/react-a11y.mjs'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import react from "@eslint-react/eslint-plugin";
import reactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals';
import { deepMerge } from '../../deepMerge.js'
/** @type {import('eslint').Linter.FlatConfig} */
export const index = deepMerge(
react.configs["recommended-type-checked"],
{
rules: reactRules
},
{
rules: reactA11yRules
},
{
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
}
}
},
plugins: {
'jsx-a11y': jsxA11y,
'react-hooks': reactHooks,
},
settings: {
react: {
version: 'detect',
},
},
}
)
export default index