-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
252 lines (252 loc) · 8.55 KB
/
.eslintrc.json
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
{
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "./tsconfig.json"
}
},
"react": {
"version": "detect"
}
},
"parserOptions": {
"ecmaVersion": "latest",
"project": "./tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"eslint-plugin-react",
"etc",
"react-hooks",
"sonarjs"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:etc/recommended",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:sonarjs/recommended"
],
"overrides": [{
"files": "*.ts?(x)",
"parser": "@typescript-eslint/parser"
}, {
"files": "*.test.ts?(x)",
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"etc/throw-error": "off"
}
}, {
"files": "*.typetest.ts?(x)",
"rules": {
"@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": false }],
"etc/throw-error": "off"
}
}, {
"files": "*.js?(x)",
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/restrict-template-expressions": "off"
}
}],
"rules": {
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/comma-dangle": ["error", "always-multiline"],
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/member-ordering": ["error", {
"classes": [
"static-field",
"field",
"constructor",
"static-method",
"abstract-method",
"protected-method",
"public-method",
"private-method"
],
"interfaces": { "order": "alphabetically" },
"typeLiterals": { "order": "alphabetically" }
}],
"@typescript-eslint/member-delimiter-style": ["error", {
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": true
}
}],
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": ["error", { "ignoreRestArgs": true }],
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-inferrable-types": ["error", {
"ignoreParameters": true,
"ignoreProperties": true
}],
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-redundant-type-constituents": "error",
"@typescript-eslint/no-shadow": ["error", { "hoist": "all" }],
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
"@typescript-eslint/no-unused-vars": ["error", {
"destructuredArrayIgnorePattern": "^_",
"ignoreRestSiblings": true
}],
"@typescript-eslint/no-use-before-define": ["error", {
"functions": false,
"classes": false
}],
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/parameter-properties": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": ["error", "double", {
"avoidEscape": true,
"allowTemplateLiterals": false
}],
"@typescript-eslint/restrict-template-expressions": ["error", {
"allowNumber": true,
"allowBoolean": true,
"allowNullish": true
}],
"@typescript-eslint/semi": "error",
"@typescript-eslint/space-infix-ops": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": ["error", { "ignoreStatic": true }],
"@typescript-eslint/unified-signatures": "error",
"array-bracket-spacing": "error",
"arrow-parens": ["error", "as-needed"],
"arrow-spacing": "error",
"brace-style": "error",
"camelcase": "error",
"comma-spacing": "error",
"computed-property-spacing": "error",
"constructor-super": "error",
"curly": "error",
"etc/no-commented-out-code": "error",
"etc/throw-error": "error",
"eol-last": "error",
"eqeqeq": "error",
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"import/newline-after-import": "error",
"import/no-absolute-path": "error",
"import/no-cycle": ["error", {
"allowUnsafeDynamicCyclicDependency": true,
"ignoreExternal": true
}],
"import/no-duplicates": "error",
"import/no-import-module-exports": "error",
"import/no-namespace": "error",
"import/no-relative-packages": "error",
"import/no-unresolved": "error",
"import/no-useless-path-segments": "error",
"import/order": ["error", {
"alphabetize": {
"caseInsensitive": false,
"order": "asc"
},
"newlines-between": "always",
"groups": ["external", "parent", "sibling"]
}],
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": ["error", { "excludeTags": ["example", "param", "returns"] }],
"jsdoc/tag-lines": ["error", "any", { "startLines": 1 }],
"jsx-quotes": "error",
"keyword-spacing": "error",
"linebreak-style": "error",
"max-classes-per-file": ["error", 1],
"max-len": ["error", {
"code": 120,
"comments": 80,
"ignoreRegExpLiterals": true,
"ignorePattern": "^import (\\{ )?\\w+( \\})? from \".+\";$",
"ignoreUrls": true,
"tabWidth": 2
}],
"new-parens": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-duplicate-imports": "error",
"no-empty-function": "error",
"no-eval": "error",
"no-extra-boolean-cast": ["error", { "enforceForLogicalOperands": true }],
"no-invalid-this": "error",
"no-labels": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0, "maxBOF": 0 }],
"no-multi-spaces": "error",
"no-new-wrappers": "error",
"no-param-reassign": "error",
"no-tabs": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-underscore-dangle": "error",
"no-use-before-define": "off",
"no-useless-computed-key": ["error", { "enforceForClassMembers": true }],
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"object-shorthand": "error",
"one-var": ["error", "never"],
"prefer-const": "error",
"quote-props": ["error", "as-needed"],
"radix": "error",
"rest-spread-spacing": "error",
"react/display-name": "off",
"react/hook-use-state": "error",
"react/jsx-boolean-value": ["error", "always"],
"react/jsx-closing-bracket-location": "error",
"react/jsx-curly-spacing": ["error", { "when": "never" }],
"react/jsx-equals-spacing": ["error", "never"],
"react/jsx-max-props-per-line": ["error", {
"maximum": 1,
"when": "multiline"
}],
"react/jsx-no-bind": "error",
"react/jsx-no-literals": "error",
"react/jsx-tag-spacing": "error",
"react/prop-types": "off",
"react/self-closing-comp": "error",
"react-hooks/rules-of-hooks": "error",
"semi-spacing": "error",
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-inverted-boolean-check": "error",
"sort-keys": "error",
"space-before-blocks": "error",
"space-in-parens": "error",
"spaced-comment": "error",
"switch-colon-spacing": "error"
}
}