1
1
module . exports = {
2
- plugins : [ 'import' , 'eslint-comments' , 'eslint-plugin-tsdoc' , 'functional' ] ,
3
2
extends : [
4
3
'eslint:all' ,
5
4
'plugin:@typescript-eslint/all' ,
@@ -8,40 +7,56 @@ module.exports = {
8
7
'plugin:functional/all' ,
9
8
'prettier' ,
10
9
] ,
10
+ plugins : [ 'import' , 'eslint-comments' , 'eslint-plugin-tsdoc' , 'functional' ] ,
11
11
rules : {
12
- 'max-lines' : [ 'error' , 1000 ] ,
13
- 'max-params' : [ 'error' , 3 ] ,
14
- complexity : [ 'error' , 5 ] ,
15
- 'max-statements' : 'off' ,
16
- 'max-lines-per-function' : 'off' ,
17
- 'default-case' : 'off' ,
18
- '@typescript-eslint/ban-ts-ignore' : 'off' , // deprecated in favor of @typescript -eslint/ban-ts-comment
19
- '@typescript-eslint/no-type-alias' : 'off' ,
20
- 'tsdoc/syntax' : 'warn' ,
21
- 'line-comment-position' : [ 'error' , { ignorePattern : 'cspell' } ] ,
22
- 'no-inline-comments' : 'off' ,
23
- 'capitalized-comments' : 'off' ,
24
- 'id-length' : 'off' ,
25
- 'no-undefined' : 'off' ,
12
+ '@typescript-eslint/consistent-indexed-object-style' : [
13
+ 'error' ,
14
+ 'index-signature' ,
15
+ ] ,
16
+ '@typescript-eslint/consistent-type-definitions' : [ 'error' , 'type' ] ,
17
+ '@typescript-eslint/explicit-function-return-type' : 'off' ,
18
+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
19
+ '@typescript-eslint/max-params' : 'error' ,
20
+ '@typescript-eslint/naming-convention' : [
21
+ 'error' ,
22
+ {
23
+ format : [ 'camelCase' ] ,
24
+ leadingUnderscore : 'allow' ,
25
+ selector : 'default' ,
26
+ } ,
27
+ {
28
+ format : [ 'camelCase' , 'UPPER_CASE' ] ,
29
+ leadingUnderscore : 'allow' ,
30
+ selector : 'variable' ,
31
+ } ,
32
+ { format : [ 'PascalCase' ] , selector : 'typeLike' } ,
33
+ { selector : 'enumMember' , format : [ 'camelCase' , 'UPPER_CASE' ] } , // Allow UPPER_CASE for opcodes
34
+ ] ,
35
+ '@typescript-eslint/no-loss-of-precision' : [ 'error' ] ,
26
36
'@typescript-eslint/no-magic-numbers' : [
27
37
'error' ,
28
38
{
29
- ignoreNumericLiteralTypes : true ,
30
- ignoreEnums : true ,
31
- ignoreArrayIndexes : true ,
32
39
ignore : [ - 1 , 0 , 1 , '-1n' , '0n' , '1n' ] ,
40
+ ignoreArrayIndexes : true ,
41
+ ignoreEnums : true ,
42
+ ignoreNumericLiteralTypes : true ,
33
43
} ,
34
44
] ,
35
- '@typescript-eslint/restrict-template-expressions' : [
45
+ '@typescript-eslint/no-unused-vars' : 'off' , // already checked by TypeScript's noUnusedLocals and noUnusedParameters (this rule emits false positives on TSDoc `@link` usage)
46
+ '@typescript-eslint/prefer-literal-enum-member' : [
36
47
'error' ,
37
- { allowNumber : true } ,
48
+ { allowBitwiseExpressions : true } ,
38
49
] ,
39
- 'eslint-comments/disable-enable-pair' : [
50
+ '@typescript-eslint/prefer-readonly-parameter-types' : 'off' ,
51
+ '@typescript-eslint/restrict-template-expressions' : [
40
52
'error' ,
41
- {
42
- allowWholeFile : true ,
43
- } ,
53
+ { allowNumber : true } ,
44
54
] ,
55
+ '@typescript-eslint/typedef' : 'off' ,
56
+ 'capitalized-comments' : 'off' ,
57
+ complexity : [ 'error' , 5 ] ,
58
+ 'default-case' : 'off' ,
59
+ 'eslint-comments/disable-enable-pair' : [ 'error' , { allowWholeFile : true } ] ,
45
60
'eslint-comments/no-aggregating-enable' : 'error' ,
46
61
'eslint-comments/no-duplicate-disable' : 'error' ,
47
62
'eslint-comments/no-unlimited-disable' : 'error' ,
@@ -59,58 +74,59 @@ module.exports = {
59
74
] ,
60
75
} ,
61
76
] ,
77
+ 'functional/functional-parameters' : [
78
+ 'error' ,
79
+ {
80
+ allowArgumentsKeyword : false ,
81
+ allowRestParameter : false ,
82
+ enforceParameterCount : false ,
83
+ } ,
84
+ ] ,
85
+ 'functional/no-conditional-statements' : [
86
+ 'error' ,
87
+ { allowReturningBranches : true } ,
88
+ ] ,
89
+ 'functional/prefer-immutable-types' : 'off' ,
90
+ 'functional/type-declaration-immutability' : 'off' ,
91
+ 'id-length' : 'off' ,
92
+ 'import/extensions' : [ 'error' , 'always' ] ,
62
93
'import/first' : 'error' ,
63
94
'import/newline-after-import' : 'error' ,
64
95
'import/no-absolute-path' : 'error' ,
65
96
'import/no-amd' : 'error' ,
97
+ 'import/no-commonjs' : 'error' ,
66
98
'import/no-cycle' : 'error' ,
67
99
'import/no-default-export' : 'error' ,
100
+ 'import/no-duplicates' : 'error' ,
101
+ 'import/no-extraneous-dependencies' : [ 'error' , { devDependencies : true } ] ,
102
+ 'import/no-internal-modules' : [ 'error' ] ,
68
103
'import/no-mutable-exports' : 'error' ,
69
104
'import/no-named-default' : 'error' ,
70
- 'import/no-commonjs' : 'error' ,
71
105
'import/no-named-export' : 'off' ,
72
106
'import/no-self-import' : 'error' ,
73
107
'import/no-useless-path-segments' : 'error' ,
74
- 'import/no-extraneous-dependencies' : [ 'error' , { devDependencies : true } ] ,
75
108
'import/order' : [
76
109
'error' ,
77
- {
78
- 'newlines-between' : 'always' ,
79
- alphabetize : {
80
- order : 'asc' ,
81
- } ,
82
- } ,
83
- ] ,
84
- 'no-duplicate-imports' : 'off' ,
85
- 'import/no-duplicates' : 'error' ,
86
- 'sort-imports' : [
87
- 'error' ,
88
- {
89
- ignoreDeclarationSort : true ,
90
- ignoreCase : true ,
91
- } ,
110
+ { alphabetize : { order : 'asc' } , 'newlines-between' : 'always' } ,
92
111
] ,
93
112
'import/prefer-default-export' : 'off' ,
94
- 'functional/no-conditional-statements' : [
95
- 'error' ,
96
- { allowReturningBranches : true } ,
97
- ] ,
98
- '@typescript-eslint/explicit-function-return-type' : 'off' ,
99
- '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
100
- '@typescript-eslint/prefer-literal-enum-member' : [
101
- 'error' ,
102
- { allowBitwiseExpressions : true } ,
103
- ] ,
104
- 'one-var' : 'off' ,
105
- '@typescript-eslint/typedef' : 'off' ,
106
- 'no-ternary' : 'off' ,
113
+ 'line-comment-position' : [ 'error' , { ignorePattern : 'cspell' } ] ,
114
+ 'max-lines' : [ 'error' , 1000 ] ,
115
+ 'max-lines-per-function' : 'off' ,
116
+ 'max-params' : 'off' ,
117
+ 'max-statements' : 'off' ,
118
+ 'no-duplicate-imports' : 'off' ,
119
+ 'no-inline-comments' : 'off' ,
120
+ 'no-loss-of-precision' : 'off' ,
107
121
'no-nested-ternary' : 'off' ,
122
+ 'no-ternary' : 'off' ,
123
+ 'no-undefined' : 'off' ,
108
124
'no-warning-comments' : 'off' ,
109
- 'no-loss-of-precision' : 'off' ,
110
- '@typescript-eslint/no-loss-of-precision' : [ 'error' ] ,
111
- '@typescript-eslint/consistent-indexed-object-style' : [
125
+ 'one-var' : 'off' ,
126
+ 'sort-imports' : [
112
127
'error' ,
113
- 'index-signature' ,
128
+ { ignoreCase : true , ignoreDeclarationSort : true } ,
114
129
] ,
130
+ 'tsdoc/syntax' : 'warn' ,
115
131
} ,
116
132
} ;
0 commit comments