@robinblomberg/eslint-config-robinblomberg 0.9.1 → 0.11.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,1373 +1,1379 @@
1
- const IS_DEVELOPMENT = !process.env.CI && process.env.NODE_ENV !== 'production';
2
- const error = 'error';
3
- const off = 'off';
4
- const warn = IS_DEVELOPMENT ? 'warn' : 'error';
5
-
6
- // eslint-disable-next-line import/no-commonjs
7
- module.exports = {
8
- env: {
9
- browser: true,
10
- es6: true,
11
- node: true,
12
- },
13
- globals: {
14
- globalThis: true,
15
- },
16
- ignorePatterns: ['**/.*/**', '**/node_modules/**'],
17
- parser: 'babel-eslint',
18
- parserOptions: {
19
- allowAwaitOutsideFunction: true,
20
- ecmaFeatures: {
21
- jsx: true,
22
- },
23
- ecmaVersion: 2017,
24
- requireConfigFile: false,
25
- sourceType: 'module',
26
- },
27
- plugins: ['import', 'jsdoc', 'sort-keys'],
28
- root: true,
29
- settings: {
30
- 'import/extensions': ['.js', '.ts'],
31
- 'import/internal-regex': '^@',
32
- jsdoc: {
33
- mode: 'closure',
34
- },
35
- react: {
36
- version: 'detect',
37
- },
38
- },
39
- // eslint-disable-next-line sort-keys
40
- overrides: [
41
- {
42
- files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
43
- globals: {
44
- NodeJS: true,
45
- },
46
- parser: '@typescript-eslint/parser',
47
- parserOptions: {
48
- project: './tsconfig.json',
49
- },
50
- plugins: ['@typescript-eslint'],
51
- rules: {
52
- '@typescript-eslint/adjacent-overload-signatures': warn,
53
- '@typescript-eslint/array-type': [
54
- warn,
55
- {
56
- default: 'array',
57
- },
58
- ],
59
- '@typescript-eslint/await-thenable': warn,
60
- '@typescript-eslint/ban-ts-comment': warn,
61
- '@typescript-eslint/ban-tslint-comment': warn,
62
- '@typescript-eslint/ban-types': [
63
- warn,
64
- {
65
- extendDefaults: true,
66
- types: {
67
- '{}': false,
68
- Function: false,
69
- },
70
- },
71
- ],
72
- '@typescript-eslint/brace-style': warn,
73
- '@typescript-eslint/camelcase': off,
74
- '@typescript-eslint/class-literal-property-style': [warn, 'fields'],
75
- '@typescript-eslint/comma-dangle': [warn, 'always-multiline'],
76
- '@typescript-eslint/comma-spacing': [
77
- warn,
78
- { after: true, before: false },
79
- ],
80
- '@typescript-eslint/consistent-type-assertions': [
81
- off,
82
- {
83
- assertionStyle: 'as',
84
- objectLiteralTypeAssertions: 'never',
85
- },
86
- ],
87
- '@typescript-eslint/consistent-type-definitions': [warn, 'type'],
88
- '@typescript-eslint/consistent-type-imports': [
89
- warn,
90
- {
91
- disallowTypeAnnotations: true,
92
- prefer: 'no-type-imports',
93
- },
94
- ],
95
- '@typescript-eslint/default-param-last': warn,
96
- '@typescript-eslint/dot-notation': warn,
97
- '@typescript-eslint/explicit-function-return-type': [
98
- off,
99
- {
100
- allowTypedFunctionExpressions: true,
101
- },
102
- ],
103
- '@typescript-eslint/explicit-member-accessibility': [
104
- warn,
105
- {
106
- accessibility: 'no-public',
107
- },
108
- ],
109
- '@typescript-eslint/explicit-module-boundary-types': off,
110
- '@typescript-eslint/func-call-spacing': warn,
111
- '@typescript-eslint/indent': [
112
- warn,
113
- 2,
114
- {
115
- SwitchCase: 1,
116
- // Ignored nodes due to false positives:
117
- ignoredNodes: [
118
- 'TSIntersectionType',
119
- 'TSTypeParameterInstantiation',
120
- 'TSUnionType',
121
- ],
122
- },
123
- ],
124
- // Definition not found (2020-10-26):
125
- // '@typescript-eslint/index': warn,
126
- '@typescript-eslint/init-declarations': off,
127
- '@typescript-eslint/keyword-spacing': warn,
128
- '@typescript-eslint/lines-between-class-members': [
129
- warn,
130
- 'always',
131
- {
132
- exceptAfterOverload: true,
133
- exceptAfterSingleLine: true,
134
- },
135
- ],
136
- '@typescript-eslint/member-delimiter-style': [
137
- warn,
138
- {
139
- multiline: {
140
- delimiter: 'semi',
141
- requireLast: true,
142
- },
143
- singleline: {
144
- delimiter: 'semi',
145
- requireLast: true,
146
- },
147
- },
148
- ],
149
- '@typescript-eslint/member-ordering': [
150
- warn,
151
- {
152
- default: [
153
- 'signature',
154
- 'private-static-field',
155
- 'protected-static-field',
156
- 'public-static-field',
157
- 'private-static-method',
158
- 'protected-static-method',
159
- 'public-static-method',
160
- 'private-decorated-field',
161
- 'protected-decorated-field',
162
- 'public-decorated-field',
163
- 'private-instance-field',
164
- 'protected-instance-field',
165
- 'public-instance-field',
166
- 'private-abstract-field',
167
- 'protected-abstract-field',
168
- 'public-abstract-field',
169
- 'static-field',
170
- 'private-field',
171
- 'protected-field',
172
- 'public-field',
173
- 'instance-field',
174
- 'abstract-field',
175
- 'decorated-field',
176
- 'field',
177
- 'private-constructor',
178
- 'protected-constructor',
179
- 'public-constructor',
180
- 'constructor',
181
- 'private-decorated-method',
182
- 'protected-decorated-method',
183
- 'public-decorated-method',
184
- 'private-instance-method',
185
- 'protected-instance-method',
186
- 'public-instance-method',
187
- 'private-abstract-method',
188
- 'protected-abstract-method',
189
- 'public-abstract-method',
190
- 'static-method',
191
- 'private-method',
192
- 'protected-method',
193
- 'public-method',
194
- 'instance-method',
195
- 'abstract-method',
196
- 'decorated-method',
197
- 'method',
198
- ],
199
- },
200
- ],
201
- '@typescript-eslint/method-signature-style': [warn, 'method'],
202
- '@typescript-eslint/naming-convention': [
203
- off,
204
- {
205
- format: ['camelCase'],
206
- leadingUnderscore: 'allow',
207
- selector: 'default',
208
- },
209
- {
210
- format: ['camelCase', 'snake_case', 'PascalCase', 'UPPER_CASE'],
211
- leadingUnderscore: 'allow',
212
- selector: ['objectLiteralProperty'],
213
- },
214
- {
215
- format: ['camelCase', 'PascalCase'],
216
- leadingUnderscore: 'allow',
217
- selector: ['function'],
218
- },
219
- {
220
- format: ['camelCase', 'UPPER_CASE'],
221
- leadingUnderscore: 'allow',
222
- selector: ['objectLiteralMethod', 'typeMethod', 'variable'],
223
- },
224
- {
225
- format: ['PascalCase'],
226
- leadingUnderscore: 'allow',
227
- selector: [
228
- 'class',
229
- 'enum',
230
- 'interface',
231
- 'typeAlias',
232
- 'typeParameter',
233
- ],
234
- },
235
- {
236
- format: ['UPPER_CASE'],
237
- leadingUnderscore: 'allow',
238
- selector: ['enumMember'],
239
- },
240
- {
241
- format: null,
242
- leadingUnderscore: 'allow',
243
- selector: ['parameter', 'property'],
244
- },
245
- ],
246
- '@typescript-eslint/no-array-constructor': warn,
247
- '@typescript-eslint/no-base-to-string': warn,
248
- '@typescript-eslint/no-confusing-non-null-assertion': warn,
249
- '@typescript-eslint/no-dupe-class-members': warn,
250
- '@typescript-eslint/no-dynamic-delete': off,
251
- '@typescript-eslint/no-empty-function': warn,
252
- '@typescript-eslint/no-empty-interface': warn,
253
- '@typescript-eslint/no-explicit-any': off,
254
- '@typescript-eslint/no-extra-non-null-assertion': warn,
255
- '@typescript-eslint/no-extra-parens': [
256
- warn,
257
- 'all',
258
- {
259
- ignoreJSX: 'all',
260
- nestedBinaryExpressions: false,
261
- },
262
- ],
263
- '@typescript-eslint/no-extra-semi': warn,
264
- '@typescript-eslint/no-extraneous-class': off,
265
- '@typescript-eslint/no-floating-promises': [
266
- warn,
267
- {
268
- ignoreIIFE: true,
269
- ignoreVoid: true,
270
- },
271
- ],
272
- '@typescript-eslint/no-for-in-array': warn,
273
- '@typescript-eslint/no-implicit-any-catch': off,
274
- '@typescript-eslint/no-implied-eval': warn,
275
- '@typescript-eslint/no-inferrable-types': warn,
276
- '@typescript-eslint/no-invalid-this': warn,
277
- '@typescript-eslint/no-invalid-void-type': off,
278
- '@typescript-eslint/no-loop-func': warn,
279
- '@typescript-eslint/no-loss-of-precision': warn,
280
- '@typescript-eslint/no-magic-numbers': [
281
- warn,
282
- {
283
- ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'],
284
- ignoreEnums: true,
285
- ignoreNumericLiteralTypes: true,
286
- ignoreReadonlyClassProperties: true,
287
- },
288
- ],
289
- '@typescript-eslint/no-misused-new': warn,
290
- '@typescript-eslint/no-misused-promises': off,
291
- '@typescript-eslint/no-namespace': [
292
- off,
293
- {
294
- allowDeclarations: true,
295
- },
296
- ],
297
- '@typescript-eslint/no-non-null-asserted-optional-chain': warn,
298
- '@typescript-eslint/no-non-null-assertion': off,
299
- '@typescript-eslint/no-parameter-properties': warn,
300
- '@typescript-eslint/no-redeclare': warn,
301
- '@typescript-eslint/no-require-imports': warn,
302
- '@typescript-eslint/no-shadow': warn,
303
- '@typescript-eslint/no-this-alias': warn,
304
- '@typescript-eslint/no-throw-literal': warn,
305
- '@typescript-eslint/no-type-alias': off,
306
- '@typescript-eslint/no-unnecessary-boolean-literal-compare': warn,
307
- '@typescript-eslint/no-unnecessary-condition': off,
308
- '@typescript-eslint/no-unnecessary-qualifier': warn,
309
- '@typescript-eslint/no-unnecessary-type-arguments': off,
310
- '@typescript-eslint/no-unnecessary-type-assertion': warn,
311
- '@typescript-eslint/no-unsafe-assignment': off,
312
- '@typescript-eslint/no-unsafe-call': off,
313
- '@typescript-eslint/no-unsafe-member-access': off,
314
- '@typescript-eslint/no-unsafe-return': off,
315
- '@typescript-eslint/no-unused-expressions': [
316
- warn,
317
- {
318
- allowShortCircuit: true,
319
- allowTaggedTemplates: true,
320
- allowTernary: true,
321
- },
322
- ],
323
- '@typescript-eslint/no-unused-vars': [
324
- warn,
325
- {
326
- args: 'after-used',
327
- argsIgnorePattern: '^_.*$',
328
- vars: 'all',
329
- varsIgnorePattern: '^_.*$|^T$',
330
- },
331
- ],
332
- '@typescript-eslint/no-use-before-define': [
333
- error,
334
- {
335
- classes: false,
336
- functions: false,
337
- variables: false,
338
- },
339
- ],
340
- '@typescript-eslint/no-useless-constructor': warn,
341
- '@typescript-eslint/no-var-requires': off,
342
- '@typescript-eslint/prefer-as-const': warn,
343
- '@typescript-eslint/prefer-enum-initializers': off,
344
- '@typescript-eslint/prefer-for-of': warn,
345
- '@typescript-eslint/prefer-function-type': warn,
346
- '@typescript-eslint/prefer-includes': warn,
347
- '@typescript-eslint/prefer-literal-enum-member': warn,
348
- '@typescript-eslint/prefer-namespace-keyword': warn,
349
- '@typescript-eslint/prefer-nullish-coalescing': warn,
350
- '@typescript-eslint/prefer-optional-chain': warn,
351
- '@typescript-eslint/prefer-readonly': warn,
352
- // Disabled due to error:
353
- // "Error: Non-null Assertion Failed: Expected to find a property "XXX" for the type."
354
- '@typescript-eslint/prefer-readonly-parameter-types': off,
355
- '@typescript-eslint/prefer-reduce-type-parameter': warn,
356
- '@typescript-eslint/prefer-regexp-exec': off,
357
- '@typescript-eslint/prefer-string-starts-ends-with': off,
358
- '@typescript-eslint/prefer-ts-expect-error': warn,
359
- '@typescript-eslint/promise-function-async': off,
360
- '@typescript-eslint/quotes': [warn, 'single'],
361
- '@typescript-eslint/require-array-sort-compare': [
362
- warn,
363
- {
364
- ignoreStringArrays: true,
365
- },
366
- ],
367
- '@typescript-eslint/require-await': warn,
368
- '@typescript-eslint/restrict-plus-operands': warn,
369
- // Disabled due to false positives:
370
- '@typescript-eslint/restrict-template-expressions': off,
371
- '@typescript-eslint/return-await': [warn, 'always'],
372
- '@typescript-eslint/semi': [warn, 'always'],
373
- '@typescript-eslint/space-before-function-paren': [warn, 'always'],
374
- '@typescript-eslint/strict-boolean-expressions': off,
375
- '@typescript-eslint/switch-exhaustiveness-check': off,
376
- '@typescript-eslint/triple-slash-reference': warn,
377
- '@typescript-eslint/type-annotation-spacing': warn,
378
- '@typescript-eslint/typedef': off,
379
- '@typescript-eslint/unbound-method': off,
380
- '@typescript-eslint/unified-signatures': warn,
381
- 'default-case': off,
382
- 'func-call-spacing': off,
383
- 'import/extensions': off,
384
- 'import/no-unassigned-import': off,
385
- // Disabled due to false positives:
386
- 'import/no-unresolved': [
387
- off,
388
- {
389
- ignore: ['\\.types$'],
390
- },
391
- ],
392
- indent: off,
393
- 'init-declarations': off,
394
- 'jsdoc/check-examples': off,
395
- 'jsdoc/require-description': off,
396
- 'jsdoc/require-description-complete-sentence': off,
397
- 'jsdoc/require-example': off,
398
- 'jsdoc/require-file-overview': off,
399
- 'jsdoc/require-hyphen-before-param-description': off,
400
- 'jsdoc/require-jsdoc': off,
401
- 'jsdoc/require-param': off,
402
- 'jsdoc/require-param-description': off,
403
- 'jsdoc/require-param-name': off,
404
- 'jsdoc/require-param-type': off,
405
- 'jsdoc/require-property': off,
406
- 'jsdoc/require-property-description': off,
407
- 'jsdoc/require-property-name': off,
408
- 'jsdoc/require-property-type': off,
409
- 'jsdoc/require-returns': off,
410
- 'jsdoc/require-returns-check': off,
411
- 'jsdoc/require-returns-description': off,
412
- 'jsdoc/require-returns-type': off,
413
- 'keyword-spacing': off,
414
- 'lines-between-class-members': off,
415
- 'no-dupe-class-members': off,
416
- 'no-empty-function': off,
417
- 'no-extra-parens': off,
418
- 'no-extra-semi': off,
419
- 'no-invalid-this': off,
420
- 'no-loop-func': off,
421
- 'no-loss-of-precision': off,
422
- 'no-redeclare': off,
423
- 'no-return-await': off,
424
- 'no-shadow': off,
425
- /**
426
- * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
427
- */
428
- 'no-undef': off,
429
- 'no-unused-expressions': off,
430
- 'no-unused-vars': off,
431
- 'no-use-before-define': off,
432
- 'no-useless-constructor': off,
433
- 'no-void': off,
434
- quotes: off,
435
- 'require-await': off,
436
- semi: off,
437
- 'space-before-function-paren': off,
438
- },
439
- },
440
- {
441
- env: {
442
- jest: true,
443
- mocha: true,
444
- },
445
- files: [
446
- '**/spec/**',
447
- '**/test/**',
448
- '**/tests/**',
449
- '**/*.spec.*',
450
- '**/*.test.*',
451
- ],
452
- rules: {
453
- '@typescript-eslint/no-magic-numbers': off,
454
- 'jsdoc/require-jsdoc': off,
455
- 'no-magic-numbers': off,
456
- 'sort-keys': off,
457
- },
458
- },
459
- {
460
- files: ['**/*.jsx', '**/*.tsx'],
461
- plugins: ['react', 'jsx-a11y'],
462
- rules: {
463
- 'jsx-a11y/accessible-emoji': warn,
464
- 'jsx-a11y/alt-text': warn,
465
- 'jsx-a11y/anchor-has-content': warn,
466
- 'jsx-a11y/anchor-is-valid': warn,
467
- 'jsx-a11y/aria-activedescendant-has-tabindex': warn,
468
- 'jsx-a11y/aria-props': warn,
469
- 'jsx-a11y/aria-proptypes': warn,
470
- 'jsx-a11y/aria-role': warn,
471
- 'jsx-a11y/aria-unsupported-elements': warn,
472
- 'jsx-a11y/autocomplete-valid': warn,
473
- 'jsx-a11y/click-events-have-key-events': warn,
474
- 'jsx-a11y/control-has-associated-label': [
475
- warn,
476
- {
477
- ignoreElements: [
478
- 'audio',
479
- 'canvas',
480
- 'embed',
481
- 'input',
482
- 'textarea',
483
- 'tr',
484
- 'video',
485
- ],
486
- ignoreRoles: [
487
- 'grid',
488
- 'listbox',
489
- 'menu',
490
- 'menubar',
491
- 'radiogroup',
492
- 'row',
493
- 'tablist',
494
- 'toolbar',
495
- 'tree',
496
- 'treegrid',
497
- ],
498
- includeRoles: ['alert', 'dialog'],
499
- },
500
- ],
501
- 'jsx-a11y/heading-has-content': warn,
502
- 'jsx-a11y/html-has-lang': warn,
503
- 'jsx-a11y/iframe-has-title': warn,
504
- 'jsx-a11y/img-redundant-alt': warn,
505
- 'jsx-a11y/interactive-supports-focus': [
506
- warn,
507
- {
508
- tabbable: [
509
- 'button',
510
- 'checkbox',
511
- 'link',
512
- 'progressbar',
513
- 'searchbox',
514
- 'slider',
515
- 'spinbutton',
516
- 'switch',
517
- 'textbox',
518
- ],
519
- },
520
- ],
521
- 'jsx-a11y/label-has-associated-control': warn,
522
- 'jsx-a11y/label-has-for': off,
523
- 'jsx-a11y/media-has-caption': warn,
524
- 'jsx-a11y/mouse-events-have-key-events': warn,
525
- 'jsx-a11y/no-access-key': warn,
526
- 'jsx-a11y/no-autofocus': warn,
527
- 'jsx-a11y/no-distracting-elements': warn,
528
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': warn,
529
- 'jsx-a11y/no-noninteractive-element-interactions': [
530
- warn,
531
- {
532
- body: ['onError', 'onLoad'],
533
- iframe: ['onError', 'onLoad'],
534
- img: ['onError', 'onLoad'],
535
- },
536
- ],
537
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': warn,
538
- 'jsx-a11y/no-noninteractive-tabindex': warn,
539
- 'jsx-a11y/no-redundant-roles': warn,
540
- 'jsx-a11y/no-static-element-interactions': warn,
541
- 'jsx-a11y/role-has-required-aria-props': warn,
542
- 'jsx-a11y/role-supports-aria-props': warn,
543
- 'jsx-a11y/scope': warn,
544
- 'jsx-a11y/tabindex-no-positive': warn,
545
- 'react/boolean-prop-naming': warn,
546
- 'react/button-has-type': warn,
547
- 'react/default-props-match-prop-types': warn,
548
- 'react/destructuring-assignment': off,
549
- 'react/display-name': warn,
550
- 'react/forbid-component-props': off,
551
- 'react/forbid-dom-props': warn,
552
- 'react/forbid-elements': warn,
553
- 'react/forbid-foreign-prop-types': warn,
554
- 'react/forbid-prop-types': warn,
555
- 'react/function-component-definition': [
556
- warn,
557
- {
558
- namedComponents: 'arrow-function',
559
- unnamedComponents: 'arrow-function',
560
- },
561
- ],
562
- 'react/jsx-boolean-value': warn,
563
- 'react/jsx-child-element-spacing': warn,
564
- 'react/jsx-closing-bracket-location': warn,
565
- 'react/jsx-closing-tag-location': warn,
566
- 'react/jsx-curly-brace-presence': [
567
- warn,
568
- {
569
- children: 'always',
570
- props: 'never',
571
- },
572
- ],
573
- 'react/jsx-curly-newline': off,
574
- 'react/jsx-curly-spacing': warn,
575
- 'react/jsx-equals-spacing': warn,
576
- 'react/jsx-filename-extension': [
577
- warn,
578
- {
579
- extensions: ['.jsx', '.tsx'],
580
- },
581
- ],
582
- 'react/jsx-first-prop-new-line': warn,
583
- 'react/jsx-fragments': warn,
584
- 'react/jsx-handler-names': warn,
585
- 'react/jsx-indent': [
586
- warn,
587
- 2,
588
- {
589
- indentLogicalExpressions: true,
590
- },
591
- ],
592
- 'react/jsx-indent-props': [warn, 2],
593
- 'react/jsx-key': warn,
594
- 'react/jsx-max-depth': off,
595
- 'react/jsx-max-props-per-line': [
596
- warn,
597
- {
598
- maximum: 1,
599
- when: 'multiline',
600
- },
601
- ],
602
- 'react/jsx-newline': off,
603
- 'react/jsx-no-bind': [
604
- warn,
605
- {
606
- allowArrowFunctions: true,
607
- allowBind: true,
608
- allowFunctions: false,
609
- ignoreDOMComponents: false,
610
- ignoreRefs: false,
611
- },
612
- ],
613
- 'react/jsx-no-comment-textnodes': warn,
614
- 'react/jsx-no-constructed-context-values': warn,
615
- 'react/jsx-no-duplicate-props': warn,
616
- 'react/jsx-no-literals': warn,
617
- 'react/jsx-no-script-url': warn,
618
- 'react/jsx-no-target-blank': warn,
619
- 'react/jsx-no-undef': warn,
620
- 'react/jsx-no-useless-fragment': off,
621
- 'react/jsx-one-expression-per-line': warn,
622
- 'react/jsx-pascal-case': warn,
623
- 'react/jsx-props-no-multi-spaces': warn,
624
- 'react/jsx-props-no-spreading': off,
625
- 'react/jsx-sort-default-props': warn,
626
- 'react/jsx-sort-props': warn,
627
- /** @deprecated */
628
- 'react/jsx-space-before-closing': off,
629
- 'react/jsx-tag-spacing': [
630
- warn,
631
- {
632
- afterOpening: 'never',
633
- beforeClosing: 'allow',
634
- beforeSelfClosing: 'always',
635
- closingSlash: 'never',
636
- },
637
- ],
638
- 'react/jsx-uses-react': warn,
639
- 'react/jsx-uses-vars': warn,
640
- 'react/jsx-wrap-multilines': [
641
- warn,
642
- {
643
- arrow: 'ignore',
644
- assignment: 'ignore',
645
- condition: 'ignore',
646
- declaration: 'ignore',
647
- logical: 'ignore',
648
- prop: 'ignore',
649
- return: 'parens',
650
- },
651
- ],
652
- 'react/no-access-state-in-setstate': warn,
653
- 'react/no-adjacent-inline-elements': off,
654
- 'react/no-array-index-key': warn,
655
- 'react/no-children-prop': warn,
656
- 'react/no-danger': warn,
657
- 'react/no-danger-with-children': warn,
658
- 'react/no-deprecated': warn,
659
- 'react/no-did-mount-set-state': warn,
660
- 'react/no-did-update-set-state': warn,
661
- 'react/no-direct-mutation-state': warn,
662
- 'react/no-find-dom-node': warn,
663
- 'react/no-is-mounted': warn,
664
- 'react/no-multi-comp': warn,
665
- 'react/no-redundant-should-component-update': warn,
666
- 'react/no-render-return-value': warn,
667
- 'react/no-set-state': off,
668
- 'react/no-string-refs': warn,
669
- 'react/no-this-in-sfc': warn,
670
- 'react/no-typos': warn,
671
- 'react/no-unescaped-entities': warn,
672
- 'react/no-unknown-property': warn,
673
- 'react/no-unsafe': warn,
674
- 'react/no-unused-prop-types': warn,
675
- 'react/no-unused-state': warn,
676
- 'react/no-will-update-set-state': warn,
677
- 'react/prefer-es6-class': warn,
678
- 'react/prefer-read-only-props': warn,
679
- 'react/prefer-stateless-function': warn,
680
- 'react/prop-types': off,
681
- 'react/react-in-jsx-scope': off,
682
- 'react/require-default-props': off,
683
- 'react/require-optimization': off,
684
- 'react/require-render-return': warn,
685
- 'react/self-closing-comp': warn,
686
- 'react/sort-comp': [
687
- warn,
688
- {
689
- groups: {
690
- lifecycle: [
691
- 'displayName',
692
- 'propTypes',
693
- 'contextTypes',
694
- 'childContextTypes',
695
- 'mixins',
696
- 'statics',
697
- 'defaultProps',
698
- 'constructor',
699
- 'getDefaultProps',
700
- 'state',
701
- 'getInitialState',
702
- 'getChildContext',
703
- 'getDerivedStateFromProps',
704
- 'componentWillMount',
705
- 'UNSAFE_componentWillMount',
706
- 'componentDidMount',
707
- 'componentWillReceiveProps',
708
- 'UNSAFE_componentWillReceiveProps',
709
- 'shouldComponentUpdate',
710
- 'componentWillUpdate',
711
- 'UNSAFE_componentWillUpdate',
712
- 'getSnapshotBeforeUpdate',
713
- 'componentDidUpdate',
714
- 'componentDidCatch',
715
- 'componentWillUnmount',
716
- ],
717
- },
718
- order: [
719
- 'static-variables',
720
- 'static-methods',
721
- 'everything-else',
722
- 'instance-variables',
723
- 'instance-methods',
724
- 'lifecycle',
725
- 'render',
726
- ],
727
- },
728
- ],
729
- 'react/sort-prop-types': warn,
730
- 'react/state-in-constructor': off,
731
- 'react/static-property-placement': warn,
732
- 'react/style-prop-object': warn,
733
- 'react/void-dom-elements-no-children': warn,
734
- },
735
- },
736
- {
737
- files: ['**/*.d.ts'],
738
- rules: {
739
- '@typescript-eslint/consistent-type-definitions': off,
740
- '@typescript-eslint/no-extraneous-class': off,
741
- '@typescript-eslint/no-use-before-define': off,
742
- 'import/no-default-export': off,
743
- 'jsdoc/require-jsdoc': off,
744
- },
745
- },
746
- {
747
- files: ['**/*.config.js', '**/*.config.ts'],
748
- rules: {
749
- '@typescript-eslint/no-magic-numbers': off,
750
- 'no-magic-numbers': off,
751
- },
752
- },
753
- {
754
- files: [
755
- '**/*.stories.js',
756
- '**/*.stories.jsx',
757
- '**/*.stories.ts',
758
- '**/*.stories.tsx',
759
- ],
760
- rules: {
761
- 'import/no-default-export': off,
762
- 'react/no-multi-comp': off,
763
- },
764
- },
765
- ],
766
- rules: {
767
- 'accessor-pairs': warn,
768
- 'array-bracket-newline': off,
769
- 'array-bracket-spacing': [warn, 'never'],
770
- 'array-callback-return': warn,
771
- 'array-element-newline': [warn, 'consistent'],
772
- 'arrow-body-style': off,
773
- 'arrow-parens': [warn, 'always'],
774
- 'arrow-spacing': [warn, { after: true, before: true }],
775
- 'block-scoped-var': warn,
776
- 'block-spacing': [warn, 'always'],
777
- 'brace-style': [warn, '1tbs'],
778
- 'callback-return': [off, ['callback', 'cb', 'next']],
779
- camelcase: [off, { properties: 'never' }],
780
- 'capitalized-comments': off,
781
- 'class-methods-use-this': off,
782
- 'comma-dangle': [warn, 'always-multiline'],
783
- 'comma-spacing': [warn, { after: true, before: false }],
784
- 'comma-style': [warn, 'last'],
785
- complexity: off,
786
- 'computed-property-spacing': [warn, 'never'],
787
- 'consistent-return': warn,
788
- 'consistent-this': warn,
789
- 'constructor-super': warn,
790
- curly: [warn, 'all'],
791
- 'default-case': warn,
792
- 'default-param-last': warn,
793
- 'dot-location': [warn, 'property'],
794
- 'dot-notation': [warn, { allowKeywords: true }],
795
- 'eol-last': warn,
796
- eqeqeq: [warn, 'always', { null: 'ignore' }],
797
- 'for-direction': warn,
798
- 'func-call-spacing': [warn, 'never'],
799
- 'func-name-matching': warn,
800
- 'func-names': [off, 'as-needed'],
801
- 'func-style': [off, 'expression'],
802
- 'function-call-argument-newline': off,
803
- 'function-paren-newline': off,
804
- 'generator-star-spacing': [warn, { after: true, before: true }],
805
- 'getter-return': warn,
806
- 'global-require': off,
807
- 'guard-for-in': warn,
808
- 'handle-callback-err': [warn, '^(err|error)$'],
809
- 'id-blacklist': warn,
810
- 'id-length': off,
811
- 'id-match': [warn, '^[$_]$|^[$_]?[_A-Za-z][A-Za-z0-9_]*$'],
812
- 'implicit-arrow-linebreak': [off, 'beside'],
813
- 'import/default': warn,
814
- 'import/dynamic-import-chunkname': off,
815
- 'import/export': warn,
816
- 'import/exports-last': warn,
817
- 'import/extensions': [
818
- warn,
819
- {
820
- js: 'always',
821
- json: 'always',
822
- },
823
- ],
824
- 'import/first': warn,
825
- 'import/group-exports': off,
826
- 'import/imports-first': warn,
827
- 'import/max-dependencies': off,
828
- // Disabled due to false positives:
829
- 'import/named': off,
830
- // Disabled due to false positives:
831
- 'import/namespace': off,
832
- 'import/newline-after-import': warn,
833
- 'import/no-absolute-path': warn,
834
- 'import/no-amd': warn,
835
- 'import/no-anonymous-default-export': warn,
836
- 'import/no-commonjs': off,
837
- 'import/no-cycle': off,
838
- 'import/no-default-export': off,
839
- 'import/no-deprecated': warn,
840
- 'import/no-duplicates': warn,
841
- 'import/no-dynamic-require': warn,
842
- 'import/no-extraneous-dependencies': warn,
843
- 'import/no-internal-modules': [
844
- warn,
845
- {
846
- allow: ['[@a-z][@a-z]*/**', '**/*.svg'],
847
- },
848
- ],
849
- 'import/no-mutable-exports': warn,
850
- 'import/no-named-as-default': warn,
851
- 'import/no-named-as-default-member': warn,
852
- 'import/no-named-default': warn,
853
- 'import/no-named-export': off,
854
- 'import/no-namespace': off,
855
- 'import/no-nodejs-modules': off,
856
- // Disabled due to false positives (e.g. "@robinblomberg/schema"):
857
- 'import/no-relative-parent-imports': off,
858
- 'import/no-restricted-paths': warn,
859
- 'import/no-self-import': warn,
860
- 'import/no-unassigned-import': warn,
861
- 'import/no-unresolved': warn,
862
- 'import/no-unused-modules': warn,
863
- 'import/no-useless-path-segments': warn,
864
- 'import/no-webpack-loader-syntax': warn,
865
- /* 'import/order': [warn, {
866
- alphabetize: {
867
- caseInsensitive: false,
868
- order: 'asc'
869
- },
870
- groups: [
871
- 'builtin',
872
- 'external',
873
- 'internal',
874
- 'unknown',
875
- 'parent',
876
- 'sibling',
877
- 'index',
878
- 'object'
879
- ],
880
- 'newlines-between': 'never'
881
- }], */
882
- 'import/prefer-default-export': off,
883
- 'import/unambiguous': off,
884
- indent: [
885
- warn,
886
- 2,
887
- {
888
- SwitchCase: 1,
889
- },
890
- ],
891
- 'init-declarations': off,
892
- 'jsdoc/check-access': warn,
893
- 'jsdoc/check-alignment': warn,
894
- 'jsdoc/check-examples': warn,
895
- 'jsdoc/check-indentation': [
896
- off,
897
- {
898
- excludeTags: ['example'],
899
- },
900
- ],
901
- 'jsdoc/check-line-alignment': warn,
902
- 'jsdoc/check-param-names': warn,
903
- 'jsdoc/check-property-names': warn,
904
- 'jsdoc/check-syntax': warn,
905
- 'jsdoc/check-tag-names': warn,
906
- 'jsdoc/check-types': [
907
- warn,
908
- {
909
- noDefaults: true,
910
- },
911
- ],
912
- 'jsdoc/check-values': warn,
913
- 'jsdoc/empty-tags': warn,
914
- 'jsdoc/implements-on-classes': warn,
915
- 'jsdoc/match-description': warn,
916
- 'jsdoc/newline-after-description': warn,
917
- 'jsdoc/no-bad-blocks': warn,
918
- 'jsdoc/no-defaults': warn,
919
- 'jsdoc/no-types': off,
920
- // Disable due to false positives when referring to a generic type from inside its function:
921
- 'jsdoc/no-undefined-types': [
922
- off,
923
- {
924
- definedTypes: [
925
- 'unknown',
926
- /**
927
- * @see typescript\lib\lib.es5.d.ts
928
- * @version 4.1.2
929
- */
930
- 'PropertyKey',
931
- 'PropertyDescriptor',
932
- 'PropertyDescriptorMap',
933
- 'ObjectConstructor',
934
- 'FunctionConstructor',
935
- 'ThisParameterType',
936
- 'OmitThisParameter',
937
- 'CallableFunction',
938
- 'NewableFunction',
939
- 'IArguments',
940
- 'StringConstructor',
941
- 'BooleanConstructor',
942
- 'NumberConstructor',
943
- 'TemplateStringsArray',
944
- 'ImportMeta',
945
- 'DateConstructor',
946
- 'RegExpMatchArray',
947
- 'RegExpExecArray',
948
- 'RegExpConstructor',
949
- 'ErrorConstructor',
950
- 'EvalErrorConstructor',
951
- 'RangeErrorConstructor',
952
- 'ReferenceErrorConstructor',
953
- 'SyntaxErrorConstructor',
954
- 'TypeErrorConstructor',
955
- 'URIErrorConstructor',
956
- 'ReadonlyArray',
957
- 'ConcatArray',
958
- 'ArrayConstructor',
959
- 'TypedPropertyDescriptor',
960
- 'ClassDecorator',
961
- 'PropertyDecorator',
962
- 'MethodDecorator',
963
- 'ParameterDecorator',
964
- 'PromiseConstructorLike',
965
- 'PromiseLike',
966
- 'ArrayLike',
967
- 'Partial',
968
- 'Required',
969
- 'Readonly',
970
- 'Pick',
971
- 'Exclude',
972
- 'Extract',
973
- 'Omit',
974
- 'NonNullable',
975
- 'Parameters',
976
- 'ConstructorParameters',
977
- 'ReturnType',
978
- 'InstanceType',
979
- 'ThisType',
980
- 'ArrayBufferTypes',
981
- 'ArrayBufferLike',
982
- 'ArrayBufferConstructor',
983
- 'ArrayBufferView',
984
- 'DataViewConstructor',
985
- 'Int8ArrayConstructor',
986
- 'Uint8ArrayConstructor',
987
- 'Uint8ClampedArrayConstructor',
988
- 'Int16ArrayConstructor',
989
- 'Uint16ArrayConstructor',
990
- 'Int32ArrayConstructor',
991
- 'Uint32ArrayConstructor',
992
- 'Float32ArrayConstructor',
993
- 'Float64ArrayConstructor',
994
- ],
995
- },
996
- ],
997
- 'jsdoc/require-description': [
998
- off,
999
- {
1000
- contexts: ['any'],
1001
- descriptionStyle: 'body',
1002
- },
1003
- ],
1004
- 'jsdoc/require-description-complete-sentence': off,
1005
- 'jsdoc/require-example': off,
1006
- 'jsdoc/require-file-overview': off,
1007
- 'jsdoc/require-hyphen-before-param-description': [warn, 'never'],
1008
- 'jsdoc/require-jsdoc': [
1009
- warn,
1010
- {
1011
- exemptEmptyFunctions: true,
1012
- publicOnly: false,
1013
- require: {
1014
- ArrowFunctionExpression: true,
1015
- ClassDeclaration: false,
1016
- ClassExpression: false,
1017
- FunctionDeclaration: true,
1018
- FunctionExpression: true,
1019
- MethodDefinition: true,
1020
- },
1021
- },
1022
- ],
1023
- 'jsdoc/require-param': [
1024
- warn,
1025
- {
1026
- checkConstructors: true,
1027
- checkDestructured: true,
1028
- checkDestructuredRoots: true,
1029
- checkGetters: true,
1030
- checkSetters: true,
1031
- },
1032
- ],
1033
- 'jsdoc/require-param-description': off,
1034
- 'jsdoc/require-param-name': warn,
1035
- 'jsdoc/require-param-type': [
1036
- warn,
1037
- {
1038
- contexts: ['any'],
1039
- },
1040
- ],
1041
- 'jsdoc/require-property': warn,
1042
- 'jsdoc/require-property-description': warn,
1043
- 'jsdoc/require-property-name': warn,
1044
- 'jsdoc/require-property-type': warn,
1045
- 'jsdoc/require-returns': off,
1046
- 'jsdoc/require-returns-check': warn,
1047
- 'jsdoc/require-returns-description': off,
1048
- 'jsdoc/require-returns-type': warn,
1049
- 'jsdoc/valid-types': off,
1050
- 'jsx-quotes': warn,
1051
- 'key-spacing': [warn, { afterColon: true, beforeColon: false }],
1052
- 'keyword-spacing': [off, { after: true, before: true }],
1053
- 'line-comment-position': off,
1054
- 'linebreak-style': [warn, 'unix'],
1055
- 'lines-around-comment': off,
1056
- 'lines-between-class-members': [
1057
- warn,
1058
- 'always',
1059
- { exceptAfterSingleLine: true },
1060
- ],
1061
- 'max-classes-per-file': [warn, 1],
1062
- 'max-depth': off,
1063
- 'max-len': [
1064
- warn,
1065
- {
1066
- code: 100,
1067
- ignoreComments: true,
1068
- ignoreRegExpLiterals: true,
1069
- },
1070
- ],
1071
- 'max-lines': off,
1072
- 'max-lines-per-function': off,
1073
- 'max-nested-callbacks': warn,
1074
- 'max-params': off,
1075
- 'max-statements': off,
1076
- 'max-statements-per-line': [warn, { max: 1 }],
1077
- 'multiline-comment-style': off,
1078
- 'multiline-ternary': off,
1079
- 'new-cap': [warn, { capIsNew: false, newIsCap: true, properties: true }],
1080
- 'new-parens': warn,
1081
- 'newline-per-chained-call': off,
1082
- 'no-alert': off,
1083
- 'no-array-constructor': warn,
1084
- 'no-async-promise-executor': warn,
1085
- 'no-await-in-loop': warn,
1086
- 'no-bitwise': warn,
1087
- 'no-buffer-constructor': warn,
1088
- 'no-caller': warn,
1089
- 'no-case-declarations': warn,
1090
- 'no-class-assign': warn,
1091
- 'no-compare-neg-zero': warn,
1092
- 'no-cond-assign': warn,
1093
- 'no-confusing-arrow': warn,
1094
- 'no-console': [warn, { allow: ['debug', 'error', 'info', 'warn'] }],
1095
- 'no-const-assign': warn,
1096
- 'no-constant-condition': [warn, { checkLoops: false }],
1097
- 'no-continue': warn,
1098
- 'no-control-regex': off,
1099
- 'no-debugger': warn,
1100
- 'no-delete-var': warn,
1101
- 'no-div-regex': warn,
1102
- 'no-dupe-args': warn,
1103
- 'no-dupe-class-members': warn,
1104
- 'no-dupe-keys': warn,
1105
- 'no-duplicate-case': warn,
1106
- 'no-duplicate-imports': warn,
1107
- 'no-else-return': warn,
1108
- 'no-empty': [warn, { allowEmptyCatch: true }],
1109
- 'no-empty-character-class': warn,
1110
- 'no-empty-function': off,
1111
- 'no-empty-pattern': off,
1112
- 'no-eq-null': off,
1113
- 'no-eval': warn,
1114
- 'no-ex-assign': warn,
1115
- 'no-extend-native': warn,
1116
- 'no-extra-bind': warn,
1117
- 'no-extra-boolean-cast': warn,
1118
- 'no-extra-label': warn,
1119
- 'no-extra-parens': [off, 'all', { nestedBinaryExpressions: false }],
1120
- 'no-extra-semi': warn,
1121
- 'no-fallthrough': warn,
1122
- 'no-floating-decimal': warn,
1123
- 'no-func-assign': warn,
1124
- 'no-global-assign': warn,
1125
- 'no-implicit-coercion': warn,
1126
- 'no-implicit-globals': warn,
1127
- 'no-implied-eval': warn,
1128
- 'no-inline-comments': off,
1129
- 'no-inner-declarations': [warn, 'functions'],
1130
- 'no-invalid-regexp': warn,
1131
- 'no-invalid-this': off,
1132
- 'no-irregular-whitespace': warn,
1133
- 'no-iterator': warn,
1134
- 'no-label-var': warn,
1135
- 'no-labels': [warn, { allowLoop: false, allowSwitch: false }],
1136
- 'no-lone-blocks': off,
1137
- 'no-lonely-if': warn,
1138
- 'no-loop-func': warn,
1139
- 'no-loss-of-precision': warn,
1140
- 'no-magic-numbers': [
1141
- off,
1142
- {
1143
- ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'],
1144
- },
1145
- ],
1146
- 'no-misleading-character-class': warn,
1147
- 'no-mixed-operators': [
1148
- warn,
1149
- {
1150
- allowSamePrecedence: true,
1151
- groups: [
1152
- ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
1153
- ['&&', '||'],
1154
- ['in', 'instanceof'],
1155
- ],
1156
- },
1157
- ],
1158
- 'no-mixed-requires': warn,
1159
- 'no-mixed-spaces-and-tabs': warn,
1160
- 'no-multi-assign': warn,
1161
- 'no-multi-spaces': warn,
1162
- 'no-multi-str': warn,
1163
- 'no-multiple-empty-lines': [warn, { max: 1, maxEOF: 0 }],
1164
- 'no-negated-condition': warn,
1165
- 'no-negated-in-lhs': warn,
1166
- 'no-nested-ternary': warn,
1167
- 'no-new': warn,
1168
- 'no-new-func': warn,
1169
- 'no-new-object': warn,
1170
- 'no-new-require': warn,
1171
- 'no-new-symbol': warn,
1172
- 'no-new-wrappers': warn,
1173
- 'no-obj-calls': warn,
1174
- 'no-octal': warn,
1175
- 'no-octal-escape': warn,
1176
- 'no-param-reassign': off,
1177
- 'no-path-concat': warn,
1178
- 'no-plusplus': off,
1179
- 'no-process-env': off,
1180
- 'no-process-exit': off,
1181
- 'no-proto': warn,
1182
- 'no-prototype-builtins': warn,
1183
- 'no-redeclare': [warn, { builtinGlobals: false }],
1184
- 'no-regex-spaces': warn,
1185
- 'no-restricted-globals': warn,
1186
- 'no-restricted-imports': warn,
1187
- 'no-restricted-modules': warn,
1188
- 'no-restricted-properties': warn,
1189
- 'no-restricted-syntax': [
1190
- warn,
1191
- 'FunctionDeclaration',
1192
- 'LabeledStatement',
1193
- 'WithStatement',
1194
- ],
1195
- 'no-return-assign': [warn, 'except-parens'],
1196
- 'no-return-await': off,
1197
- 'no-script-url': warn,
1198
- 'no-self-assign': [warn, { props: true }],
1199
- 'no-self-compare': warn,
1200
- 'no-sequences': warn,
1201
- 'no-shadow': warn,
1202
- 'no-shadow-restricted-names': warn,
1203
- 'no-sparse-arrays': warn,
1204
- 'no-sync': warn,
1205
- 'no-tabs': warn,
1206
- 'no-template-curly-in-string': warn,
1207
- 'no-ternary': off,
1208
- 'no-this-before-super': warn,
1209
- 'no-throw-literal': warn,
1210
- 'no-trailing-spaces': warn,
1211
- 'no-undef': error,
1212
- 'no-undef-init': warn,
1213
- 'no-undefined': off,
1214
- 'no-underscore-dangle': off,
1215
- 'no-unexpected-multiline': warn,
1216
- 'no-unmodified-loop-condition': warn,
1217
- 'no-unneeded-ternary': [warn, { defaultAssignment: false }],
1218
- 'no-unreachable': warn,
1219
- 'no-unsafe-finally': warn,
1220
- 'no-unsafe-negation': warn,
1221
- 'no-unused-expressions': [
1222
- warn,
1223
- {
1224
- allowShortCircuit: true,
1225
- allowTaggedTemplates: true,
1226
- allowTernary: true,
1227
- },
1228
- ],
1229
- 'no-unused-labels': warn,
1230
- 'no-unused-vars': [
1231
- warn,
1232
- {
1233
- args: 'after-used',
1234
- argsIgnorePattern: '^_.*$',
1235
- vars: 'all',
1236
- varsIgnorePattern: '^_.*$|^T$',
1237
- },
1238
- ],
1239
- 'no-use-before-define': [
1240
- error,
1241
- {
1242
- classes: false,
1243
- functions: false,
1244
- variables: false,
1245
- },
1246
- ],
1247
- 'no-useless-call': warn,
1248
- 'no-useless-catch': warn,
1249
- 'no-useless-computed-key': warn,
1250
- 'no-useless-concat': warn,
1251
- 'no-useless-constructor': warn,
1252
- 'no-useless-escape': warn,
1253
- 'no-useless-rename': warn,
1254
- 'no-useless-return': warn,
1255
- 'no-var': warn,
1256
- 'no-void': warn,
1257
- 'no-warning-comments': warn,
1258
- 'no-whitespace-before-property': warn,
1259
- 'no-with': warn,
1260
- 'nonblock-statement-body-position': warn,
1261
- 'object-curly-newline': [warn, { consistent: true, multiline: true }],
1262
- 'object-curly-spacing': [warn, 'always'],
1263
- 'object-property-newline': [
1264
- warn,
1265
- {
1266
- allowMultiplePropertiesPerLine: true,
1267
- },
1268
- ],
1269
- 'object-shorthand': [warn, 'always'],
1270
- 'one-var': [warn, 'never'],
1271
- 'one-var-declaration-per-line': warn,
1272
- 'operator-assignment': [warn, 'always'],
1273
- 'operator-linebreak': [
1274
- warn,
1275
- 'after',
1276
- {
1277
- overrides: {
1278
- ':': 'before',
1279
- '?': 'before',
1280
- '??': 'before',
1281
- },
1282
- },
1283
- ],
1284
- 'padded-blocks': [
1285
- warn,
1286
- {
1287
- blocks: 'never',
1288
- classes: 'never',
1289
- switches: 'never',
1290
- },
1291
- ],
1292
- 'padding-line-between-statements': warn,
1293
- 'prefer-arrow-callback': warn,
1294
- 'prefer-const': [warn, { destructuring: 'all' }],
1295
- 'prefer-destructuring': [off, { array: false, object: true }],
1296
- 'prefer-named-capture-group': off,
1297
- 'prefer-numeric-literals': warn,
1298
- 'prefer-object-spread': warn,
1299
- 'prefer-promise-reject-errors': warn,
1300
- 'prefer-regex-literals': warn,
1301
- 'prefer-rest-params': warn,
1302
- 'prefer-spread': warn,
1303
- 'prefer-template': off,
1304
- 'quote-props': [warn, 'as-needed'],
1305
- quotes: [
1306
- warn,
1307
- 'single',
1308
- {
1309
- allowTemplateLiterals: false,
1310
- avoidEscape: true,
1311
- },
1312
- ],
1313
- radix: warn,
1314
- // Disabled due to false (?) positives:
1315
- 'require-atomic-updates': off,
1316
- 'require-await': warn,
1317
- 'require-unicode-regexp': off,
1318
- 'require-yield': warn,
1319
- 'rest-spread-spacing': [warn, 'never'],
1320
- semi: [warn, 'always'],
1321
- 'semi-spacing': [warn, { after: true, before: false }],
1322
- 'semi-style': [warn, 'last'],
1323
- 'sort-imports': [
1324
- off,
1325
- {
1326
- ignoreCase: false,
1327
- ignoreDeclarationSort: false,
1328
- ignoreMemberSort: false,
1329
- memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
1330
- },
1331
- ],
1332
- 'sort-keys': off,
1333
- 'sort-keys/sort-keys-fix': [warn, 'asc', { natural: false }],
1334
- 'sort-vars': warn,
1335
- 'space-before-blocks': [warn, 'always'],
1336
- 'space-before-function-paren': [warn, 'always'],
1337
- 'space-in-parens': [warn, 'never'],
1338
- 'space-infix-ops': warn,
1339
- 'space-unary-ops': [warn, { nonwords: false, words: true }],
1340
- 'spaced-comment': [
1341
- warn,
1342
- 'always',
1343
- {
1344
- block: {
1345
- balanced: true,
1346
- exceptions: ['*'],
1347
- },
1348
- line: {
1349
- markers: ['!', '?', '*', '/', '//'],
1350
- },
1351
- },
1352
- ],
1353
- strict: [warn, 'never'],
1354
- 'switch-colon-spacing': [
1355
- warn,
1356
- {
1357
- after: true,
1358
- before: false,
1359
- },
1360
- ],
1361
- 'symbol-description': warn,
1362
- 'template-curly-spacing': [warn, 'never'],
1363
- 'template-tag-spacing': [warn, 'never'],
1364
- 'unicode-bom': [warn, 'never'],
1365
- 'use-isnan': warn,
1366
- 'valid-typeof': [warn, { requireStringLiterals: true }],
1367
- 'vars-on-top': warn,
1368
- 'wrap-iife': [warn, 'any', { functionPrototypeMethods: true }],
1369
- 'wrap-regex': off,
1370
- 'yield-star-spacing': [warn, 'both'],
1371
- yoda: [warn, 'never'],
1372
- },
1373
- };
1
+ const IS_DEVELOPMENT = !process.env.CI && process.env.NODE_ENV !== 'production';
2
+ const error = 'error';
3
+ const off = 'off';
4
+ const warn = IS_DEVELOPMENT ? 'warn' : 'error';
5
+
6
+ module.exports = {
7
+ env: {
8
+ browser: true,
9
+ es6: true,
10
+ node: true,
11
+ },
12
+ globals: {
13
+ globalThis: true,
14
+ },
15
+ ignorePatterns: ['**/.*/**', '**/node_modules/**'],
16
+ overrides: [
17
+ {
18
+ files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
19
+ globals: {
20
+ NodeJS: true,
21
+ },
22
+ parser: '@typescript-eslint/parser',
23
+ parserOptions: {
24
+ project: './tsconfig.json',
25
+ },
26
+ plugins: ['@typescript-eslint'],
27
+ rules: {
28
+ '@typescript-eslint/adjacent-overload-signatures': warn,
29
+ '@typescript-eslint/array-type': [
30
+ warn,
31
+ {
32
+ default: 'array',
33
+ },
34
+ ],
35
+ '@typescript-eslint/await-thenable': warn,
36
+ '@typescript-eslint/ban-ts-comment': warn,
37
+ '@typescript-eslint/ban-tslint-comment': warn,
38
+ '@typescript-eslint/ban-types': [
39
+ off,
40
+ {
41
+ extendDefaults: true,
42
+ types: {
43
+ Boolean: false,
44
+ Function: false,
45
+ Number: false,
46
+ Object: false,
47
+ '{}': false,
48
+ },
49
+ },
50
+ ],
51
+ '@typescript-eslint/brace-style': warn,
52
+ '@typescript-eslint/camelcase': off,
53
+ '@typescript-eslint/class-literal-property-style': [warn, 'fields'],
54
+ '@typescript-eslint/comma-dangle': [warn, 'always-multiline'],
55
+ '@typescript-eslint/comma-spacing': [
56
+ warn,
57
+ { after: true, before: false },
58
+ ],
59
+ '@typescript-eslint/consistent-type-assertions': [
60
+ off,
61
+ {
62
+ assertionStyle: 'as',
63
+ objectLiteralTypeAssertions: 'never',
64
+ },
65
+ ],
66
+ '@typescript-eslint/consistent-type-definitions': [warn, 'type'],
67
+ '@typescript-eslint/consistent-type-imports': [
68
+ warn,
69
+ {
70
+ disallowTypeAnnotations: true,
71
+ prefer: 'no-type-imports',
72
+ },
73
+ ],
74
+ '@typescript-eslint/default-param-last': warn,
75
+ '@typescript-eslint/dot-notation': warn,
76
+ '@typescript-eslint/explicit-function-return-type': [
77
+ off,
78
+ {
79
+ allowTypedFunctionExpressions: true,
80
+ },
81
+ ],
82
+ '@typescript-eslint/explicit-member-accessibility': [
83
+ warn,
84
+ {
85
+ accessibility: 'no-public',
86
+ },
87
+ ],
88
+ '@typescript-eslint/explicit-module-boundary-types': off,
89
+ '@typescript-eslint/func-call-spacing': warn,
90
+ '@typescript-eslint/indent': [
91
+ warn,
92
+ 2,
93
+ {
94
+ SwitchCase: 1,
95
+ // Ignored nodes due to false positives:
96
+ ignoredNodes: [
97
+ 'TSIntersectionType',
98
+ 'TSTypeParameterInstantiation',
99
+ 'TSUnionType',
100
+ ],
101
+ },
102
+ ],
103
+ // Definition not found (2020-10-26):
104
+ // '@typescript-eslint/index': warn,
105
+ '@typescript-eslint/init-declarations': off,
106
+ '@typescript-eslint/keyword-spacing': warn,
107
+ '@typescript-eslint/lines-between-class-members': [
108
+ warn,
109
+ 'always',
110
+ {
111
+ exceptAfterOverload: true,
112
+ exceptAfterSingleLine: true,
113
+ },
114
+ ],
115
+ '@typescript-eslint/member-delimiter-style': [
116
+ warn,
117
+ {
118
+ multiline: {
119
+ delimiter: 'semi',
120
+ requireLast: true,
121
+ },
122
+ singleline: {
123
+ delimiter: 'semi',
124
+ requireLast: true,
125
+ },
126
+ },
127
+ ],
128
+ '@typescript-eslint/member-ordering': [
129
+ warn,
130
+ {
131
+ default: [
132
+ 'signature',
133
+ 'private-static-field',
134
+ 'protected-static-field',
135
+ 'public-static-field',
136
+ 'private-static-method',
137
+ 'protected-static-method',
138
+ 'public-static-method',
139
+ 'private-decorated-field',
140
+ 'protected-decorated-field',
141
+ 'public-decorated-field',
142
+ 'private-instance-field',
143
+ 'protected-instance-field',
144
+ 'public-instance-field',
145
+ 'private-abstract-field',
146
+ 'protected-abstract-field',
147
+ 'public-abstract-field',
148
+ 'static-field',
149
+ 'private-field',
150
+ 'protected-field',
151
+ 'public-field',
152
+ 'instance-field',
153
+ 'abstract-field',
154
+ 'decorated-field',
155
+ 'field',
156
+ 'private-constructor',
157
+ 'protected-constructor',
158
+ 'public-constructor',
159
+ 'constructor',
160
+ 'private-decorated-method',
161
+ 'protected-decorated-method',
162
+ 'public-decorated-method',
163
+ 'private-instance-method',
164
+ 'protected-instance-method',
165
+ 'public-instance-method',
166
+ 'private-abstract-method',
167
+ 'protected-abstract-method',
168
+ 'public-abstract-method',
169
+ 'static-method',
170
+ 'private-method',
171
+ 'protected-method',
172
+ 'public-method',
173
+ 'instance-method',
174
+ 'abstract-method',
175
+ 'decorated-method',
176
+ 'method',
177
+ ],
178
+ },
179
+ ],
180
+ '@typescript-eslint/method-signature-style': [warn, 'method'],
181
+ '@typescript-eslint/naming-convention': [
182
+ off,
183
+ {
184
+ format: ['camelCase'],
185
+ leadingUnderscore: 'allow',
186
+ selector: 'default',
187
+ },
188
+ {
189
+ format: ['camelCase', 'snake_case', 'PascalCase', 'UPPER_CASE'],
190
+ leadingUnderscore: 'allow',
191
+ selector: ['objectLiteralProperty'],
192
+ },
193
+ {
194
+ format: ['camelCase', 'PascalCase'],
195
+ leadingUnderscore: 'allow',
196
+ selector: ['function'],
197
+ },
198
+ {
199
+ format: ['camelCase', 'UPPER_CASE'],
200
+ leadingUnderscore: 'allow',
201
+ selector: ['objectLiteralMethod', 'typeMethod', 'variable'],
202
+ },
203
+ {
204
+ format: ['PascalCase'],
205
+ leadingUnderscore: 'allow',
206
+ selector: [
207
+ 'class',
208
+ 'enum',
209
+ 'interface',
210
+ 'typeAlias',
211
+ 'typeParameter',
212
+ ],
213
+ },
214
+ {
215
+ format: ['UPPER_CASE'],
216
+ leadingUnderscore: 'allow',
217
+ selector: ['enumMember'],
218
+ },
219
+ {
220
+ format: null,
221
+ leadingUnderscore: 'allow',
222
+ selector: ['parameter', 'property'],
223
+ },
224
+ ],
225
+ '@typescript-eslint/no-array-constructor': warn,
226
+ '@typescript-eslint/no-base-to-string': warn,
227
+ '@typescript-eslint/no-confusing-non-null-assertion': warn,
228
+ '@typescript-eslint/no-dupe-class-members': warn,
229
+ '@typescript-eslint/no-dynamic-delete': off,
230
+ '@typescript-eslint/no-empty-function': warn,
231
+ '@typescript-eslint/no-empty-interface': warn,
232
+ '@typescript-eslint/no-explicit-any': off,
233
+ '@typescript-eslint/no-extra-non-null-assertion': warn,
234
+ '@typescript-eslint/no-extra-parens': [
235
+ warn,
236
+ 'all',
237
+ {
238
+ ignoreJSX: 'all',
239
+ nestedBinaryExpressions: false,
240
+ },
241
+ ],
242
+ '@typescript-eslint/no-extra-semi': warn,
243
+ '@typescript-eslint/no-extraneous-class': off,
244
+ '@typescript-eslint/no-floating-promises': [
245
+ warn,
246
+ {
247
+ ignoreIIFE: true,
248
+ ignoreVoid: true,
249
+ },
250
+ ],
251
+ '@typescript-eslint/no-for-in-array': warn,
252
+ '@typescript-eslint/no-implicit-any-catch': off,
253
+ '@typescript-eslint/no-implied-eval': warn,
254
+ '@typescript-eslint/no-inferrable-types': warn,
255
+ '@typescript-eslint/no-invalid-this': warn,
256
+ '@typescript-eslint/no-invalid-void-type': off,
257
+ '@typescript-eslint/no-loop-func': warn,
258
+ '@typescript-eslint/no-loss-of-precision': warn,
259
+ '@typescript-eslint/no-magic-numbers': [
260
+ warn,
261
+ {
262
+ ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'],
263
+ ignoreEnums: true,
264
+ ignoreNumericLiteralTypes: true,
265
+ ignoreReadonlyClassProperties: true,
266
+ },
267
+ ],
268
+ '@typescript-eslint/no-misused-new': warn,
269
+ '@typescript-eslint/no-misused-promises': off,
270
+ '@typescript-eslint/no-namespace': [
271
+ off,
272
+ {
273
+ allowDeclarations: true,
274
+ },
275
+ ],
276
+ '@typescript-eslint/no-non-null-asserted-optional-chain': warn,
277
+ '@typescript-eslint/no-non-null-assertion': off,
278
+ '@typescript-eslint/no-parameter-properties': warn,
279
+ '@typescript-eslint/no-redeclare': warn,
280
+ '@typescript-eslint/no-require-imports': warn,
281
+ '@typescript-eslint/no-shadow': warn,
282
+ '@typescript-eslint/no-this-alias': warn,
283
+ '@typescript-eslint/no-throw-literal': warn,
284
+ '@typescript-eslint/no-type-alias': off,
285
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': warn,
286
+ '@typescript-eslint/no-unnecessary-condition': off,
287
+ '@typescript-eslint/no-unnecessary-qualifier': warn,
288
+ '@typescript-eslint/no-unnecessary-type-arguments': off,
289
+ '@typescript-eslint/no-unnecessary-type-assertion': warn,
290
+ '@typescript-eslint/no-unsafe-assignment': off,
291
+ '@typescript-eslint/no-unsafe-call': off,
292
+ '@typescript-eslint/no-unsafe-member-access': off,
293
+ '@typescript-eslint/no-unsafe-return': off,
294
+ '@typescript-eslint/no-unused-expressions': [
295
+ warn,
296
+ {
297
+ allowShortCircuit: true,
298
+ allowTaggedTemplates: true,
299
+ allowTernary: true,
300
+ },
301
+ ],
302
+ '@typescript-eslint/no-unused-vars': [
303
+ warn,
304
+ {
305
+ args: 'after-used',
306
+ argsIgnorePattern: '^_.*$',
307
+ vars: 'all',
308
+ varsIgnorePattern: '^_.*$|^T$',
309
+ },
310
+ ],
311
+ '@typescript-eslint/no-use-before-define': [
312
+ error,
313
+ {
314
+ classes: false,
315
+ functions: false,
316
+ variables: false,
317
+ },
318
+ ],
319
+ '@typescript-eslint/no-useless-constructor': warn,
320
+ '@typescript-eslint/no-var-requires': off,
321
+ '@typescript-eslint/prefer-as-const': warn,
322
+ '@typescript-eslint/prefer-enum-initializers': off,
323
+ '@typescript-eslint/prefer-for-of': warn,
324
+ '@typescript-eslint/prefer-function-type': warn,
325
+ '@typescript-eslint/prefer-includes': warn,
326
+ '@typescript-eslint/prefer-literal-enum-member': warn,
327
+ '@typescript-eslint/prefer-namespace-keyword': warn,
328
+ '@typescript-eslint/prefer-nullish-coalescing': warn,
329
+ '@typescript-eslint/prefer-optional-chain': warn,
330
+ '@typescript-eslint/prefer-readonly': warn,
331
+ // Disabled due to error:
332
+ // "Error: Non-null Assertion Failed: Expected to find a property "XXX" for the type."
333
+ '@typescript-eslint/prefer-readonly-parameter-types': off,
334
+ '@typescript-eslint/prefer-reduce-type-parameter': warn,
335
+ '@typescript-eslint/prefer-regexp-exec': off,
336
+ '@typescript-eslint/prefer-string-starts-ends-with': off,
337
+ '@typescript-eslint/prefer-ts-expect-error': warn,
338
+ '@typescript-eslint/promise-function-async': off,
339
+ '@typescript-eslint/quotes': [warn, 'single'],
340
+ '@typescript-eslint/require-array-sort-compare': [
341
+ warn,
342
+ {
343
+ ignoreStringArrays: true,
344
+ },
345
+ ],
346
+ '@typescript-eslint/require-await': warn,
347
+ '@typescript-eslint/restrict-plus-operands': warn,
348
+ // Disabled due to false positives:
349
+ '@typescript-eslint/restrict-template-expressions': off,
350
+ '@typescript-eslint/return-await': [warn, 'always'],
351
+ '@typescript-eslint/semi': [warn, 'always'],
352
+ '@typescript-eslint/space-before-function-paren': [warn, 'always'],
353
+ '@typescript-eslint/strict-boolean-expressions': off,
354
+ '@typescript-eslint/switch-exhaustiveness-check': off,
355
+ '@typescript-eslint/triple-slash-reference': warn,
356
+ '@typescript-eslint/type-annotation-spacing': warn,
357
+ '@typescript-eslint/typedef': off,
358
+ '@typescript-eslint/unbound-method': off,
359
+ '@typescript-eslint/unified-signatures': warn,
360
+ 'default-case': off,
361
+ 'func-call-spacing': off,
362
+ 'import/extensions': off,
363
+ 'import/no-unassigned-import': off,
364
+ // Disabled due to false positives:
365
+ 'import/no-unresolved': [
366
+ off,
367
+ {
368
+ ignore: ['\\.types$'],
369
+ },
370
+ ],
371
+ indent: off,
372
+ 'init-declarations': off,
373
+ 'jsdoc/check-examples': off,
374
+ 'jsdoc/require-description': off,
375
+ 'jsdoc/require-description-complete-sentence': off,
376
+ 'jsdoc/require-example': off,
377
+ 'jsdoc/require-file-overview': off,
378
+ 'jsdoc/require-hyphen-before-param-description': off,
379
+ 'jsdoc/require-jsdoc': off,
380
+ 'jsdoc/require-param': off,
381
+ 'jsdoc/require-param-description': off,
382
+ 'jsdoc/require-param-name': off,
383
+ 'jsdoc/require-param-type': off,
384
+ 'jsdoc/require-property': off,
385
+ 'jsdoc/require-property-description': off,
386
+ 'jsdoc/require-property-name': off,
387
+ 'jsdoc/require-property-type': off,
388
+ 'jsdoc/require-returns': off,
389
+ 'jsdoc/require-returns-check': off,
390
+ 'jsdoc/require-returns-description': off,
391
+ 'jsdoc/require-returns-type': off,
392
+ 'keyword-spacing': off,
393
+ 'lines-between-class-members': off,
394
+ 'no-dupe-class-members': off,
395
+ 'no-empty-function': off,
396
+ 'no-extra-parens': off,
397
+ 'no-extra-semi': off,
398
+ 'no-invalid-this': off,
399
+ 'no-loop-func': off,
400
+ 'no-loss-of-precision': off,
401
+ 'no-redeclare': off,
402
+ 'no-return-await': off,
403
+ 'no-shadow': off,
404
+ /**
405
+ * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
406
+ */
407
+ 'no-undef': off,
408
+ 'no-unused-expressions': off,
409
+ 'no-unused-vars': off,
410
+ 'no-use-before-define': off,
411
+ 'no-useless-constructor': off,
412
+ 'no-void': off,
413
+ quotes: off,
414
+ 'require-await': off,
415
+ semi: off,
416
+ 'space-before-function-paren': off,
417
+ },
418
+ },
419
+ {
420
+ env: {
421
+ jest: true,
422
+ mocha: true,
423
+ },
424
+ files: [
425
+ '**/spec/**',
426
+ '**/test/**',
427
+ '**/tests/**',
428
+ '**/*.spec.*',
429
+ '**/*.test.*',
430
+ ],
431
+ rules: {
432
+ '@typescript-eslint/no-magic-numbers': off,
433
+ 'jsdoc/require-jsdoc': off,
434
+ 'no-magic-numbers': off,
435
+ 'sort-keys': off,
436
+ },
437
+ },
438
+ {
439
+ files: ['**/*.jsx', '**/*.tsx'],
440
+ plugins: ['react', 'jsx-a11y'],
441
+ rules: {
442
+ 'jsx-a11y/accessible-emoji': warn,
443
+ 'jsx-a11y/alt-text': warn,
444
+ 'jsx-a11y/anchor-has-content': warn,
445
+ 'jsx-a11y/anchor-is-valid': warn,
446
+ 'jsx-a11y/aria-activedescendant-has-tabindex': warn,
447
+ 'jsx-a11y/aria-props': warn,
448
+ 'jsx-a11y/aria-proptypes': warn,
449
+ 'jsx-a11y/aria-role': warn,
450
+ 'jsx-a11y/aria-unsupported-elements': warn,
451
+ 'jsx-a11y/autocomplete-valid': warn,
452
+ 'jsx-a11y/click-events-have-key-events': warn,
453
+ 'jsx-a11y/control-has-associated-label': [
454
+ warn,
455
+ {
456
+ ignoreElements: [
457
+ 'audio',
458
+ 'canvas',
459
+ 'embed',
460
+ 'input',
461
+ 'textarea',
462
+ 'tr',
463
+ 'video',
464
+ ],
465
+ ignoreRoles: [
466
+ 'grid',
467
+ 'listbox',
468
+ 'menu',
469
+ 'menubar',
470
+ 'radiogroup',
471
+ 'row',
472
+ 'tablist',
473
+ 'toolbar',
474
+ 'tree',
475
+ 'treegrid',
476
+ ],
477
+ includeRoles: ['alert', 'dialog'],
478
+ },
479
+ ],
480
+ 'jsx-a11y/heading-has-content': warn,
481
+ 'jsx-a11y/html-has-lang': warn,
482
+ 'jsx-a11y/iframe-has-title': warn,
483
+ 'jsx-a11y/img-redundant-alt': warn,
484
+ 'jsx-a11y/interactive-supports-focus': [
485
+ warn,
486
+ {
487
+ tabbable: [
488
+ 'button',
489
+ 'checkbox',
490
+ 'link',
491
+ 'progressbar',
492
+ 'searchbox',
493
+ 'slider',
494
+ 'spinbutton',
495
+ 'switch',
496
+ 'textbox',
497
+ ],
498
+ },
499
+ ],
500
+ 'jsx-a11y/label-has-associated-control': warn,
501
+ 'jsx-a11y/label-has-for': off,
502
+ 'jsx-a11y/media-has-caption': warn,
503
+ 'jsx-a11y/mouse-events-have-key-events': warn,
504
+ 'jsx-a11y/no-access-key': warn,
505
+ 'jsx-a11y/no-autofocus': warn,
506
+ 'jsx-a11y/no-distracting-elements': warn,
507
+ 'jsx-a11y/no-interactive-element-to-noninteractive-role': warn,
508
+ 'jsx-a11y/no-noninteractive-element-interactions': [
509
+ warn,
510
+ {
511
+ body: ['onError', 'onLoad'],
512
+ iframe: ['onError', 'onLoad'],
513
+ img: ['onError', 'onLoad'],
514
+ },
515
+ ],
516
+ 'jsx-a11y/no-noninteractive-element-to-interactive-role': warn,
517
+ 'jsx-a11y/no-noninteractive-tabindex': warn,
518
+ 'jsx-a11y/no-redundant-roles': warn,
519
+ 'jsx-a11y/no-static-element-interactions': warn,
520
+ 'jsx-a11y/role-has-required-aria-props': warn,
521
+ 'jsx-a11y/role-supports-aria-props': warn,
522
+ 'jsx-a11y/scope': warn,
523
+ 'jsx-a11y/tabindex-no-positive': warn,
524
+ 'react/boolean-prop-naming': warn,
525
+ 'react/button-has-type': warn,
526
+ 'react/default-props-match-prop-types': warn,
527
+ 'react/destructuring-assignment': off,
528
+ 'react/display-name': warn,
529
+ 'react/forbid-component-props': off,
530
+ 'react/forbid-dom-props': warn,
531
+ 'react/forbid-elements': warn,
532
+ 'react/forbid-foreign-prop-types': warn,
533
+ 'react/forbid-prop-types': warn,
534
+ 'react/function-component-definition': [
535
+ warn,
536
+ {
537
+ namedComponents: 'arrow-function',
538
+ unnamedComponents: 'arrow-function',
539
+ },
540
+ ],
541
+ 'react/jsx-boolean-value': warn,
542
+ 'react/jsx-child-element-spacing': warn,
543
+ 'react/jsx-closing-bracket-location': warn,
544
+ 'react/jsx-closing-tag-location': warn,
545
+ 'react/jsx-curly-brace-presence': [
546
+ warn,
547
+ {
548
+ children: 'always',
549
+ props: 'never',
550
+ },
551
+ ],
552
+ 'react/jsx-curly-newline': off,
553
+ 'react/jsx-curly-spacing': warn,
554
+ 'react/jsx-equals-spacing': warn,
555
+ 'react/jsx-filename-extension': [
556
+ warn,
557
+ {
558
+ extensions: ['.jsx', '.tsx'],
559
+ },
560
+ ],
561
+ 'react/jsx-first-prop-new-line': warn,
562
+ 'react/jsx-fragments': warn,
563
+ 'react/jsx-handler-names': warn,
564
+ 'react/jsx-indent': [
565
+ warn,
566
+ 2,
567
+ {
568
+ indentLogicalExpressions: true,
569
+ },
570
+ ],
571
+ 'react/jsx-indent-props': [warn, 2],
572
+ 'react/jsx-key': warn,
573
+ 'react/jsx-max-depth': off,
574
+ 'react/jsx-max-props-per-line': [
575
+ warn,
576
+ {
577
+ maximum: 1,
578
+ when: 'multiline',
579
+ },
580
+ ],
581
+ 'react/jsx-newline': off,
582
+ 'react/jsx-no-bind': [
583
+ warn,
584
+ {
585
+ allowArrowFunctions: true,
586
+ allowBind: true,
587
+ allowFunctions: false,
588
+ ignoreDOMComponents: false,
589
+ ignoreRefs: false,
590
+ },
591
+ ],
592
+ 'react/jsx-no-comment-textnodes': warn,
593
+ 'react/jsx-no-constructed-context-values': warn,
594
+ 'react/jsx-no-duplicate-props': warn,
595
+ 'react/jsx-no-literals': warn,
596
+ 'react/jsx-no-script-url': warn,
597
+ 'react/jsx-no-target-blank': warn,
598
+ 'react/jsx-no-undef': warn,
599
+ 'react/jsx-no-useless-fragment': off,
600
+ 'react/jsx-one-expression-per-line': warn,
601
+ 'react/jsx-pascal-case': warn,
602
+ 'react/jsx-props-no-multi-spaces': warn,
603
+ 'react/jsx-props-no-spreading': off,
604
+ 'react/jsx-sort-default-props': warn,
605
+ 'react/jsx-sort-props': warn,
606
+ /** @deprecated */
607
+ 'react/jsx-space-before-closing': off,
608
+ 'react/jsx-tag-spacing': [
609
+ warn,
610
+ {
611
+ afterOpening: 'never',
612
+ beforeClosing: 'allow',
613
+ beforeSelfClosing: 'always',
614
+ closingSlash: 'never',
615
+ },
616
+ ],
617
+ 'react/jsx-uses-react': warn,
618
+ 'react/jsx-uses-vars': warn,
619
+ 'react/jsx-wrap-multilines': [
620
+ warn,
621
+ {
622
+ arrow: 'ignore',
623
+ assignment: 'ignore',
624
+ condition: 'ignore',
625
+ declaration: 'ignore',
626
+ logical: 'ignore',
627
+ prop: 'ignore',
628
+ return: 'parens',
629
+ },
630
+ ],
631
+ 'react/no-access-state-in-setstate': warn,
632
+ 'react/no-adjacent-inline-elements': off,
633
+ 'react/no-array-index-key': warn,
634
+ 'react/no-children-prop': warn,
635
+ 'react/no-danger': warn,
636
+ 'react/no-danger-with-children': warn,
637
+ 'react/no-deprecated': warn,
638
+ 'react/no-did-mount-set-state': warn,
639
+ 'react/no-did-update-set-state': warn,
640
+ 'react/no-direct-mutation-state': warn,
641
+ 'react/no-find-dom-node': warn,
642
+ 'react/no-is-mounted': warn,
643
+ 'react/no-multi-comp': warn,
644
+ 'react/no-redundant-should-component-update': warn,
645
+ 'react/no-render-return-value': warn,
646
+ 'react/no-set-state': off,
647
+ 'react/no-string-refs': warn,
648
+ 'react/no-this-in-sfc': warn,
649
+ 'react/no-typos': warn,
650
+ 'react/no-unescaped-entities': warn,
651
+ 'react/no-unknown-property': warn,
652
+ 'react/no-unsafe': warn,
653
+ 'react/no-unused-prop-types': warn,
654
+ 'react/no-unused-state': warn,
655
+ 'react/no-will-update-set-state': warn,
656
+ 'react/prefer-es6-class': warn,
657
+ 'react/prefer-read-only-props': warn,
658
+ 'react/prefer-stateless-function': warn,
659
+ 'react/prop-types': off,
660
+ 'react/react-in-jsx-scope': off,
661
+ 'react/require-default-props': off,
662
+ 'react/require-optimization': off,
663
+ 'react/require-render-return': warn,
664
+ 'react/self-closing-comp': warn,
665
+ 'react/sort-comp': [
666
+ warn,
667
+ {
668
+ groups: {
669
+ lifecycle: [
670
+ 'displayName',
671
+ 'propTypes',
672
+ 'contextTypes',
673
+ 'childContextTypes',
674
+ 'mixins',
675
+ 'statics',
676
+ 'defaultProps',
677
+ 'constructor',
678
+ 'getDefaultProps',
679
+ 'state',
680
+ 'getInitialState',
681
+ 'getChildContext',
682
+ 'getDerivedStateFromProps',
683
+ 'componentWillMount',
684
+ 'UNSAFE_componentWillMount',
685
+ 'componentDidMount',
686
+ 'componentWillReceiveProps',
687
+ 'UNSAFE_componentWillReceiveProps',
688
+ 'shouldComponentUpdate',
689
+ 'componentWillUpdate',
690
+ 'UNSAFE_componentWillUpdate',
691
+ 'getSnapshotBeforeUpdate',
692
+ 'componentDidUpdate',
693
+ 'componentDidCatch',
694
+ 'componentWillUnmount',
695
+ ],
696
+ },
697
+ order: [
698
+ 'static-variables',
699
+ 'static-methods',
700
+ 'everything-else',
701
+ 'instance-variables',
702
+ 'instance-methods',
703
+ 'lifecycle',
704
+ 'render',
705
+ ],
706
+ },
707
+ ],
708
+ 'react/sort-prop-types': warn,
709
+ 'react/state-in-constructor': off,
710
+ 'react/static-property-placement': warn,
711
+ 'react/style-prop-object': warn,
712
+ 'react/void-dom-elements-no-children': warn,
713
+ },
714
+ },
715
+ {
716
+ files: ['**/*.d.ts'],
717
+ rules: {
718
+ '@typescript-eslint/consistent-type-definitions': off,
719
+ '@typescript-eslint/no-extraneous-class': off,
720
+ '@typescript-eslint/no-use-before-define': off,
721
+ 'import/no-default-export': off,
722
+ 'jsdoc/require-jsdoc': off,
723
+ },
724
+ },
725
+ {
726
+ files: ['**/*.config.js', '**/*.config.ts'],
727
+ rules: {
728
+ '@typescript-eslint/no-magic-numbers': off,
729
+ 'no-magic-numbers': off,
730
+ },
731
+ },
732
+ {
733
+ files: [
734
+ '**/*.stories.js',
735
+ '**/*.stories.jsx',
736
+ '**/*.stories.ts',
737
+ '**/*.stories.tsx',
738
+ ],
739
+ rules: {
740
+ 'import/no-default-export': off,
741
+ 'react/no-multi-comp': off,
742
+ },
743
+ },
744
+ ],
745
+ parser: '@babel/eslint-parser',
746
+ parserOptions: {
747
+ allowAwaitOutsideFunction: true,
748
+ ecmaFeatures: {
749
+ jsx: true,
750
+ },
751
+ ecmaVersion: 2017,
752
+ requireConfigFile: false,
753
+ sourceType: 'module',
754
+ },
755
+ plugins: ['import', 'jsdoc', 'sort-keys'],
756
+ root: true,
757
+ rules: {
758
+ 'accessor-pairs': warn,
759
+ 'array-bracket-newline': off,
760
+ 'array-bracket-spacing': [warn, 'never'],
761
+ 'array-callback-return': warn,
762
+ 'array-element-newline': [warn, 'consistent'],
763
+ 'arrow-body-style': off,
764
+ 'arrow-parens': [warn, 'always'],
765
+ 'arrow-spacing': [warn, { after: true, before: true }],
766
+ 'block-scoped-var': warn,
767
+ 'block-spacing': [warn, 'always'],
768
+ 'brace-style': [warn, '1tbs'],
769
+ 'callback-return': [off, ['callback', 'cb', 'next']],
770
+ camelcase: [off, { properties: 'never' }],
771
+ 'capitalized-comments': off,
772
+ 'class-methods-use-this': off,
773
+ 'comma-dangle': [warn, 'always-multiline'],
774
+ 'comma-spacing': [warn, { after: true, before: false }],
775
+ 'comma-style': [warn, 'last'],
776
+ complexity: off,
777
+ 'computed-property-spacing': [warn, 'never'],
778
+ 'consistent-return': warn,
779
+ 'consistent-this': warn,
780
+ 'constructor-super': warn,
781
+ curly: [warn, 'all'],
782
+ 'default-case': warn,
783
+ 'default-param-last': warn,
784
+ 'dot-location': [warn, 'property'],
785
+ 'dot-notation': [warn, { allowKeywords: true }],
786
+ 'eol-last': warn,
787
+ eqeqeq: [warn, 'always', { null: 'ignore' }],
788
+ 'for-direction': warn,
789
+ 'func-call-spacing': [warn, 'never'],
790
+ 'func-name-matching': warn,
791
+ 'func-names': [off, 'as-needed'],
792
+ 'func-style': [off, 'expression'],
793
+ 'function-call-argument-newline': off,
794
+ 'function-paren-newline': off,
795
+ 'generator-star-spacing': [warn, { after: true, before: true }],
796
+ 'getter-return': warn,
797
+ 'global-require': off,
798
+ 'guard-for-in': warn,
799
+ 'handle-callback-err': [warn, '^(err|error)$'],
800
+ 'id-blacklist': warn,
801
+ 'id-length': off,
802
+ 'id-match': [warn, '^[$_]$|^[$_]?[_A-Za-z][A-Za-z0-9_]*$'],
803
+ 'implicit-arrow-linebreak': [off, 'beside'],
804
+ 'import/default': warn,
805
+ 'import/dynamic-import-chunkname': off,
806
+ 'import/export': warn,
807
+ 'import/exports-last': warn,
808
+ 'import/extensions': [
809
+ warn,
810
+ {
811
+ js: 'always',
812
+ json: 'always',
813
+ },
814
+ ],
815
+ 'import/first': warn,
816
+ 'import/group-exports': off,
817
+ 'import/imports-first': warn,
818
+ 'import/max-dependencies': off,
819
+ // Disabled due to false positives:
820
+ 'import/named': off,
821
+ // Disabled due to false positives:
822
+ 'import/namespace': off,
823
+ 'import/newline-after-import': warn,
824
+ 'import/no-absolute-path': warn,
825
+ 'import/no-amd': warn,
826
+ 'import/no-anonymous-default-export': warn,
827
+ 'import/no-commonjs': off,
828
+ 'import/no-cycle': off,
829
+ 'import/no-default-export': off,
830
+ 'import/no-deprecated': warn,
831
+ 'import/no-duplicates': warn,
832
+ 'import/no-dynamic-require': warn,
833
+ 'import/no-extraneous-dependencies': warn,
834
+ 'import/no-internal-modules': [
835
+ warn,
836
+ {
837
+ allow: ['[@a-z][@a-z]*/**', '**/*.svg'],
838
+ },
839
+ ],
840
+ 'import/no-mutable-exports': warn,
841
+ 'import/no-named-as-default': warn,
842
+ 'import/no-named-as-default-member': warn,
843
+ 'import/no-named-default': warn,
844
+ 'import/no-named-export': off,
845
+ 'import/no-namespace': off,
846
+ 'import/no-nodejs-modules': off,
847
+ // Disabled due to false positives (e.g. "@robinblomberg/schema"):
848
+ 'import/no-relative-parent-imports': off,
849
+ 'import/no-restricted-paths': warn,
850
+ 'import/no-self-import': warn,
851
+ 'import/no-unassigned-import': warn,
852
+ 'import/no-unresolved': warn,
853
+ 'import/no-unused-modules': warn,
854
+ 'import/no-useless-path-segments': warn,
855
+ 'import/no-webpack-loader-syntax': warn,
856
+ /* 'import/order': [warn, {
857
+ alphabetize: {
858
+ caseInsensitive: false,
859
+ order: 'asc'
860
+ },
861
+ groups: [
862
+ 'builtin',
863
+ 'external',
864
+ 'internal',
865
+ 'unknown',
866
+ 'parent',
867
+ 'sibling',
868
+ 'index',
869
+ 'object'
870
+ ],
871
+ 'newlines-between': 'never'
872
+ }], */
873
+ 'import/prefer-default-export': off,
874
+ 'import/unambiguous': off,
875
+ indent: [
876
+ warn,
877
+ 2,
878
+ {
879
+ SwitchCase: 1,
880
+ },
881
+ ],
882
+ 'init-declarations': off,
883
+ 'jsdoc/check-access': warn,
884
+ 'jsdoc/check-alignment': warn,
885
+ 'jsdoc/check-examples': warn,
886
+ 'jsdoc/check-indentation': [
887
+ off,
888
+ {
889
+ excludeTags: ['example'],
890
+ },
891
+ ],
892
+ 'jsdoc/check-line-alignment': warn,
893
+ 'jsdoc/check-param-names': warn,
894
+ 'jsdoc/check-property-names': warn,
895
+ 'jsdoc/check-syntax': warn,
896
+ 'jsdoc/check-tag-names': warn,
897
+ 'jsdoc/check-types': [
898
+ warn,
899
+ {
900
+ noDefaults: true,
901
+ },
902
+ ],
903
+ 'jsdoc/check-values': warn,
904
+ 'jsdoc/empty-tags': warn,
905
+ 'jsdoc/implements-on-classes': warn,
906
+ 'jsdoc/match-description': warn,
907
+ 'jsdoc/newline-after-description': warn,
908
+ 'jsdoc/no-bad-blocks': warn,
909
+ 'jsdoc/no-defaults': warn,
910
+ 'jsdoc/no-types': off,
911
+ // Disable due to false positives when referring to a generic type from inside its function:
912
+ 'jsdoc/no-undefined-types': [
913
+ off,
914
+ {
915
+ definedTypes: [
916
+ 'unknown',
917
+ /**
918
+ * @see typescript\lib\lib.es5.d.ts
919
+ * @version 4.1.2
920
+ */
921
+ 'PropertyKey',
922
+ 'PropertyDescriptor',
923
+ 'PropertyDescriptorMap',
924
+ 'ObjectConstructor',
925
+ 'FunctionConstructor',
926
+ 'ThisParameterType',
927
+ 'OmitThisParameter',
928
+ 'CallableFunction',
929
+ 'NewableFunction',
930
+ 'IArguments',
931
+ 'StringConstructor',
932
+ 'BooleanConstructor',
933
+ 'NumberConstructor',
934
+ 'TemplateStringsArray',
935
+ 'ImportMeta',
936
+ 'DateConstructor',
937
+ 'RegExpMatchArray',
938
+ 'RegExpExecArray',
939
+ 'RegExpConstructor',
940
+ 'ErrorConstructor',
941
+ 'EvalErrorConstructor',
942
+ 'RangeErrorConstructor',
943
+ 'ReferenceErrorConstructor',
944
+ 'SyntaxErrorConstructor',
945
+ 'TypeErrorConstructor',
946
+ 'URIErrorConstructor',
947
+ 'ReadonlyArray',
948
+ 'ConcatArray',
949
+ 'ArrayConstructor',
950
+ 'TypedPropertyDescriptor',
951
+ 'ClassDecorator',
952
+ 'PropertyDecorator',
953
+ 'MethodDecorator',
954
+ 'ParameterDecorator',
955
+ 'PromiseConstructorLike',
956
+ 'PromiseLike',
957
+ 'ArrayLike',
958
+ 'Partial',
959
+ 'Required',
960
+ 'Readonly',
961
+ 'Pick',
962
+ 'Exclude',
963
+ 'Extract',
964
+ 'Omit',
965
+ 'NonNullable',
966
+ 'Parameters',
967
+ 'ConstructorParameters',
968
+ 'ReturnType',
969
+ 'InstanceType',
970
+ 'ThisType',
971
+ 'ArrayBufferTypes',
972
+ 'ArrayBufferLike',
973
+ 'ArrayBufferConstructor',
974
+ 'ArrayBufferView',
975
+ 'DataViewConstructor',
976
+ 'Int8ArrayConstructor',
977
+ 'Uint8ArrayConstructor',
978
+ 'Uint8ClampedArrayConstructor',
979
+ 'Int16ArrayConstructor',
980
+ 'Uint16ArrayConstructor',
981
+ 'Int32ArrayConstructor',
982
+ 'Uint32ArrayConstructor',
983
+ 'Float32ArrayConstructor',
984
+ 'Float64ArrayConstructor',
985
+ ],
986
+ },
987
+ ],
988
+ 'jsdoc/require-description': [
989
+ off,
990
+ {
991
+ contexts: ['any'],
992
+ descriptionStyle: 'body',
993
+ },
994
+ ],
995
+ 'jsdoc/require-description-complete-sentence': off,
996
+ 'jsdoc/require-example': off,
997
+ 'jsdoc/require-file-overview': off,
998
+ 'jsdoc/require-hyphen-before-param-description': [warn, 'never'],
999
+ 'jsdoc/require-jsdoc': [
1000
+ warn,
1001
+ {
1002
+ exemptEmptyFunctions: true,
1003
+ publicOnly: false,
1004
+ require: {
1005
+ ArrowFunctionExpression: true,
1006
+ ClassDeclaration: false,
1007
+ ClassExpression: false,
1008
+ FunctionDeclaration: true,
1009
+ FunctionExpression: true,
1010
+ MethodDefinition: true,
1011
+ },
1012
+ },
1013
+ ],
1014
+ 'jsdoc/require-param': [
1015
+ warn,
1016
+ {
1017
+ checkConstructors: true,
1018
+ checkDestructured: true,
1019
+ checkDestructuredRoots: true,
1020
+ checkGetters: true,
1021
+ checkSetters: true,
1022
+ },
1023
+ ],
1024
+ 'jsdoc/require-param-description': off,
1025
+ 'jsdoc/require-param-name': warn,
1026
+ 'jsdoc/require-param-type': [
1027
+ warn,
1028
+ {
1029
+ contexts: ['any'],
1030
+ },
1031
+ ],
1032
+ 'jsdoc/require-property': warn,
1033
+ 'jsdoc/require-property-description': warn,
1034
+ 'jsdoc/require-property-name': warn,
1035
+ 'jsdoc/require-property-type': warn,
1036
+ 'jsdoc/require-returns': off,
1037
+ 'jsdoc/require-returns-check': warn,
1038
+ 'jsdoc/require-returns-description': off,
1039
+ 'jsdoc/require-returns-type': warn,
1040
+ 'jsdoc/valid-types': off,
1041
+ 'jsx-quotes': warn,
1042
+ 'key-spacing': [warn, { afterColon: true, beforeColon: false }],
1043
+ 'keyword-spacing': [off, { after: true, before: true }],
1044
+ 'line-comment-position': off,
1045
+ 'linebreak-style': [warn, 'unix'],
1046
+ 'lines-around-comment': off,
1047
+ 'lines-between-class-members': [
1048
+ warn,
1049
+ 'always',
1050
+ { exceptAfterSingleLine: true },
1051
+ ],
1052
+ 'max-classes-per-file': [warn, 1],
1053
+ 'max-depth': off,
1054
+ 'max-len': [
1055
+ warn,
1056
+ {
1057
+ code: 100,
1058
+ ignoreComments: true,
1059
+ ignoreRegExpLiterals: true,
1060
+ },
1061
+ ],
1062
+ 'max-lines': off,
1063
+ 'max-lines-per-function': off,
1064
+ 'max-nested-callbacks': warn,
1065
+ 'max-params': off,
1066
+ 'max-statements': off,
1067
+ 'max-statements-per-line': [warn, { max: 1 }],
1068
+ 'multiline-comment-style': off,
1069
+ 'multiline-ternary': off,
1070
+ 'new-cap': [warn, { capIsNew: false, newIsCap: true, properties: true }],
1071
+ 'new-parens': warn,
1072
+ 'newline-per-chained-call': off,
1073
+ 'no-alert': off,
1074
+ 'no-array-constructor': warn,
1075
+ 'no-async-promise-executor': warn,
1076
+ 'no-await-in-loop': warn,
1077
+ 'no-bitwise': warn,
1078
+ 'no-buffer-constructor': warn,
1079
+ 'no-caller': warn,
1080
+ 'no-case-declarations': warn,
1081
+ 'no-class-assign': warn,
1082
+ 'no-compare-neg-zero': warn,
1083
+ 'no-cond-assign': warn,
1084
+ 'no-confusing-arrow': warn,
1085
+ 'no-console': [warn, { allow: ['debug', 'error', 'info', 'warn'] }],
1086
+ 'no-const-assign': warn,
1087
+ 'no-constant-condition': [warn, { checkLoops: false }],
1088
+ 'no-continue': warn,
1089
+ 'no-control-regex': off,
1090
+ 'no-debugger': warn,
1091
+ 'no-delete-var': warn,
1092
+ 'no-div-regex': warn,
1093
+ 'no-dupe-args': warn,
1094
+ 'no-dupe-class-members': warn,
1095
+ 'no-dupe-keys': warn,
1096
+ 'no-duplicate-case': warn,
1097
+ 'no-duplicate-imports': warn,
1098
+ 'no-else-return': warn,
1099
+ 'no-empty': [warn, { allowEmptyCatch: true }],
1100
+ 'no-empty-character-class': warn,
1101
+ 'no-empty-function': off,
1102
+ 'no-empty-pattern': off,
1103
+ 'no-eq-null': off,
1104
+ 'no-eval': warn,
1105
+ 'no-ex-assign': warn,
1106
+ 'no-extend-native': warn,
1107
+ 'no-extra-bind': warn,
1108
+ 'no-extra-boolean-cast': warn,
1109
+ 'no-extra-label': warn,
1110
+ 'no-extra-parens': [off, 'all', { nestedBinaryExpressions: false }],
1111
+ 'no-extra-semi': warn,
1112
+ 'no-fallthrough': warn,
1113
+ 'no-floating-decimal': warn,
1114
+ 'no-func-assign': warn,
1115
+ 'no-global-assign': warn,
1116
+ 'no-implicit-coercion': [
1117
+ warn,
1118
+ {
1119
+ boolean: false,
1120
+ },
1121
+ ],
1122
+ 'no-implicit-globals': warn,
1123
+ 'no-implied-eval': warn,
1124
+ 'no-inline-comments': off,
1125
+ 'no-inner-declarations': [warn, 'functions'],
1126
+ 'no-invalid-regexp': warn,
1127
+ 'no-invalid-this': off,
1128
+ 'no-irregular-whitespace': warn,
1129
+ 'no-iterator': warn,
1130
+ 'no-label-var': warn,
1131
+ 'no-labels': [warn, { allowLoop: false, allowSwitch: false }],
1132
+ 'no-lone-blocks': off,
1133
+ 'no-lonely-if': warn,
1134
+ 'no-loop-func': warn,
1135
+ 'no-loss-of-precision': warn,
1136
+ 'no-magic-numbers': [
1137
+ off,
1138
+ {
1139
+ ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'],
1140
+ },
1141
+ ],
1142
+ 'no-misleading-character-class': warn,
1143
+ 'no-mixed-operators': [
1144
+ warn,
1145
+ {
1146
+ allowSamePrecedence: true,
1147
+ groups: [
1148
+ ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
1149
+ ['&&', '||'],
1150
+ ['in', 'instanceof'],
1151
+ ],
1152
+ },
1153
+ ],
1154
+ 'no-mixed-requires': warn,
1155
+ 'no-mixed-spaces-and-tabs': warn,
1156
+ 'no-multi-assign': warn,
1157
+ 'no-multi-spaces': warn,
1158
+ 'no-multi-str': warn,
1159
+ 'no-multiple-empty-lines': [warn, { max: 1, maxEOF: 0 }],
1160
+ 'no-negated-condition': warn,
1161
+ 'no-negated-in-lhs': warn,
1162
+ 'no-nested-ternary': warn,
1163
+ 'no-new': warn,
1164
+ 'no-new-func': warn,
1165
+ 'no-new-object': warn,
1166
+ 'no-new-require': warn,
1167
+ 'no-new-symbol': warn,
1168
+ 'no-new-wrappers': off,
1169
+ 'no-obj-calls': warn,
1170
+ 'no-octal': warn,
1171
+ 'no-octal-escape': warn,
1172
+ 'no-param-reassign': off,
1173
+ 'no-path-concat': warn,
1174
+ 'no-plusplus': off,
1175
+ 'no-process-env': off,
1176
+ 'no-process-exit': off,
1177
+ 'no-proto': warn,
1178
+ 'no-prototype-builtins': warn,
1179
+ 'no-redeclare': [warn, { builtinGlobals: false }],
1180
+ 'no-regex-spaces': warn,
1181
+ 'no-restricted-globals': warn,
1182
+ 'no-restricted-imports': warn,
1183
+ 'no-restricted-modules': warn,
1184
+ 'no-restricted-properties': warn,
1185
+ 'no-restricted-syntax': [
1186
+ warn,
1187
+ 'FunctionDeclaration',
1188
+ 'LabeledStatement',
1189
+ 'WithStatement',
1190
+ ],
1191
+ 'no-return-assign': [warn, 'except-parens'],
1192
+ 'no-return-await': off,
1193
+ 'no-script-url': warn,
1194
+ 'no-self-assign': [warn, { props: true }],
1195
+ 'no-self-compare': warn,
1196
+ 'no-sequences': warn,
1197
+ 'no-shadow': warn,
1198
+ 'no-shadow-restricted-names': warn,
1199
+ 'no-sparse-arrays': warn,
1200
+ 'no-sync': warn,
1201
+ 'no-tabs': warn,
1202
+ 'no-template-curly-in-string': warn,
1203
+ 'no-ternary': off,
1204
+ 'no-this-before-super': warn,
1205
+ 'no-throw-literal': warn,
1206
+ 'no-trailing-spaces': warn,
1207
+ 'no-undef': error,
1208
+ 'no-undef-init': warn,
1209
+ 'no-undefined': off,
1210
+ 'no-underscore-dangle': off,
1211
+ 'no-unexpected-multiline': warn,
1212
+ 'no-unmodified-loop-condition': warn,
1213
+ 'no-unneeded-ternary': [warn, { defaultAssignment: false }],
1214
+ 'no-unreachable': warn,
1215
+ 'no-unsafe-finally': warn,
1216
+ 'no-unsafe-negation': warn,
1217
+ 'no-unused-expressions': [
1218
+ warn,
1219
+ {
1220
+ allowShortCircuit: true,
1221
+ allowTaggedTemplates: true,
1222
+ allowTernary: true,
1223
+ },
1224
+ ],
1225
+ 'no-unused-labels': warn,
1226
+ 'no-unused-vars': [
1227
+ warn,
1228
+ {
1229
+ args: 'after-used',
1230
+ argsIgnorePattern: '^_.*$',
1231
+ vars: 'all',
1232
+ varsIgnorePattern: '^_.*$|^T$',
1233
+ },
1234
+ ],
1235
+ 'no-use-before-define': [
1236
+ error,
1237
+ {
1238
+ classes: false,
1239
+ functions: false,
1240
+ variables: false,
1241
+ },
1242
+ ],
1243
+ 'no-useless-call': warn,
1244
+ 'no-useless-catch': warn,
1245
+ 'no-useless-computed-key': warn,
1246
+ 'no-useless-concat': warn,
1247
+ 'no-useless-constructor': warn,
1248
+ 'no-useless-escape': warn,
1249
+ 'no-useless-rename': warn,
1250
+ 'no-useless-return': warn,
1251
+ 'no-var': warn,
1252
+ 'no-void': warn,
1253
+ 'no-warning-comments': warn,
1254
+ 'no-whitespace-before-property': warn,
1255
+ 'no-with': warn,
1256
+ 'nonblock-statement-body-position': warn,
1257
+ 'object-curly-newline': [warn, { consistent: true, multiline: true }],
1258
+ 'object-curly-spacing': [warn, 'always'],
1259
+ 'object-property-newline': [
1260
+ warn,
1261
+ {
1262
+ allowMultiplePropertiesPerLine: true,
1263
+ },
1264
+ ],
1265
+ 'object-shorthand': [warn, 'always'],
1266
+ 'one-var': [warn, 'never'],
1267
+ 'one-var-declaration-per-line': warn,
1268
+ 'operator-assignment': [warn, 'always'],
1269
+ 'operator-linebreak': [
1270
+ warn,
1271
+ 'after',
1272
+ {
1273
+ overrides: {
1274
+ ':': 'before',
1275
+ '?': 'before',
1276
+ '??': 'before',
1277
+ },
1278
+ },
1279
+ ],
1280
+ 'padded-blocks': [
1281
+ warn,
1282
+ {
1283
+ blocks: 'never',
1284
+ classes: 'never',
1285
+ switches: 'never',
1286
+ },
1287
+ ],
1288
+ 'padding-line-between-statements': warn,
1289
+ 'prefer-arrow-callback': warn,
1290
+ 'prefer-const': [warn, { destructuring: 'all' }],
1291
+ 'prefer-destructuring': [off, { array: false, object: true }],
1292
+ 'prefer-named-capture-group': off,
1293
+ 'prefer-numeric-literals': warn,
1294
+ 'prefer-object-spread': warn,
1295
+ 'prefer-promise-reject-errors': warn,
1296
+ 'prefer-regex-literals': warn,
1297
+ 'prefer-rest-params': warn,
1298
+ 'prefer-spread': warn,
1299
+ 'prefer-template': off,
1300
+ 'quote-props': [warn, 'as-needed'],
1301
+ quotes: [
1302
+ warn,
1303
+ 'single',
1304
+ {
1305
+ allowTemplateLiterals: false,
1306
+ avoidEscape: true,
1307
+ },
1308
+ ],
1309
+ radix: warn,
1310
+ // Disabled due to false (?) positives:
1311
+ 'require-atomic-updates': off,
1312
+ 'require-await': warn,
1313
+ 'require-unicode-regexp': off,
1314
+ 'require-yield': warn,
1315
+ 'rest-spread-spacing': [warn, 'never'],
1316
+ semi: [warn, 'always'],
1317
+ 'semi-spacing': [warn, { after: true, before: false }],
1318
+ 'semi-style': [warn, 'last'],
1319
+ 'sort-imports': [
1320
+ off,
1321
+ {
1322
+ ignoreCase: false,
1323
+ ignoreDeclarationSort: false,
1324
+ ignoreMemberSort: false,
1325
+ memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
1326
+ },
1327
+ ],
1328
+ 'sort-keys': off,
1329
+ 'sort-keys/sort-keys-fix': [warn, 'asc', { natural: false }],
1330
+ 'sort-vars': warn,
1331
+ 'space-before-blocks': [warn, 'always'],
1332
+ 'space-before-function-paren': [warn, 'always'],
1333
+ 'space-in-parens': [warn, 'never'],
1334
+ 'space-infix-ops': warn,
1335
+ 'space-unary-ops': [warn, { nonwords: false, words: true }],
1336
+ 'spaced-comment': [
1337
+ warn,
1338
+ 'always',
1339
+ {
1340
+ block: {
1341
+ balanced: true,
1342
+ exceptions: ['*'],
1343
+ },
1344
+ line: {
1345
+ markers: ['!', '?', '*', '/', '//'],
1346
+ },
1347
+ },
1348
+ ],
1349
+ strict: [warn, 'never'],
1350
+ 'switch-colon-spacing': [
1351
+ warn,
1352
+ {
1353
+ after: true,
1354
+ before: false,
1355
+ },
1356
+ ],
1357
+ 'symbol-description': warn,
1358
+ 'template-curly-spacing': [warn, 'never'],
1359
+ 'template-tag-spacing': [warn, 'never'],
1360
+ 'unicode-bom': [warn, 'never'],
1361
+ 'use-isnan': warn,
1362
+ 'valid-typeof': [warn, { requireStringLiterals: true }],
1363
+ 'vars-on-top': warn,
1364
+ 'wrap-iife': [warn, 'any', { functionPrototypeMethods: true }],
1365
+ 'wrap-regex': off,
1366
+ 'yield-star-spacing': [warn, 'both'],
1367
+ yoda: [warn, 'never'],
1368
+ },
1369
+ settings: {
1370
+ 'import/extensions': ['.js', '.ts'],
1371
+ 'import/internal-regex': '^@',
1372
+ jsdoc: {
1373
+ mode: 'closure',
1374
+ },
1375
+ react: {
1376
+ version: 'detect',
1377
+ },
1378
+ },
1379
+ };