-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
213 lines (213 loc) · 6.3 KB
/
index.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
module.exports = {
env: {
browser: true,
es2022: true,
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
},
plugins: [
'react',
'@typescript-eslint',
'prettier',
'import',
'jsx-expressions',
'react-hooks',
'jsx-a11y',
],
extends: [
'plugin:react/recommended',
'airbnb',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
],
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-unresolved': 'error',
'import/prefer-default-export': 'off',
'arrow-parens': ['error', 'always'],
'arrow-spacing': ['error', { before: true, after: true }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'sibling', 'parent', 'index'],
pathGroups: [
{
pattern: 'react',
group: 'builtin',
},
],
pathGroupsExcludedImportTypes: ['internal', 'react'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
warnOnUnassignedImports: true,
},
],
'import/no-useless-path-segments': 'error',
'import/dynamic-import-chunkname': ['error', { importFunctions: ['dynamicImport'] }],
'prettier/prettier': 'error',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'default-case': 'off',
'no-param-reassign': 'off',
'camelcase': 'off',
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-var-requires': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'error',
'default-param-last': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
'no-restricted-imports': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: ['@mui/*/*/*', '!@mui/material/test-utils/*'],
},
],
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/consistent-type-exports': 'warn',
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'typeLike',
format: ['PascalCase'],
},
],
'@typescript-eslint/consistent-indexed-object-style': 'warn',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': false,
'ts-ignore': true,
'ts-nocheck': true,
'ts-check': false,
'minimumDescriptionLength': 8,
},
],
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-regexp-exec': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
'@typescript-eslint/prefer-ts-expect-error': 'warn',
'@typescript-eslint/require-array-sort-compare': 'warn',
'@typescript-eslint/restrict-plus-operands': [
'error',
{ skipCompoundAssignments: true, allowAny: true },
],
"@typescript-eslint/sort-type-constituents": [
"warn",
{
"checkIntersections": true,
"checkUnions": true,
"groupOrder": [
"named",
"keyword",
"operator",
"literal",
"function",
"import",
"conditional",
"object",
"tuple",
"intersection",
"union",
"nullish"
]
}
],
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'@typescript-eslint/no-implied-eval': 'error',
'@typescript-eslint/no-throw-literal': 'error',
'no-return-await': 'off',
'@typescript-eslint/return-await': 'warn',
'curly': 'error',
'no-restricted-syntax': [
'error',
{
selector: 'SwitchCase > *.consequent[type!="BlockStatement"]',
message: 'Switch cases without brackets are disallowed.',
},
],
'radix': 'error',
'react/jsx-handler-names': 'warn',
'react/no-unknown-property': ['error', { ignore: ['css'] }],
'react/jsx-no-constructed-context-values': 'error',
'react/hook-use-state': 'error',
'react/jsx-key': ['warn', { checkFragmentShorthand: true }],
'react/jsx-sort-props': [
'warn',
{
callbacksLast: true,
ignoreCase: true,
noSortAlphabetically: false,
reservedFirst: true,
shorthandFirst: true,
},
],
'react/jsx-uses-react': 'off',
'react/jsx-wrap-multilines': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/state-in-constructor': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-curly-newline': 'off',
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
},
],
'react/no-multi-comp': ['error', { ignoreStateless: true }],
'react/jsx-pascal-case': 'error',
'jsx-expressions/strict-logical-expressions': 'error',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
alias: true
},
},
},
}