@@ -26,7 +26,7 @@ const GLOB_TEST = [
2626 "**/*.spec.{ts,tsx,cts,mts}" ,
2727 "**/*.test.{ts,tsx,cts,mts}" ,
2828 "**/spec.{ts,tsx,cts,mts}" ,
29- "**/test.{ts,tsx,cts,mts}" ,
29+ "**/test.{ts,tsx,cts,mts}"
3030] ;
3131// const GLOB_YAML = ["*.{yaml,yml}", "**/*.{yaml,yml}"];
3232const GLOB_CONFIG = [ "*.config.{ts,tsx,cts,mts}" , "**/*.config.{ts,tsx,cts,mts}" ] ;
@@ -37,21 +37,21 @@ const templateIndentAnnotations = [
3737 "dedent" ,
3838 "html" ,
3939 "tsx" ,
40- "ts" ,
40+ "ts"
4141] ;
4242
4343const packagesTsConfigs = [
4444 "packages/*/tsconfig.json" ,
45- "packages/*/*/tsconfig.json" ,
45+ "packages/*/*/tsconfig.json"
4646] ;
4747
4848const rootTsConfigs = [
49- "tsconfig.json" ,
49+ "tsconfig.json"
5050] ;
5151
5252const p11tOptions = {
5353 type : "natural" ,
54- ignoreCase : false ,
54+ ignoreCase : false
5555} ;
5656
5757const p11tGroups = {
@@ -62,17 +62,17 @@ const p11tGroups = {
6262 "^name$" ,
6363 "^meta$" ,
6464 "^title$" ,
65- "^description$" ,
65+ "^description$"
6666 ] ,
6767 alias : [ "^alias$" , "^as$" ] ,
68- rules : [ "^node$" , "^messageId$" ] ,
68+ rules : [ "^node$" , "^messageId$" ]
6969 } ,
70- groups : [ "id" , "type" , "meta" , "alias" , "rules" , "unknown" ] ,
70+ groups : [ "id" , "type" , "meta" , "alias" , "rules" , "unknown" ]
7171} ;
7272
7373const enableTypeCheckedRules = {
7474 ...tseslint . configs . strictTypeCheckedOnly
75- . map ( x => x . rules )
75+ . map ( ( x ) => x . rules )
7676 . reduce ( ( a , b ) => ( { ...a , ...b } ) , { } ) ,
7777 ...eslintPluginSafeTypeScript . configs . recommended . rules ,
7878 "@susisu/safe-typescript/no-unsafe-object-property-check" : "off" ,
@@ -86,37 +86,37 @@ const enableTypeCheckedRules = {
8686 allowNullableObject : false ,
8787 allowNullableString : false ,
8888 allowNumber : true ,
89- allowString : false ,
90- } ] ,
89+ allowString : false
90+ } ]
9191} as const ;
9292
93- const disableTypeCheckedRules = Object . fromEntries ( Object . keys ( enableTypeCheckedRules ) . map ( x => [ x , "off" ] ) ) ;
93+ const disableTypeCheckedRules = Object . fromEntries ( Object . keys ( enableTypeCheckedRules ) . map ( ( x ) => [ x , "off" ] ) ) ;
9494
9595export default tseslint . config (
9696 eslintConfigFlatGitignore ( ) ,
9797 {
9898 extends : [
9999 // @ts -expect-error - TODO: make types compatible
100- eslintMarkdown . configs . recommended ,
100+ eslintMarkdown . configs . recommended
101101 ] ,
102102 files : GLOB_MD ,
103103 ignores : [
104- "packages/**/docs/**/*.md" ,
104+ "packages/**/docs/**/*.md"
105105 ] ,
106106 language : "markdown/gfm" ,
107107 rules : {
108108 "markdown/no-html" : "error" ,
109- "markdown/no-missing-label-refs" : "off" ,
110- } ,
109+ "markdown/no-missing-label-refs" : "off"
110+ }
111111 } ,
112112 {
113113 name : "global-ignores" ,
114114 ignores : [
115115 "docs" ,
116116 "examples" ,
117117 "website" ,
118- "test" ,
119- ] ,
118+ "test"
119+ ]
120120 } ,
121121 {
122122 files : [ ...GLOB_JS , ...GLOB_TS ] ,
@@ -128,7 +128,7 @@ export default tseslint.config(
128128 eslintPluginPerfectionist . configs [ "recommended-natural" ] ,
129129 eslintPluginRegexp . configs [ "flat/recommended" ] ,
130130 eslintPluginJsdoc . configs [ "flat/recommended-typescript-error" ] ,
131- eslintPluginEslintPlugin . configs [ "flat/all-type-checked" ] ,
131+ eslintPluginEslintPlugin . configs [ "flat/all-type-checked" ]
132132 ] ,
133133 languageOptions : {
134134 parser : tseslint . parser ,
@@ -137,16 +137,16 @@ export default tseslint.config(
137137 project : packagesTsConfigs ,
138138 projectService : true ,
139139 tsconfigRootDir : dirname ,
140- warnOnUnsupportedTypeScriptVersion : false ,
141- } ,
140+ warnOnUnsupportedTypeScriptVersion : false
141+ }
142142 } ,
143143 plugins : {
144144 [ "@stylistic" ] : eslintStylistic ,
145145 [ "@susisu/safe-typescript" ] : eslintPluginSafeTypeScript ,
146146 [ "local" ] : eslintPluginLocal ,
147147 [ "simple-import-sort" ] : eslintPluginSimpleImportSort ,
148- [ "unicorn" ] : eslintPluginUnicorn ,
149- } ,
148+ [ "unicorn" ] : eslintPluginUnicorn
149+ }
150150 } ,
151151 {
152152 files : [ ...GLOB_JS , ...GLOB_TS ] ,
@@ -167,8 +167,8 @@ export default tseslint.config(
167167 "error" ,
168168 {
169169 message : "no optional" ,
170- selector : "TSPropertySignature[optional=true]" ,
171- } ,
170+ selector : "TSPropertySignature[optional=true]"
171+ }
172172 ] ,
173173 // Part: typescript-eslint rules
174174 "@typescript-eslint/ban-ts-comment" : [
@@ -178,8 +178,8 @@ export default tseslint.config(
178178 "ts-check" : false ,
179179 "ts-expect-error" : "allow-with-description" ,
180180 "ts-ignore" : true ,
181- "ts-nocheck" : true ,
182- } ,
181+ "ts-nocheck" : true
182+ }
183183 ] ,
184184 "@typescript-eslint/ban-types" : "off" ,
185185 "@typescript-eslint/consistent-type-imports" : "error" ,
@@ -192,8 +192,8 @@ export default tseslint.config(
192192 {
193193 argsIgnorePattern : "^_" ,
194194 caughtErrors : "all" ,
195- varsIgnorePattern : "^_" ,
196- } ,
195+ varsIgnorePattern : "^_"
196+ }
197197 ] ,
198198 ...enableTypeCheckedRules ,
199199 // Part: jsdoc rules
@@ -211,16 +211,24 @@ export default tseslint.config(
211211 "simple-import-sort/exports" : "warn" ,
212212 "simple-import-sort/imports" : "warn" ,
213213 // Part: stylistic rules
214+ "@stylistic/arrow-parens" : [ "warn" , "always" ] ,
215+ "@stylistic/comma-dangle" : [ "warn" , "never" ] ,
214216 "@stylistic/curly-newline" : [ "warn" , "always" ] ,
217+ "@stylistic/no-multi-spaces" : [ "warn" ] ,
218+ "@stylistic/operator-linebreak" : [
219+ "warn" ,
220+ "before"
221+ ] ,
222+ "@stylistic/quote-props" : [ "error" , "as-needed" ] ,
215223 // Part: perfectionist rules
216224 "perfectionist/sort-exports" : "off" ,
217225 "perfectionist/sort-imports" : "off" ,
218226 "perfectionist/sort-interfaces" : [
219227 "warn" ,
220228 {
221229 ...p11tOptions ,
222- ...p11tGroups ,
223- } ,
230+ ...p11tGroups
231+ }
224232 ] ,
225233 "perfectionist/sort-intersection-types" : "off" ,
226234 "perfectionist/sort-modules" : "off" ,
@@ -230,16 +238,16 @@ export default tseslint.config(
230238 "warn" ,
231239 {
232240 ...p11tOptions ,
233- ...p11tGroups ,
234- } ,
241+ ...p11tGroups
242+ }
235243 ] ,
236244 "perfectionist/sort-objects" : [
237245 "warn" ,
238246 {
239247 ...p11tOptions ,
240248 ...p11tGroups ,
241- partitionByComment : "^Part:.*" ,
242- } ,
249+ partitionByComment : "^Part:.*"
250+ }
243251 ] ,
244252 "perfectionist/sort-switch-case" : "off" ,
245253 "perfectionist/sort-union-types" : "warn" ,
@@ -248,8 +256,8 @@ export default tseslint.config(
248256 "warn" ,
249257 {
250258 comments : templateIndentAnnotations ,
251- tags : templateIndentAnnotations ,
252- } ,
259+ tags : templateIndentAnnotations
260+ }
253261 ] ,
254262 // Part: eslint-plugin rules
255263 "eslint-plugin/meta-property-ordering" : "off" ,
@@ -258,53 +266,53 @@ export default tseslint.config(
258266 "eslint-plugin/require-meta-docs-url" : "off" ,
259267 // Part: local rules
260268 "local/avoid-multiline-template-expression" : "warn" ,
261- "local/prefer-eqeq-nullish-comparison" : "warn" ,
269+ "local/prefer-eqeq-nullish-comparison" : "warn"
262270 } ,
263271 settings : {
264272 "import-x/parsers" : {
265- "@typescript-eslint/parser" : GLOB_TS ,
273+ "@typescript-eslint/parser" : GLOB_TS
266274 } ,
267- "import-x/resolver" : "oxc" ,
268- } ,
275+ "import-x/resolver" : "oxc"
276+ }
269277 } ,
270278 {
271279 files : GLOB_JS ,
272280 languageOptions : {
273281 parserOptions : {
274282 project : false ,
275- projectService : false ,
276- } ,
283+ projectService : false
284+ }
277285 } ,
278286 rules : {
279287 ...disableTypeCheckedRules ,
280- "@typescript-eslint/no-var-requires" : "off" ,
281- } ,
288+ "@typescript-eslint/no-var-requires" : "off"
289+ }
282290 } ,
283291 {
284292 files : GLOB_TEST ,
285293 languageOptions : {
286294 globals : {
287- ...eslintPluginVitest . environments . env . globals ,
295+ ...eslintPluginVitest . environments . env . globals
288296 } ,
289297 parser : tseslint . parser ,
290298 parserOptions : {
291299 allowAutomaticSingleRunInference : true ,
292300 project : rootTsConfigs ,
293301 projectService : true ,
294302 tsconfigRootDir : dirname ,
295- warnOnUnsupportedTypeScriptVersion : false ,
296- } ,
303+ warnOnUnsupportedTypeScriptVersion : false
304+ }
297305 } ,
298306 plugins : {
299- vitest : eslintPluginVitest ,
307+ vitest : eslintPluginVitest
300308 } ,
301309 rules : {
302310 ...disableTypeCheckedRules ,
303311 ...eslintPluginVitest . configs . recommended . rules ,
304312 "@typescript-eslint/no-empty-function" : [ "error" , { allow : [ "arrowFunctions" ] } ] ,
305313 "import-x/no-extraneous-dependencies" : "off" ,
306- "local/avoid-multiline-template-expression" : "off" ,
307- } ,
314+ "local/avoid-multiline-template-expression" : "off"
315+ }
308316 } ,
309317 {
310318 files : GLOB_SCRIPT ,
@@ -315,12 +323,12 @@ export default tseslint.config(
315323 project : rootTsConfigs ,
316324 projectService : true ,
317325 tsconfigRootDir : dirname ,
318- warnOnUnsupportedTypeScriptVersion : false ,
319- } ,
326+ warnOnUnsupportedTypeScriptVersion : false
327+ }
320328 } ,
321329 rules : {
322- "no-console" : "off" ,
323- } ,
330+ "no-console" : "off"
331+ }
324332 } ,
325333 {
326334 files : GLOB_CONFIG ,
@@ -329,12 +337,12 @@ export default tseslint.config(
329337 parserOptions : {
330338 allowAutomaticSingleRunInference : true ,
331339 project : false ,
332- projectService : false ,
333- } ,
340+ projectService : false
341+ }
334342 } ,
335343 rules : {
336344 ...disableTypeCheckedRules ,
337- "import-x/no-extraneous-dependencies" : "off" ,
338- } ,
339- } ,
345+ "import-x/no-extraneous-dependencies" : "off"
346+ }
347+ }
340348) ;
0 commit comments