1
- import babelParser from "@babel/eslint-parser " ;
1
+ import { join } from "node:path " ;
2
2
import js from "@eslint/js" ;
3
- import globals from "globals " ;
3
+ import ts from "typescript-eslint " ;
4
4
5
- export default [
5
+ export default ts . config (
6
6
js . configs . recommended ,
7
+ ...ts . configs . strictTypeChecked ,
8
+ ...ts . configs . stylisticTypeChecked ,
7
9
{
8
10
languageOptions : {
9
- globals : { ...globals . nodeBuiltin } ,
10
- parser : babelParser ,
11
11
parserOptions : {
12
- requireConfigFile : false ,
13
- babelOptions : {
14
- babelrc : false ,
15
- configFile : false ,
16
- plugins : [ "@babel/plugin-syntax-import-attributes" ]
17
- }
12
+ project : "tsconfig.json" ,
13
+ tsconfigRootDir : join ( import . meta. dirname , ".." )
18
14
}
19
15
} ,
20
16
rules : {
@@ -28,7 +24,7 @@ export default [
28
24
"no-template-curly-in-string" : "error" ,
29
25
"no-unmodified-loop-condition" : "error" ,
30
26
"no-unreachable-loop" : "error" ,
31
- "no-use-before-define" : [ "error" , { functions : false } ] ,
27
+ "no-use-before-define" : "off" ,
32
28
"no-useless-assignment" : "error" ,
33
29
"require-atomic-updates" : [ "error" , { allowProperties : true } ] ,
34
30
@@ -53,7 +49,7 @@ export default [
53
49
"grouped-accessor-pairs" : "error" ,
54
50
"guard-for-in" : "error" ,
55
51
"id-denylist" : "error" ,
56
- "id-length" : [ "error" , { exceptions : [ "_" , "x" , "y" ] } ] ,
52
+ "id-length" : [ "error" , { exceptions : [ "_" , "$" , " x", "y" ] } ] ,
57
53
"id-match" : "error" ,
58
54
"init-declarations" : "error" ,
59
55
"logical-assignment-operators" : "error" ,
@@ -64,7 +60,6 @@ export default [
64
60
"max-nested-callbacks" : "error" ,
65
61
"max-params" : "off" ,
66
62
"max-statements" : [ "error" , { max : 25 } ] ,
67
- "multiline-comment-style" : [ "error" , "separate-lines" ] ,
68
63
"new-cap" : [ "error" , { capIsNewExceptions : [ "RangeError" , "SyntaxError" , "TypeError" ] } ] ,
69
64
"no-alert" : "error" ,
70
65
"no-array-constructor" : "error" ,
@@ -155,8 +150,64 @@ export default [
155
150
"vars-on-top" : "error" ,
156
151
"yoda" : "error" ,
157
152
158
- "line-comment-position" : "error" ,
159
- "unicode-bom" : "error"
153
+ "unicode-bom" : "error" ,
154
+
155
+ "@typescript-eslint/class-methods-use-this" : "off" ,
156
+ "@typescript-eslint/consistent-return" : "error" ,
157
+ "@typescript-eslint/consistent-type-exports" : "error" ,
158
+ "@typescript-eslint/consistent-type-imports" : "error" ,
159
+ "@typescript-eslint/default-param-last" : "error" ,
160
+ "@typescript-eslint/explicit-function-return-type" : [ "error" , { allowExpressions : true } ] ,
161
+ "@typescript-eslint/explicit-member-accessibility" : [ "error" , { accessibility : "no-public" } ] ,
162
+ "@typescript-eslint/explicit-module-boundary-types" : "error" ,
163
+ "@typescript-eslint/init-declarations" : "error" ,
164
+ "@typescript-eslint/max-params" : [ "error" , { max : 4 } ] ,
165
+ "@typescript-eslint/member-ordering" : "error" ,
166
+ "@typescript-eslint/method-signature-style" : "error" ,
167
+ "@typescript-eslint/naming-convention" : "off" ,
168
+ "@typescript-eslint/no-confusing-void-expression" : "off" ,
169
+ "@typescript-eslint/no-dupe-class-members" : "error" ,
170
+ "@typescript-eslint/no-empty-object-type" : "error" ,
171
+ "@typescript-eslint/no-explicit-any" : "off" ,
172
+ "@typescript-eslint/no-import-type-side-effects" : "error" ,
173
+ "@typescript-eslint/no-invalid-this" : "error" ,
174
+ "@typescript-eslint/no-loop-func" : "error" ,
175
+ "@typescript-eslint/no-magic-numbers" : "off" ,
176
+ "@typescript-eslint/no-non-null-assertion" : "off" ,
177
+ "@typescript-eslint/no-redeclare" : "error" ,
178
+ "@typescript-eslint/no-require-imports" : "error" ,
179
+ "@typescript-eslint/no-restricted-imports" : "error" ,
180
+ "@typescript-eslint/no-shadow" : "error" ,
181
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment" : "error" ,
182
+ "@typescript-eslint/no-unnecessary-qualifier" : "error" ,
183
+ "@typescript-eslint/no-unnecessary-type-parameters" : "error" ,
184
+ "@typescript-eslint/no-unsafe-unary-minus" : "error" ,
185
+ "@typescript-eslint/no-unused-expressions" : [ "error" , { allowTaggedTemplates : true , allowTernary : true } ] ,
186
+ "@typescript-eslint/no-use-before-define" : [ "error" , { functions : false } ] ,
187
+ "@typescript-eslint/no-useless-empty-export" : "error" ,
188
+ "@typescript-eslint/parameter-properties" : "error" ,
189
+ "@typescript-eslint/prefer-destructuring" : "error" ,
190
+ "@typescript-eslint/prefer-enum-initializers" : "off" ,
191
+ "@typescript-eslint/prefer-find" : "error" ,
192
+ "@typescript-eslint/prefer-readonly" : "error" ,
193
+ "@typescript-eslint/prefer-readonly-parameter-types" : "off" ,
194
+ "@typescript-eslint/prefer-regexp-exec" : "error" ,
195
+ "@typescript-eslint/promise-function-async" : "off" ,
196
+ "@typescript-eslint/require-array-sort-compare" : "error" ,
197
+ "@typescript-eslint/restrict-template-expressions" : "off" ,
198
+ "@typescript-eslint/return-await" : "error" ,
199
+ "@typescript-eslint/strict-boolean-expressions" : "off" ,
200
+ "@typescript-eslint/switch-exhaustiveness-check" : "error" ,
201
+ "@typescript-eslint/typedef" : "error"
202
+ }
203
+ } ,
204
+ {
205
+ files : [ "gulpfile.js" , "test/**/*.js" ] ,
206
+ rules : {
207
+ "prefer-arrow-callback" : "off" ,
208
+ "@typescript-eslint/explicit-function-return-type" : "off" ,
209
+ "@typescript-eslint/explicit-module-boundary-types" : "off" ,
210
+ "@typescript-eslint/no-floating-promises" : "off"
160
211
}
161
212
}
162
- ] ;
213
+ ) ;
0 commit comments