@@ -9,7 +9,7 @@ const rules = {
9
9
'no-await-in-loop' : 0 ,
10
10
'no-compare-neg-zero' : 2 ,
11
11
'no-cond-assign' : 2 ,
12
- 'no-console' : 0 ,
12
+ 'no-console' : 1 ,
13
13
'no-constant-condition' : 2 ,
14
14
'no-control-regex' : 2 ,
15
15
'no-debugger' : 2 ,
@@ -22,7 +22,7 @@ const rules = {
22
22
'no-ex-assign' : 2 ,
23
23
'no-extra-boolean-cast' : 2 ,
24
24
'no-extra-parens' : 0 , // replaced by @typescript -eslint/no-extra-parens
25
- 'no-extra-semi' : 2 ,
25
+ 'no-extra-semi' : 0 , // replaced by @typescript -eslint/no-extra-semi
26
26
'no-func-assign' : 2 ,
27
27
'no-import-assign' : 2 ,
28
28
'no-inner-declarations' : 0 ,
@@ -346,7 +346,7 @@ const rules = {
346
346
'react/jsx-curly-newline' : 1 ,
347
347
'react/jsx-curly-spacing' : 1 ,
348
348
'react/jsx-equals-spacing' : 1 ,
349
- 'react/jsx-filename-extension' : [ 1 , { extensions : [ '.js' , '.tsx' ] } ] ,
349
+ 'react/jsx-filename-extension' : [ 1 , { extensions : [ '.js' , '.tsx' ] } ] , // TODO: remove .js
350
350
'react/jsx-first-prop-new-line' : 1 ,
351
351
'react/jsx-handler-names' : 0 ,
352
352
'react/jsx-indent' : [ 1 , 2 ] ,
@@ -392,6 +392,48 @@ const rules = {
392
392
'react-hooks/rules-of-hooks' : 2 ,
393
393
'react-hooks/exhaustive-deps' : 1 ,
394
394
395
+ // https://github.com/jest-community/eslint-plugin-jest#rules
396
+ 'jest/consistent-test-it' : 1 ,
397
+ 'jest/expect-expect' : 0 ,
398
+ 'jest/lowercase-name' : 0 ,
399
+ 'jest/no-alias-methods' : 1 ,
400
+ 'jest/no-commented-out-tests' : 0 , // TODO
401
+ 'jest/no-disabled-tests' : 0 ,
402
+ 'jest/no-duplicate-hooks' : 2 ,
403
+ 'jest/no-expect-resolves' : 0 ,
404
+ 'jest/no-export' : 1 ,
405
+ 'jest/no-focused-tests' : 1 ,
406
+ 'jest/no-hooks' : 0 , // TODO
407
+ 'jest/no-identical-title' : 2 ,
408
+ 'jest/no-if' : 1 ,
409
+ 'jest/no-jasmine-globals' : 1 ,
410
+ 'jest/no-jest-import' : 1 ,
411
+ 'jest/no-large-snapshots' : 0 ,
412
+ 'jest/no-mocks-import' : 1 ,
413
+ 'jest/no-standalone-expect' : 2 ,
414
+ 'jest/no-test-callback' : 0 ,
415
+ 'jest/no-test-prefixes' : 0 ,
416
+ 'jest/no-test-return-statement' : 0 ,
417
+ 'jest/no-truthy-falsy' : 1 ,
418
+ 'jest/no-try-expect' : 1 ,
419
+ 'jest/prefer-called-with' : 0 ,
420
+ 'jest/prefer-expect-assertions' : 0 ,
421
+ 'jest/prefer-hooks-on-top' : 0 ,
422
+ 'jest/prefer-inline-snapshots' : 0 ,
423
+ 'jest/prefer-spy-on' : 2 ,
424
+ 'jest/prefer-strict-equal' : 1 ,
425
+ 'jest/prefer-to-be-null' : 1 ,
426
+ 'jest/prefer-to-be-undefined' : 1 ,
427
+ 'jest/prefer-to-contain' : 1 ,
428
+ 'jest/prefer-to-have-length' : 1 ,
429
+ 'jest/prefer-todo' : 1 ,
430
+ 'jest/require-top-level-describe' : 0 ,
431
+ 'jest/require-to-throw-message' : 0 ,
432
+ 'jest/valid-describe' : 2 ,
433
+ 'jest/valid-expect-in-promise' : 1 ,
434
+ 'jest/valid-expect' : [ 1 , { alwaysAwait : true } ] ,
435
+ 'jest/valid-title' : 2 ,
436
+
395
437
// SonarJS rules
396
438
// https://github.com/SonarSource/eslint-plugin-sonarjs#rules
397
439
'sonarjs/no-all-duplicated-branches' : 2 ,
@@ -430,7 +472,7 @@ const rules = {
430
472
'@typescript-eslint/brace-style' : [ 1 , '1tbs' , { allowSingleLine : true } ] ,
431
473
'@typescript-eslint/camelcase' : 0 ,
432
474
'@typescript-eslint/class-name-casing' : 0 ,
433
- '@typescript-eslint/consistent-type-assertions' : [ 2 , { assertionStyle : 'as' , objectLiteralTypeAssertions : 'allow' } ] ,
475
+ '@typescript-eslint/consistent-type-assertions' : [ 2 , { assertionStyle : 'as' , objectLiteralTypeAssertions : 'allow' } ] , // TODO: allow -> never
434
476
'@typescript-eslint/consistent-type-definitions' : [ 1 , 'interface' ] ,
435
477
'@typescript-eslint/explicit-function-return-type' : 0 ,
436
478
'@typescript-eslint/explicit-member-accessibility' : 0 ,
@@ -451,9 +493,11 @@ const rules = {
451
493
nestedBinaryExpressions : false ,
452
494
ignoreJSX : 'all'
453
495
} ] ,
496
+ '@typescript-eslint/no-extra-semi' : 2 ,
454
497
'@typescript-eslint/no-extraneous-class' : 2 ,
455
498
'@typescript-eslint/no-floating-promises' : 0 ,
456
499
'@typescript-eslint/no-for-in-array' : 0 ,
500
+ '@typescript-eslint/no-implied-eval' : 0 ,
457
501
'@typescript-eslint/no-inferrable-types' : 1 ,
458
502
'@typescript-eslint/no-magic-numbers' : 0 ,
459
503
'@typescript-eslint/no-misused-new' : 2 ,
@@ -463,6 +507,7 @@ const rules = {
463
507
'@typescript-eslint/no-parameter-properties' : 0 ,
464
508
'@typescript-eslint/no-require-imports' : 1 ,
465
509
'@typescript-eslint/no-this-alias' : 0 ,
510
+ '@typescript-eslint/no-throw-literal' : 0 ,
466
511
'@typescript-eslint/no-type-alias' : 0 ,
467
512
'@typescript-eslint/no-unnecessary-condition' : 0 ,
468
513
'@typescript-eslint/no-unnecessary-qualifier' : 0 ,
@@ -518,22 +563,21 @@ module.exports = {
518
563
plugins : [
519
564
'react' ,
520
565
'react-hooks' ,
566
+ 'jest' ,
521
567
'sonarjs' ,
522
568
'@typescript-eslint'
523
569
] ,
524
570
rules,
525
571
overrides : [ {
572
+ // TODO: remove
526
573
files : [
527
- 'examples/**/*' ,
528
- 'src/**/*'
574
+ 'examples/**/*'
529
575
] ,
530
576
env : {
531
577
browser : true
532
- } ,
533
- globals : {
534
- process : 'readable'
535
578
}
536
579
} , {
580
+ // TODO: remove
537
581
files : [
538
582
'src/**/__tests__/**/*'
539
583
] ,
@@ -550,8 +594,7 @@ module.exports = {
550
594
files : [
551
595
'babel.config.js' ,
552
596
'jest.config.js' ,
553
- 'webpack-dev-server.mjs' ,
554
- 'tools/**/*.mjs'
597
+ '*.mjs'
555
598
] ,
556
599
env : {
557
600
node : true
@@ -571,9 +614,6 @@ module.exports = {
571
614
] ,
572
615
parserOptions : {
573
616
sourceType : 'script'
574
- } ,
575
- rules : {
576
- '@typescript-eslint/no-require-imports' : 0
577
617
}
578
618
} ]
579
619
} ;
0 commit comments