1 | {
|
2 | "rulesDirectory": [
|
3 | "node_modules/tslint-misc-rules/rules",
|
4 | "node_modules/tslint-microsoft-contrib",
|
5 | "node_modules/tslint-eslint-rules/dist/rules"
|
6 | ],
|
7 | "extends": [
|
8 | "tslint:recommended",
|
9 | "tslint-microsoft-contrib",
|
10 | "tslint-eslint-rules",
|
11 | "tslint-config-prettier",
|
12 | "tslint-sonarts"
|
13 | ],
|
14 | "linterOptions": {
|
15 | "exclude": ["src/types/**/*"]
|
16 | },
|
17 | "rules": {
|
18 | // -----
|
19 | // tslint-misc-rules
|
20 | // -----
|
21 | "prefer-es6-imports": true,
|
22 | "class-method-newlines": true,
|
23 | "prefer-or-operator-over-ternary": true,
|
24 | // -----
|
25 | // tslint-eslint-rules
|
26 | // -----
|
27 | "array-bracket-spacing": [true, "never"],
|
28 | "block-spacing": [true, "always"],
|
29 | "brace-style": [
|
30 | true,
|
31 | "1tbs",
|
32 | {
|
33 | "allowSingleLine": false
|
34 | }
|
35 | ],
|
36 | // ter-max-len already handled by max-line-length rule
|
37 | "object-curly-spacing": [true, "always"],
|
38 | "space-in-parens": [true, "never"],
|
39 | "ter-arrow-body-style": [true, "always"],
|
40 | "ter-arrow-parens": [true, "as-needed"],
|
41 | "ter-arrow-spacing": [true],
|
42 | "ter-prefer-arrow-callback": [true],
|
43 | "no-constant-condition": true,
|
44 | "no-control-regex": true,
|
45 | "no-duplicate-switch-case": true,
|
46 | "no-empty-character-class": true,
|
47 | "no-ex-assign": true,
|
48 | "no-extra-boolean-cast": true,
|
49 | "no-extra-semi": true,
|
50 | "no-inner-declarations": [true, "both"],
|
51 | "no-invalid-regexp": true,
|
52 | // no-irregular-whitespace handled by no-irregular-whitespace rule
|
53 | "no-regex-spaces": true,
|
54 | "no-unexpected-multiline": true,
|
55 | "valid-jsdoc": {
|
56 | "severity": "warning",
|
57 | "options": {
|
58 | "requireReturn": false,
|
59 | "prefer": {
|
60 | "arg": "param",
|
61 | "argument": "param",
|
62 | "class": "constructor",
|
63 | "return": "returns",
|
64 | "virtual": "abstract"
|
65 | },
|
66 | "requireParamType": false,
|
67 | "requireReturnType": false,
|
68 | "requireParamDescription": true,
|
69 | "requireReturnDescription": true
|
70 | }
|
71 | },
|
72 | "no-multi-spaces": true,
|
73 | // -----
|
74 | // custom - various
|
75 | // -----
|
76 | "cyclomatic-complexity": false,
|
77 | "no-any": true,
|
78 | "no-unsafe-any": false,
|
79 | "completed-docs": false,
|
80 | "no-void-expression": false,
|
81 | "no-console": [false],
|
82 | "comment-format": [true, "check-space"],
|
83 | "max-line-length": [true, 120],
|
84 | "member-ordering": [
|
85 | true,
|
86 | {
|
87 | "order": [
|
88 | "public-static-field",
|
89 | "protected-static-field",
|
90 | "private-static-field",
|
91 | "public-instance-field",
|
92 | "protected-instance-field",
|
93 | "private-instance-field",
|
94 | "constructor",
|
95 | "public-static-method",
|
96 | "protected-static-method",
|
97 | "private-static-method",
|
98 | "public-instance-method",
|
99 | "protected-instance-method",
|
100 | "private-instance-method"
|
101 | ]
|
102 | }
|
103 | ],
|
104 | "only-arrow-functions": [true, "allow-declarations"],
|
105 | "typedef": [
|
106 | true,
|
107 | "call-signature",
|
108 | "parameter",
|
109 | "property-declaration",
|
110 | "variable-declaration",
|
111 | "member-variable-declaration"
|
112 | ],
|
113 | "typedef-whitespace": [
|
114 | true,
|
115 | {
|
116 | "call-signature": "nospace",
|
117 | "index-signature": "nospace",
|
118 | "parameter": "nospace",
|
119 | "property-declaration": "nospace",
|
120 | "variable-declaration": "nospace"
|
121 | },
|
122 | {
|
123 | "call-signature": "space",
|
124 | "index-signature": "space",
|
125 | "parameter": "space",
|
126 | "property-declaration": "space",
|
127 | "variable-declaration": "space"
|
128 | }
|
129 | ],
|
130 | "variable-name": [true, "ban-keywords", "check-format"],
|
131 | "one-line": [true, "check-open-brace", "check-catch", "check-else", "check-finally", "check-whitespace"],
|
132 | "interface-name": [true, "never-prefix"],
|
133 | "no-import-side-effect": [
|
134 | true,
|
135 | {
|
136 | "ignore-pattern": "/rxjs.*/"
|
137 | }
|
138 | ],
|
139 | "no-invalid-this": false,
|
140 | "no-parameter-properties": false,
|
141 | "promise-function-async": false,
|
142 | "no-submodule-imports": [true, "ava", "howler", "webrtc-adapter"],
|
143 | "no-parameter-reassignment": false,
|
144 | "switch-final-break": [true, "always"],
|
145 | // -----
|
146 | // custom - tslint-microsoft-contrib
|
147 | // -----
|
148 | "import-name": false, // TODO: Currently broken
|
149 | "no-string-based-set-timeout": false, // TODO: Currently broken
|
150 | "max-func-body-length": [
|
151 | true,
|
152 | 100,
|
153 | {
|
154 | "ignore-comments": true
|
155 | }
|
156 | ],
|
157 | "no-cookies": false,
|
158 | "no-relative-imports": false,
|
159 | "no-stateless-class": false,
|
160 | "export-name": false,
|
161 | "no-increment-decrement": false,
|
162 | "no-backbone-get-set-outside-model": false,
|
163 | "no-null-keyword": false,
|
164 | "function-name": [
|
165 | true,
|
166 | {
|
167 | "method-regex": "^[a-z][\\w\\d]+$",
|
168 | "private-method-regex": "^[a-z][\\w\\d]+$",
|
169 | "static-method-regex": "^[a-z][\\w\\d]+$",
|
170 | "function-regex": "^[a-z][\\w\\d]+$"
|
171 | }
|
172 | ],
|
173 | "no-suspicious-comment": {
|
174 | "severity": "warning"
|
175 | },
|
176 |
|
177 | // -----
|
178 | // custom - tslint-sonarts
|
179 | // -----
|
180 | "arguments-order": {
|
181 | "severity": "warning"
|
182 | },
|
183 | "bool-param-default": {
|
184 | "severity": "warning"
|
185 | },
|
186 | "cognitive-complexity": {
|
187 | "severity": "warning",
|
188 | "options": [20]
|
189 | },
|
190 | "consecutive-overloads": {
|
191 | "severity": "warning"
|
192 | },
|
193 | "max-switch-cases": {
|
194 | "severity": "warning"
|
195 | },
|
196 | "max-union-size": {
|
197 | "severity": "warning",
|
198 | "options": [5]
|
199 | },
|
200 | "mccabe-complexity": {
|
201 | "severity": "warning",
|
202 | "options": [15]
|
203 | },
|
204 | "no-accessor-field-mismatch": {
|
205 | "severity": "warning"
|
206 | },
|
207 | "no-all-duplicated-branches": {
|
208 | "severity": "warning"
|
209 | },
|
210 | "no-alphabetical-sort": {
|
211 | "severity": "warning"
|
212 | },
|
213 | "no-array-delete": {
|
214 | "severity": "warning"
|
215 | },
|
216 | "no-big-function": false, // Already covered by max-func-body-length
|
217 | "no-case-with-or": {
|
218 | "severity": "warning"
|
219 | },
|
220 | "no-collapsible-if": {
|
221 | "severity": "warning"
|
222 | },
|
223 | "no-collection-size-mischeck": {
|
224 | "severity": "warning"
|
225 | },
|
226 | "no-commented-code": {
|
227 | "severity": "warning"
|
228 | },
|
229 | "no-dead-store": {
|
230 | "severity": "warning"
|
231 | },
|
232 | "no-duplicate-in-composite": {
|
233 | "severity": "warning"
|
234 | },
|
235 | "no-duplicate-string": {
|
236 | "severity": "warning"
|
237 | },
|
238 | "no-duplicated-branches": {
|
239 | "severity": "warning"
|
240 | },
|
241 | "no-element-overwrite": {
|
242 | "severity": "warning"
|
243 | },
|
244 | "no-empty-array": {
|
245 | "severity": "warning"
|
246 | },
|
247 | "no-empty-destructuring": {
|
248 | "severity": "warning"
|
249 | },
|
250 | "no-empty-nested-blocks": {
|
251 | "severity": "warning"
|
252 | },
|
253 | "no-extra-semicolon": {
|
254 | "severity": "warning"
|
255 | },
|
256 | "no-gratuitous-expressions": {
|
257 | "severity": "warning"
|
258 | },
|
259 | "no-hardcoded-credentials": {
|
260 | "severity": "warning"
|
261 | },
|
262 | "no-identical-conditions": {
|
263 | "severity": "warning"
|
264 | },
|
265 | "no-identical-expressions": {
|
266 | "severity": "warning"
|
267 | },
|
268 | "no-identical-functions": {
|
269 | "severity": "warning"
|
270 | },
|
271 | "no-ignored-initial-value": {
|
272 | "severity": "warning"
|
273 | },
|
274 | "no-ignored-return": {
|
275 | "severity": "warning"
|
276 | },
|
277 | "no-in-misuse": {
|
278 | "severity": "warning"
|
279 | },
|
280 | "no-inconsistent-return": {
|
281 | "severity": "warning"
|
282 | },
|
283 | "no-invalid-await": {
|
284 | "severity": "warning"
|
285 | },
|
286 | "no-invariant-return": {
|
287 | "severity": "warning"
|
288 | },
|
289 | "no-inverted-boolean-check": {
|
290 | "severity": "warning"
|
291 | },
|
292 | "no-misleading-array-reverse": {
|
293 | "severity": "warning"
|
294 | },
|
295 | "no-misspelled-operator": {
|
296 | "severity": "warning"
|
297 | },
|
298 | "no-multiline-string-literals": {
|
299 | "severity": "warning"
|
300 | },
|
301 | "no-nested-incdec": false,
|
302 | "no-nested-switch": {
|
303 | "severity": "warning"
|
304 | },
|
305 | "no-nested-template-literals": {
|
306 | "severity": "warning"
|
307 | },
|
308 | "no-redundant-boolean": {
|
309 | "severity": "warning"
|
310 | },
|
311 | "no-redundant-jump": {
|
312 | "severity": "warning"
|
313 | },
|
314 | "no-redundant-parentheses": {
|
315 | "severity": "warning"
|
316 | },
|
317 | "no-return-type-any": false, // Already covered by no-any
|
318 | "no-same-line-conditional": {
|
319 | "severity": "warning"
|
320 | },
|
321 | "no-self-assignment": {
|
322 | "severity": "warning"
|
323 | },
|
324 | "no-small-switch": {
|
325 | "severity": "warning"
|
326 | },
|
327 | "no-statements-same-line": {
|
328 | "severity": "warning"
|
329 | },
|
330 | "no-try-promise": {
|
331 | "severity": "warning"
|
332 | },
|
333 | "no-unconditional-jump": {
|
334 | "severity": "warning"
|
335 | },
|
336 | "no-undefined-argument": {
|
337 | "severity": "warning"
|
338 | },
|
339 | "no-unenclosed-multiline-block": {
|
340 | "severity": "warning"
|
341 | },
|
342 | "no-unthrown-error": {
|
343 | "severity": "warning"
|
344 | },
|
345 | "no-unused-array": {
|
346 | "severity": "warning"
|
347 | },
|
348 | "no-use-of-empty-return-value": {
|
349 | "severity": "warning"
|
350 | },
|
351 | "no-useless-cast": {
|
352 | "severity": "warning"
|
353 | },
|
354 | "no-useless-catch": {
|
355 | "severity": "warning"
|
356 | },
|
357 | "no-useless-increment": {
|
358 | "severity": "warning"
|
359 | },
|
360 | "no-useless-intersection": {
|
361 | "severity": "warning"
|
362 | },
|
363 | "no-variable-usage-before-declaration": {
|
364 | "severity": "warning"
|
365 | },
|
366 | "parameters-max-number": {
|
367 | "severity": "warning"
|
368 | },
|
369 | "prefer-default-last": {
|
370 | "severity": "warning"
|
371 | },
|
372 | "prefer-immediate-return": {
|
373 | "severity": "warning"
|
374 | },
|
375 | "prefer-optional": {
|
376 | "severity": "warning"
|
377 | },
|
378 | "prefer-promise-shorthand": {
|
379 | "severity": "warning"
|
380 | },
|
381 | "prefer-type-guard": {
|
382 | "severity": "warning"
|
383 | },
|
384 | "use-primitive-type": {
|
385 | "severity": "warning"
|
386 | },
|
387 | "use-type-alias": {
|
388 | "severity": "warning"
|
389 | }
|
390 | }
|
391 | }
|