@xylabs/eslint-config-flat 7.0.0-rc.24 → 7.0.0-rc.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,11 +34,22 @@ var ignores = [
34
34
  // src/import/index.ts
35
35
  var importConfig = {
36
36
  ignores,
37
- files: ["**/*.ts", "**/*.d.ts", "**/*.tsx", "**/*.d.tsx", "**/*.ts", "**/*.d.ts", "**/*.jsx", "**/*.d.jsx"],
37
+ files: [
38
+ "**/*.ts",
39
+ "**/*.d.ts",
40
+ "**/*.tsx",
41
+ "**/*.d.tsx",
42
+ "**/*.ts",
43
+ "**/*.d.ts",
44
+ "**/*.jsx",
45
+ "**/*.d.jsx"
46
+ ],
38
47
  languageOptions: {
39
48
  parser: tsParser,
40
49
  parserOptions: {
41
- ecmaFeatures: { modules: true },
50
+ ecmaFeatures: {
51
+ modules: true
52
+ },
42
53
  ecmaVersion: "latest",
43
54
  project: "./tsconfig.json"
44
55
  }
@@ -47,28 +58,48 @@ var importConfig = {
47
58
  "import-x": importPlugin,
48
59
  "simple-import-sort": simpleImportSort
49
60
  },
50
- settings: { "import-x/resolver": { typescript: { project: "./tsconfig.json" } } },
61
+ settings: {
62
+ "import-x/resolver": {
63
+ typescript: {
64
+ project: "./tsconfig.json"
65
+ }
66
+ }
67
+ },
51
68
  rules: {
52
69
  ...importPlugin.configs.recommended.rules,
53
- "simple-import-sort/imports": ["warn"],
54
- "simple-import-sort/exports": ["warn"],
55
- "import-x/default": ["off"],
56
- "import-x/named": ["off"],
57
- "import-x/namespace": ["off"],
58
- "import-x/no-absolute-path": ["warn"],
70
+ "simple-import-sort/imports": [
71
+ "warn"
72
+ ],
73
+ "simple-import-sort/exports": [
74
+ "warn"
75
+ ],
76
+ "import-x/default": [
77
+ "off"
78
+ ],
79
+ "import-x/named": [
80
+ "off"
81
+ ],
82
+ "import-x/namespace": [
83
+ "off"
84
+ ],
85
+ "import-x/no-absolute-path": [
86
+ "warn"
87
+ ],
59
88
  "import-x/no-cycle": [
60
89
  "warn",
61
- { maxDepth: 2 }
90
+ {
91
+ maxDepth: 2
92
+ }
93
+ ],
94
+ "import-x/no-deprecated": [
95
+ "off"
62
96
  ],
63
- "import-x/no-deprecated": ["off"],
64
97
  "import-x/no-internal-modules": [
65
98
  "warn",
66
99
  {
67
100
  allow: [
68
101
  "vitest/*",
69
- // Allow imports from vitest
70
102
  "@*/**",
71
- // Allow imports from any @scoped package
72
103
  // Allow imports to any index.js file
73
104
  "**/index.js",
74
105
  "**/index.ts",
@@ -77,11 +108,21 @@ var importConfig = {
77
108
  ]
78
109
  }
79
110
  ],
80
- "import-x/no-named-as-default-member": ["off"],
81
- "import-x/no-named-as-default": ["off"],
82
- "import-x/no-restricted-paths": ["warn"],
83
- "import-x/no-self-import": ["warn"],
84
- "import-x/no-useless-path-segments": ["warn"]
111
+ "import-x/no-named-as-default-member": [
112
+ "off"
113
+ ],
114
+ "import-x/no-named-as-default": [
115
+ "off"
116
+ ],
117
+ "import-x/no-restricted-paths": [
118
+ "warn"
119
+ ],
120
+ "import-x/no-self-import": [
121
+ "warn"
122
+ ],
123
+ "import-x/no-useless-path-segments": [
124
+ "warn"
125
+ ]
85
126
  }
86
127
  };
87
128
 
@@ -89,8 +130,12 @@ var importConfig = {
89
130
  import markdown from "eslint-plugin-markdown";
90
131
  var markdownConfig = {
91
132
  ignores,
92
- plugins: { markdown },
93
- files: ["**/*.md"],
133
+ plugins: {
134
+ markdown
135
+ },
136
+ files: [
137
+ "**/*.md"
138
+ ],
94
139
  processor: "markdown/markdown"
95
140
  };
96
141
 
@@ -98,8 +143,14 @@ var markdownConfig = {
98
143
  var rulesConfig = {
99
144
  ignores,
100
145
  rules: {
101
- "complexity": ["error", 18],
102
- "max-depth": ["error", 6],
146
+ "complexity": [
147
+ "error",
148
+ 18
149
+ ],
150
+ "max-depth": [
151
+ "error",
152
+ 6
153
+ ],
103
154
  "max-lines": [
104
155
  "error",
105
156
  {
@@ -107,9 +158,18 @@ var rulesConfig = {
107
158
  skipBlankLines: true
108
159
  }
109
160
  ],
110
- "array-element-newline": ["warn", "consistent"],
111
- "max-nested-callbacks": ["error", 6],
112
- "max-statements": ["error", 32],
161
+ "array-element-newline": [
162
+ "warn",
163
+ "consistent"
164
+ ],
165
+ "max-nested-callbacks": [
166
+ "error",
167
+ 6
168
+ ],
169
+ "max-statements": [
170
+ "error",
171
+ 32
172
+ ],
113
173
  "no-restricted-imports": [
114
174
  "error",
115
175
  {
@@ -126,47 +186,101 @@ var rulesConfig = {
126
186
  }
127
187
  ],
128
188
  // 'no-secrets/no-secrets': ['off'],
129
- "no-tabs": ["error"],
189
+ "no-tabs": [
190
+ "error"
191
+ ],
130
192
  "no-unused-vars": "off",
131
193
  "no-useless-escape": "off",
132
- "quotes": [2, "single", "avoid-escape"],
194
+ "quotes": [
195
+ 2,
196
+ "single",
197
+ "avoid-escape"
198
+ ],
133
199
  "require-await": "error",
134
- "semi": ["warn", "never"]
135
- // 'sort-keys-fix/sort-keys-fix': 'warn',
200
+ "semi": [
201
+ "warn",
202
+ "never"
203
+ ]
136
204
  }
137
205
  };
138
206
 
139
207
  // src/sonar/index.ts
140
208
  import sonarjs from "eslint-plugin-sonarjs";
141
209
  var sonarConfig = {
142
- plugins: { sonarjs },
210
+ plugins: {
211
+ sonarjs
212
+ },
143
213
  ignores,
144
214
  rules: {
145
215
  // ...sonarjs.configs.recommended.rules,
146
- "sonarjs/no-small-switch": ["off"],
147
- "sonarjs/os-command": ["off"],
148
- "sonarjs/no-os-command-from-path": ["off"],
149
- "sonarjs/no-nested-conditional": ["off"],
150
- "sonarjs/todo-tag": ["off"],
151
- "sonarjs/deprecation": ["warn"],
152
- "sonarjs/no-nested-functions": ["off"],
153
- "sonarjs/function-return-type": ["off"],
154
- "sonarjs/pseudo-random": ["off"],
155
- "sonarjs/public-static-readonly": ["warn"],
156
- "sonarjs/post-message": ["off"],
157
- "sonarjs/different-types-comparison": ["off"],
158
- "sonarjs/no-alphabetical-sort": ["warn"],
159
- "sonarjs/no-identical-functions": ["warn"],
160
- "sonarjs/no-empty-test-file": ["off"],
161
- "sonarjs/no-dead-store": ["warn"],
162
- "sonarjs/no-redundant-jump": ["warn"],
163
- "sonarjs/void-use": ["off"],
216
+ "sonarjs/no-small-switch": [
217
+ "off"
218
+ ],
219
+ "sonarjs/os-command": [
220
+ "off"
221
+ ],
222
+ "sonarjs/no-os-command-from-path": [
223
+ "off"
224
+ ],
225
+ "sonarjs/no-nested-conditional": [
226
+ "off"
227
+ ],
228
+ "sonarjs/todo-tag": [
229
+ "off"
230
+ ],
231
+ "sonarjs/deprecation": [
232
+ "warn"
233
+ ],
234
+ "sonarjs/no-nested-functions": [
235
+ "off"
236
+ ],
237
+ "sonarjs/function-return-type": [
238
+ "off"
239
+ ],
240
+ "sonarjs/pseudo-random": [
241
+ "off"
242
+ ],
243
+ "sonarjs/public-static-readonly": [
244
+ "warn"
245
+ ],
246
+ "sonarjs/post-message": [
247
+ "off"
248
+ ],
249
+ "sonarjs/different-types-comparison": [
250
+ "off"
251
+ ],
252
+ "sonarjs/no-alphabetical-sort": [
253
+ "warn"
254
+ ],
255
+ "sonarjs/no-identical-functions": [
256
+ "warn"
257
+ ],
258
+ "sonarjs/no-empty-test-file": [
259
+ "off"
260
+ ],
261
+ "sonarjs/no-dead-store": [
262
+ "warn"
263
+ ],
264
+ "sonarjs/no-redundant-jump": [
265
+ "warn"
266
+ ],
267
+ "sonarjs/void-use": [
268
+ "off"
269
+ ],
164
270
  // handled by eslint
165
- "sonarjs/cognitive-complexity": ["off"],
166
- "sonarjs/unused-import": ["off"],
271
+ "sonarjs/cognitive-complexity": [
272
+ "off"
273
+ ],
274
+ "sonarjs/unused-import": [
275
+ "off"
276
+ ],
167
277
  // handled by typescript-eslint
168
- "sonarjs/no-unused-vars": ["off"],
169
- "sonarjs/no-commented-code": ["off"]
278
+ "sonarjs/no-unused-vars": [
279
+ "off"
280
+ ],
281
+ "sonarjs/no-commented-code": [
282
+ "off"
283
+ ]
170
284
  }
171
285
  };
172
286
 
@@ -192,7 +306,9 @@ var typescriptConfig = {
192
306
  languageOptions: {
193
307
  parser: tsParser2,
194
308
  parserOptions: {
195
- ecmaFeatures: { modules: true },
309
+ ecmaFeatures: {
310
+ modules: true
311
+ },
196
312
  ecmaVersion: "latest",
197
313
  project: "./tsconfig.json"
198
314
  }
@@ -204,16 +320,54 @@ var typescriptConfig = {
204
320
  rules: {
205
321
  ...tsPlugin.configs.recommended.rules,
206
322
  ...esStylistic.configs["recommended"].rules,
207
- "@typescript-eslint/no-empty-object-type": ["off"],
208
- "@typescript-eslint/explicit-member-accessibility": ["warn", { accessibility: "no-public" }],
323
+ "@typescript-eslint/no-empty-object-type": [
324
+ "off"
325
+ ],
326
+ "@typescript-eslint/explicit-member-accessibility": [
327
+ "warn",
328
+ {
329
+ accessibility: "no-public"
330
+ }
331
+ ],
209
332
  "@typescript-eslint/explicit-module-boundary-types": "off",
210
- "@stylistic/brace-style": ["warn", "1tbs", { allowSingleLine: true }],
211
- "@stylistic/quotes": ["warn", "single", { avoidEscape: true }],
212
- "@typescript-eslint/consistent-type-imports": ["warn", { fixStyle: "separate-type-imports", prefer: "type-imports" }],
213
- "@stylistic/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: true }],
214
- "@stylistic/function-call-argument-newline": ["warn", "consistent"],
215
- "@stylistic/function-paren-newline": ["warn", "multiline-arguments"],
216
- "@typescript-eslint/triple-slash-reference": ["off"],
333
+ "@stylistic/brace-style": [
334
+ "warn",
335
+ "1tbs",
336
+ {
337
+ allowSingleLine: true
338
+ }
339
+ ],
340
+ "@stylistic/quotes": [
341
+ "warn",
342
+ "single",
343
+ {
344
+ avoidEscape: true
345
+ }
346
+ ],
347
+ "@typescript-eslint/consistent-type-imports": [
348
+ "warn",
349
+ {
350
+ fixStyle: "separate-type-imports",
351
+ prefer: "type-imports"
352
+ }
353
+ ],
354
+ "@stylistic/object-property-newline": [
355
+ "warn",
356
+ {
357
+ allowAllPropertiesOnSameLine: true
358
+ }
359
+ ],
360
+ "@stylistic/function-call-argument-newline": [
361
+ "warn",
362
+ "consistent"
363
+ ],
364
+ "@stylistic/function-paren-newline": [
365
+ "warn",
366
+ "multiline-arguments"
367
+ ],
368
+ "@typescript-eslint/triple-slash-reference": [
369
+ "off"
370
+ ],
217
371
  "@stylistic/member-delimiter-style": [
218
372
  "error",
219
373
  {
@@ -227,29 +381,37 @@ var typescriptConfig = {
227
381
  }
228
382
  }
229
383
  ],
230
- "@stylistic/object-curly-newline": ["warn", {
231
- ObjectExpression: {
232
- multiline: true,
233
- minProperties: 3,
234
- consistent: false
235
- },
236
- ObjectPattern: {
237
- multiline: true,
238
- minProperties: 3,
239
- consistent: false
240
- },
241
- ImportDeclaration: {
242
- multiline: true,
243
- minProperties: 3,
244
- consistent: false
245
- },
246
- ExportDeclaration: {
247
- multiline: true,
248
- minProperties: 3,
249
- consistent: false
384
+ "@stylistic/object-curly-newline": [
385
+ "warn",
386
+ {
387
+ ObjectExpression: {
388
+ multiline: true,
389
+ minProperties: 3,
390
+ consistent: false
391
+ },
392
+ ObjectPattern: {
393
+ multiline: true,
394
+ minProperties: 3,
395
+ consistent: false
396
+ },
397
+ ImportDeclaration: {
398
+ multiline: true,
399
+ minProperties: 3,
400
+ consistent: false
401
+ },
402
+ ExportDeclaration: {
403
+ multiline: true,
404
+ minProperties: 3,
405
+ consistent: false
406
+ }
407
+ }
408
+ ],
409
+ "@stylistic/max-len": [
410
+ "warn",
411
+ {
412
+ code: 160
250
413
  }
251
- }],
252
- "@stylistic/max-len": ["warn", { code: 160 }],
414
+ ],
253
415
  "no-restricted-syntax": [
254
416
  "warn",
255
417
  {
@@ -287,24 +449,78 @@ var typescriptConfig = {
287
449
  "protected-constructor",
288
450
  "private-constructor",
289
451
  "constructor",
290
- ["public-static-get", "public-static-set"],
291
- ["protected-static-get", "protected-static-set"],
292
- ["private-static-get", "private-static-set"],
293
- ["public-decorated-get", "public-decorated-set"],
294
- ["protected-decorated-get", "protected-decorated-set"],
295
- ["private-decorated-get", "private-decorated-set"],
296
- ["public-instance-get", "public-instance-set"],
297
- ["protected-instance-get", "protected-instance-set"],
298
- ["private-instance-get", "private-instance-set"],
299
- ["public-abstract-get", "public-abstract-set"],
300
- ["protected-abstract-get", "protected-abstract-set"],
301
- ["public-get", "public-set"],
302
- ["protected-get", "protected-set"],
303
- ["private-get", "private-set"],
304
- ["static-get", "static-set"],
305
- ["instance-get", "instance-set"],
306
- ["abstract-get", "abstract-set"],
307
- ["decorated-get", "decorated-set"],
452
+ [
453
+ "public-static-get",
454
+ "public-static-set"
455
+ ],
456
+ [
457
+ "protected-static-get",
458
+ "protected-static-set"
459
+ ],
460
+ [
461
+ "private-static-get",
462
+ "private-static-set"
463
+ ],
464
+ [
465
+ "public-decorated-get",
466
+ "public-decorated-set"
467
+ ],
468
+ [
469
+ "protected-decorated-get",
470
+ "protected-decorated-set"
471
+ ],
472
+ [
473
+ "private-decorated-get",
474
+ "private-decorated-set"
475
+ ],
476
+ [
477
+ "public-instance-get",
478
+ "public-instance-set"
479
+ ],
480
+ [
481
+ "protected-instance-get",
482
+ "protected-instance-set"
483
+ ],
484
+ [
485
+ "private-instance-get",
486
+ "private-instance-set"
487
+ ],
488
+ [
489
+ "public-abstract-get",
490
+ "public-abstract-set"
491
+ ],
492
+ [
493
+ "protected-abstract-get",
494
+ "protected-abstract-set"
495
+ ],
496
+ [
497
+ "public-get",
498
+ "public-set"
499
+ ],
500
+ [
501
+ "protected-get",
502
+ "protected-set"
503
+ ],
504
+ [
505
+ "private-get",
506
+ "private-set"
507
+ ],
508
+ [
509
+ "static-get",
510
+ "static-set"
511
+ ],
512
+ [
513
+ "instance-get",
514
+ "instance-set"
515
+ ],
516
+ [
517
+ "abstract-get",
518
+ "abstract-set"
519
+ ],
520
+ [
521
+ "decorated-get",
522
+ "decorated-set"
523
+ ],
308
524
  "get",
309
525
  "set",
310
526
  "public-static-method",
@@ -333,7 +549,10 @@ var typescriptConfig = {
333
549
  ],
334
550
  "@typescript-eslint/no-floating-promises": "error",
335
551
  "@typescript-eslint/no-misused-promises": "error",
336
- "semi": ["warn", "never"],
552
+ "semi": [
553
+ "warn",
554
+ "never"
555
+ ],
337
556
  "@typescript-eslint/no-unused-vars": [
338
557
  "warn",
339
558
  {
@@ -342,48 +561,83 @@ var typescriptConfig = {
342
561
  ignoreRestSiblings: true
343
562
  }
344
563
  ],
345
- "@typescript-eslint/strict-boolean-expressions": ["warn", {
346
- allowAny: true,
347
- allowNullableBoolean: true,
348
- allowNullableEnum: false,
349
- allowNullableNumber: false,
350
- allowNullableObject: true,
351
- allowNullableString: false,
352
- allowNumber: false,
353
- allowString: false
354
- }]
564
+ "@typescript-eslint/strict-boolean-expressions": [
565
+ "warn",
566
+ {
567
+ allowAny: true,
568
+ allowNullableBoolean: true,
569
+ allowNullableEnum: false,
570
+ allowNullableNumber: false,
571
+ allowNullableObject: true,
572
+ allowNullableString: false,
573
+ allowNumber: false,
574
+ allowString: false
575
+ }
576
+ ]
355
577
  }
356
578
  };
357
579
 
358
580
  // src/unicorn/index.ts
359
581
  import unicornPlugin from "eslint-plugin-unicorn";
360
582
  var unicornConfig = {
361
- plugins: { unicorn: unicornPlugin },
583
+ plugins: {
584
+ unicorn: unicornPlugin
585
+ },
362
586
  rules: {
363
587
  ...unicornPlugin.configs["flat/recommended"].rules,
364
- "unicorn/catch-error-name": ["off"],
365
- "unicorn/consistent-function-scoping": ["off"],
366
- "unicorn/filename-case": ["off"],
367
- "unicorn/new-for-builtins": ["off"],
368
- "unicorn/no-array-callback-reference": ["off"],
369
- "unicorn/no-await-expression-member": ["off"],
370
- "unicorn/no-nested-ternary": ["off"],
371
- "unicorn/no-null": ["off"],
372
- "unicorn/number-literal-case": ["off"],
373
- "unicorn/prefer-module": ["off"],
374
- "unicorn/prefer-top-level-await": ["off"],
375
- "unicorn/prevent-abbreviations": ["off"]
588
+ "unicorn/catch-error-name": [
589
+ "off"
590
+ ],
591
+ "unicorn/consistent-function-scoping": [
592
+ "off"
593
+ ],
594
+ "unicorn/filename-case": [
595
+ "off"
596
+ ],
597
+ "unicorn/new-for-builtins": [
598
+ "off"
599
+ ],
600
+ "unicorn/no-array-callback-reference": [
601
+ "off"
602
+ ],
603
+ "unicorn/no-await-expression-member": [
604
+ "off"
605
+ ],
606
+ "unicorn/no-nested-ternary": [
607
+ "off"
608
+ ],
609
+ "unicorn/no-null": [
610
+ "off"
611
+ ],
612
+ "unicorn/number-literal-case": [
613
+ "off"
614
+ ],
615
+ "unicorn/prefer-module": [
616
+ "off"
617
+ ],
618
+ "unicorn/prefer-top-level-await": [
619
+ "off"
620
+ ],
621
+ "unicorn/prevent-abbreviations": [
622
+ "off"
623
+ ]
376
624
  }
377
625
  };
378
626
 
379
627
  // src/workspaces/index.ts
380
628
  import workspacesPlugin from "eslint-plugin-workspaces";
381
629
  var workspacesConfig = {
382
- plugins: { workspaces: workspacesPlugin },
630
+ plugins: {
631
+ workspaces: workspacesPlugin
632
+ },
383
633
  rules: {
384
634
  ...workspacesPlugin.configs.recommended.rules,
385
- "workspaces/no-relative-imports": ["off"],
386
- "workspaces/require-dependency": ["off"]
635
+ "workspaces/no-relative-imports": [
636
+ "off"
637
+ ],
638
+ "workspaces/require-dependency": [
639
+ "off"
640
+ ]
387
641
  }
388
642
  };
389
643
 
@@ -391,24 +645,48 @@ var workspacesConfig = {
391
645
  import json from "@eslint/json";
392
646
  var jsonConfig = {
393
647
  ignores,
394
- files: ["**/*.json"],
395
- plugins: { json },
648
+ files: [
649
+ "**/*.json"
650
+ ],
651
+ plugins: {
652
+ json
653
+ },
396
654
  language: "json/json",
397
- rules: { "json/no-duplicate-keys": ["error"] }
655
+ rules: {
656
+ "json/no-duplicate-keys": [
657
+ "error"
658
+ ]
659
+ }
398
660
  };
399
661
  var jsoncConfig = {
400
662
  ignores,
401
- files: ["**/*.jsonc"],
402
- plugins: { json },
663
+ files: [
664
+ "**/*.jsonc"
665
+ ],
666
+ plugins: {
667
+ json
668
+ },
403
669
  language: "json/jsonc",
404
- rules: { "json/no-duplicate-keys": ["error"] }
670
+ rules: {
671
+ "json/no-duplicate-keys": [
672
+ "error"
673
+ ]
674
+ }
405
675
  };
406
676
  var json5Config = {
407
677
  ignores,
408
- files: ["**/*.json5"],
409
- plugins: { json },
678
+ files: [
679
+ "**/*.json5"
680
+ ],
681
+ plugins: {
682
+ json
683
+ },
410
684
  language: "json/json5",
411
- rules: { "json/no-duplicate-keys": ["error"] }
685
+ rules: {
686
+ "json/no-duplicate-keys": [
687
+ "error"
688
+ ]
689
+ }
412
690
  };
413
691
 
414
692
  // src/index.ts