@@ -8,60 +8,68 @@ const ruleOverridesForJs = Object.keys(
8
8
{ }
9
9
) ;
10
10
11
+ const sharedRules = {
12
+ indent : 0 ,
13
+ 'brace-style' : 0 ,
14
+ 'chai-friendly/no-unused-expressions' : 0 ,
15
+ 'mocha/no-exclusive-tests' : 2 ,
16
+ 'no-cond-assign' : [ 2 , 'except-parens' ] ,
17
+ 'no-console' : [ 1 , { allow : [ 'warn' , 'error' , 'info' ] } ] ,
18
+ 'no-empty-function' : 0 ,
19
+ 'no-shadow' : 0 ,
20
+ 'no-use-before-define' : 0 ,
21
+ 'object-curly-spacing' : [ 2 , 'always' ] ,
22
+ 'react/sort-comp' : 0 , // Does not seem work as expected with TypeScript.
23
+ 'restrict-template-expressions' : 0 ,
24
+ 'space-before-function-paren' : 0 ,
25
+ 'valid-jsdoc' : 0 ,
26
+ } ;
27
+
11
28
module . exports = {
12
29
plugins : [ 'mocha' , '@typescript-eslint' ] ,
13
30
parser : '@typescript-eslint/parser' , // Specifies the ESLint parser.
14
31
parserOptions : {
15
32
ecmaVersion : 2018 ,
16
33
sourceType : 'module' ,
17
- project : [ './tsconfig.json' ] ,
18
34
} ,
19
35
extends : [
20
36
'eslint-config-mongodb-js/react' ,
21
37
'plugin:@typescript-eslint/eslint-recommended' ,
22
38
'plugin:@typescript-eslint/recommended' ,
23
39
'plugin:@typescript-eslint/recommended-requiring-type-checking' ,
24
40
] ,
25
- rules : {
26
- 'chai-friendly/no-unused-expressions' : 0 ,
27
- 'object-curly-spacing' : [ 2 , 'always' ] ,
28
- 'no-empty-function' : 0 ,
29
- 'valid-jsdoc' : 0 ,
30
- 'react/sort-comp' : 0 , // Does not seem work as expected with typescript.
31
- '@typescript-eslint/no-empty-function' : 0 ,
32
- '@typescript-eslint/no-use-before-define' : 0 ,
33
- '@typescript-eslint/no-explicit-any' : 0 ,
34
- '@typescript-eslint/no-var-requires' : 0 ,
35
- '@typescript-eslint/no-unused-vars' : 2 ,
36
- '@typescript-eslint/explicit-module-boundary-types' : 0 ,
37
- '@typescript-eslint/ban-types' : 0 ,
38
- 'mocha/no-skipped-tests' : 1 ,
39
- 'mocha/no-exclusive-tests' : 2 ,
40
- semi : 0 ,
41
- '@typescript-eslint/semi' : [ 2 , 'always' ] ,
42
- 'no-console' : [ 1 , { allow : [ 'warn' , 'error' , 'info' ] } ] ,
43
- 'no-shadow' : 0 ,
44
- 'no-use-before-define' : 0 ,
45
- 'no-cond-assign' : [ 2 , 'except-parens' ] ,
46
- 'space-before-function-paren' : 0 ,
47
- '@typescript-eslint/no-floating-promises' : 0 ,
48
-
49
- 'restrict-template-expressions' : 0 ,
50
- '@typescript-eslint/restrict-template-expressions' : 0 ,
51
-
52
- '@typescript-eslint/no-floating-promises' : 2 ,
53
-
54
- // VV These rules we'd like to turn off one day so they error.
55
- '@typescript-eslint/no-unsafe-assignment' : 0 ,
56
- '@typescript-eslint/no-unsafe-member-access' : 0 ,
57
- '@typescript-eslint/no-unsafe-call' : 0 ,
58
- '@typescript-eslint/no-unsafe-return' : 0 ,
59
- } ,
60
41
overrides : [
42
+ {
43
+ files : [ '*.ts' , '*.tsx' ] ,
44
+ rules : {
45
+ ...sharedRules ,
46
+ semi : 0 ,
47
+ '@typescript-eslint/no-empty-function' : 0 ,
48
+ '@typescript-eslint/no-use-before-define' : 0 ,
49
+ '@typescript-eslint/no-explicit-any' : 0 ,
50
+ '@typescript-eslint/no-var-requires' : 0 ,
51
+ '@typescript-eslint/no-unused-vars' : 2 ,
52
+ '@typescript-eslint/explicit-module-boundary-types' : 0 ,
53
+ '@typescript-eslint/ban-types' : 0 ,
54
+ '@typescript-eslint/semi' : [ 2 , 'always' ] ,
55
+ '@typescript-eslint/restrict-template-expressions' : 0 ,
56
+ '@typescript-eslint/no-floating-promises' : 2 ,
57
+ // VV These rules we'd like to turn off one day so they error.
58
+ '@typescript-eslint/no-unsafe-assignment' : 0 ,
59
+ '@typescript-eslint/no-unsafe-member-access' : 0 ,
60
+ '@typescript-eslint/no-unsafe-call' : 0 ,
61
+ '@typescript-eslint/no-unsafe-return' : 0 ,
62
+ '@typescript-eslint/no-unsafe-argument' : 0 ,
63
+ } ,
64
+ parserOptions : {
65
+ project : [ './tsconfig.json' ] , // Specify it only for TypeScript files.
66
+ } ,
67
+ } ,
61
68
{
62
69
files : [ '**/*.js' ] ,
63
70
rules : {
64
71
...ruleOverridesForJs ,
72
+ ...sharedRules ,
65
73
semi : [ 2 , 'always' ] ,
66
74
} ,
67
75
} ,
0 commit comments