-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathreact.js
More file actions
45 lines (42 loc) · 1.06 KB
/
react.js
File metadata and controls
45 lines (42 loc) · 1.06 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import react from 'eslint-plugin-react';
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
import reactCompiler from 'eslint-plugin-react-compiler';
import reactHooks from 'eslint-plugin-react-hooks';
const reactConfig = [
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
pluginJsxA11y.flatConfigs.recommended,
reactCompiler.configs.recommended,
{
plugins: {
'react-hooks': reactHooks,
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect'
}
},
rules: {
'react/jsx-tag-spacing': ['error', { beforeClosing: 'never' }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
// Disabled rules from presets
'react/display-name': ['off', { 'ignoreTranspilerName': false }],
'react/prop-types': 'off',
},
},
{
files: ['*.test.*', '*.spec.*'],
rules: {
'react/no-children-prop': 'off',
},
},
];
export default reactConfig;