@@ -71,35 +71,13 @@ const p11tGroups = {
7171 groups : [ "id" , "type" , "meta" , "alias" , "rules" , "unknown" ] ,
7272} ;
7373
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-
9374export default tseslint . config (
75+ { ignores : GLOB_IGNORES } ,
9476 {
95- name : "global-ignores" ,
96- ignores : GLOB_IGNORES ,
97- } ,
98- {
77+ files : GLOB_MD ,
9978 extends : [
10079 markdown . configs . recommended ,
10180 ] ,
102- files : GLOB_MD ,
10381 ignores : [
10482 "packages/**/docs/**/*.md" ,
10583 ] ,
@@ -113,20 +91,19 @@ export default tseslint.config(
11391 files : [ ...GLOB_JS , ...GLOB_TS ] ,
11492 extends : [
11593 js . configs . recommended ,
116- ...tseslint . configs . strict ,
94+ ...tseslint . configs . strictTypeChecked ,
11795 pluginDeMorgan . configs . recommended ,
118- pluginPerfectionist . configs [ "recommended-natural" ] ,
119- pluginRegexp . configs [ "flat/recommended" ] ,
12096 pluginJsdoc . configs [ "flat/recommended-typescript-error" ] ,
97+ pluginRegexp . configs [ "flat/recommended" ] ,
98+ pluginPerfectionist . configs [ "recommended-natural" ] ,
12199 ] ,
122100 languageOptions : {
123101 parser : tseslint . parser ,
124102 parserOptions : {
125- allowAutomaticSingleRunInference : true ,
126103 project : packagesTsConfigs ,
127104 projectService : true ,
128105 tsconfigRootDir : dirname ,
129- warnOnUnsupportedTypeScriptVersion : false ,
106+ // warnOnUnsupportedTypeScriptVersion: false,
130107 } ,
131108 } ,
132109 plugins : {
@@ -140,14 +117,12 @@ export default tseslint.config(
140117 files : [ ...GLOB_JS , ...GLOB_TS ] ,
141118 rules : {
142119 eqeqeq : [ "error" , "smart" ] ,
120+ "no-undef" : "off" ,
143121 "no-console" : "error" ,
144122 "no-else-return" : "error" ,
145123 "no-fallthrough" : [ "error" , { commentPattern : ".*intentional fallthrough.*" } ] ,
146124 "no-implicit-coercion" : [ "error" , { allow : [ "!!" ] } ] ,
147125 "no-mixed-operators" : "warn" ,
148- "no-process-exit" : "error" ,
149- "no-undef" : "off" ,
150- "one-var" : [ "error" , "never" ] ,
151126 "prefer-object-has-own" : "error" ,
152127 // Part: custom rules
153128 "no-restricted-syntax" : [
@@ -176,7 +151,17 @@ export default tseslint.config(
176151 "@typescript-eslint/no-misused-promises" : "off" ,
177152 "@typescript-eslint/no-unnecessary-parameter-property-assignment" : "warn" ,
178153 "@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+ } ] ,
180165 // Part: jsdoc rules
181166 "jsdoc/check-param-names" : "warn" ,
182167 "jsdoc/check-tag-names" : "warn" ,
@@ -245,72 +230,41 @@ export default tseslint.config(
245230 } ,
246231 } ,
247232 {
248- files : GLOB_JS ,
233+ files : [ ...GLOB_JS , ...GLOB_SCRIPT , ...GLOB_CONFIG ] ,
234+ extends : [
235+ tseslint . configs . disableTypeChecked ,
236+ ] ,
249237 languageOptions : {
250238 parserOptions : {
251239 project : false ,
252240 projectService : false ,
253241 } ,
254242 } ,
255243 rules : {
256- ...disableTypeCheckedRules ,
257- "@typescript-eslint/no-var-requires" : "off" ,
244+ "no-console" : "off" ,
258245 } ,
259246 } ,
260247 {
261248 files : GLOB_TEST ,
249+ extends : [
250+ pluginVitest . configs . recommended ,
251+ ] ,
262252 languageOptions : {
263253 globals : {
264254 ...pluginVitest . environments . env . globals ,
265255 } ,
266- parser : tseslint . parser ,
267256 parserOptions : {
268- allowAutomaticSingleRunInference : true ,
269257 project : "tsconfig.json" ,
270258 projectService : true ,
271259 tsconfigRootDir : dirname ,
272- warnOnUnsupportedTypeScriptVersion : false ,
273260 } ,
274261 } ,
275262 plugins : {
276263 vitest : pluginVitest ,
277264 } ,
278265 rules : {
279- ...disableTypeCheckedRules ,
280- ...pluginVitest . configs . recommended . rules ,
281266 "@typescript-eslint/no-empty-function" : [ "error" , { allow : [ "arrowFunctions" ] } ] ,
282267 "local/avoid-multiline-template-expression" : "off" ,
283268 } ,
284269 } ,
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- } ,
316270) ;
0 commit comments