1
+ import js from '@eslint/js' ;
1
2
import stylisticPlugin from '@stylistic/eslint-plugin' ;
2
3
import * as importPlugin from 'eslint-plugin-import-x' ;
3
4
import promise from 'eslint-plugin-promise' ;
@@ -35,71 +36,44 @@ export function prepareConfig() {
35
36
promise
36
37
} ,
37
38
rules : {
39
+ ...js . configs . recommended . rules ,
38
40
'accessor-pairs' : 'error' ,
39
41
'array-callback-return' : 'error' ,
40
42
'arrow-body-style' : 'error' ,
41
43
'block-spacing' : 'error' ,
42
44
'brace-style' : 'error' ,
43
45
'camelcase' : 'error' ,
44
46
'consistent-return' : 'error' ,
45
- 'constructor-super' : 'error' ,
46
47
'curly' : 'error' ,
47
48
'default-case' : 'error' ,
48
49
'default-case-last' : 'error' ,
49
50
'dot-notation' : 'error' ,
50
51
'eqeqeq' : 'error' ,
51
- 'for-direction' : 'error' ,
52
52
'func-names' : 'error' ,
53
53
'func-style' : [ 'error' , 'declaration' , { allowArrowFunctions : true } ] ,
54
- 'getter-return' : 'error' ,
55
54
'grouped-accessor-pairs' : 'error' ,
56
55
'guard-for-in' : 'error' ,
57
56
'new-cap' : 'error' ,
58
57
'no-alert' : 'error' ,
59
58
'no-array-constructor' : 'error' ,
60
- 'no-async-promise-executor' : 'error' ,
61
59
'no-await-in-loop' : 'error' ,
62
60
'no-caller' : 'error' ,
63
- 'no-case-declarations' : 'error' ,
64
- 'no-class-assign' : 'error' ,
65
- 'no-compare-neg-zero' : 'error' ,
66
61
'no-cond-assign' : [ 'error' , 'always' ] ,
67
62
'no-console' : 'error' ,
68
- 'no-const-assign' : 'error' ,
69
- 'no-constant-binary-expression' : 'error' ,
70
- 'no-constant-condition' : 'error' ,
71
63
'no-constructor-return' : 'error' ,
72
64
'no-continue' : 'error' ,
73
- 'no-control-regex' : 'error' ,
74
- 'no-debugger' : 'error' ,
75
- 'no-delete-var' : 'error' ,
76
65
'no-div-regex' : 'error' ,
77
- 'no-dupe-args' : 'error' ,
78
- 'no-dupe-class-members' : 'error' ,
79
- 'no-dupe-else-if' : 'error' ,
80
- 'no-dupe-keys' : 'error' ,
81
- 'no-duplicate-case' : 'error' ,
82
66
'no-else-return' : 'error' ,
83
67
'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
84
- 'no-empty-character-class' : 'error' ,
85
68
'no-empty-function' : 'error' ,
86
- 'no-empty-pattern' : 'error' ,
87
- 'no-empty-static-block' : 'error' ,
88
69
'no-eval' : 'error' ,
89
- 'no-ex-assign' : 'error' ,
90
70
'no-extend-native' : 'error' ,
91
71
'no-extra-bind' : 'error' ,
92
- 'no-extra-boolean-cast' : 'error' ,
93
72
'no-fallthrough' : [ 'error' , { allowEmptyCase : true } ] ,
94
- 'no-func-assign' : 'error' ,
95
- 'no-global-assign' : 'error' ,
96
73
'no-implicit-coercion' : [ 'error' , { allow : [ '!!' ] } ] ,
97
74
'no-implied-eval' : 'error' ,
98
- 'no-import-assign' : 'error' ,
99
75
'no-inner-declarations' : 'error' ,
100
- 'no-invalid-regexp' : 'error' ,
101
76
'no-invalid-this' : 'error' ,
102
- 'no-irregular-whitespace' : 'error' ,
103
77
'no-iterator' : 'error' ,
104
78
'no-labels' : 'error' ,
105
79
'no-lone-blocks' : 'error' ,
@@ -115,46 +89,28 @@ export function prepareConfig() {
115
89
ignoreDefaultValues : true
116
90
}
117
91
] ,
118
- 'no-misleading-character-class' : 'error' ,
119
92
'no-multi-assign' : 'error' ,
120
93
'no-multi-str' : 'error' ,
121
94
'no-negated-condition' : 'error' ,
122
95
'no-nested-ternary' : 'warn' ,
123
96
'no-new' : 'error' ,
124
97
'no-new-func' : 'error' ,
125
- 'no-new-native-nonconstructor' : 'error' ,
126
98
'no-new-wrappers' : 'error' ,
127
- 'no-nonoctal-decimal-escape' : 'error' ,
128
- 'no-obj-calls' : 'error' ,
129
99
'no-object-constructor' : 'error' ,
130
- 'no-octal' : 'error' ,
131
100
'no-octal-escape' : 'error' ,
132
101
'no-param-reassign' : 'error' ,
133
102
'no-promise-executor-return' : 'error' ,
134
- 'no-redeclare' : 'error' ,
135
- 'no-regex-spaces' : 'error' ,
136
103
'no-return-assign' : 'error' ,
137
104
'no-script-url' : 'error' ,
138
- 'no-self-assign' : 'error' ,
139
105
'no-self-compare' : 'error' ,
140
106
'no-sequences' : 'error' ,
141
- 'no-setter-return' : 'error' ,
142
107
'no-shadow' : 'error' ,
143
- 'no-shadow-restricted-names' : 'error' ,
144
- 'no-sparse-arrays' : 'error' ,
145
108
'no-template-curly-in-string' : 'warn' ,
146
- 'no-this-before-super' : 'error' ,
147
109
'no-throw-literal' : 'error' ,
148
- 'no-undef' : 'error' ,
149
110
'no-undef-init' : 'error' ,
150
- 'no-unexpected-multiline' : 'error' ,
151
111
'no-unmodified-loop-condition' : 'error' ,
152
- 'no-unreachable' : 'error' ,
153
112
'no-unreachable-loop' : 'error' ,
154
- 'no-unsafe-finally' : 'error' ,
155
- 'no-unsafe-negation' : 'error' ,
156
113
'no-unused-expressions' : 'error' ,
157
- 'no-unused-labels' : 'error' ,
158
114
'no-unused-vars' : [
159
115
'error' ,
160
116
{
@@ -165,17 +121,14 @@ export function prepareConfig() {
165
121
] ,
166
122
'no-use-before-define' : [ 'error' , { classes : true , functions : false , variables : true } ] ,
167
123
'no-useless-call' : 'error' ,
168
- 'no-useless-catch' : 'error' ,
169
124
'no-useless-computed-key' : 'error' ,
170
125
'no-useless-concat' : 'error' ,
171
126
'no-useless-constructor' : 'error' ,
172
- 'no-useless-escape' : 'error' ,
173
127
'no-useless-rename' : 'error' ,
174
128
'no-useless-return' : 'error' ,
175
129
'no-var' : 'error' ,
176
130
'no-void' : [ 'error' , { allowAsStatement : true } ] ,
177
131
'no-warning-comments' : 'error' ,
178
- 'no-with' : 'error' ,
179
132
'object-shorthand' : 'error' ,
180
133
'one-var' : [ 'error' , 'never' ] ,
181
134
'operator-assignment' : 'error' ,
@@ -193,9 +146,7 @@ export function prepareConfig() {
193
146
'radix' : 'error' ,
194
147
'require-atomic-updates' : 'error' ,
195
148
'require-await' : 'error' ,
196
- 'require-yield' : 'error' ,
197
149
'symbol-description' : 'error' ,
198
- 'use-isnan' : 'error' ,
199
150
'valid-typeof' : [ 'error' , { requireStringLiterals : true } ] ,
200
151
'yoda' : [ 'error' , 'never' , { exceptRange : true } ] ,
201
152
@@ -346,14 +297,15 @@ export function prepareConfig() {
346
297
'dot-notation' : 'off' ,
347
298
'no-array-constructor' : 'off' ,
348
299
'no-empty-function' : 'off' ,
349
- 'no-- implicit-returns' : 'off' ,
300
+ 'no-implicit-returns' : 'off' ,
350
301
'no-implied-eval' : 'off' ,
351
302
'no-invalid-this' : 'off' ,
352
303
'no-loop-func' : 'off' ,
353
304
'no-loss-of-precision' : 'off' ,
354
305
'no-magic-numbers' : 'off' ,
355
306
'no-shadow' : 'off' ,
356
307
'no-throw-literal' : 'off' , // extended by tseslint/only-throw-error
308
+ 'no-unsafe-optional-chaining' : 'off' ,
357
309
'no-unused-expressions' : 'off' ,
358
310
'no-unused-vars' : 'off' ,
359
311
'no-use-before-define' : 'off' ,
0 commit comments