-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreact.js
25 lines (24 loc) · 972 Bytes
/
react.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import reactPlugin from 'eslint-plugin-react'
import hooksPlugin from 'eslint-plugin-react-hooks'
import reactCompilerPlugin from 'eslint-plugin-react-compiler'
/** @type {Awaited<import('typescript-eslint').Config>} */
export default [
{
files: ['**/*.{ts,tsx}'],
plugins: {
react: reactPlugin,
'react-hooks': hooksPlugin,
'react-compiler': reactCompilerPlugin,
},
rules: {
...reactPlugin.configs['jsx-runtime'].rules,
...hooksPlugin.configs.recommended.rules,
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
'react/self-closing-comp': 'error',
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
'react/jsx-boolean-value': ['error', 'never'],
// https://github.com/facebook/react/tree/main/compiler/packages/eslint-plugin-react-compiler
'react-compiler/react-compiler': 'error',
},
},
]