-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patheslint.config.js
More file actions
90 lines (89 loc) · 2.66 KB
/
eslint.config.js
File metadata and controls
90 lines (89 loc) · 2.66 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import globals from 'globals'
import eslint from '@eslint/js'
import tsPlugin from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import prettierPlugin from 'eslint-plugin-prettier'
export default [
{
ignores: ['build/**', 'coverage/**']
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { jsx: true }
},
globals: {
...globals.browser,
...globals.node
}
},
plugins: {
'@typescript-eslint': tsPlugin,
'react-hooks': reactHooksPlugin,
prettier: prettierPlugin
},
rules: {
...eslint.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'parameter',
format: ['camelCase'],
trailingUnderscore: 'allowSingleOrDouble'
},
{
selector: 'class',
format: ['PascalCase']
},
{
selector: 'enum',
format: ['PascalCase', 'UPPER_CASE']
},
{
selector: 'enumMember',
format: ['PascalCase', 'UPPER_CASE']
},
{
selector: 'interface',
format: ['PascalCase']
},
{
selector: 'typeAlias',
format: ['PascalCase']
},
{
selector: 'typeParameter',
format: ['PascalCase']
}
],
'@typescript-eslint/no-explicit-any': 'warn',
'react-hooks/rules-of-hooks': 'warn',
'react-hooks/exhaustive-deps': 'warn'
},
settings: {
react: {
version: 'detect'
}
}
},
{
files: ['**/__tests__/**/*.{ts,tsx}', '**/*.test.{ts,tsx}'],
languageOptions: {
globals: {
test: 'readonly',
expect: 'readonly',
describe: 'readonly',
it: 'readonly',
vi: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly'
}
}
}
]