-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
56 lines (50 loc) · 1.23 KB
/
eslint.config.mjs
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
46
47
48
49
50
51
52
53
54
55
56
import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
import reactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
import js from '@eslint/js'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import pluginSecurity from 'eslint-plugin-security'
export default [
js.configs.recommended,
jsxA11y.flatConfigs.recommended,
pluginSecurity.configs.recommended,
reactRecommended,
{
rules: {
'prefer-const': 'error',
indent: ['error', 2, {
SwitchCase: 1,
}],
'linebreak-style': ['warn', 'unix'],
quotes: ['error', 'single'],
'no-extra-semi': ['error'],
semi: ['error', 'never'],
'react/prop-types': ['warn'],
'no-unused-vars': ['warn'],
'no-unreachable': ['warn'],
'eol-last': ['warn'],
'jsx-a11y/no-autofocus': ['off'],
'security/detect-object-injection': ['off'],
},
settings: {
react: {
version: '18.2.0',
},
},
plugins: {
'react-hooks': reactHooks,
},
languageOptions: {
globals: {
...globals.browser,
},
ecmaVersion: 13,
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
}
]