@@ -71,35 +71,13 @@ const p11tGroups = {
71
71
groups : [ "id" , "type" , "meta" , "alias" , "rules" , "unknown" ] ,
72
72
} ;
73
73
74
- const enableTypeCheckedRules = {
75
- ...tseslint . configs . strictTypeCheckedOnly
76
- . map ( ( x ) => x . rules )
77
- . reduce ( ( a , b ) => ( { ...a , ...b } ) , { } ) ,
78
- "@typescript-eslint/consistent-type-exports" : "error" ,
79
- "@typescript-eslint/strict-boolean-expressions" : [ "error" , {
80
- allowAny : false ,
81
- allowNullableBoolean : false ,
82
- allowNullableEnum : false ,
83
- allowNullableNumber : false ,
84
- allowNullableObject : false ,
85
- allowNullableString : false ,
86
- allowNumber : true ,
87
- allowString : false ,
88
- } ] ,
89
- } satisfies typeof tseslint . configs . disableTypeChecked . rules ;
90
-
91
- const disableTypeCheckedRules = Object . fromEntries ( Object . keys ( enableTypeCheckedRules ) . map ( ( x ) => [ x , "off" ] ) ) ;
92
-
93
74
export default tseslint . config (
75
+ { ignores : GLOB_IGNORES } ,
94
76
{
95
- name : "global-ignores" ,
96
- ignores : GLOB_IGNORES ,
97
- } ,
98
- {
77
+ files : GLOB_MD ,
99
78
extends : [
100
79
markdown . configs . recommended ,
101
80
] ,
102
- files : GLOB_MD ,
103
81
ignores : [
104
82
"packages/**/docs/**/*.md" ,
105
83
] ,
@@ -113,20 +91,19 @@ export default tseslint.config(
113
91
files : [ ...GLOB_JS , ...GLOB_TS ] ,
114
92
extends : [
115
93
js . configs . recommended ,
116
- ...tseslint . configs . strict ,
94
+ ...tseslint . configs . strictTypeChecked ,
117
95
pluginDeMorgan . configs . recommended ,
118
- pluginPerfectionist . configs [ "recommended-natural" ] ,
119
- pluginRegexp . configs [ "flat/recommended" ] ,
120
96
pluginJsdoc . configs [ "flat/recommended-typescript-error" ] ,
97
+ pluginRegexp . configs [ "flat/recommended" ] ,
98
+ pluginPerfectionist . configs [ "recommended-natural" ] ,
121
99
] ,
122
100
languageOptions : {
123
101
parser : tseslint . parser ,
124
102
parserOptions : {
125
- allowAutomaticSingleRunInference : true ,
126
103
project : packagesTsConfigs ,
127
104
projectService : true ,
128
105
tsconfigRootDir : dirname ,
129
- warnOnUnsupportedTypeScriptVersion : false ,
106
+ // warnOnUnsupportedTypeScriptVersion: false,
130
107
} ,
131
108
} ,
132
109
plugins : {
@@ -140,14 +117,12 @@ export default tseslint.config(
140
117
files : [ ...GLOB_JS , ...GLOB_TS ] ,
141
118
rules : {
142
119
eqeqeq : [ "error" , "smart" ] ,
120
+ "no-undef" : "off" ,
143
121
"no-console" : "error" ,
144
122
"no-else-return" : "error" ,
145
123
"no-fallthrough" : [ "error" , { commentPattern : ".*intentional fallthrough.*" } ] ,
146
124
"no-implicit-coercion" : [ "error" , { allow : [ "!!" ] } ] ,
147
125
"no-mixed-operators" : "warn" ,
148
- "no-process-exit" : "error" ,
149
- "no-undef" : "off" ,
150
- "one-var" : [ "error" , "never" ] ,
151
126
"prefer-object-has-own" : "error" ,
152
127
// Part: custom rules
153
128
"no-restricted-syntax" : [
@@ -176,7 +151,17 @@ export default tseslint.config(
176
151
"@typescript-eslint/no-misused-promises" : "off" ,
177
152
"@typescript-eslint/no-unnecessary-parameter-property-assignment" : "warn" ,
178
153
"@typescript-eslint/no-unused-vars" : [ "warn" , { caughtErrors : "all" } ] ,
179
- ...enableTypeCheckedRules ,
154
+ "@typescript-eslint/consistent-type-exports" : "error" ,
155
+ "@typescript-eslint/strict-boolean-expressions" : [ "error" , {
156
+ allowAny : false ,
157
+ allowNullableBoolean : false ,
158
+ allowNullableEnum : false ,
159
+ allowNullableNumber : false ,
160
+ allowNullableObject : false ,
161
+ allowNullableString : false ,
162
+ allowNumber : true ,
163
+ allowString : false ,
164
+ } ] ,
180
165
// Part: jsdoc rules
181
166
"jsdoc/check-param-names" : "warn" ,
182
167
"jsdoc/check-tag-names" : "warn" ,
@@ -245,72 +230,41 @@ export default tseslint.config(
245
230
} ,
246
231
} ,
247
232
{
248
- files : GLOB_JS ,
233
+ files : [ ...GLOB_JS , ...GLOB_SCRIPT , ...GLOB_CONFIG ] ,
234
+ extends : [
235
+ tseslint . configs . disableTypeChecked ,
236
+ ] ,
249
237
languageOptions : {
250
238
parserOptions : {
251
239
project : false ,
252
240
projectService : false ,
253
241
} ,
254
242
} ,
255
243
rules : {
256
- ...disableTypeCheckedRules ,
257
- "@typescript-eslint/no-var-requires" : "off" ,
244
+ "no-console" : "off" ,
258
245
} ,
259
246
} ,
260
247
{
261
248
files : GLOB_TEST ,
249
+ extends : [
250
+ pluginVitest . configs . recommended ,
251
+ ] ,
262
252
languageOptions : {
263
253
globals : {
264
254
...pluginVitest . environments . env . globals ,
265
255
} ,
266
- parser : tseslint . parser ,
267
256
parserOptions : {
268
- allowAutomaticSingleRunInference : true ,
269
257
project : "tsconfig.json" ,
270
258
projectService : true ,
271
259
tsconfigRootDir : dirname ,
272
- warnOnUnsupportedTypeScriptVersion : false ,
273
260
} ,
274
261
} ,
275
262
plugins : {
276
263
vitest : pluginVitest ,
277
264
} ,
278
265
rules : {
279
- ...disableTypeCheckedRules ,
280
- ...pluginVitest . configs . recommended . rules ,
281
266
"@typescript-eslint/no-empty-function" : [ "error" , { allow : [ "arrowFunctions" ] } ] ,
282
267
"local/avoid-multiline-template-expression" : "off" ,
283
268
} ,
284
269
} ,
285
- {
286
- files : GLOB_SCRIPT ,
287
- languageOptions : {
288
- parser : tseslint . parser ,
289
- parserOptions : {
290
- allowAutomaticSingleRunInference : true ,
291
- project : "tsconfig.json" ,
292
- projectService : true ,
293
- tsconfigRootDir : dirname ,
294
- warnOnUnsupportedTypeScriptVersion : false ,
295
- } ,
296
- } ,
297
- rules : {
298
- "no-console" : "off" ,
299
- ...disableTypeCheckedRules ,
300
- } ,
301
- } ,
302
- {
303
- files : GLOB_CONFIG ,
304
- languageOptions : {
305
- parser : tseslint . parser ,
306
- parserOptions : {
307
- allowAutomaticSingleRunInference : true ,
308
- project : false ,
309
- projectService : false ,
310
- } ,
311
- } ,
312
- rules : {
313
- ...disableTypeCheckedRules ,
314
- } ,
315
- } ,
316
270
) ;
0 commit comments