@sarj/eslint-plugin 5.1.0 → 6.1.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/README.md +1 -0
- package/dist/index.cjs +473 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +152 -111
- package/dist/index.d.ts +152 -111
- package/dist/index.js +473 -191
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -437,11 +437,151 @@ declare const rules: {
|
|
|
437
437
|
"no-async-callback-in-waitfor": _typescript_eslint_utils_ts_eslint.RuleModule<"noAsyncCallbackInWaitFor", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
438
438
|
name: string;
|
|
439
439
|
};
|
|
440
|
+
"prefer-module-level-schema": _typescript_eslint_utils_ts_eslint.RuleModule<"hoistSchema", readonly [{
|
|
441
|
+
factories?: readonly string[];
|
|
442
|
+
ignoreTestFiles?: boolean;
|
|
443
|
+
minProperties?: number;
|
|
444
|
+
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
445
|
+
name: string;
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
declare const recommendedRules: {
|
|
449
|
+
readonly "@sarj/zod-naming-convention": "warn";
|
|
450
|
+
readonly "@sarj/require-assert-never": "error";
|
|
451
|
+
readonly "@sarj/require-zod-form-validation": "error";
|
|
452
|
+
readonly "@sarj/enforce-file-structure": "warn";
|
|
453
|
+
readonly "@sarj/no-client-side-data-fetching": "warn";
|
|
454
|
+
readonly "@sarj/prefer-server-actions": "warn";
|
|
455
|
+
readonly "@sarj/no-unnecessary-use-client": "warn";
|
|
456
|
+
readonly "@sarj/prefer-schema-for-api-payload": "warn";
|
|
457
|
+
readonly "@sarj/no-sentinel-return-on-catch": "warn";
|
|
458
|
+
readonly "@sarj/no-log-only-catch": "warn";
|
|
459
|
+
readonly "@sarj/no-insecure-random-id": "warn";
|
|
460
|
+
readonly "@sarj/no-json-stringify-error": "warn";
|
|
461
|
+
readonly "@sarj/no-string-concat-in-loop": "warn";
|
|
462
|
+
readonly "@sarj/prefer-discriminated-union": "warn";
|
|
463
|
+
readonly "@sarj/no-comment-cruft": "warn";
|
|
464
|
+
readonly "@sarj/prefer-semantic-colors": readonly ["warn", {
|
|
465
|
+
readonly requireSemanticTokens: true;
|
|
466
|
+
}];
|
|
467
|
+
readonly "@sarj/no-fat-try-blocks": "warn";
|
|
468
|
+
readonly "@sarj/no-cors-wildcard-with-credentials": "warn";
|
|
469
|
+
readonly "@sarj/no-secret-in-log": "warn";
|
|
470
|
+
readonly "@sarj/no-unsafe-mock-casting": "warn";
|
|
471
|
+
readonly "@sarj/prefer-string-literal-union": "warn";
|
|
472
|
+
readonly "@sarj/prefer-zod-enum": "warn";
|
|
473
|
+
readonly "@sarj/prefer-zod-infer": "warn";
|
|
474
|
+
readonly "@sarj/require-fetch-timeout": "warn";
|
|
475
|
+
readonly "@sarj/no-silent-promise-catch": "warn";
|
|
476
|
+
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
477
|
+
readonly "@sarj/store-insert-requires-on-conflict": "warn";
|
|
478
|
+
readonly "@sarj/no-offset-pagination": "warn";
|
|
479
|
+
readonly "@sarj/no-select-star": "warn";
|
|
480
|
+
readonly "@sarj/no-hand-rolled-sleep": "warn";
|
|
481
|
+
readonly "@sarj/no-sleep-in-test-body": "warn";
|
|
482
|
+
readonly "@sarj/no-conditional-in-test": "warn";
|
|
483
|
+
readonly "@sarj/no-repeated-string-literal": "warn";
|
|
484
|
+
readonly "@sarj/no-positional-tuple-return": "warn";
|
|
485
|
+
readonly "@sarj/no-dynamic-sql": "warn";
|
|
486
|
+
readonly "@sarj/no-zod-native-enum": "warn";
|
|
487
|
+
readonly "@sarj/prefer-module-level-constant": "warn";
|
|
488
|
+
readonly "@sarj/no-restated-comment": "warn";
|
|
489
|
+
readonly "@sarj/jsdoc-restates-signature": "warn";
|
|
490
|
+
readonly "@sarj/trailing-value-narration": "warn";
|
|
491
|
+
readonly "@sarj/no-type-member-comment-wall": "warn";
|
|
492
|
+
readonly "@sarj/no-tautological-expect": "warn";
|
|
493
|
+
readonly "@sarj/require-interface-for-injected-service": "warn";
|
|
494
|
+
readonly "@sarj/prefer-non-nullable-collection": "warn";
|
|
495
|
+
readonly "@sarj/no-async-callback-in-waitfor": "warn";
|
|
496
|
+
readonly "@sarj/prefer-module-level-schema": "warn";
|
|
497
|
+
readonly "@sarj/strict-test-assertions": "warn";
|
|
440
498
|
};
|
|
499
|
+
declare const strictRules: {
|
|
500
|
+
readonly "@sarj/zod-naming-convention": "error";
|
|
501
|
+
readonly "@sarj/require-assert-never": "error";
|
|
502
|
+
readonly "@sarj/require-zod-form-validation": "error";
|
|
503
|
+
readonly "@sarj/enforce-file-structure": "error";
|
|
504
|
+
readonly "@sarj/no-raw-env": "error";
|
|
505
|
+
readonly "@sarj/no-enum": "error";
|
|
506
|
+
readonly "@sarj/no-client-side-data-fetching": "error";
|
|
507
|
+
readonly "@sarj/prefer-server-actions": "error";
|
|
508
|
+
readonly "@sarj/no-unnecessary-use-client": "error";
|
|
509
|
+
readonly "@sarj/prefer-schema-for-api-payload": "error";
|
|
510
|
+
readonly "@sarj/no-sentinel-return-on-catch": "error";
|
|
511
|
+
readonly "@sarj/no-log-only-catch": "error";
|
|
512
|
+
readonly "@sarj/no-insecure-random-id": "error";
|
|
513
|
+
readonly "@sarj/no-json-stringify-error": "error";
|
|
514
|
+
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
515
|
+
readonly "@sarj/prefer-discriminated-union": "error";
|
|
516
|
+
readonly "@sarj/no-comment-cruft": "error";
|
|
517
|
+
readonly "@sarj/prefer-semantic-colors": readonly ["error", {
|
|
518
|
+
readonly requireSemanticTokens: true;
|
|
519
|
+
}];
|
|
520
|
+
readonly "@sarj/no-fat-try-blocks": "error";
|
|
521
|
+
readonly "@sarj/no-cors-wildcard-with-credentials": "error";
|
|
522
|
+
readonly "@sarj/no-secret-in-log": "error";
|
|
523
|
+
readonly "@sarj/no-unsafe-mock-casting": "error";
|
|
524
|
+
readonly "@sarj/prefer-string-literal-union": "error";
|
|
525
|
+
readonly "@sarj/prefer-zod-enum": "error";
|
|
526
|
+
readonly "@sarj/prefer-zod-infer": "error";
|
|
527
|
+
readonly "@sarj/require-fetch-timeout": "error";
|
|
528
|
+
readonly "@sarj/no-silent-promise-catch": "error";
|
|
529
|
+
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
530
|
+
readonly "@sarj/store-insert-requires-on-conflict": "error";
|
|
531
|
+
readonly "@sarj/no-offset-pagination": "error";
|
|
532
|
+
readonly "@sarj/no-select-star": "error";
|
|
533
|
+
readonly "@sarj/no-hand-rolled-sleep": "error";
|
|
534
|
+
readonly "@sarj/no-sleep-in-test-body": "error";
|
|
535
|
+
readonly "@sarj/no-conditional-in-test": "error";
|
|
536
|
+
readonly "@sarj/no-repeated-string-literal": "error";
|
|
537
|
+
readonly "@sarj/no-positional-tuple-return": "error";
|
|
538
|
+
readonly "@sarj/no-dynamic-sql": "error";
|
|
539
|
+
readonly "@sarj/no-raw-fetch-outside-clients": "error";
|
|
540
|
+
readonly "@sarj/no-storage-in-stateless-modules": "error";
|
|
541
|
+
readonly "@sarj/no-zod-native-enum": "error";
|
|
542
|
+
readonly "@sarj/prefer-module-level-constant": "error";
|
|
543
|
+
readonly "@sarj/no-restated-comment": "error";
|
|
544
|
+
readonly "@sarj/jsdoc-restates-signature": "error";
|
|
545
|
+
readonly "@sarj/trailing-value-narration": "error";
|
|
546
|
+
readonly "@sarj/no-type-member-comment-wall": "error";
|
|
547
|
+
readonly "@sarj/no-tautological-expect": "error";
|
|
548
|
+
readonly "@sarj/require-interface-for-injected-service": "error";
|
|
549
|
+
readonly "@sarj/prefer-non-nullable-collection": "error";
|
|
550
|
+
readonly "@sarj/no-async-callback-in-waitfor": "error";
|
|
551
|
+
readonly "@sarj/prefer-module-level-schema": "error";
|
|
552
|
+
readonly "@sarj/strict-test-assertions": "error";
|
|
553
|
+
};
|
|
554
|
+
type FlatPreset = {
|
|
555
|
+
readonly name: string;
|
|
556
|
+
readonly plugins: Record<string, unknown>;
|
|
557
|
+
readonly rules: Record<string, unknown>;
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* The presets, as FLAT config objects.
|
|
561
|
+
*
|
|
562
|
+
* Both used to declare `plugins: ["@sarj"]` -- eslintrc syntax -- and ESLint
|
|
563
|
+
* rejects that outright:
|
|
564
|
+
*
|
|
565
|
+
* Config (unnamed): Key "plugins": This appears to be in eslintrc format
|
|
566
|
+
* (array of strings) rather than flat config format (object).
|
|
567
|
+
*
|
|
568
|
+
* So `sarj.configs.strict`, the "just extend the plugin, do not copy the file"
|
|
569
|
+
* path, threw for anyone who tried it, and copying `eslint.strict.mjs` and
|
|
570
|
+
* editing the copy was the only thing that worked -- exactly the vendoring
|
|
571
|
+
* these presets exist to prevent. `plugins` is now the object form flat config
|
|
572
|
+
* wants, so both presets go straight into an `eslint.config.mjs` array (no
|
|
573
|
+
* spread):
|
|
574
|
+
*
|
|
575
|
+
* import sarj from "@sarj/eslint-plugin";
|
|
576
|
+
* export default [sarj.configs.strict];
|
|
577
|
+
*
|
|
578
|
+
* Neither preset sets `files` or a parser. They carry rules and nothing else,
|
|
579
|
+
* so they compose with whatever a repo already has rather than narrowing it.
|
|
580
|
+
*/
|
|
441
581
|
declare const plugin: {
|
|
442
582
|
meta: {
|
|
443
|
-
name:
|
|
444
|
-
version:
|
|
583
|
+
readonly name: "@sarj/eslint-plugin";
|
|
584
|
+
readonly version: "6.1.0";
|
|
445
585
|
};
|
|
446
586
|
rules: {
|
|
447
587
|
"enforce-file-structure": _typescript_eslint_utils_ts_eslint.RuleModule<"importsFirst" | "useServerDirective", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -614,117 +754,18 @@ declare const plugin: {
|
|
|
614
754
|
"no-async-callback-in-waitfor": _typescript_eslint_utils_ts_eslint.RuleModule<"noAsyncCallbackInWaitFor", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
615
755
|
name: string;
|
|
616
756
|
};
|
|
757
|
+
"prefer-module-level-schema": _typescript_eslint_utils_ts_eslint.RuleModule<"hoistSchema", readonly [{
|
|
758
|
+
factories?: readonly string[];
|
|
759
|
+
ignoreTestFiles?: boolean;
|
|
760
|
+
minProperties?: number;
|
|
761
|
+
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
762
|
+
name: string;
|
|
763
|
+
};
|
|
617
764
|
};
|
|
618
765
|
configs: {
|
|
619
|
-
recommended:
|
|
620
|
-
|
|
621
|
-
rules: {
|
|
622
|
-
"@sarj/zod-naming-convention": string;
|
|
623
|
-
"@sarj/require-assert-never": string;
|
|
624
|
-
"@sarj/require-zod-form-validation": string;
|
|
625
|
-
"@sarj/enforce-file-structure": string;
|
|
626
|
-
"@sarj/no-client-side-data-fetching": string;
|
|
627
|
-
"@sarj/prefer-server-actions": string;
|
|
628
|
-
"@sarj/no-unnecessary-use-client": string;
|
|
629
|
-
"@sarj/prefer-schema-for-api-payload": string;
|
|
630
|
-
"@sarj/no-sentinel-return-on-catch": string;
|
|
631
|
-
"@sarj/no-log-only-catch": string;
|
|
632
|
-
"@sarj/no-insecure-random-id": string;
|
|
633
|
-
"@sarj/no-json-stringify-error": string;
|
|
634
|
-
"@sarj/no-string-concat-in-loop": string;
|
|
635
|
-
"@sarj/prefer-discriminated-union": string;
|
|
636
|
-
"@sarj/no-comment-cruft": string;
|
|
637
|
-
"@sarj/prefer-semantic-colors": (string | {
|
|
638
|
-
requireSemanticTokens: boolean;
|
|
639
|
-
})[];
|
|
640
|
-
"@sarj/no-fat-try-blocks": string;
|
|
641
|
-
"@sarj/no-cors-wildcard-with-credentials": string;
|
|
642
|
-
"@sarj/no-secret-in-log": string;
|
|
643
|
-
"@sarj/no-unsafe-mock-casting": string;
|
|
644
|
-
"@sarj/prefer-string-literal-union": string;
|
|
645
|
-
"@sarj/prefer-zod-enum": string;
|
|
646
|
-
"@sarj/prefer-zod-infer": string;
|
|
647
|
-
"@sarj/require-fetch-timeout": string;
|
|
648
|
-
"@sarj/no-silent-promise-catch": string;
|
|
649
|
-
"@sarj/prefer-constant-time-secret-compare": string;
|
|
650
|
-
"@sarj/store-insert-requires-on-conflict": string;
|
|
651
|
-
"@sarj/no-offset-pagination": string;
|
|
652
|
-
"@sarj/no-select-star": string;
|
|
653
|
-
"@sarj/no-hand-rolled-sleep": string;
|
|
654
|
-
"@sarj/no-sleep-in-test-body": string;
|
|
655
|
-
"@sarj/no-conditional-in-test": string;
|
|
656
|
-
"@sarj/no-repeated-string-literal": string;
|
|
657
|
-
"@sarj/no-positional-tuple-return": string;
|
|
658
|
-
"@sarj/no-dynamic-sql": string;
|
|
659
|
-
"@sarj/no-zod-native-enum": string;
|
|
660
|
-
"@sarj/prefer-module-level-constant": string;
|
|
661
|
-
"@sarj/no-restated-comment": string;
|
|
662
|
-
"@sarj/jsdoc-restates-signature": string;
|
|
663
|
-
"@sarj/trailing-value-narration": string;
|
|
664
|
-
"@sarj/no-type-member-comment-wall": string;
|
|
665
|
-
"@sarj/no-tautological-expect": string;
|
|
666
|
-
"@sarj/require-interface-for-injected-service": string;
|
|
667
|
-
"@sarj/prefer-non-nullable-collection": string;
|
|
668
|
-
"@sarj/no-async-callback-in-waitfor": string;
|
|
669
|
-
};
|
|
670
|
-
};
|
|
671
|
-
strict: {
|
|
672
|
-
plugins: string[];
|
|
673
|
-
rules: {
|
|
674
|
-
"@sarj/zod-naming-convention": string;
|
|
675
|
-
"@sarj/require-assert-never": string;
|
|
676
|
-
"@sarj/require-zod-form-validation": string;
|
|
677
|
-
"@sarj/enforce-file-structure": string;
|
|
678
|
-
"@sarj/no-raw-env": string;
|
|
679
|
-
"@sarj/no-enum": string;
|
|
680
|
-
"@sarj/no-client-side-data-fetching": string;
|
|
681
|
-
"@sarj/prefer-server-actions": string;
|
|
682
|
-
"@sarj/no-unnecessary-use-client": string;
|
|
683
|
-
"@sarj/prefer-schema-for-api-payload": string;
|
|
684
|
-
"@sarj/no-sentinel-return-on-catch": string;
|
|
685
|
-
"@sarj/no-log-only-catch": string;
|
|
686
|
-
"@sarj/no-insecure-random-id": string;
|
|
687
|
-
"@sarj/no-json-stringify-error": string;
|
|
688
|
-
"@sarj/no-string-concat-in-loop": string;
|
|
689
|
-
"@sarj/prefer-discriminated-union": string;
|
|
690
|
-
"@sarj/no-comment-cruft": string;
|
|
691
|
-
"@sarj/prefer-semantic-colors": (string | {
|
|
692
|
-
requireSemanticTokens: boolean;
|
|
693
|
-
})[];
|
|
694
|
-
"@sarj/no-fat-try-blocks": string;
|
|
695
|
-
"@sarj/no-cors-wildcard-with-credentials": string;
|
|
696
|
-
"@sarj/no-secret-in-log": string;
|
|
697
|
-
"@sarj/no-unsafe-mock-casting": string;
|
|
698
|
-
"@sarj/prefer-string-literal-union": string;
|
|
699
|
-
"@sarj/prefer-zod-enum": string;
|
|
700
|
-
"@sarj/prefer-zod-infer": string;
|
|
701
|
-
"@sarj/require-fetch-timeout": string;
|
|
702
|
-
"@sarj/no-silent-promise-catch": string;
|
|
703
|
-
"@sarj/prefer-constant-time-secret-compare": string;
|
|
704
|
-
"@sarj/store-insert-requires-on-conflict": string;
|
|
705
|
-
"@sarj/no-offset-pagination": string;
|
|
706
|
-
"@sarj/no-select-star": string;
|
|
707
|
-
"@sarj/no-hand-rolled-sleep": string;
|
|
708
|
-
"@sarj/no-sleep-in-test-body": string;
|
|
709
|
-
"@sarj/no-conditional-in-test": string;
|
|
710
|
-
"@sarj/no-repeated-string-literal": string;
|
|
711
|
-
"@sarj/no-positional-tuple-return": string;
|
|
712
|
-
"@sarj/no-dynamic-sql": string;
|
|
713
|
-
"@sarj/no-raw-fetch-outside-clients": string;
|
|
714
|
-
"@sarj/no-storage-in-stateless-modules": string;
|
|
715
|
-
"@sarj/no-zod-native-enum": string;
|
|
716
|
-
"@sarj/prefer-module-level-constant": string;
|
|
717
|
-
"@sarj/no-restated-comment": string;
|
|
718
|
-
"@sarj/jsdoc-restates-signature": string;
|
|
719
|
-
"@sarj/trailing-value-narration": string;
|
|
720
|
-
"@sarj/no-type-member-comment-wall": string;
|
|
721
|
-
"@sarj/no-tautological-expect": string;
|
|
722
|
-
"@sarj/require-interface-for-injected-service": string;
|
|
723
|
-
"@sarj/prefer-non-nullable-collection": string;
|
|
724
|
-
"@sarj/no-async-callback-in-waitfor": string;
|
|
725
|
-
};
|
|
726
|
-
};
|
|
766
|
+
recommended: FlatPreset;
|
|
767
|
+
strict: FlatPreset;
|
|
727
768
|
};
|
|
728
769
|
};
|
|
729
770
|
|
|
730
|
-
export { plugin as default, rules };
|
|
771
|
+
export { plugin as default, recommendedRules, rules, strictRules };
|
package/dist/index.d.ts
CHANGED
|
@@ -437,11 +437,151 @@ declare const rules: {
|
|
|
437
437
|
"no-async-callback-in-waitfor": _typescript_eslint_utils_ts_eslint.RuleModule<"noAsyncCallbackInWaitFor", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
438
438
|
name: string;
|
|
439
439
|
};
|
|
440
|
+
"prefer-module-level-schema": _typescript_eslint_utils_ts_eslint.RuleModule<"hoistSchema", readonly [{
|
|
441
|
+
factories?: readonly string[];
|
|
442
|
+
ignoreTestFiles?: boolean;
|
|
443
|
+
minProperties?: number;
|
|
444
|
+
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
445
|
+
name: string;
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
declare const recommendedRules: {
|
|
449
|
+
readonly "@sarj/zod-naming-convention": "warn";
|
|
450
|
+
readonly "@sarj/require-assert-never": "error";
|
|
451
|
+
readonly "@sarj/require-zod-form-validation": "error";
|
|
452
|
+
readonly "@sarj/enforce-file-structure": "warn";
|
|
453
|
+
readonly "@sarj/no-client-side-data-fetching": "warn";
|
|
454
|
+
readonly "@sarj/prefer-server-actions": "warn";
|
|
455
|
+
readonly "@sarj/no-unnecessary-use-client": "warn";
|
|
456
|
+
readonly "@sarj/prefer-schema-for-api-payload": "warn";
|
|
457
|
+
readonly "@sarj/no-sentinel-return-on-catch": "warn";
|
|
458
|
+
readonly "@sarj/no-log-only-catch": "warn";
|
|
459
|
+
readonly "@sarj/no-insecure-random-id": "warn";
|
|
460
|
+
readonly "@sarj/no-json-stringify-error": "warn";
|
|
461
|
+
readonly "@sarj/no-string-concat-in-loop": "warn";
|
|
462
|
+
readonly "@sarj/prefer-discriminated-union": "warn";
|
|
463
|
+
readonly "@sarj/no-comment-cruft": "warn";
|
|
464
|
+
readonly "@sarj/prefer-semantic-colors": readonly ["warn", {
|
|
465
|
+
readonly requireSemanticTokens: true;
|
|
466
|
+
}];
|
|
467
|
+
readonly "@sarj/no-fat-try-blocks": "warn";
|
|
468
|
+
readonly "@sarj/no-cors-wildcard-with-credentials": "warn";
|
|
469
|
+
readonly "@sarj/no-secret-in-log": "warn";
|
|
470
|
+
readonly "@sarj/no-unsafe-mock-casting": "warn";
|
|
471
|
+
readonly "@sarj/prefer-string-literal-union": "warn";
|
|
472
|
+
readonly "@sarj/prefer-zod-enum": "warn";
|
|
473
|
+
readonly "@sarj/prefer-zod-infer": "warn";
|
|
474
|
+
readonly "@sarj/require-fetch-timeout": "warn";
|
|
475
|
+
readonly "@sarj/no-silent-promise-catch": "warn";
|
|
476
|
+
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
477
|
+
readonly "@sarj/store-insert-requires-on-conflict": "warn";
|
|
478
|
+
readonly "@sarj/no-offset-pagination": "warn";
|
|
479
|
+
readonly "@sarj/no-select-star": "warn";
|
|
480
|
+
readonly "@sarj/no-hand-rolled-sleep": "warn";
|
|
481
|
+
readonly "@sarj/no-sleep-in-test-body": "warn";
|
|
482
|
+
readonly "@sarj/no-conditional-in-test": "warn";
|
|
483
|
+
readonly "@sarj/no-repeated-string-literal": "warn";
|
|
484
|
+
readonly "@sarj/no-positional-tuple-return": "warn";
|
|
485
|
+
readonly "@sarj/no-dynamic-sql": "warn";
|
|
486
|
+
readonly "@sarj/no-zod-native-enum": "warn";
|
|
487
|
+
readonly "@sarj/prefer-module-level-constant": "warn";
|
|
488
|
+
readonly "@sarj/no-restated-comment": "warn";
|
|
489
|
+
readonly "@sarj/jsdoc-restates-signature": "warn";
|
|
490
|
+
readonly "@sarj/trailing-value-narration": "warn";
|
|
491
|
+
readonly "@sarj/no-type-member-comment-wall": "warn";
|
|
492
|
+
readonly "@sarj/no-tautological-expect": "warn";
|
|
493
|
+
readonly "@sarj/require-interface-for-injected-service": "warn";
|
|
494
|
+
readonly "@sarj/prefer-non-nullable-collection": "warn";
|
|
495
|
+
readonly "@sarj/no-async-callback-in-waitfor": "warn";
|
|
496
|
+
readonly "@sarj/prefer-module-level-schema": "warn";
|
|
497
|
+
readonly "@sarj/strict-test-assertions": "warn";
|
|
440
498
|
};
|
|
499
|
+
declare const strictRules: {
|
|
500
|
+
readonly "@sarj/zod-naming-convention": "error";
|
|
501
|
+
readonly "@sarj/require-assert-never": "error";
|
|
502
|
+
readonly "@sarj/require-zod-form-validation": "error";
|
|
503
|
+
readonly "@sarj/enforce-file-structure": "error";
|
|
504
|
+
readonly "@sarj/no-raw-env": "error";
|
|
505
|
+
readonly "@sarj/no-enum": "error";
|
|
506
|
+
readonly "@sarj/no-client-side-data-fetching": "error";
|
|
507
|
+
readonly "@sarj/prefer-server-actions": "error";
|
|
508
|
+
readonly "@sarj/no-unnecessary-use-client": "error";
|
|
509
|
+
readonly "@sarj/prefer-schema-for-api-payload": "error";
|
|
510
|
+
readonly "@sarj/no-sentinel-return-on-catch": "error";
|
|
511
|
+
readonly "@sarj/no-log-only-catch": "error";
|
|
512
|
+
readonly "@sarj/no-insecure-random-id": "error";
|
|
513
|
+
readonly "@sarj/no-json-stringify-error": "error";
|
|
514
|
+
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
515
|
+
readonly "@sarj/prefer-discriminated-union": "error";
|
|
516
|
+
readonly "@sarj/no-comment-cruft": "error";
|
|
517
|
+
readonly "@sarj/prefer-semantic-colors": readonly ["error", {
|
|
518
|
+
readonly requireSemanticTokens: true;
|
|
519
|
+
}];
|
|
520
|
+
readonly "@sarj/no-fat-try-blocks": "error";
|
|
521
|
+
readonly "@sarj/no-cors-wildcard-with-credentials": "error";
|
|
522
|
+
readonly "@sarj/no-secret-in-log": "error";
|
|
523
|
+
readonly "@sarj/no-unsafe-mock-casting": "error";
|
|
524
|
+
readonly "@sarj/prefer-string-literal-union": "error";
|
|
525
|
+
readonly "@sarj/prefer-zod-enum": "error";
|
|
526
|
+
readonly "@sarj/prefer-zod-infer": "error";
|
|
527
|
+
readonly "@sarj/require-fetch-timeout": "error";
|
|
528
|
+
readonly "@sarj/no-silent-promise-catch": "error";
|
|
529
|
+
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
530
|
+
readonly "@sarj/store-insert-requires-on-conflict": "error";
|
|
531
|
+
readonly "@sarj/no-offset-pagination": "error";
|
|
532
|
+
readonly "@sarj/no-select-star": "error";
|
|
533
|
+
readonly "@sarj/no-hand-rolled-sleep": "error";
|
|
534
|
+
readonly "@sarj/no-sleep-in-test-body": "error";
|
|
535
|
+
readonly "@sarj/no-conditional-in-test": "error";
|
|
536
|
+
readonly "@sarj/no-repeated-string-literal": "error";
|
|
537
|
+
readonly "@sarj/no-positional-tuple-return": "error";
|
|
538
|
+
readonly "@sarj/no-dynamic-sql": "error";
|
|
539
|
+
readonly "@sarj/no-raw-fetch-outside-clients": "error";
|
|
540
|
+
readonly "@sarj/no-storage-in-stateless-modules": "error";
|
|
541
|
+
readonly "@sarj/no-zod-native-enum": "error";
|
|
542
|
+
readonly "@sarj/prefer-module-level-constant": "error";
|
|
543
|
+
readonly "@sarj/no-restated-comment": "error";
|
|
544
|
+
readonly "@sarj/jsdoc-restates-signature": "error";
|
|
545
|
+
readonly "@sarj/trailing-value-narration": "error";
|
|
546
|
+
readonly "@sarj/no-type-member-comment-wall": "error";
|
|
547
|
+
readonly "@sarj/no-tautological-expect": "error";
|
|
548
|
+
readonly "@sarj/require-interface-for-injected-service": "error";
|
|
549
|
+
readonly "@sarj/prefer-non-nullable-collection": "error";
|
|
550
|
+
readonly "@sarj/no-async-callback-in-waitfor": "error";
|
|
551
|
+
readonly "@sarj/prefer-module-level-schema": "error";
|
|
552
|
+
readonly "@sarj/strict-test-assertions": "error";
|
|
553
|
+
};
|
|
554
|
+
type FlatPreset = {
|
|
555
|
+
readonly name: string;
|
|
556
|
+
readonly plugins: Record<string, unknown>;
|
|
557
|
+
readonly rules: Record<string, unknown>;
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* The presets, as FLAT config objects.
|
|
561
|
+
*
|
|
562
|
+
* Both used to declare `plugins: ["@sarj"]` -- eslintrc syntax -- and ESLint
|
|
563
|
+
* rejects that outright:
|
|
564
|
+
*
|
|
565
|
+
* Config (unnamed): Key "plugins": This appears to be in eslintrc format
|
|
566
|
+
* (array of strings) rather than flat config format (object).
|
|
567
|
+
*
|
|
568
|
+
* So `sarj.configs.strict`, the "just extend the plugin, do not copy the file"
|
|
569
|
+
* path, threw for anyone who tried it, and copying `eslint.strict.mjs` and
|
|
570
|
+
* editing the copy was the only thing that worked -- exactly the vendoring
|
|
571
|
+
* these presets exist to prevent. `plugins` is now the object form flat config
|
|
572
|
+
* wants, so both presets go straight into an `eslint.config.mjs` array (no
|
|
573
|
+
* spread):
|
|
574
|
+
*
|
|
575
|
+
* import sarj from "@sarj/eslint-plugin";
|
|
576
|
+
* export default [sarj.configs.strict];
|
|
577
|
+
*
|
|
578
|
+
* Neither preset sets `files` or a parser. They carry rules and nothing else,
|
|
579
|
+
* so they compose with whatever a repo already has rather than narrowing it.
|
|
580
|
+
*/
|
|
441
581
|
declare const plugin: {
|
|
442
582
|
meta: {
|
|
443
|
-
name:
|
|
444
|
-
version:
|
|
583
|
+
readonly name: "@sarj/eslint-plugin";
|
|
584
|
+
readonly version: "6.1.0";
|
|
445
585
|
};
|
|
446
586
|
rules: {
|
|
447
587
|
"enforce-file-structure": _typescript_eslint_utils_ts_eslint.RuleModule<"importsFirst" | "useServerDirective", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -614,117 +754,18 @@ declare const plugin: {
|
|
|
614
754
|
"no-async-callback-in-waitfor": _typescript_eslint_utils_ts_eslint.RuleModule<"noAsyncCallbackInWaitFor", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
615
755
|
name: string;
|
|
616
756
|
};
|
|
757
|
+
"prefer-module-level-schema": _typescript_eslint_utils_ts_eslint.RuleModule<"hoistSchema", readonly [{
|
|
758
|
+
factories?: readonly string[];
|
|
759
|
+
ignoreTestFiles?: boolean;
|
|
760
|
+
minProperties?: number;
|
|
761
|
+
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
762
|
+
name: string;
|
|
763
|
+
};
|
|
617
764
|
};
|
|
618
765
|
configs: {
|
|
619
|
-
recommended:
|
|
620
|
-
|
|
621
|
-
rules: {
|
|
622
|
-
"@sarj/zod-naming-convention": string;
|
|
623
|
-
"@sarj/require-assert-never": string;
|
|
624
|
-
"@sarj/require-zod-form-validation": string;
|
|
625
|
-
"@sarj/enforce-file-structure": string;
|
|
626
|
-
"@sarj/no-client-side-data-fetching": string;
|
|
627
|
-
"@sarj/prefer-server-actions": string;
|
|
628
|
-
"@sarj/no-unnecessary-use-client": string;
|
|
629
|
-
"@sarj/prefer-schema-for-api-payload": string;
|
|
630
|
-
"@sarj/no-sentinel-return-on-catch": string;
|
|
631
|
-
"@sarj/no-log-only-catch": string;
|
|
632
|
-
"@sarj/no-insecure-random-id": string;
|
|
633
|
-
"@sarj/no-json-stringify-error": string;
|
|
634
|
-
"@sarj/no-string-concat-in-loop": string;
|
|
635
|
-
"@sarj/prefer-discriminated-union": string;
|
|
636
|
-
"@sarj/no-comment-cruft": string;
|
|
637
|
-
"@sarj/prefer-semantic-colors": (string | {
|
|
638
|
-
requireSemanticTokens: boolean;
|
|
639
|
-
})[];
|
|
640
|
-
"@sarj/no-fat-try-blocks": string;
|
|
641
|
-
"@sarj/no-cors-wildcard-with-credentials": string;
|
|
642
|
-
"@sarj/no-secret-in-log": string;
|
|
643
|
-
"@sarj/no-unsafe-mock-casting": string;
|
|
644
|
-
"@sarj/prefer-string-literal-union": string;
|
|
645
|
-
"@sarj/prefer-zod-enum": string;
|
|
646
|
-
"@sarj/prefer-zod-infer": string;
|
|
647
|
-
"@sarj/require-fetch-timeout": string;
|
|
648
|
-
"@sarj/no-silent-promise-catch": string;
|
|
649
|
-
"@sarj/prefer-constant-time-secret-compare": string;
|
|
650
|
-
"@sarj/store-insert-requires-on-conflict": string;
|
|
651
|
-
"@sarj/no-offset-pagination": string;
|
|
652
|
-
"@sarj/no-select-star": string;
|
|
653
|
-
"@sarj/no-hand-rolled-sleep": string;
|
|
654
|
-
"@sarj/no-sleep-in-test-body": string;
|
|
655
|
-
"@sarj/no-conditional-in-test": string;
|
|
656
|
-
"@sarj/no-repeated-string-literal": string;
|
|
657
|
-
"@sarj/no-positional-tuple-return": string;
|
|
658
|
-
"@sarj/no-dynamic-sql": string;
|
|
659
|
-
"@sarj/no-zod-native-enum": string;
|
|
660
|
-
"@sarj/prefer-module-level-constant": string;
|
|
661
|
-
"@sarj/no-restated-comment": string;
|
|
662
|
-
"@sarj/jsdoc-restates-signature": string;
|
|
663
|
-
"@sarj/trailing-value-narration": string;
|
|
664
|
-
"@sarj/no-type-member-comment-wall": string;
|
|
665
|
-
"@sarj/no-tautological-expect": string;
|
|
666
|
-
"@sarj/require-interface-for-injected-service": string;
|
|
667
|
-
"@sarj/prefer-non-nullable-collection": string;
|
|
668
|
-
"@sarj/no-async-callback-in-waitfor": string;
|
|
669
|
-
};
|
|
670
|
-
};
|
|
671
|
-
strict: {
|
|
672
|
-
plugins: string[];
|
|
673
|
-
rules: {
|
|
674
|
-
"@sarj/zod-naming-convention": string;
|
|
675
|
-
"@sarj/require-assert-never": string;
|
|
676
|
-
"@sarj/require-zod-form-validation": string;
|
|
677
|
-
"@sarj/enforce-file-structure": string;
|
|
678
|
-
"@sarj/no-raw-env": string;
|
|
679
|
-
"@sarj/no-enum": string;
|
|
680
|
-
"@sarj/no-client-side-data-fetching": string;
|
|
681
|
-
"@sarj/prefer-server-actions": string;
|
|
682
|
-
"@sarj/no-unnecessary-use-client": string;
|
|
683
|
-
"@sarj/prefer-schema-for-api-payload": string;
|
|
684
|
-
"@sarj/no-sentinel-return-on-catch": string;
|
|
685
|
-
"@sarj/no-log-only-catch": string;
|
|
686
|
-
"@sarj/no-insecure-random-id": string;
|
|
687
|
-
"@sarj/no-json-stringify-error": string;
|
|
688
|
-
"@sarj/no-string-concat-in-loop": string;
|
|
689
|
-
"@sarj/prefer-discriminated-union": string;
|
|
690
|
-
"@sarj/no-comment-cruft": string;
|
|
691
|
-
"@sarj/prefer-semantic-colors": (string | {
|
|
692
|
-
requireSemanticTokens: boolean;
|
|
693
|
-
})[];
|
|
694
|
-
"@sarj/no-fat-try-blocks": string;
|
|
695
|
-
"@sarj/no-cors-wildcard-with-credentials": string;
|
|
696
|
-
"@sarj/no-secret-in-log": string;
|
|
697
|
-
"@sarj/no-unsafe-mock-casting": string;
|
|
698
|
-
"@sarj/prefer-string-literal-union": string;
|
|
699
|
-
"@sarj/prefer-zod-enum": string;
|
|
700
|
-
"@sarj/prefer-zod-infer": string;
|
|
701
|
-
"@sarj/require-fetch-timeout": string;
|
|
702
|
-
"@sarj/no-silent-promise-catch": string;
|
|
703
|
-
"@sarj/prefer-constant-time-secret-compare": string;
|
|
704
|
-
"@sarj/store-insert-requires-on-conflict": string;
|
|
705
|
-
"@sarj/no-offset-pagination": string;
|
|
706
|
-
"@sarj/no-select-star": string;
|
|
707
|
-
"@sarj/no-hand-rolled-sleep": string;
|
|
708
|
-
"@sarj/no-sleep-in-test-body": string;
|
|
709
|
-
"@sarj/no-conditional-in-test": string;
|
|
710
|
-
"@sarj/no-repeated-string-literal": string;
|
|
711
|
-
"@sarj/no-positional-tuple-return": string;
|
|
712
|
-
"@sarj/no-dynamic-sql": string;
|
|
713
|
-
"@sarj/no-raw-fetch-outside-clients": string;
|
|
714
|
-
"@sarj/no-storage-in-stateless-modules": string;
|
|
715
|
-
"@sarj/no-zod-native-enum": string;
|
|
716
|
-
"@sarj/prefer-module-level-constant": string;
|
|
717
|
-
"@sarj/no-restated-comment": string;
|
|
718
|
-
"@sarj/jsdoc-restates-signature": string;
|
|
719
|
-
"@sarj/trailing-value-narration": string;
|
|
720
|
-
"@sarj/no-type-member-comment-wall": string;
|
|
721
|
-
"@sarj/no-tautological-expect": string;
|
|
722
|
-
"@sarj/require-interface-for-injected-service": string;
|
|
723
|
-
"@sarj/prefer-non-nullable-collection": string;
|
|
724
|
-
"@sarj/no-async-callback-in-waitfor": string;
|
|
725
|
-
};
|
|
726
|
-
};
|
|
766
|
+
recommended: FlatPreset;
|
|
767
|
+
strict: FlatPreset;
|
|
727
768
|
};
|
|
728
769
|
};
|
|
729
770
|
|
|
730
|
-
export { plugin as default, rules };
|
|
771
|
+
export { plugin as default, recommendedRules, rules, strictRules };
|