/
.eslintrc
207 lines (207 loc) · 7.31 KB
/
.eslintrc
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
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/array-type": ["error", {
"array": "array-simple"
}],
"@typescript-eslint/ban-ts-comment": ["error", {
"ts-expect-error": "allow-with-description",
"ts-ignore": "allow-with-description",
"minimumDescriptionLength": 10
}],
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/consistent-indexed-object-style": [
"error",
"record"
],
"@typescript-eslint/consistent-type-assertions": ["error", {
"assertionStyle": "as",
"objectLiteralTypeAssertions": "allow-as-parameter"
}],
"@typescript-eslint/consistent-type-imports": ["error", {
"prefer": "no-type-imports",
"disallowTypeAnnotations": true
}],
"default-param-last": "off",
"@typescript-eslint/default-param-last": "error",
"dot-notation": "off",
"@typescript-eslint/dot-notation": ["error", {
"allowKeywords": false,
"allowPattern": "^[a-zA-Z0-9]+(_[a-zA-Z0-9]+)+$",
"allowPrivateClassPropertyAccess": true,
"allowProtectedClassPropertyAccess": true
}],
"@typescript-eslint/explicit-member-accessibility": ["error", {
"accessibility": "no-public"
}],
"@typescript-eslint/explicit-module-boundary-types": "off",
"lines-between-class-members": "off",
"@typescript-eslint/lines-between-class-members": ["error", {
"exceptAfterSingleLine": true
}],
"@typescript-eslint/member-ordering": ["warn", {
"default": {
"memberTypes": [
"private-static-field",
"protected-static-field",
"public-static-field",
"private-abstract-field",
"protected-abstract-field",
"public-abstract-field",
"private-decorated-field",
"protected-decorated-field",
"public-decorated-field",
"private-instance-field",
"protected-instance-field",
"public-instance-field",
"signature",
"private-constructor",
"protected-constructor",
"public-constructor",
"private-static-method",
"protected-static-method",
"public-static-method",
"private-abstract-method",
"protected-abstract-method",
"public-abstract-method",
"private-decorated-method",
"protected-decorated-method",
"public-decorated-method",
"private-instance-method",
"protected-instance-method",
"public-instance-method"
],
"order": "as-written"
},
"interfaces": {
"memberTypes": ["constructor", "method", "field", "signature"],
"order": "as-written"
},
"typeLiterals": {
"memberTypes": ["constructor", "method", "field", "signature"],
"order": "as-written"
}
}],
"@typescript-eslint/method-signature-style": "warn",
"@typescript-eslint/naming-convention": ["error", {
"selector": "default",
"format": ["camelCase"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
}, {
"selector": "variable",
"types": ["function"],
"format": ["camelCase", "PascalCase"]
}, {
"selector": "variable",
"modifiers": ["const"],
"format": ["camelCase", "UPPER_CASE"]
}, {
"selector": "classProperty",
"modifiers": ["static", "readonly"],
"format": ["UPPER_CASE"]
}, {
"selector": ["typeLike", "enumMember"],
"format": ["PascalCase"],
"custom": {
"regex": "^[A-Z][A-Z][a-z0-9]",
"match": false
}
}],
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-confusing-void-expression": ["error", {
"ignoreArrowShorthand": true
}],
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": "error",
"no-duplicate-imports": "off",
"@typescript-eslint/no-duplicate-imports": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": ["error", {
"allowSingleExtends": true
}],
"@typescript-eslint/no-explicit-any": ["error", {
"fixToUnknown": true
}],
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-implied-eval": "error",
"no-invalid-this": "off",
"@typescript-eslint/no-invalid-this": "error",
"no-loop-func": "off",
"@typescript-eslint/no-loop-func": "error",
"no-loss-of-precision": "off",
"@typescript-eslint/no-loss-of-precision": "error",
"no-magic-numbers": "off",
"@typescript-eslint/no-namespace": ["error", {
"allowDeclarations": true
}],
"@typescript-eslint/no-non-null-assertion": "off",
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-require-imports": "warn",
"@typescript-eslint/no-shadow": ["warn", {
"hoist": "never",
"ignoreFunctionTypeParameterNameValueShadow": true
}],
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-condition": ["error", {
"allowConstantLoopConditions": true
}],
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "warn",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "warn",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/non-nullable-type-assertion-style": "error",
"@typescript-eslint/prefer-as-const": "warn",
"@typescript-eslint/prefer-literal-enum-member": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/require-array-sort-compare": "warn",
"no-return-await": "off",
"@typescript-eslint/return-await": "error",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/triple-slash-reference": ["error", {
"path": "never",
"types": "prefer-import",
"lib": "always"
}],
"@typescript-eslint/unbound-method": "warn",
"react/react-in-jsx-scope": "off"
}
}