@xylabs/eslint-config-flat 7.0.3 → 7.1.1

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,22 +34,11 @@ var ignores = [
34
34
  // src/import/index.ts
35
35
  var importConfig = {
36
36
  ignores,
37
- files: [
38
- "**/*.ts",
39
- "**/*.d.ts",
40
- "**/*.tsx",
41
- "**/*.d.tsx",
42
- "**/*.ts",
43
- "**/*.d.ts",
44
- "**/*.jsx",
45
- "**/*.d.jsx"
46
- ],
37
+ files: ["**/*.ts", "**/*.d.ts", "**/*.tsx", "**/*.d.tsx", "**/*.ts", "**/*.d.ts", "**/*.jsx", "**/*.d.jsx"],
47
38
  languageOptions: {
48
39
  parser: tsParser,
49
40
  parserOptions: {
50
- ecmaFeatures: {
51
- modules: true
52
- },
41
+ ecmaFeatures: { modules: true },
53
42
  ecmaVersion: "latest",
54
43
  project: "./tsconfig.json"
55
44
  }
@@ -58,48 +47,28 @@ var importConfig = {
58
47
  "import-x": importPlugin,
59
48
  "simple-import-sort": simpleImportSort
60
49
  },
61
- settings: {
62
- "import-x/resolver": {
63
- typescript: {
64
- project: "./tsconfig.json"
65
- }
66
- }
67
- },
50
+ settings: { "import-x/resolver": { typescript: { project: "./tsconfig.json" } } },
68
51
  rules: {
69
52
  ...importPlugin.configs.recommended.rules,
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
- ],
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"],
88
59
  "import-x/no-cycle": [
89
60
  "warn",
90
- {
91
- maxDepth: 2
92
- }
93
- ],
94
- "import-x/no-deprecated": [
95
- "off"
61
+ { maxDepth: 2 }
96
62
  ],
63
+ "import-x/no-deprecated": ["off"],
97
64
  "import-x/no-internal-modules": [
98
65
  "warn",
99
66
  {
100
67
  allow: [
101
68
  "vitest/*",
69
+ // Allow imports from vitest
102
70
  "@*/**",
71
+ // Allow imports from any @scoped package
103
72
  // Allow imports to any index.js file
104
73
  "**/index.js",
105
74
  "**/index.ts",
@@ -108,21 +77,11 @@ var importConfig = {
108
77
  ]
109
78
  }
110
79
  ],
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
- ]
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"]
126
85
  }
127
86
  };
128
87
 
@@ -130,12 +89,8 @@ var importConfig = {
130
89
  import markdown from "eslint-plugin-markdown";
131
90
  var markdownConfig = {
132
91
  ignores,
133
- plugins: {
134
- markdown
135
- },
136
- files: [
137
- "**/*.md"
138
- ],
92
+ plugins: { markdown },
93
+ files: ["**/*.md"],
139
94
  processor: "markdown/markdown"
140
95
  };
141
96
 
@@ -143,14 +98,8 @@ var markdownConfig = {
143
98
  var rulesConfig = {
144
99
  ignores,
145
100
  rules: {
146
- "complexity": [
147
- "error",
148
- 18
149
- ],
150
- "max-depth": [
151
- "error",
152
- 6
153
- ],
101
+ "complexity": ["error", 18],
102
+ "max-depth": ["error", 6],
154
103
  "max-lines": [
155
104
  "error",
156
105
  {
@@ -158,18 +107,9 @@ var rulesConfig = {
158
107
  skipBlankLines: true
159
108
  }
160
109
  ],
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
- ],
110
+ "array-element-newline": ["warn", "consistent"],
111
+ "max-nested-callbacks": ["error", 6],
112
+ "max-statements": ["error", 32],
173
113
  "no-restricted-imports": [
174
114
  "error",
175
115
  {
@@ -186,101 +126,47 @@ var rulesConfig = {
186
126
  }
187
127
  ],
188
128
  // 'no-secrets/no-secrets': ['off'],
189
- "no-tabs": [
190
- "error"
191
- ],
129
+ "no-tabs": ["error"],
192
130
  "no-unused-vars": "off",
193
131
  "no-useless-escape": "off",
194
- "quotes": [
195
- 2,
196
- "single",
197
- "avoid-escape"
198
- ],
132
+ "quotes": [2, "single", "avoid-escape"],
199
133
  "require-await": "error",
200
- "semi": [
201
- "warn",
202
- "never"
203
- ]
134
+ "semi": ["warn", "never"]
135
+ // 'sort-keys-fix/sort-keys-fix': 'warn',
204
136
  }
205
137
  };
206
138
 
207
139
  // src/sonar/index.ts
208
140
  import sonarjs from "eslint-plugin-sonarjs";
209
141
  var sonarConfig = {
210
- plugins: {
211
- sonarjs
212
- },
142
+ plugins: { sonarjs },
213
143
  ignores,
214
144
  rules: {
215
145
  // ...sonarjs.configs.recommended.rules,
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
- ],
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"],
270
164
  // handled by eslint
271
- "sonarjs/cognitive-complexity": [
272
- "off"
273
- ],
274
- "sonarjs/unused-import": [
275
- "off"
276
- ],
165
+ "sonarjs/cognitive-complexity": ["off"],
166
+ "sonarjs/unused-import": ["off"],
277
167
  // handled by typescript-eslint
278
- "sonarjs/no-unused-vars": [
279
- "off"
280
- ],
281
- "sonarjs/no-commented-code": [
282
- "off"
283
- ]
168
+ "sonarjs/no-unused-vars": ["off"],
169
+ "sonarjs/no-commented-code": ["off"]
284
170
  }
285
171
  };
286
172
 
@@ -306,9 +192,7 @@ var typescriptConfig = {
306
192
  languageOptions: {
307
193
  parser: tsParser2,
308
194
  parserOptions: {
309
- ecmaFeatures: {
310
- modules: true
311
- },
195
+ ecmaFeatures: { modules: true },
312
196
  ecmaVersion: "latest",
313
197
  project: "./tsconfig.json"
314
198
  }
@@ -320,54 +204,16 @@ var typescriptConfig = {
320
204
  rules: {
321
205
  ...tsPlugin.configs.recommended.rules,
322
206
  ...esStylistic.configs["recommended"].rules,
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
- ],
207
+ "@typescript-eslint/no-empty-object-type": ["off"],
208
+ "@typescript-eslint/explicit-member-accessibility": ["warn", { accessibility: "no-public" }],
332
209
  "@typescript-eslint/explicit-module-boundary-types": "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
- ],
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"],
371
217
  "@stylistic/member-delimiter-style": [
372
218
  "error",
373
219
  {
@@ -381,37 +227,29 @@ var typescriptConfig = {
381
227
  }
382
228
  }
383
229
  ],
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
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
413
250
  }
414
- ],
251
+ }],
252
+ "@stylistic/max-len": ["warn", { code: 160 }],
415
253
  "no-restricted-syntax": [
416
254
  "warn",
417
255
  {
@@ -449,78 +287,24 @@ var typescriptConfig = {
449
287
  "protected-constructor",
450
288
  "private-constructor",
451
289
  "constructor",
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
- ],
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"],
524
308
  "get",
525
309
  "set",
526
310
  "public-static-method",
@@ -549,10 +333,7 @@ var typescriptConfig = {
549
333
  ],
550
334
  "@typescript-eslint/no-floating-promises": "error",
551
335
  "@typescript-eslint/no-misused-promises": "error",
552
- "semi": [
553
- "warn",
554
- "never"
555
- ],
336
+ "semi": ["warn", "never"],
556
337
  "@typescript-eslint/no-unused-vars": [
557
338
  "warn",
558
339
  {
@@ -561,83 +342,48 @@ var typescriptConfig = {
561
342
  ignoreRestSiblings: true
562
343
  }
563
344
  ],
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
- ]
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
+ }]
577
355
  }
578
356
  };
579
357
 
580
358
  // src/unicorn/index.ts
581
359
  import unicornPlugin from "eslint-plugin-unicorn";
582
360
  var unicornConfig = {
583
- plugins: {
584
- unicorn: unicornPlugin
585
- },
361
+ plugins: { unicorn: unicornPlugin },
586
362
  rules: {
587
363
  ...unicornPlugin.configs["flat/recommended"].rules,
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
- ]
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"]
624
376
  }
625
377
  };
626
378
 
627
379
  // src/workspaces/index.ts
628
380
  import workspacesPlugin from "eslint-plugin-workspaces";
629
381
  var workspacesConfig = {
630
- plugins: {
631
- workspaces: workspacesPlugin
632
- },
382
+ plugins: { workspaces: workspacesPlugin },
633
383
  rules: {
634
384
  ...workspacesPlugin.configs.recommended.rules,
635
- "workspaces/no-relative-imports": [
636
- "off"
637
- ],
638
- "workspaces/require-dependency": [
639
- "off"
640
- ]
385
+ "workspaces/no-relative-imports": ["off"],
386
+ "workspaces/require-dependency": ["off"]
641
387
  }
642
388
  };
643
389
 
@@ -645,48 +391,24 @@ var workspacesConfig = {
645
391
  import json from "@eslint/json";
646
392
  var jsonConfig = {
647
393
  ignores,
648
- files: [
649
- "**/*.json"
650
- ],
651
- plugins: {
652
- json
653
- },
394
+ files: ["**/*.json"],
395
+ plugins: { json },
654
396
  language: "json/json",
655
- rules: {
656
- "json/no-duplicate-keys": [
657
- "error"
658
- ]
659
- }
397
+ rules: { "json/no-duplicate-keys": ["error"] }
660
398
  };
661
399
  var jsoncConfig = {
662
400
  ignores,
663
- files: [
664
- "**/*.jsonc"
665
- ],
666
- plugins: {
667
- json
668
- },
401
+ files: ["**/*.jsonc"],
402
+ plugins: { json },
669
403
  language: "json/jsonc",
670
- rules: {
671
- "json/no-duplicate-keys": [
672
- "error"
673
- ]
674
- }
404
+ rules: { "json/no-duplicate-keys": ["error"] }
675
405
  };
676
406
  var json5Config = {
677
407
  ignores,
678
- files: [
679
- "**/*.json5"
680
- ],
681
- plugins: {
682
- json
683
- },
408
+ files: ["**/*.json5"],
409
+ plugins: { json },
684
410
  language: "json/json5",
685
- rules: {
686
- "json/no-duplicate-keys": [
687
- "error"
688
- ]
689
- }
411
+ rules: { "json/no-duplicate-keys": ["error"] }
690
412
  };
691
413
 
692
414
  // src/index.ts