@abinnovision/eslint-config-base 3.2.0 → 3.2.1-beta.5

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