-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.yml
674 lines (674 loc) · 16.6 KB
/
.eslintrc.yml
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
root: true
env:
es6: true
node: true
jest/globals: true
extends:
- 'eslint:recommended'
- google
- 'plugin:@typescript-eslint/eslint-recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
- 'plugin:import/errors'
- 'plugin:import/warnings'
- 'plugin:import/typescript'
- 'plugin:jsdoc/recommended'
- 'plugin:prettier/recommended'
- 'plugin:rxjs/recommended'
globals:
Atomics: readonly
SharedArrayBuffer: readonly
createInstance: readonly
parserOptions:
ecmaVersion: 2018
sourceType: module
project:
- './tsconfig.*?.json'
parser: '@typescript-eslint/parser'
plugins:
- '@typescript-eslint'
- typescript-sort-keys
- jest
- prettier
- progress
- jsdoc
- import
- rxjs
settings:
import/extensions:
- .js
- .mjs
- .cjs
- .ts
import/parsers:
'@typescript-eslint/parser':
- .ts
import/cache:
lifetime: Infinity
import/resolver:
typescript:
alwaysTryTypes: true
project:
- './tsconfig.app.json'
- './tsconfig.spec.json'
jsdoc:
mode: typescript
rules:
progress/activate: 1
no-new-native-nonconstructor: error
no-empty-static-block: error
no-constant-binary-expression: error
import/no-named-default: error
import/no-default-export: error
import/no-relative-packages: error
import/prefer-default-export: off
import/no-named-export: off
no-restricted-imports:
- error
- patterns:
- message: 'Use instead firebase-admin/'
group:
- 'firebase-admin/lib/*'
'@typescript-eslint/member-ordering':
- error
- default:
memberTypes:
- signature
- public-static-field
- protected-static-field
- private-static-field
- public-static-method
- protected-static-method
- private-static-method
- public-abstract-field
- protected-abstract-field
- abstract-field
- public-instance-field
- protected-instance-field
- private-instance-field
- public-constructor
- protected-constructor
- private-constructor
- public-instance-method
- protected-instance-method
- private-instance-method
- public-abstract-method
- protected-abstract-method
- abstract-method
typescript-sort-keys/interface:
- error
- asc
- caseSensitive: true
natural: true
typescript-sort-keys/string-enum:
- error
- asc
- caseSensitive: true
natural: true
quotes: off
no-else-return:
- error
- allowElseIf: true
sort-keys:
- error
- asc
- caseSensitive: true
natural: true
minKeys: 2
'@typescript-eslint/quotes':
- error
- backtick
'@typescript-eslint/no-var-requires': off
'@typescript-eslint/explicit-function-return-type': off
'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: ^_
import/no-namespace: off
import/first: error
import/exports-last: error
import/no-duplicates: error
import/no-commonjs: error
import/no-dynamic-require: error
import/order:
- error
- groups:
- index
- sibling
- parent
- internal
- external
- builtin
- object
newlines-between: never
alphabetize:
order: asc
caseInsensitive: false
indent: off
# Prefer import/no-duplicates
no-duplicate-imports: off
sort-imports: off
new-cap:
- error
- capIsNewExceptions:
- StoreConfig
'@typescript-eslint/naming-convention':
- error
- selector: default
format:
- camelCase
- selector: variable
format:
- camelCase
- UPPER_CASE
- selector: variable
types:
- boolean
format:
- PascalCase
- UPPER_CASE
prefix:
- is
- has
- should
- contains
- as
- to
- selector: parameter
format:
- camelCase
leadingUnderscore: allow
- selector: parameter
types:
- boolean
format:
- PascalCase
leadingUnderscore: allow
prefix:
- is
- has
- should
- contains
- as
- to
- selector: function
format:
- camelCase
- selector: memberLike
modifiers:
- private
format:
- camelCase
leadingUnderscore: require
- selector: memberLike
modifiers:
- protected
format:
- camelCase
leadingUnderscore: require
- selector: typeLike
format:
- PascalCase
- selector: typeParameter
format:
- PascalCase
prefix:
- T
- selector: interface
format:
- PascalCase
prefix:
- I
- selector: typeAlias
format:
- PascalCase
prefix:
- I
- selector: enumMember
format:
- UPPER_CASE
- selector: enum
format:
- PascalCase
suffix:
- Enum
- selector: objectLiteralProperty
format: null
'@typescript-eslint/no-explicit-any':
- error
- fixToUnknown: false
ignoreRestArgs: false
object-curly-spacing:
- error
- always
linebreak-style: off
computed-property-spacing:
- error
- never
array-bracket-spacing: off
prefer-rest-params: off
require-jsdoc: off
max-len: off
comma-dangle: off
object-shorthand:
- error
- always
- avoidExplicitReturnArrows: true
arrow-body-style:
- error
- as-needed
- requireReturnForObjectLiteral: true
no-dupe-else-if: error
no-unmodified-loop-condition: error
no-eval: error
no-extra-label: error
no-await-in-loop: error
prefer-destructuring:
- error
- VariableDeclarator:
array: true
object: true
AssignmentExpression:
array: true
object: true
- enforceForRenamedProperties: false
'@typescript-eslint/unbound-method': off
'@typescript-eslint/no-unsafe-call': off
'@typescript-eslint/no-unsafe-member-access': off
'@typescript-eslint/no-unsafe-return': off
'@typescript-eslint/no-unsafe-assignment': off
'@typescript-eslint/prefer-enum-initializers': error
'@typescript-eslint/prefer-literal-enum-member': off
'@typescript-eslint/unified-signatures': error
'@typescript-eslint/ban-ts-comment': error
no-undef-init: error
no-magic-numbers: off
'@typescript-eslint/no-magic-numbers': error
prettier/prettier:
- error
- printWidth: 120
useTabs: false
semi: true
singleQuote: true
quoteProps: consistent
trailingComma: es5
bracketSpacing: true
arrowParens: always
endOfLine: auto
tabWidth: 2
import/no-unresolved: error
prefer-template: error
no-useless-concat: error
no-native-reassign: error
no-global-assign: error
no-param-reassign: error
no-constant-condition:
- error
- checkLoops: true
prefer-promise-reject-errors:
- error
- allowEmptyReject: false
no-case-declarations: error
no-irregular-whitespace:
- error
- skipStrings: false
skipComments: false
skipRegExps: false
skipTemplates: false
'@typescript-eslint/adjacent-overload-signatures': error
'@typescript-eslint/no-misused-promises':
- error
- checksConditionals: true
checksVoidReturn: true
checksSpreads: true
no-invalid-this: off
'@typescript-eslint/no-invalid-this': error
prefer-const:
- error
- destructuring: any
ignoreReadBeforeAssign: false
camelcase: off
valid-jsdoc: off
jsdoc/require-jsdoc:
- warn # TODO change it to error but we should fix all current jsdoc errors
- publicOnly: true
exemptEmptyConstructors: true
exemptEmptyFunctions: false
checkConstructors: false
checkGetters: false
checkSetters: false
enableFixer: false # TODO change it to error but we should fix all current jsdoc errors
require:
ArrowFunctionExpression: true
ClassDeclaration: true
ClassExpression: true
FunctionDeclaration: true
FunctionExpression: true
MethodDefinition: true
curly:
- error
- all
jsdoc/check-access: error
jsdoc/check-alignment: error
# TODO enable back once ESLint 8 is properly fixed; see https://github.com/gajus/eslint-plugin-jsdoc#check-examples
jsdoc/check-examples: off
jsdoc/check-indentation:
- error
- excludeTags:
- param
jsdoc/check-param-names: error
jsdoc/check-property-names: error
jsdoc/check-syntax: error
jsdoc/require-param-description: error
jsdoc/require-param-name: error
jsdoc/require-param-type: error
jsdoc/require-param: error
jsdoc/require-property: error
jsdoc/require-property-description: error
jsdoc/require-property-name: error
jsdoc/require-property-type: error
jsdoc/require-returns-check: error
jsdoc/require-returns-description: error
jsdoc/require-returns-type: error
jsdoc/require-returns: error
jsdoc/sort-tags: error
jsdoc/check-tag-names: error
jsdoc/check-types: error
jsdoc/check-values: error
jsdoc/no-multi-asterisks: error
jsdoc/require-description-complete-sentence:
- error
- tags:
- see
newlineBeforeCapsAssumesBadSentenceEnd: true
jsdoc/require-description:
- error
- contexts:
- any
descriptionStyle: tag
checkConstructors: false
checkGetters: true
checkSetters: true
jsdoc/require-example: off
jsdoc/require-file-overview: off
jsdoc/multiline-blocks:
- error
- allowMultipleTags: true
noMultilineBlocks: false
jsdoc/require-hyphen-before-param-description:
- error
- never
jsdoc/require-asterisk-prefix:
- error
- always
jsdoc/empty-tags: error
jsdoc/no-bad-blocks: error
jsdoc/implements-on-classes: error
jsdoc/newline-after-description:
- error
- always
jsdoc/check-line-alignment:
- error
- always
'@typescript-eslint/prefer-regexp-exec': error
'@typescript-eslint/await-thenable': error
'@typescript-eslint/prefer-readonly': error
'@typescript-eslint/triple-slash-reference':
- error
- path: never
types: never
lib: never
'@typescript-eslint/prefer-readonly-parameter-types': off
'@typescript-eslint/no-empty-interface':
- error
- allowSingleExtends: false
'@typescript-eslint/restrict-template-expressions':
- error
- allowNumber: false
allowBoolean: false
allowAny: false
allowNullish: false
'@typescript-eslint/ban-types':
- error
- types:
Readonly:
message: 'Sonia rule - Useless due to no-param-reassign rule'
ReadonlyArray:
message: 'Sonia rule - Useless due to no-param-reassign rule'
extendDefaults: true
'@typescript-eslint/restrict-plus-operands':
- error
- checkCompoundAssignments: true
'@typescript-eslint/no-floating-promises':
- error
- ignoreVoid: true
no-undef:
- error
- typeof: true
no-useless-escape: error
no-prototype-builtins: error
require-await: off
'@typescript-eslint/require-await': error
no-empty-function: off
no-var: error
spaced-comment:
- error
- always
- markers:
- /
'@typescript-eslint/no-empty-function':
- error
- allow:
- decoratedFunctions
padding-line-between-statements:
- error
- blankLine: always
prev:
- '*'
next:
- class
- do
- for
- if
- return
- switch
- try
- blankLine: always
prev:
- block-like
- const
- let
- var
next: '*'
- blankLine: never
prev:
- const
- let
- var
next:
- const
- let
- var
rxjs/finnish:
- error
- functions: true
methods: true
parameters: true
properties: true
variables: true
strict: true
rxjs/no-async-subscribe: error
rxjs/no-compat: error
rxjs/no-create: error
rxjs/no-explicit-generics: off
rxjs/no-exposed-subjects:
- error
- allowProtected: true
rxjs/no-ignored-error: off
rxjs/no-ignored-notifier: error
rxjs/no-ignored-observable: error
rxjs/no-ignored-replay-buffer: error
rxjs/no-ignored-subscribe: off
rxjs/no-ignored-subscription: error
rxjs/no-ignored-takewhile-value: error
rxjs/no-implicit-any-catch: error
rxjs/no-index: error
rxjs/no-internal: error
rxjs/no-nested-subscribe: error
rxjs/no-topromise: off
rxjs/no-unbound-methods: error
rxjs/no-unsafe-subject-next: error
rxjs/no-unsafe-takeuntil: error
rxjs/prefer-observer: error
rxjs/throw-error: error
'@typescript-eslint/no-redundant-type-constituents': off
'@typescript-eslint/no-useless-empty-export': error
'space-before-blocks': off
'@typescript-eslint/space-before-blocks': error
'@typescript-eslint/no-duplicate-enum-values': error
'@typescript-eslint/consistent-generic-constructors': error
overrides:
- files:
- '*.js'
- '*.cjs'
rules:
'@typescript-eslint/explicit-module-boundary-types': off
import/no-commonjs: off
- files:
- '*.ts'
rules:
'@typescript-eslint/explicit-function-return-type':
- error
- allowExpressions: false
allowTypedFunctionExpressions: false
allowHigherOrderFunctions: false
'@typescript-eslint/no-var-requires': error
- files:
- '*.spec.ts'
extends:
- 'plugin:jest/style'
- 'plugin:jest/all'
rules:
jsdoc/require-description: off
jest/max-nested-describe: off
jest/prefer-expect-resolves: error
jest/prefer-to-have-length: error
jest/no-identical-title: error
jest/prefer-to-be: error
jest/valid-expect-in-promise: error
jest/prefer-comparison-matcher: error
jest/prefer-equality-matcher: error
jest/valid-title: error
jest/require-hook: error
jest/no-done-callback: error
jest/no-disabled-tests: warn
jest/prefer-lowercase-title:
- error
- ignore:
- describe
jest/no-hooks:
- error
- allow:
- beforeAll
- beforeEach
- afterAll
- afterEach
no-magic-numbers: off
'@typescript-eslint/no-magic-numbers': off
'@typescript-eslint/naming-convention':
- error
- selector: default
format:
- camelCase
- selector: variable
format:
- camelCase
- UPPER_CASE
- selector: variable
types:
- boolean
format:
- camelCase
- UPPER_CASE
- selector: parameter
format:
- camelCase
leadingUnderscore: allow
- selector: parameter
types:
- boolean
format:
- camelCase
leadingUnderscore: allow
- selector: function
format:
- camelCase
- selector: memberLike
modifiers:
- private
format:
- camelCase
leadingUnderscore: require
- selector: memberLike
modifiers:
- protected
format:
- camelCase
leadingUnderscore: require
- selector: typeLike
format:
- PascalCase
- selector: typeParameter
format:
- PascalCase
prefix:
- T
- selector: interface
format:
- PascalCase
prefix:
- I
- selector: typeAlias
format:
- PascalCase
prefix:
- I
- selector: enumMember
format:
- UPPER_CASE
- selector: enum
format:
- PascalCase
suffix:
- Enum
- selector: objectLiteralProperty
format: null
'@typescript-eslint/no-explicit-any': off
'@typescript-eslint/ban-ts-comment': off
'@typescript-eslint/unbound-method': off # Disabled as expected by jest because it has it's own version
jest/unbound-method: error
padding-line-between-statements:
- error
- blankLine: always
prev:
- '*'
next:
- class
- do
- for
- if
- return
- switch
- try
- blankLine: always
prev:
- block-like
next: '*'
rxjs/no-ignored-subscription: off
jest/no-conditional-in-test: error
jest/prefer-mock-promise-shorthand: error
jest/prefer-each: error
jest/prefer-hooks-in-order: error
jest/max-expects: off
jest/prefer-snapshot-hint:
- error
- always