@abinnovision/eslint-config-base 3.0.0 → 3.0.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.
package/dist/index.cjs ADDED
@@ -0,0 +1,886 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ base: () => config,
34
+ configFiles: () => config2,
35
+ nestjs: () => config3,
36
+ vitest: () => config4
37
+ });
38
+ module.exports = __toCommonJS(src_exports);
39
+
40
+ // src/configs/base.ts
41
+ var import_js = __toESM(require("@eslint/js"), 1);
42
+ var import_config = require("eslint/config");
43
+ var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
44
+ var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
45
+ var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
46
+ var config = (0, import_config.defineConfig)([
47
+ {
48
+ files: ["**/*.{ts,tsx,js,jsx}"],
49
+ languageOptions: {
50
+ ecmaVersion: "latest"
51
+ },
52
+ plugins: {
53
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
54
+ import: import_eslint_plugin_import.default,
55
+ uimports: import_eslint_plugin_unused_imports.default
56
+ },
57
+ extends: [
58
+ /**
59
+ * ESLint Recommended Rules
60
+ *
61
+ * @see https://eslint.org/docs/latest/rules/
62
+ */
63
+ import_js.default.configs.recommended
64
+ ],
65
+ rules: {
66
+ /**
67
+ * Enforce getter/setter pairs in objects and classes.
68
+ *
69
+ * @see https://eslint.org/docs/latest/rules/accessor-pairs
70
+ */
71
+ "accessor-pairs": [
72
+ "error",
73
+ { setWithoutGet: true, getWithoutSet: false }
74
+ ],
75
+ /**
76
+ * Enforce return statements in callbacks of array methods.
77
+ *
78
+ * @see https://eslint.org/docs/latest/rules/array-callback-return
79
+ */
80
+ "array-callback-return": "error",
81
+ /**
82
+ * Disallow Array constructor.
83
+ *
84
+ * @see https://eslint.org/docs/latest/rules/no-array-constructor
85
+ */
86
+ "no-array-constructor": "error",
87
+ /**
88
+ * Disallow use of arguments.caller or arguments.callee.
89
+ *
90
+ * @see https://eslint.org/docs/latest/rules/no-caller
91
+ */
92
+ "no-caller": "error",
93
+ /**
94
+ * Enforce default clauses in switch statements to be last.
95
+ *
96
+ * @see https://eslint.org/docs/latest/rules/default-case-last
97
+ */
98
+ "default-case-last": "error",
99
+ /**
100
+ * Require === and !==.
101
+ *
102
+ * @see https://eslint.org/docs/latest/rules/eqeqeq
103
+ */
104
+ eqeqeq: ["error", "always"],
105
+ /**
106
+ * Disallow eval().
107
+ *
108
+ * @see https://eslint.org/docs/latest/rules/no-eval
109
+ */
110
+ "no-eval": "error",
111
+ /**
112
+ * Disallow extending native types.
113
+ *
114
+ * @see https://eslint.org/docs/latest/rules/no-extend-native
115
+ */
116
+ "no-extend-native": "error",
117
+ /**
118
+ * Disallow unnecessary function binding.
119
+ *
120
+ * @see https://eslint.org/docs/latest/rules/no-extra-bind
121
+ */
122
+ "no-extra-bind": "error",
123
+ /**
124
+ * Disallow leading or trailing decimal points in numeric literals.
125
+ *
126
+ * @see https://eslint.org/docs/latest/rules/no-floating-decimal
127
+ */
128
+ "no-floating-decimal": "error",
129
+ /**
130
+ * Disallow assignment operators in return statements.
131
+ *
132
+ * @see https://eslint.org/docs/latest/rules/no-return-assign
133
+ */
134
+ "no-return-assign": "error",
135
+ /**
136
+ * Disallow new operators outside of assignments or comparisons.
137
+ *
138
+ * @see https://eslint.org/docs/latest/rules/no-new
139
+ */
140
+ "no-new": "error",
141
+ /**
142
+ * Disallow new operators with Function object.
143
+ *
144
+ * @see https://eslint.org/docs/latest/rules/no-new-func
145
+ */
146
+ "no-new-func": "error",
147
+ /**
148
+ * Disallow new operators with Symbol object.
149
+ *
150
+ * @see https://eslint.org/docs/latest/rules/no-new-symbol
151
+ */
152
+ "no-new-symbol": "error",
153
+ /**
154
+ * Disallow new operators with String, Number, and Boolean objects.
155
+ *
156
+ * @see https://eslint.org/docs/latest/rules/no-new-wrappers
157
+ */
158
+ "no-new-wrappers": "error",
159
+ /**
160
+ * Disallow octal escape sequences in string literals.
161
+ *
162
+ * @see https://eslint.org/docs/latest/rules/no-octal-escape
163
+ */
164
+ "no-octal-escape": "error",
165
+ /**
166
+ * Disallow variable redeclaration.
167
+ *
168
+ * @see https://eslint.org/docs/latest/rules/no-redeclare
169
+ */
170
+ "no-redeclare": "error",
171
+ /**
172
+ * Disallow comparisons where both sides are exactly the same.
173
+ *
174
+ * @see https://eslint.org/docs/latest/rules/no-self-compare
175
+ */
176
+ "no-self-compare": "error",
177
+ /**
178
+ * Disallow comma operators.
179
+ *
180
+ * @see https://eslint.org/docs/latest/rules/no-sequences
181
+ */
182
+ "no-sequences": "error",
183
+ /**
184
+ * Disallow throwing literals as exceptions.
185
+ *
186
+ * @see https://eslint.org/docs/latest/rules/no-throw-literal
187
+ */
188
+ "no-throw-literal": "error",
189
+ /**
190
+ * Disallow loops with a body that allows only one iteration.
191
+ *
192
+ * @see https://eslint.org/docs/latest/rules/no-unreachable-loop
193
+ */
194
+ "no-unreachable-loop": "error",
195
+ /**
196
+ * Disallow redundant return statements.
197
+ *
198
+ * @see https://eslint.org/docs/latest/rules/no-useless-return
199
+ */
200
+ "no-useless-return": "error",
201
+ /**
202
+ * Require var declarations be placed at the top of their scope.
203
+ *
204
+ * @see https://eslint.org/docs/latest/rules/vars-on-top
205
+ */
206
+ "vars-on-top": "error",
207
+ /**
208
+ * Require let or const instead of var.
209
+ *
210
+ * @see https://eslint.org/docs/latest/rules/no-var
211
+ */
212
+ "no-var": "error",
213
+ /**
214
+ * Require const declarations for variables that are never reassigned.
215
+ *
216
+ * @see https://eslint.org/docs/latest/rules/prefer-const
217
+ */
218
+ "prefer-const": "error",
219
+ /**
220
+ * Require object spread over Object.assign.
221
+ *
222
+ * @see https://eslint.org/docs/latest/rules/prefer-object-spread
223
+ */
224
+ "prefer-object-spread": "error",
225
+ /**
226
+ * Require rest parameters instead of arguments.
227
+ *
228
+ * @see https://eslint.org/docs/latest/rules/prefer-rest-params
229
+ */
230
+ "prefer-rest-params": "error",
231
+ /**
232
+ * Require spread operators instead of .apply().
233
+ *
234
+ * @see https://eslint.org/docs/latest/rules/prefer-spread
235
+ */
236
+ "prefer-spread": "error",
237
+ /**
238
+ * Custom JS Rules: Code Quality & Complexity
239
+ */
240
+ /**
241
+ * Enforce a maximum cyclomatic complexity allowed in a program.
242
+ *
243
+ * @see https://eslint.org/docs/latest/rules/complexity
244
+ */
245
+ complexity: ["error", { max: 25 }],
246
+ /**
247
+ * Enforce a maximum depth that blocks can be nested.
248
+ *
249
+ * @see https://eslint.org/docs/latest/rules/max-depth
250
+ */
251
+ "max-depth": ["error", 5],
252
+ /**
253
+ * Enforce a maximum depth that callbacks can be nested.
254
+ *
255
+ * @see https://eslint.org/docs/latest/rules/max-nested-callbacks
256
+ */
257
+ "max-nested-callbacks": ["error", 3],
258
+ /**
259
+ * Enforce a maximum number of parameters in function definitions.
260
+ *
261
+ * @see https://eslint.org/docs/latest/rules/max-params
262
+ */
263
+ "max-params": ["error", 3],
264
+ /**
265
+ * Require for-in loops to include an if statement.
266
+ *
267
+ * @see https://eslint.org/docs/latest/rules/guard-for-in
268
+ */
269
+ "guard-for-in": "error",
270
+ /**
271
+ * Require grouped accessor pairs in object literals and classes.
272
+ *
273
+ * @see https://eslint.org/docs/latest/rules/grouped-accessor-pairs
274
+ */
275
+ "grouped-accessor-pairs": "error",
276
+ /**
277
+ * Require constructor names to begin with a capital letter.
278
+ *
279
+ * @see https://eslint.org/docs/latest/rules/new-cap
280
+ */
281
+ "new-cap": [
282
+ "error",
283
+ {
284
+ newIsCap: true,
285
+ capIsNew: false,
286
+ properties: true
287
+ }
288
+ ],
289
+ /**
290
+ * Disallow returning value from constructor.
291
+ *
292
+ * @see https://eslint.org/docs/latest/rules/no-constructor-return
293
+ */
294
+ "no-constructor-return": "error",
295
+ /**
296
+ * Disallow variable or function declarations in nested blocks.
297
+ *
298
+ * @see https://eslint.org/docs/latest/rules/no-inner-declarations
299
+ */
300
+ "no-inner-declarations": "error",
301
+ /**
302
+ * Disallow mixed binary operators without parentheses.
303
+ *
304
+ * @see https://eslint.org/docs/latest/rules/no-mixed-operators
305
+ */
306
+ "no-mixed-operators": "error",
307
+ /**
308
+ * Disallow the use of console.
309
+ *
310
+ * @see https://eslint.org/docs/latest/rules/no-console
311
+ */
312
+ "no-console": "warn",
313
+ /**
314
+ * Custom Configuration Adjustments
315
+ * Override ESLint recommended rules where we want different behavior
316
+ */
317
+ /**
318
+ * Disallow assignment operators in conditional expressions except when enclosed in parentheses.
319
+ *
320
+ * @see https://eslint.org/docs/latest/rules/no-cond-assign
321
+ */
322
+ "no-cond-assign": ["error", "except-parens"],
323
+ /**
324
+ * Disallow constant expressions in conditions except loops.
325
+ *
326
+ * @see https://eslint.org/docs/latest/rules/no-constant-condition
327
+ */
328
+ "no-constant-condition": ["error", { checkLoops: false }],
329
+ /**
330
+ * Disallow empty block statements except catch blocks.
331
+ *
332
+ * @see https://eslint.org/docs/latest/rules/no-empty
333
+ */
334
+ "no-empty": ["error", { allowEmptyCatch: true }],
335
+ /**
336
+ * Import Ordering and Organization
337
+ * Enforces consistent import structure
338
+ */
339
+ /**
340
+ * Enforce a convention in module import order.
341
+ *
342
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
343
+ */
344
+ "import/order": [
345
+ "error",
346
+ {
347
+ groups: [
348
+ // Externals
349
+ ["builtin", "external"],
350
+ // Internals
351
+ ["internal", "unknown", "parent", "sibling", "index"],
352
+ // Types
353
+ ["object", "type"]
354
+ ],
355
+ "newlines-between": "always",
356
+ alphabetize: { order: "asc", caseInsensitive: true },
357
+ warnOnUnassignedImports: true
358
+ }
359
+ ],
360
+ /**
361
+ * Require exports to be placed at the end of the file.
362
+ *
363
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
364
+ */
365
+ "import/exports-last": "warn",
366
+ /**
367
+ * Require imports to be placed before other statements.
368
+ *
369
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
370
+ */
371
+ "import/first": "error",
372
+ /**
373
+ * Require a newline after import statements.
374
+ *
375
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
376
+ */
377
+ "import/newline-after-import": "error",
378
+ /**
379
+ * Unused Imports Handling
380
+ * Uses unused-imports plugin for better detection
381
+ */
382
+ /**
383
+ * Disables base no-unused-vars (replaced by unused-imports).
384
+ */
385
+ "no-unused-vars": "off",
386
+ /**
387
+ * Disallow unused imports.
388
+ *
389
+ * @see https://github.com/sweepline/eslint-plugin-unused-imports
390
+ */
391
+ "uimports/no-unused-imports": "error",
392
+ /**
393
+ * Disallow unused variables.
394
+ *
395
+ * @see https://github.com/sweepline/eslint-plugin-unused-imports
396
+ */
397
+ "uimports/no-unused-vars": [
398
+ "warn",
399
+ {
400
+ vars: "all",
401
+ varsIgnorePattern: "^_",
402
+ args: "after-used",
403
+ argsIgnorePattern: "^_"
404
+ }
405
+ ]
406
+ }
407
+ },
408
+ {
409
+ /**
410
+ * TypeScript-Specific Configuration
411
+ */
412
+ files: ["**/*.{ts,tsx}"],
413
+ plugins: {
414
+ "@typescript-eslint": import_typescript_eslint.default.plugin
415
+ },
416
+ languageOptions: {
417
+ parser: import_typescript_eslint.default.parser,
418
+ parserOptions: {
419
+ project: "./tsconfig.json"
420
+ }
421
+ },
422
+ extends: [
423
+ /**
424
+ * TypeScript ESLint Recommended Rules
425
+ *
426
+ * @see https://typescript-eslint.io/rules
427
+ */
428
+ import_typescript_eslint.default.configs.strictTypeChecked
429
+ ],
430
+ rules: {
431
+ /**
432
+ * Allow explicit any for flexibility.
433
+ *
434
+ * @see https://typescript-eslint.io/rules/no-explicit-any
435
+ */
436
+ "@typescript-eslint/no-explicit-any": "off",
437
+ /**
438
+ * Allow non-null assertions.
439
+ *
440
+ * @see https://typescript-eslint.io/rules/no-non-null-assertion
441
+ */
442
+ "@typescript-eslint/no-non-null-assertion": "warn",
443
+ /**
444
+ * Require Promise-like statements to be handled appropriately.
445
+ *
446
+ * @see https://typescript-eslint.io/rules/no-floating-promises
447
+ */
448
+ "@typescript-eslint/no-floating-promises": "error",
449
+ /**
450
+ * Require explicit accessibility modifiers on class properties and methods.
451
+ *
452
+ * @see https://typescript-eslint.io/rules/explicit-member-accessibility
453
+ */
454
+ "@typescript-eslint/explicit-member-accessibility": "error",
455
+ /**
456
+ * Require a consistent member declaration order.
457
+ *
458
+ * @see https://typescript-eslint.io/rules/member-ordering
459
+ */
460
+ "@typescript-eslint/member-ordering": [
461
+ "error",
462
+ {
463
+ default: [
464
+ // Fields
465
+ "public-static-field",
466
+ "protected-static-field",
467
+ "private-static-field",
468
+ "public-instance-field",
469
+ "protected-instance-field",
470
+ "private-instance-field",
471
+ // Constructors
472
+ "public-constructor",
473
+ "protected-constructor",
474
+ "private-constructor",
475
+ // Methods
476
+ "public-static-method",
477
+ "protected-static-method",
478
+ "private-static-method",
479
+ "public-instance-method",
480
+ "protected-instance-method",
481
+ "private-instance-method"
482
+ ]
483
+ }
484
+ ],
485
+ /**
486
+ * Enforce using a particular method signature syntax.
487
+ *
488
+ * @see https://typescript-eslint.io/rules/method-signature-style
489
+ */
490
+ "@typescript-eslint/method-signature-style": "error",
491
+ /**
492
+ * Enforce consistent usage of type assertions.
493
+ *
494
+ * @see https://typescript-eslint.io/rules/consistent-type-assertions
495
+ */
496
+ "@typescript-eslint/consistent-type-assertions": [
497
+ "error",
498
+ {
499
+ assertionStyle: "as",
500
+ objectLiteralTypeAssertions: "never"
501
+ }
502
+ ],
503
+ /**
504
+ * Enforce type definitions to consistently use interface or type.
505
+ *
506
+ * @see https://typescript-eslint.io/rules/consistent-type-definitions
507
+ */
508
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
509
+ /**
510
+ * Enforce consistent usage of type imports.
511
+ *
512
+ * @see https://typescript-eslint.io/rules/consistent-type-imports
513
+ */
514
+ "@typescript-eslint/consistent-type-imports": "error",
515
+ /**
516
+ * Disallow type imports with side effects.
517
+ *
518
+ * @see https://typescript-eslint.io/rules/no-import-type-side-effects
519
+ */
520
+ "@typescript-eslint/no-import-type-side-effects": "error",
521
+ /**
522
+ * Require using for-of loops instead of standard for loops over arrays.
523
+ *
524
+ * @see https://typescript-eslint.io/rules/prefer-for-of
525
+ */
526
+ "@typescript-eslint/prefer-for-of": "warn",
527
+ /**
528
+ * Require using function types instead of interfaces with call signatures.
529
+ *
530
+ * @see https://typescript-eslint.io/rules/prefer-function-type
531
+ */
532
+ "@typescript-eslint/prefer-function-type": "error",
533
+ /**
534
+ * Custom Overrides for TypeScript Rules
535
+ */
536
+ /**
537
+ * Disallow TypeScript namespaces except in declarations and definition files.
538
+ *
539
+ * @see https://typescript-eslint.io/rules/no-namespace
540
+ */
541
+ "@typescript-eslint/no-namespace": [
542
+ "error",
543
+ {
544
+ allowDeclarations: true,
545
+ allowDefinitionFiles: true
546
+ }
547
+ ],
548
+ /**
549
+ * Require awaiting a value before returning it from an async function.
550
+ *
551
+ * @see https://typescript-eslint.io/rules/return-await
552
+ */
553
+ "@typescript-eslint/return-await": ["warn", "always"],
554
+ /**
555
+ * Disable TypeScript no-unused-vars (using unused-imports plugin).
556
+ */
557
+ "@typescript-eslint/no-unused-vars": "off",
558
+ /**
559
+ * Disallow classes used as namespaces except when used with decorators.
560
+ *
561
+ * @see https://typescript-eslint.io/rules/no-extraneous-class
562
+ */
563
+ "@typescript-eslint/no-extraneous-class": [
564
+ "error",
565
+ {
566
+ allowWithDecorator: true
567
+ }
568
+ ]
569
+ }
570
+ }
571
+ ]);
572
+
573
+ // src/configs/flavour-config-files.ts
574
+ var import_config2 = require("eslint/config");
575
+ var import_globals = __toESM(require("globals"), 1);
576
+ var config2 = (0, import_config2.defineConfig)([
577
+ {
578
+ languageOptions: {
579
+ globals: {
580
+ ...import_globals.default.node
581
+ }
582
+ },
583
+ rules: {
584
+ /**
585
+ * Disallow the use of console.
586
+ * Disabled for config files that often log build information.
587
+ *
588
+ * @see https://eslint.org/docs/latest/rules/no-console
589
+ */
590
+ "no-console": "off",
591
+ /**
592
+ * Enforce a maximum number of lines per function.
593
+ * Disabled for complex build configurations.
594
+ *
595
+ * @see https://eslint.org/docs/latest/rules/max-lines-per-function
596
+ */
597
+ "max-lines-per-function": "off",
598
+ /**
599
+ * Disallow require statements except in import statements.
600
+ * Disabled for CommonJS config files.
601
+ *
602
+ * @see https://typescript-eslint.io/rules/no-var-requires
603
+ */
604
+ "@typescript-eslint/no-var-requires": "off"
605
+ }
606
+ }
607
+ ]);
608
+
609
+ // src/configs/flavour-nestjs.ts
610
+ var import_config3 = require("eslint/config");
611
+ var config3 = (0, import_config3.defineConfig)([
612
+ {
613
+ files: ["**/*.{ts,js}"],
614
+ rules: {
615
+ /**
616
+ * Enforce a maximum number of parameters in function definitions.
617
+ * Increased to 8 for NestJS dependency injection patterns.
618
+ *
619
+ * @see https://eslint.org/docs/latest/rules/max-params
620
+ */
621
+ "max-params": ["error", 8],
622
+ /**
623
+ * Disallow useless constructors.
624
+ * Disabled for NestJS as DI decorators make constructors appear "useless".
625
+ *
626
+ * @see https://typescript-eslint.io/rules/no-useless-constructor
627
+ */
628
+ "@typescript-eslint/no-useless-constructor": "off",
629
+ /**
630
+ * Disallow empty functions.
631
+ * Allow empty constructors for NestJS DI parameter properties.
632
+ *
633
+ * @see https://typescript-eslint.io/rules/no-empty-function
634
+ */
635
+ "@typescript-eslint/no-empty-function": [
636
+ "error",
637
+ { allow: ["constructors"] }
638
+ ],
639
+ /**
640
+ * Require or disallow parameter properties in class constructors.
641
+ * Enforces NestJS DI pattern using parameter properties.
642
+ *
643
+ * @see https://typescript-eslint.io/rules/parameter-properties
644
+ */
645
+ "@typescript-eslint/parameter-properties": [
646
+ "error",
647
+ {
648
+ allow: [
649
+ "private readonly",
650
+ "protected readonly",
651
+ "public readonly",
652
+ "private",
653
+ "protected",
654
+ "public"
655
+ ],
656
+ prefer: "parameter-property"
657
+ }
658
+ ]
659
+ }
660
+ }
661
+ ]);
662
+
663
+ // src/configs/flavour-vitest.ts
664
+ var import_eslint_plugin = __toESM(require("@vitest/eslint-plugin"), 1);
665
+ var import_config4 = require("eslint/config");
666
+ var config4 = (0, import_config4.defineConfig)([
667
+ {
668
+ files: [
669
+ "**/*.test.{ts,tsx,js,jsx}",
670
+ "**/*.spec.{ts,tsx,js,jsx}",
671
+ "**/__tests__/**/*.{ts,tsx,js,jsx}"
672
+ ],
673
+ plugins: {
674
+ vitest: import_eslint_plugin.default
675
+ },
676
+ languageOptions: {
677
+ globals: {
678
+ ...import_eslint_plugin.default.environments.env.globals
679
+ }
680
+ },
681
+ settings: {
682
+ vitest: {
683
+ typecheck: true
684
+ }
685
+ },
686
+ rules: {
687
+ /**
688
+ * Enable Vitest recommended rules.
689
+ */
690
+ ...import_eslint_plugin.default.configs.recommended.rules,
691
+ /**
692
+ * Enforce a maximum number of parameters in function definitions.
693
+ * Increased to 5 for test setup functions that receive fixtures and mocks.
694
+ *
695
+ * @see https://eslint.org/docs/latest/rules/max-params
696
+ */
697
+ "max-params": ["error", 5],
698
+ /**
699
+ * Enforce a maximum depth that callbacks can be nested.
700
+ * Increased to 5 for describe/it/beforeEach nesting patterns.
701
+ *
702
+ * @see https://eslint.org/docs/latest/rules/max-nested-callbacks
703
+ */
704
+ "max-nested-callbacks": ["error", 5],
705
+ /**
706
+ * Enforce a maximum cyclomatic complexity allowed in a program.
707
+ * Increased to 30 and downgraded to warn for complex test scenarios.
708
+ *
709
+ * @see https://eslint.org/docs/latest/rules/complexity
710
+ */
711
+ complexity: ["warn", 30],
712
+ /**
713
+ * Enforce a maximum number of lines per function.
714
+ * Disabled for test cases with comprehensive setup and assertions.
715
+ *
716
+ * @see https://eslint.org/docs/latest/rules/max-lines-per-function
717
+ */
718
+ "max-lines-per-function": "off",
719
+ /**
720
+ * Enforce a maximum number of statements allowed in function blocks.
721
+ * Disabled for tests with multiple setup and assertion statements.
722
+ *
723
+ * @see https://eslint.org/docs/latest/rules/max-statements
724
+ */
725
+ "max-statements": "off",
726
+ /**
727
+ * Enforce a maximum number of lines per file.
728
+ * Disabled for comprehensive test suites.
729
+ *
730
+ * @see https://eslint.org/docs/latest/rules/max-lines
731
+ */
732
+ "max-lines": "off",
733
+ /**
734
+ * Disallow assigning a value with type any to variables and properties.
735
+ * Disabled for mock objects and test utilities.
736
+ *
737
+ * @see https://typescript-eslint.io/rules/no-unsafe-assignment
738
+ */
739
+ "@typescript-eslint/no-unsafe-assignment": "off",
740
+ /**
741
+ * Disallow member access on a value with type any.
742
+ * Disabled for mock objects.
743
+ *
744
+ * @see https://typescript-eslint.io/rules/no-unsafe-member-access
745
+ */
746
+ "@typescript-eslint/no-unsafe-member-access": "off",
747
+ /**
748
+ * Disallow calling a value with type any.
749
+ * Disabled for test utilities like vi.fn().
750
+ *
751
+ * @see https://typescript-eslint.io/rules/no-unsafe-call
752
+ */
753
+ "@typescript-eslint/no-unsafe-call": "off",
754
+ /**
755
+ * Disallow returning a value with type any from a function.
756
+ * Disabled for test helper functions.
757
+ *
758
+ * @see https://typescript-eslint.io/rules/no-unsafe-return
759
+ */
760
+ "@typescript-eslint/no-unsafe-return": "off",
761
+ /**
762
+ * Disallow passing a value with type any to a function parameter.
763
+ * Disabled for test mock parameters.
764
+ *
765
+ * @see https://typescript-eslint.io/rules/no-unsafe-argument
766
+ */
767
+ "@typescript-eslint/no-unsafe-argument": "off",
768
+ /**
769
+ * Require unbound methods to be called with correct this context.
770
+ * Disabled for Vitest expectations like expect(obj.method).toBeCalled().
771
+ *
772
+ * @see https://typescript-eslint.io/rules/unbound-method
773
+ */
774
+ "@typescript-eslint/unbound-method": "off",
775
+ /**
776
+ * Disallow magic numbers.
777
+ * Disabled for test assertions with literal values.
778
+ *
779
+ * @see https://typescript-eslint.io/rules/no-magic-numbers
780
+ */
781
+ "@typescript-eslint/no-magic-numbers": "off",
782
+ /**
783
+ * Require Promise-like statements to be handled appropriately.
784
+ * Downgraded to warn for test utilities.
785
+ *
786
+ * @see https://typescript-eslint.io/rules/no-floating-promises
787
+ */
788
+ "@typescript-eslint/no-floating-promises": "warn",
789
+ /**
790
+ * Disallow non-null assertions using the ! postfix operator.
791
+ * Disabled for tests where values are known to exist.
792
+ *
793
+ * @see https://typescript-eslint.io/rules/no-non-null-assertion
794
+ */
795
+ "@typescript-eslint/no-non-null-assertion": "off",
796
+ /**
797
+ * Disallow empty functions.
798
+ * Disabled for test stubs and spies.
799
+ *
800
+ * @see https://eslint.org/docs/latest/rules/no-empty-function
801
+ */
802
+ "no-empty-function": "off",
803
+ /**
804
+ * Disallow empty functions.
805
+ * Disabled for test stubs and spies.
806
+ *
807
+ * @see https://typescript-eslint.io/rules/no-empty-function
808
+ */
809
+ "@typescript-eslint/no-empty-function": "off",
810
+ /**
811
+ * Disallow magic numbers.
812
+ * Disabled for test assertions.
813
+ *
814
+ * @see https://eslint.org/docs/latest/rules/no-magic-numbers
815
+ */
816
+ "no-magic-numbers": "off",
817
+ /**
818
+ * Disallow the use of console.
819
+ * Disabled for test debugging.
820
+ *
821
+ * @see https://eslint.org/docs/latest/rules/no-console
822
+ */
823
+ "no-console": "off",
824
+ /**
825
+ * Disallow focused tests.
826
+ * Prevents .only from being committed.
827
+ *
828
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
829
+ */
830
+ "vitest/no-focused-tests": "error",
831
+ /**
832
+ * Disallow disabled tests.
833
+ * Warns about .skip usage.
834
+ *
835
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
836
+ */
837
+ "vitest/no-disabled-tests": "warn",
838
+ /**
839
+ * Enforce lowercase test names.
840
+ * Consistent test naming convention.
841
+ *
842
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
843
+ */
844
+ "vitest/prefer-lowercase-title": "warn",
845
+ /**
846
+ * Enforce a maximum depth for nested describe calls.
847
+ *
848
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
849
+ */
850
+ "vitest/max-nested-describe": ["error", { max: 5 }],
851
+ /**
852
+ * Disallow conditional logic in tests.
853
+ * Tests should be deterministic.
854
+ *
855
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
856
+ */
857
+ "vitest/no-conditional-in-test": "error",
858
+ /**
859
+ * Disallow conditional expects.
860
+ * Expectations should not be inside conditionals.
861
+ *
862
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
863
+ */
864
+ "vitest/no-conditional-expect": "error",
865
+ /**
866
+ * Enforce consistent hook ordering.
867
+ *
868
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
869
+ */
870
+ "vitest/prefer-hooks-in-order": "warn",
871
+ /**
872
+ * Prefer vi.spyOn over manual mocks.
873
+ *
874
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
875
+ */
876
+ "vitest/prefer-spy-on": "warn"
877
+ }
878
+ }
879
+ ]);
880
+ // Annotate the CommonJS export names for ESM import in node:
881
+ 0 && (module.exports = {
882
+ base,
883
+ configFiles,
884
+ nestjs,
885
+ vitest
886
+ });