@sarj/eslint-plugin 5.0.0 → 6.0.0

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.d.cts CHANGED
@@ -1,5 +1,35 @@
1
1
  import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
2
 
3
+ /**
4
+ * @fileoverview An object type whose member comments mostly re-spell the
5
+ * members' own names and types — the VOLUME arm of the comment family, judged
6
+ * once per TYPE rather than once per comment.
7
+ *
8
+ * interface SapCredentials {
9
+ * // Database host.
10
+ * host?: string;
11
+ * // Database host port.
12
+ * port?: number;
13
+ * // Database username.
14
+ * username?: string;
15
+ * }
16
+ *
17
+ * `jsdoc-restates-signature` needs every content word covered, so it deletes
18
+ * the first row and cannot touch the second. That is the right verdict for one
19
+ * line and the wrong one for ten, so the unit of judgement here is the type.
20
+ *
21
+ * Examples: https://github.com/sarj-ai/standards/blob/main/packages/typescript/tests/rules/no-type-member-comment-wall.test.ts
22
+ * Evidence: https://github.com/sarj-ai/standards/blob/main/docs/rules/no-type-member-comment-wall.md
23
+ */
24
+
25
+ /** Every threshold this rule applies; each is documented at `DEFAULTS`. */
26
+ interface RuleOptions$3 {
27
+ readonly minCommentedMembers: number;
28
+ readonly minCommentedRatio: number;
29
+ readonly minRestatedRatio: number;
30
+ readonly maxNovelWords: number;
31
+ }
32
+
3
33
  /**
4
34
  * @fileoverview Keep modules that are stateless by design free of private
5
35
  * storage.
@@ -389,6 +419,9 @@ declare const rules: {
389
419
  "trailing-value-narration": _typescript_eslint_utils_ts_eslint.RuleModule<"narratesValue", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
390
420
  name: string;
391
421
  };
422
+ "no-type-member-comment-wall": _typescript_eslint_utils_ts_eslint.RuleModule<"commentWall", readonly [Partial<RuleOptions$3>?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
423
+ name: string;
424
+ };
392
425
  "no-tautological-expect": _typescript_eslint_utils_ts_eslint.RuleModule<"tautologicalComparison" | "tautologicalMatcher", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
393
426
  name: string;
394
427
  };
@@ -405,10 +438,141 @@ declare const rules: {
405
438
  name: string;
406
439
  };
407
440
  };
441
+ declare const recommendedRules: {
442
+ readonly "@sarj/zod-naming-convention": "warn";
443
+ readonly "@sarj/require-assert-never": "error";
444
+ readonly "@sarj/require-zod-form-validation": "error";
445
+ readonly "@sarj/enforce-file-structure": "warn";
446
+ readonly "@sarj/no-client-side-data-fetching": "warn";
447
+ readonly "@sarj/prefer-server-actions": "warn";
448
+ readonly "@sarj/no-unnecessary-use-client": "warn";
449
+ readonly "@sarj/prefer-schema-for-api-payload": "warn";
450
+ readonly "@sarj/no-sentinel-return-on-catch": "warn";
451
+ readonly "@sarj/no-log-only-catch": "warn";
452
+ readonly "@sarj/no-insecure-random-id": "warn";
453
+ readonly "@sarj/no-json-stringify-error": "warn";
454
+ readonly "@sarj/no-string-concat-in-loop": "warn";
455
+ readonly "@sarj/prefer-discriminated-union": "warn";
456
+ readonly "@sarj/no-comment-cruft": "warn";
457
+ readonly "@sarj/prefer-semantic-colors": readonly ["warn", {
458
+ readonly requireSemanticTokens: true;
459
+ }];
460
+ readonly "@sarj/no-fat-try-blocks": "warn";
461
+ readonly "@sarj/no-cors-wildcard-with-credentials": "warn";
462
+ readonly "@sarj/no-secret-in-log": "warn";
463
+ readonly "@sarj/no-unsafe-mock-casting": "warn";
464
+ readonly "@sarj/prefer-string-literal-union": "warn";
465
+ readonly "@sarj/prefer-zod-enum": "warn";
466
+ readonly "@sarj/prefer-zod-infer": "warn";
467
+ readonly "@sarj/require-fetch-timeout": "warn";
468
+ readonly "@sarj/no-silent-promise-catch": "warn";
469
+ readonly "@sarj/prefer-constant-time-secret-compare": "error";
470
+ readonly "@sarj/store-insert-requires-on-conflict": "warn";
471
+ readonly "@sarj/no-offset-pagination": "warn";
472
+ readonly "@sarj/no-select-star": "warn";
473
+ readonly "@sarj/no-hand-rolled-sleep": "warn";
474
+ readonly "@sarj/no-sleep-in-test-body": "warn";
475
+ readonly "@sarj/no-conditional-in-test": "warn";
476
+ readonly "@sarj/no-repeated-string-literal": "warn";
477
+ readonly "@sarj/no-positional-tuple-return": "warn";
478
+ readonly "@sarj/no-dynamic-sql": "warn";
479
+ readonly "@sarj/no-zod-native-enum": "warn";
480
+ readonly "@sarj/prefer-module-level-constant": "warn";
481
+ readonly "@sarj/no-restated-comment": "warn";
482
+ readonly "@sarj/jsdoc-restates-signature": "warn";
483
+ readonly "@sarj/trailing-value-narration": "warn";
484
+ readonly "@sarj/no-type-member-comment-wall": "warn";
485
+ readonly "@sarj/no-tautological-expect": "warn";
486
+ readonly "@sarj/require-interface-for-injected-service": "warn";
487
+ readonly "@sarj/prefer-non-nullable-collection": "warn";
488
+ readonly "@sarj/no-async-callback-in-waitfor": "warn";
489
+ readonly "@sarj/strict-test-assertions": "warn";
490
+ };
491
+ declare const strictRules: {
492
+ readonly "@sarj/zod-naming-convention": "error";
493
+ readonly "@sarj/require-assert-never": "error";
494
+ readonly "@sarj/require-zod-form-validation": "error";
495
+ readonly "@sarj/enforce-file-structure": "error";
496
+ readonly "@sarj/no-raw-env": "error";
497
+ readonly "@sarj/no-enum": "error";
498
+ readonly "@sarj/no-client-side-data-fetching": "error";
499
+ readonly "@sarj/prefer-server-actions": "error";
500
+ readonly "@sarj/no-unnecessary-use-client": "error";
501
+ readonly "@sarj/prefer-schema-for-api-payload": "error";
502
+ readonly "@sarj/no-sentinel-return-on-catch": "error";
503
+ readonly "@sarj/no-log-only-catch": "error";
504
+ readonly "@sarj/no-insecure-random-id": "error";
505
+ readonly "@sarj/no-json-stringify-error": "error";
506
+ readonly "@sarj/no-string-concat-in-loop": "error";
507
+ readonly "@sarj/prefer-discriminated-union": "error";
508
+ readonly "@sarj/no-comment-cruft": "error";
509
+ readonly "@sarj/prefer-semantic-colors": readonly ["error", {
510
+ readonly requireSemanticTokens: true;
511
+ }];
512
+ readonly "@sarj/no-fat-try-blocks": "error";
513
+ readonly "@sarj/no-cors-wildcard-with-credentials": "error";
514
+ readonly "@sarj/no-secret-in-log": "error";
515
+ readonly "@sarj/no-unsafe-mock-casting": "error";
516
+ readonly "@sarj/prefer-string-literal-union": "error";
517
+ readonly "@sarj/prefer-zod-enum": "error";
518
+ readonly "@sarj/prefer-zod-infer": "error";
519
+ readonly "@sarj/require-fetch-timeout": "error";
520
+ readonly "@sarj/no-silent-promise-catch": "error";
521
+ readonly "@sarj/prefer-constant-time-secret-compare": "error";
522
+ readonly "@sarj/store-insert-requires-on-conflict": "error";
523
+ readonly "@sarj/no-offset-pagination": "error";
524
+ readonly "@sarj/no-select-star": "error";
525
+ readonly "@sarj/no-hand-rolled-sleep": "error";
526
+ readonly "@sarj/no-sleep-in-test-body": "error";
527
+ readonly "@sarj/no-conditional-in-test": "error";
528
+ readonly "@sarj/no-repeated-string-literal": "error";
529
+ readonly "@sarj/no-positional-tuple-return": "error";
530
+ readonly "@sarj/no-dynamic-sql": "error";
531
+ readonly "@sarj/no-raw-fetch-outside-clients": "error";
532
+ readonly "@sarj/no-storage-in-stateless-modules": "error";
533
+ readonly "@sarj/no-zod-native-enum": "error";
534
+ readonly "@sarj/prefer-module-level-constant": "error";
535
+ readonly "@sarj/no-restated-comment": "error";
536
+ readonly "@sarj/jsdoc-restates-signature": "error";
537
+ readonly "@sarj/trailing-value-narration": "error";
538
+ readonly "@sarj/no-type-member-comment-wall": "error";
539
+ readonly "@sarj/no-tautological-expect": "error";
540
+ readonly "@sarj/require-interface-for-injected-service": "error";
541
+ readonly "@sarj/prefer-non-nullable-collection": "error";
542
+ readonly "@sarj/no-async-callback-in-waitfor": "error";
543
+ readonly "@sarj/strict-test-assertions": "error";
544
+ };
545
+ type FlatPreset = {
546
+ readonly name: string;
547
+ readonly plugins: Record<string, unknown>;
548
+ readonly rules: Record<string, unknown>;
549
+ };
550
+ /**
551
+ * The presets, as FLAT config objects.
552
+ *
553
+ * Both used to declare `plugins: ["@sarj"]` -- eslintrc syntax -- and ESLint
554
+ * rejects that outright:
555
+ *
556
+ * Config (unnamed): Key "plugins": This appears to be in eslintrc format
557
+ * (array of strings) rather than flat config format (object).
558
+ *
559
+ * So `sarj.configs.strict`, the "just extend the plugin, do not copy the file"
560
+ * path, threw for anyone who tried it, and copying `eslint.strict.mjs` and
561
+ * editing the copy was the only thing that worked -- exactly the vendoring
562
+ * these presets exist to prevent. `plugins` is now the object form flat config
563
+ * wants, so both presets go straight into an `eslint.config.mjs` array (no
564
+ * spread):
565
+ *
566
+ * import sarj from "@sarj/eslint-plugin";
567
+ * export default [sarj.configs.strict];
568
+ *
569
+ * Neither preset sets `files` or a parser. They carry rules and nothing else,
570
+ * so they compose with whatever a repo already has rather than narrowing it.
571
+ */
408
572
  declare const plugin: {
409
573
  meta: {
410
- name: string;
411
- version: string;
574
+ readonly name: "@sarj/eslint-plugin";
575
+ readonly version: "6.0.0";
412
576
  };
413
577
  rules: {
414
578
  "enforce-file-structure": _typescript_eslint_utils_ts_eslint.RuleModule<"importsFirst" | "useServerDirective", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
@@ -563,6 +727,9 @@ declare const plugin: {
563
727
  "trailing-value-narration": _typescript_eslint_utils_ts_eslint.RuleModule<"narratesValue", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
564
728
  name: string;
565
729
  };
730
+ "no-type-member-comment-wall": _typescript_eslint_utils_ts_eslint.RuleModule<"commentWall", readonly [Partial<RuleOptions$3>?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
731
+ name: string;
732
+ };
566
733
  "no-tautological-expect": _typescript_eslint_utils_ts_eslint.RuleModule<"tautologicalComparison" | "tautologicalMatcher", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
567
734
  name: string;
568
735
  };
@@ -580,113 +747,9 @@ declare const plugin: {
580
747
  };
581
748
  };
582
749
  configs: {
583
- recommended: {
584
- plugins: string[];
585
- rules: {
586
- "@sarj/zod-naming-convention": string;
587
- "@sarj/require-assert-never": string;
588
- "@sarj/require-zod-form-validation": string;
589
- "@sarj/enforce-file-structure": string;
590
- "@sarj/no-client-side-data-fetching": string;
591
- "@sarj/prefer-server-actions": string;
592
- "@sarj/no-unnecessary-use-client": string;
593
- "@sarj/prefer-schema-for-api-payload": string;
594
- "@sarj/no-sentinel-return-on-catch": string;
595
- "@sarj/no-log-only-catch": string;
596
- "@sarj/no-insecure-random-id": string;
597
- "@sarj/no-json-stringify-error": string;
598
- "@sarj/no-string-concat-in-loop": string;
599
- "@sarj/prefer-discriminated-union": string;
600
- "@sarj/no-comment-cruft": string;
601
- "@sarj/prefer-semantic-colors": (string | {
602
- requireSemanticTokens: boolean;
603
- })[];
604
- "@sarj/no-fat-try-blocks": string;
605
- "@sarj/no-cors-wildcard-with-credentials": string;
606
- "@sarj/no-secret-in-log": string;
607
- "@sarj/no-unsafe-mock-casting": string;
608
- "@sarj/prefer-string-literal-union": string;
609
- "@sarj/prefer-zod-enum": string;
610
- "@sarj/prefer-zod-infer": string;
611
- "@sarj/require-fetch-timeout": string;
612
- "@sarj/no-silent-promise-catch": string;
613
- "@sarj/prefer-constant-time-secret-compare": string;
614
- "@sarj/store-insert-requires-on-conflict": string;
615
- "@sarj/no-offset-pagination": string;
616
- "@sarj/no-select-star": string;
617
- "@sarj/no-hand-rolled-sleep": string;
618
- "@sarj/no-sleep-in-test-body": string;
619
- "@sarj/no-conditional-in-test": string;
620
- "@sarj/no-repeated-string-literal": string;
621
- "@sarj/no-positional-tuple-return": string;
622
- "@sarj/no-dynamic-sql": string;
623
- "@sarj/no-zod-native-enum": string;
624
- "@sarj/prefer-module-level-constant": string;
625
- "@sarj/no-restated-comment": string;
626
- "@sarj/jsdoc-restates-signature": string;
627
- "@sarj/trailing-value-narration": string;
628
- "@sarj/no-tautological-expect": string;
629
- "@sarj/require-interface-for-injected-service": string;
630
- "@sarj/prefer-non-nullable-collection": string;
631
- "@sarj/no-async-callback-in-waitfor": string;
632
- };
633
- };
634
- strict: {
635
- plugins: string[];
636
- rules: {
637
- "@sarj/zod-naming-convention": string;
638
- "@sarj/require-assert-never": string;
639
- "@sarj/require-zod-form-validation": string;
640
- "@sarj/enforce-file-structure": string;
641
- "@sarj/no-raw-env": string;
642
- "@sarj/no-enum": string;
643
- "@sarj/no-client-side-data-fetching": string;
644
- "@sarj/prefer-server-actions": string;
645
- "@sarj/no-unnecessary-use-client": string;
646
- "@sarj/prefer-schema-for-api-payload": string;
647
- "@sarj/no-sentinel-return-on-catch": string;
648
- "@sarj/no-log-only-catch": string;
649
- "@sarj/no-insecure-random-id": string;
650
- "@sarj/no-json-stringify-error": string;
651
- "@sarj/no-string-concat-in-loop": string;
652
- "@sarj/prefer-discriminated-union": string;
653
- "@sarj/no-comment-cruft": string;
654
- "@sarj/prefer-semantic-colors": (string | {
655
- requireSemanticTokens: boolean;
656
- })[];
657
- "@sarj/no-fat-try-blocks": string;
658
- "@sarj/no-cors-wildcard-with-credentials": string;
659
- "@sarj/no-secret-in-log": string;
660
- "@sarj/no-unsafe-mock-casting": string;
661
- "@sarj/prefer-string-literal-union": string;
662
- "@sarj/prefer-zod-enum": string;
663
- "@sarj/prefer-zod-infer": string;
664
- "@sarj/require-fetch-timeout": string;
665
- "@sarj/no-silent-promise-catch": string;
666
- "@sarj/prefer-constant-time-secret-compare": string;
667
- "@sarj/store-insert-requires-on-conflict": string;
668
- "@sarj/no-offset-pagination": string;
669
- "@sarj/no-select-star": string;
670
- "@sarj/no-hand-rolled-sleep": string;
671
- "@sarj/no-sleep-in-test-body": string;
672
- "@sarj/no-conditional-in-test": string;
673
- "@sarj/no-repeated-string-literal": string;
674
- "@sarj/no-positional-tuple-return": string;
675
- "@sarj/no-dynamic-sql": string;
676
- "@sarj/no-raw-fetch-outside-clients": string;
677
- "@sarj/no-storage-in-stateless-modules": string;
678
- "@sarj/no-zod-native-enum": string;
679
- "@sarj/prefer-module-level-constant": string;
680
- "@sarj/no-restated-comment": string;
681
- "@sarj/jsdoc-restates-signature": string;
682
- "@sarj/trailing-value-narration": string;
683
- "@sarj/no-tautological-expect": string;
684
- "@sarj/require-interface-for-injected-service": string;
685
- "@sarj/prefer-non-nullable-collection": string;
686
- "@sarj/no-async-callback-in-waitfor": string;
687
- };
688
- };
750
+ recommended: FlatPreset;
751
+ strict: FlatPreset;
689
752
  };
690
753
  };
691
754
 
692
- export { plugin as default, rules };
755
+ export { plugin as default, recommendedRules, rules, strictRules };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,35 @@
1
1
  import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
2
 
3
+ /**
4
+ * @fileoverview An object type whose member comments mostly re-spell the
5
+ * members' own names and types — the VOLUME arm of the comment family, judged
6
+ * once per TYPE rather than once per comment.
7
+ *
8
+ * interface SapCredentials {
9
+ * // Database host.
10
+ * host?: string;
11
+ * // Database host port.
12
+ * port?: number;
13
+ * // Database username.
14
+ * username?: string;
15
+ * }
16
+ *
17
+ * `jsdoc-restates-signature` needs every content word covered, so it deletes
18
+ * the first row and cannot touch the second. That is the right verdict for one
19
+ * line and the wrong one for ten, so the unit of judgement here is the type.
20
+ *
21
+ * Examples: https://github.com/sarj-ai/standards/blob/main/packages/typescript/tests/rules/no-type-member-comment-wall.test.ts
22
+ * Evidence: https://github.com/sarj-ai/standards/blob/main/docs/rules/no-type-member-comment-wall.md
23
+ */
24
+
25
+ /** Every threshold this rule applies; each is documented at `DEFAULTS`. */
26
+ interface RuleOptions$3 {
27
+ readonly minCommentedMembers: number;
28
+ readonly minCommentedRatio: number;
29
+ readonly minRestatedRatio: number;
30
+ readonly maxNovelWords: number;
31
+ }
32
+
3
33
  /**
4
34
  * @fileoverview Keep modules that are stateless by design free of private
5
35
  * storage.
@@ -389,6 +419,9 @@ declare const rules: {
389
419
  "trailing-value-narration": _typescript_eslint_utils_ts_eslint.RuleModule<"narratesValue", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
390
420
  name: string;
391
421
  };
422
+ "no-type-member-comment-wall": _typescript_eslint_utils_ts_eslint.RuleModule<"commentWall", readonly [Partial<RuleOptions$3>?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
423
+ name: string;
424
+ };
392
425
  "no-tautological-expect": _typescript_eslint_utils_ts_eslint.RuleModule<"tautologicalComparison" | "tautologicalMatcher", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
393
426
  name: string;
394
427
  };
@@ -405,10 +438,141 @@ declare const rules: {
405
438
  name: string;
406
439
  };
407
440
  };
441
+ declare const recommendedRules: {
442
+ readonly "@sarj/zod-naming-convention": "warn";
443
+ readonly "@sarj/require-assert-never": "error";
444
+ readonly "@sarj/require-zod-form-validation": "error";
445
+ readonly "@sarj/enforce-file-structure": "warn";
446
+ readonly "@sarj/no-client-side-data-fetching": "warn";
447
+ readonly "@sarj/prefer-server-actions": "warn";
448
+ readonly "@sarj/no-unnecessary-use-client": "warn";
449
+ readonly "@sarj/prefer-schema-for-api-payload": "warn";
450
+ readonly "@sarj/no-sentinel-return-on-catch": "warn";
451
+ readonly "@sarj/no-log-only-catch": "warn";
452
+ readonly "@sarj/no-insecure-random-id": "warn";
453
+ readonly "@sarj/no-json-stringify-error": "warn";
454
+ readonly "@sarj/no-string-concat-in-loop": "warn";
455
+ readonly "@sarj/prefer-discriminated-union": "warn";
456
+ readonly "@sarj/no-comment-cruft": "warn";
457
+ readonly "@sarj/prefer-semantic-colors": readonly ["warn", {
458
+ readonly requireSemanticTokens: true;
459
+ }];
460
+ readonly "@sarj/no-fat-try-blocks": "warn";
461
+ readonly "@sarj/no-cors-wildcard-with-credentials": "warn";
462
+ readonly "@sarj/no-secret-in-log": "warn";
463
+ readonly "@sarj/no-unsafe-mock-casting": "warn";
464
+ readonly "@sarj/prefer-string-literal-union": "warn";
465
+ readonly "@sarj/prefer-zod-enum": "warn";
466
+ readonly "@sarj/prefer-zod-infer": "warn";
467
+ readonly "@sarj/require-fetch-timeout": "warn";
468
+ readonly "@sarj/no-silent-promise-catch": "warn";
469
+ readonly "@sarj/prefer-constant-time-secret-compare": "error";
470
+ readonly "@sarj/store-insert-requires-on-conflict": "warn";
471
+ readonly "@sarj/no-offset-pagination": "warn";
472
+ readonly "@sarj/no-select-star": "warn";
473
+ readonly "@sarj/no-hand-rolled-sleep": "warn";
474
+ readonly "@sarj/no-sleep-in-test-body": "warn";
475
+ readonly "@sarj/no-conditional-in-test": "warn";
476
+ readonly "@sarj/no-repeated-string-literal": "warn";
477
+ readonly "@sarj/no-positional-tuple-return": "warn";
478
+ readonly "@sarj/no-dynamic-sql": "warn";
479
+ readonly "@sarj/no-zod-native-enum": "warn";
480
+ readonly "@sarj/prefer-module-level-constant": "warn";
481
+ readonly "@sarj/no-restated-comment": "warn";
482
+ readonly "@sarj/jsdoc-restates-signature": "warn";
483
+ readonly "@sarj/trailing-value-narration": "warn";
484
+ readonly "@sarj/no-type-member-comment-wall": "warn";
485
+ readonly "@sarj/no-tautological-expect": "warn";
486
+ readonly "@sarj/require-interface-for-injected-service": "warn";
487
+ readonly "@sarj/prefer-non-nullable-collection": "warn";
488
+ readonly "@sarj/no-async-callback-in-waitfor": "warn";
489
+ readonly "@sarj/strict-test-assertions": "warn";
490
+ };
491
+ declare const strictRules: {
492
+ readonly "@sarj/zod-naming-convention": "error";
493
+ readonly "@sarj/require-assert-never": "error";
494
+ readonly "@sarj/require-zod-form-validation": "error";
495
+ readonly "@sarj/enforce-file-structure": "error";
496
+ readonly "@sarj/no-raw-env": "error";
497
+ readonly "@sarj/no-enum": "error";
498
+ readonly "@sarj/no-client-side-data-fetching": "error";
499
+ readonly "@sarj/prefer-server-actions": "error";
500
+ readonly "@sarj/no-unnecessary-use-client": "error";
501
+ readonly "@sarj/prefer-schema-for-api-payload": "error";
502
+ readonly "@sarj/no-sentinel-return-on-catch": "error";
503
+ readonly "@sarj/no-log-only-catch": "error";
504
+ readonly "@sarj/no-insecure-random-id": "error";
505
+ readonly "@sarj/no-json-stringify-error": "error";
506
+ readonly "@sarj/no-string-concat-in-loop": "error";
507
+ readonly "@sarj/prefer-discriminated-union": "error";
508
+ readonly "@sarj/no-comment-cruft": "error";
509
+ readonly "@sarj/prefer-semantic-colors": readonly ["error", {
510
+ readonly requireSemanticTokens: true;
511
+ }];
512
+ readonly "@sarj/no-fat-try-blocks": "error";
513
+ readonly "@sarj/no-cors-wildcard-with-credentials": "error";
514
+ readonly "@sarj/no-secret-in-log": "error";
515
+ readonly "@sarj/no-unsafe-mock-casting": "error";
516
+ readonly "@sarj/prefer-string-literal-union": "error";
517
+ readonly "@sarj/prefer-zod-enum": "error";
518
+ readonly "@sarj/prefer-zod-infer": "error";
519
+ readonly "@sarj/require-fetch-timeout": "error";
520
+ readonly "@sarj/no-silent-promise-catch": "error";
521
+ readonly "@sarj/prefer-constant-time-secret-compare": "error";
522
+ readonly "@sarj/store-insert-requires-on-conflict": "error";
523
+ readonly "@sarj/no-offset-pagination": "error";
524
+ readonly "@sarj/no-select-star": "error";
525
+ readonly "@sarj/no-hand-rolled-sleep": "error";
526
+ readonly "@sarj/no-sleep-in-test-body": "error";
527
+ readonly "@sarj/no-conditional-in-test": "error";
528
+ readonly "@sarj/no-repeated-string-literal": "error";
529
+ readonly "@sarj/no-positional-tuple-return": "error";
530
+ readonly "@sarj/no-dynamic-sql": "error";
531
+ readonly "@sarj/no-raw-fetch-outside-clients": "error";
532
+ readonly "@sarj/no-storage-in-stateless-modules": "error";
533
+ readonly "@sarj/no-zod-native-enum": "error";
534
+ readonly "@sarj/prefer-module-level-constant": "error";
535
+ readonly "@sarj/no-restated-comment": "error";
536
+ readonly "@sarj/jsdoc-restates-signature": "error";
537
+ readonly "@sarj/trailing-value-narration": "error";
538
+ readonly "@sarj/no-type-member-comment-wall": "error";
539
+ readonly "@sarj/no-tautological-expect": "error";
540
+ readonly "@sarj/require-interface-for-injected-service": "error";
541
+ readonly "@sarj/prefer-non-nullable-collection": "error";
542
+ readonly "@sarj/no-async-callback-in-waitfor": "error";
543
+ readonly "@sarj/strict-test-assertions": "error";
544
+ };
545
+ type FlatPreset = {
546
+ readonly name: string;
547
+ readonly plugins: Record<string, unknown>;
548
+ readonly rules: Record<string, unknown>;
549
+ };
550
+ /**
551
+ * The presets, as FLAT config objects.
552
+ *
553
+ * Both used to declare `plugins: ["@sarj"]` -- eslintrc syntax -- and ESLint
554
+ * rejects that outright:
555
+ *
556
+ * Config (unnamed): Key "plugins": This appears to be in eslintrc format
557
+ * (array of strings) rather than flat config format (object).
558
+ *
559
+ * So `sarj.configs.strict`, the "just extend the plugin, do not copy the file"
560
+ * path, threw for anyone who tried it, and copying `eslint.strict.mjs` and
561
+ * editing the copy was the only thing that worked -- exactly the vendoring
562
+ * these presets exist to prevent. `plugins` is now the object form flat config
563
+ * wants, so both presets go straight into an `eslint.config.mjs` array (no
564
+ * spread):
565
+ *
566
+ * import sarj from "@sarj/eslint-plugin";
567
+ * export default [sarj.configs.strict];
568
+ *
569
+ * Neither preset sets `files` or a parser. They carry rules and nothing else,
570
+ * so they compose with whatever a repo already has rather than narrowing it.
571
+ */
408
572
  declare const plugin: {
409
573
  meta: {
410
- name: string;
411
- version: string;
574
+ readonly name: "@sarj/eslint-plugin";
575
+ readonly version: "6.0.0";
412
576
  };
413
577
  rules: {
414
578
  "enforce-file-structure": _typescript_eslint_utils_ts_eslint.RuleModule<"importsFirst" | "useServerDirective", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
@@ -563,6 +727,9 @@ declare const plugin: {
563
727
  "trailing-value-narration": _typescript_eslint_utils_ts_eslint.RuleModule<"narratesValue", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
564
728
  name: string;
565
729
  };
730
+ "no-type-member-comment-wall": _typescript_eslint_utils_ts_eslint.RuleModule<"commentWall", readonly [Partial<RuleOptions$3>?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
731
+ name: string;
732
+ };
566
733
  "no-tautological-expect": _typescript_eslint_utils_ts_eslint.RuleModule<"tautologicalComparison" | "tautologicalMatcher", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
567
734
  name: string;
568
735
  };
@@ -580,113 +747,9 @@ declare const plugin: {
580
747
  };
581
748
  };
582
749
  configs: {
583
- recommended: {
584
- plugins: string[];
585
- rules: {
586
- "@sarj/zod-naming-convention": string;
587
- "@sarj/require-assert-never": string;
588
- "@sarj/require-zod-form-validation": string;
589
- "@sarj/enforce-file-structure": string;
590
- "@sarj/no-client-side-data-fetching": string;
591
- "@sarj/prefer-server-actions": string;
592
- "@sarj/no-unnecessary-use-client": string;
593
- "@sarj/prefer-schema-for-api-payload": string;
594
- "@sarj/no-sentinel-return-on-catch": string;
595
- "@sarj/no-log-only-catch": string;
596
- "@sarj/no-insecure-random-id": string;
597
- "@sarj/no-json-stringify-error": string;
598
- "@sarj/no-string-concat-in-loop": string;
599
- "@sarj/prefer-discriminated-union": string;
600
- "@sarj/no-comment-cruft": string;
601
- "@sarj/prefer-semantic-colors": (string | {
602
- requireSemanticTokens: boolean;
603
- })[];
604
- "@sarj/no-fat-try-blocks": string;
605
- "@sarj/no-cors-wildcard-with-credentials": string;
606
- "@sarj/no-secret-in-log": string;
607
- "@sarj/no-unsafe-mock-casting": string;
608
- "@sarj/prefer-string-literal-union": string;
609
- "@sarj/prefer-zod-enum": string;
610
- "@sarj/prefer-zod-infer": string;
611
- "@sarj/require-fetch-timeout": string;
612
- "@sarj/no-silent-promise-catch": string;
613
- "@sarj/prefer-constant-time-secret-compare": string;
614
- "@sarj/store-insert-requires-on-conflict": string;
615
- "@sarj/no-offset-pagination": string;
616
- "@sarj/no-select-star": string;
617
- "@sarj/no-hand-rolled-sleep": string;
618
- "@sarj/no-sleep-in-test-body": string;
619
- "@sarj/no-conditional-in-test": string;
620
- "@sarj/no-repeated-string-literal": string;
621
- "@sarj/no-positional-tuple-return": string;
622
- "@sarj/no-dynamic-sql": string;
623
- "@sarj/no-zod-native-enum": string;
624
- "@sarj/prefer-module-level-constant": string;
625
- "@sarj/no-restated-comment": string;
626
- "@sarj/jsdoc-restates-signature": string;
627
- "@sarj/trailing-value-narration": string;
628
- "@sarj/no-tautological-expect": string;
629
- "@sarj/require-interface-for-injected-service": string;
630
- "@sarj/prefer-non-nullable-collection": string;
631
- "@sarj/no-async-callback-in-waitfor": string;
632
- };
633
- };
634
- strict: {
635
- plugins: string[];
636
- rules: {
637
- "@sarj/zod-naming-convention": string;
638
- "@sarj/require-assert-never": string;
639
- "@sarj/require-zod-form-validation": string;
640
- "@sarj/enforce-file-structure": string;
641
- "@sarj/no-raw-env": string;
642
- "@sarj/no-enum": string;
643
- "@sarj/no-client-side-data-fetching": string;
644
- "@sarj/prefer-server-actions": string;
645
- "@sarj/no-unnecessary-use-client": string;
646
- "@sarj/prefer-schema-for-api-payload": string;
647
- "@sarj/no-sentinel-return-on-catch": string;
648
- "@sarj/no-log-only-catch": string;
649
- "@sarj/no-insecure-random-id": string;
650
- "@sarj/no-json-stringify-error": string;
651
- "@sarj/no-string-concat-in-loop": string;
652
- "@sarj/prefer-discriminated-union": string;
653
- "@sarj/no-comment-cruft": string;
654
- "@sarj/prefer-semantic-colors": (string | {
655
- requireSemanticTokens: boolean;
656
- })[];
657
- "@sarj/no-fat-try-blocks": string;
658
- "@sarj/no-cors-wildcard-with-credentials": string;
659
- "@sarj/no-secret-in-log": string;
660
- "@sarj/no-unsafe-mock-casting": string;
661
- "@sarj/prefer-string-literal-union": string;
662
- "@sarj/prefer-zod-enum": string;
663
- "@sarj/prefer-zod-infer": string;
664
- "@sarj/require-fetch-timeout": string;
665
- "@sarj/no-silent-promise-catch": string;
666
- "@sarj/prefer-constant-time-secret-compare": string;
667
- "@sarj/store-insert-requires-on-conflict": string;
668
- "@sarj/no-offset-pagination": string;
669
- "@sarj/no-select-star": string;
670
- "@sarj/no-hand-rolled-sleep": string;
671
- "@sarj/no-sleep-in-test-body": string;
672
- "@sarj/no-conditional-in-test": string;
673
- "@sarj/no-repeated-string-literal": string;
674
- "@sarj/no-positional-tuple-return": string;
675
- "@sarj/no-dynamic-sql": string;
676
- "@sarj/no-raw-fetch-outside-clients": string;
677
- "@sarj/no-storage-in-stateless-modules": string;
678
- "@sarj/no-zod-native-enum": string;
679
- "@sarj/prefer-module-level-constant": string;
680
- "@sarj/no-restated-comment": string;
681
- "@sarj/jsdoc-restates-signature": string;
682
- "@sarj/trailing-value-narration": string;
683
- "@sarj/no-tautological-expect": string;
684
- "@sarj/require-interface-for-injected-service": string;
685
- "@sarj/prefer-non-nullable-collection": string;
686
- "@sarj/no-async-callback-in-waitfor": string;
687
- };
688
- };
750
+ recommended: FlatPreset;
751
+ strict: FlatPreset;
689
752
  };
690
753
  };
691
754
 
692
- export { plugin as default, rules };
755
+ export { plugin as default, recommendedRules, rules, strictRules };