@sarj/eslint-plugin 16.7.0 → 16.8.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.cjs +18 -23
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +18 -23
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -52,7 +52,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
52
52
|
// package.json
|
|
53
53
|
var package_default = {
|
|
54
54
|
name: "@sarj/eslint-plugin",
|
|
55
|
-
version: "16.
|
|
55
|
+
version: "16.8.0",
|
|
56
56
|
packageManager: "npm@12.1.0",
|
|
57
57
|
description: "Custom ESLint rules for hypermodern TypeScript / React / Next.js projects",
|
|
58
58
|
type: "module",
|
|
@@ -1569,7 +1569,7 @@ function abstractContractOperations(node, functionAliases) {
|
|
|
1569
1569
|
|
|
1570
1570
|
// src/rules/require-explicit-service-contract.ts
|
|
1571
1571
|
var REQUIRE_EXPLICIT_SERVICE_CONTRACT_DOCUMENTATION = {
|
|
1572
|
-
defaultLevel: "
|
|
1572
|
+
defaultLevel: "error",
|
|
1573
1573
|
summary: "Require explicit contracts for classes that invoke retained collaborators.",
|
|
1574
1574
|
rationale: "A one-operation service can orchestrate a collaborator without declaring the contract that callers consume and implementations and fakes satisfy.",
|
|
1575
1575
|
remediation: "Explicitly implement a focused interface or extend an abstract class covering the service operations. Export the contract only when its consumers need it.",
|
|
@@ -7556,7 +7556,7 @@ function branchTerminates(branch) {
|
|
|
7556
7556
|
var import_utils42 = require("@typescript-eslint/utils");
|
|
7557
7557
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
7558
7558
|
var NO_JSON_STRINGIFY_OBJECT_EQUALITY_DOCUMENTATION = {
|
|
7559
|
-
defaultLevel: "
|
|
7559
|
+
defaultLevel: "error",
|
|
7560
7560
|
summary: "Do not use JSON serialization as structural object equality.",
|
|
7561
7561
|
rationale: "JSON text equality depends on property insertion order and serialization behavior, so semantically equal objects can compare unequal and distinct values can collapse together.",
|
|
7562
7562
|
remediation: "Compare an explicit domain projection structurally, or use a reviewed canonical serializer when JSON semantics are required.",
|
|
@@ -12777,7 +12777,7 @@ var TEST_MODULES = /* @__PURE__ */ new Set(["vitest", "@jest/globals", "bun:test
|
|
|
12777
12777
|
var TEST_NAMES2 = /* @__PURE__ */ new Set(["it", "test"]);
|
|
12778
12778
|
var MODIFIERS = /* @__PURE__ */ new Set(["only", "skip", "concurrent", "fails", "failing", "todo"]);
|
|
12779
12779
|
var NO_DUPLICATE_TEST_CASE_DOCUMENTATION = {
|
|
12780
|
-
defaultLevel: "
|
|
12780
|
+
defaultLevel: "error",
|
|
12781
12781
|
summary: "Report repeated literal rows in framework test.each or it.each tables.",
|
|
12782
12782
|
rationale: "Identical rows repeat the same inputs and expected values without exposing a distinct case. Accidental duplicates consume test time and hide a missing boundary vector.",
|
|
12783
12783
|
remediation: "Remove the accidental duplicate or replace it with the intended distinct boundary. Preserve intentional repeated or stateful scenarios with a local explanation; do not delete their coverage automatically.",
|
|
@@ -17636,7 +17636,7 @@ var OPERATIONAL_ROLES = /* @__PURE__ */ new Set([
|
|
|
17636
17636
|
]);
|
|
17637
17637
|
var MAX_ALIAS_DEPTH = 16;
|
|
17638
17638
|
var PREFER_NOMINAL_ID_TYPES_DOCUMENTATION = {
|
|
17639
|
-
defaultLevel: "
|
|
17639
|
+
defaultLevel: "error",
|
|
17640
17640
|
summary: "Distinguish identifier roles sharing primitive types at callable boundaries.",
|
|
17641
17641
|
rationale: "Two identifier roles represented by the same primitive accept each other's values, so swapped arguments survive type checking. Transparent aliases do not prevent this.",
|
|
17642
17642
|
remediation: "Introduce distinct branded identifier types at a validated domain boundary and use them in the callable contract. Keep wire representations primitive until validation; suppress a required external signature locally with a reason.",
|
|
@@ -22282,15 +22282,15 @@ var require_fetch_timeout_default = createRule({
|
|
|
22282
22282
|
// src/rules/require-interface-for-exported-class.ts
|
|
22283
22283
|
var import_utils120 = require("@typescript-eslint/utils");
|
|
22284
22284
|
var REQUIRE_INTERFACE_FOR_EXPORTED_CLASS_DOCUMENTATION = {
|
|
22285
|
-
defaultLevel: "
|
|
22285
|
+
defaultLevel: "error",
|
|
22286
22286
|
summary: "Require exported concrete classes with public behavior to declare a contract.",
|
|
22287
22287
|
rationale: "An explicit contract names the intended public capability separately from implementation details. TypeScript already supports structural compatibility; this is an architecture policy, not a prerequisite for substitution.",
|
|
22288
22288
|
remediation: "Declare a focused interface and add an implements clause, or inherit from an intentional base contract.",
|
|
22289
22289
|
category: "architecture",
|
|
22290
22290
|
limitations: [
|
|
22291
22291
|
"JavaScript files are excluded because implements is TypeScript syntax; imported framework base contracts still require manual policy review.",
|
|
22292
|
-
"An exported injected service may also receive require-port-for-service:
|
|
22293
|
-
"The
|
|
22292
|
+
"An exported injected service may also receive require-port-for-service: the two diagnostics intentionally enforce distinct service-boundary and general exported-contract policy scopes.",
|
|
22293
|
+
"The rule checks module-level class declarations and direct class-expression values exported directly, through local export specifiers, or through a default identifier; re-exports and expressions wrapped in other calls require review.",
|
|
22294
22294
|
"An extends clause satisfies the contract only when its target is a locally declared abstract class; imported base-class contracts require an explicit implements clause.",
|
|
22295
22295
|
"Static factories and data-only classes without public instance methods are outside the contract requirement."
|
|
22296
22296
|
],
|
|
@@ -24968,8 +24968,6 @@ var LIBRARY_IMPORT_POLICY = ["error", {
|
|
|
24968
24968
|
var ADVISORY_RULES = [
|
|
24969
24969
|
"@sarj/excessive-commentary",
|
|
24970
24970
|
"@sarj/no-bespoke-api-case-conversion",
|
|
24971
|
-
"@sarj/no-duplicate-test-case",
|
|
24972
|
-
"@sarj/no-json-stringify-object-equality",
|
|
24973
24971
|
"@sarj/no-restated-comment",
|
|
24974
24972
|
"@sarj/no-restated-jsdoc",
|
|
24975
24973
|
"@sarj/prefer-millisecond-control-duration-schema",
|
|
@@ -24977,12 +24975,9 @@ var ADVISORY_RULES = [
|
|
|
24977
24975
|
"@sarj/prefer-multi-value-zod-literal",
|
|
24978
24976
|
"@sarj/prefer-node-crypto-hash",
|
|
24979
24977
|
"@sarj/prefer-node-fs-promises",
|
|
24980
|
-
"@sarj/prefer-nominal-id-types",
|
|
24981
24978
|
"@sarj/prefer-shared-zod-enum",
|
|
24982
24979
|
"@sarj/prefer-whole-object-assertion",
|
|
24983
24980
|
"@sarj/require-camelcase-properties",
|
|
24984
|
-
"@sarj/require-explicit-service-contract",
|
|
24985
|
-
"@sarj/require-interface-for-exported-class",
|
|
24986
24981
|
"@sarj/require-sql-access-class"
|
|
24987
24982
|
];
|
|
24988
24983
|
var RECOMMENDED_RULES = {
|
|
@@ -25024,7 +25019,7 @@ var RECOMMENDED_RULES = {
|
|
|
25024
25019
|
"@sarj/no-bare-return-from-test-catch": "error",
|
|
25025
25020
|
"@sarj/no-bespoke-api-case-conversion": "warn",
|
|
25026
25021
|
"@sarj/no-detached-global-fetch": "error",
|
|
25027
|
-
"@sarj/no-json-stringify-object-equality": "
|
|
25022
|
+
"@sarj/no-json-stringify-object-equality": "error",
|
|
25028
25023
|
"@sarj/no-dangerously-allow-svg": "error",
|
|
25029
25024
|
"@sarj/no-duplicate-lifecycle-refresh-listeners": "error",
|
|
25030
25025
|
"@sarj/no-long-comment": "error",
|
|
@@ -25046,7 +25041,7 @@ var RECOMMENDED_RULES = {
|
|
|
25046
25041
|
"@sarj/no-sleep-in-test-body": "error",
|
|
25047
25042
|
"@sarj/no-string-concat-in-loop": "error",
|
|
25048
25043
|
"@sarj/no-tautological-expect": "error",
|
|
25049
|
-
"@sarj/no-duplicate-test-case": "
|
|
25044
|
+
"@sarj/no-duplicate-test-case": "error",
|
|
25050
25045
|
"@sarj/no-typed-doc-sections": "error",
|
|
25051
25046
|
"@sarj/no-trailing-value-narration": "error",
|
|
25052
25047
|
"@sarj/no-declaration-comment-wall": "error",
|
|
@@ -25069,7 +25064,7 @@ var RECOMMENDED_RULES = {
|
|
|
25069
25064
|
"@sarj/prefer-module-level-refined-schema": "warn",
|
|
25070
25065
|
"@sarj/prefer-multi-value-zod-literal": ["warn", { zodMajorVersion: 4 }],
|
|
25071
25066
|
"@sarj/prefer-named-callback-domain": "error",
|
|
25072
|
-
"@sarj/prefer-nominal-id-types": "
|
|
25067
|
+
"@sarj/prefer-nominal-id-types": "error",
|
|
25073
25068
|
"@sarj/prefer-named-complex-return-type": "error",
|
|
25074
25069
|
"@sarj/prefer-node-crypto-hash": "warn",
|
|
25075
25070
|
"@sarj/prefer-node-fs-promises": "warn",
|
|
@@ -25088,8 +25083,8 @@ var RECOMMENDED_RULES = {
|
|
|
25088
25083
|
"@sarj/require-assert-never": "error",
|
|
25089
25084
|
"@sarj/require-fetch-timeout": "error",
|
|
25090
25085
|
"@sarj/require-explicit-contract-implementation": "error",
|
|
25091
|
-
"@sarj/require-explicit-service-contract": "
|
|
25092
|
-
"@sarj/require-interface-for-exported-class": "
|
|
25086
|
+
"@sarj/require-explicit-service-contract": "error",
|
|
25087
|
+
"@sarj/require-interface-for-exported-class": "error",
|
|
25093
25088
|
"@sarj/require-port-for-service": "error",
|
|
25094
25089
|
"@sarj/require-sql-access-class": "warn",
|
|
25095
25090
|
"@sarj/require-static-next-matcher": "error",
|
|
@@ -25143,7 +25138,7 @@ var STRICT_RULES = {
|
|
|
25143
25138
|
"@sarj/no-bare-return-from-test-catch": "error",
|
|
25144
25139
|
"@sarj/no-bespoke-api-case-conversion": "warn",
|
|
25145
25140
|
"@sarj/no-detached-global-fetch": "error",
|
|
25146
|
-
"@sarj/no-json-stringify-object-equality": "
|
|
25141
|
+
"@sarj/no-json-stringify-object-equality": "error",
|
|
25147
25142
|
"@sarj/no-dangerously-allow-svg": "error",
|
|
25148
25143
|
"@sarj/no-duplicate-lifecycle-refresh-listeners": "error",
|
|
25149
25144
|
"@sarj/no-long-comment": "error",
|
|
@@ -25168,7 +25163,7 @@ var STRICT_RULES = {
|
|
|
25168
25163
|
"@sarj/no-storage-in-stateless-modules": "error",
|
|
25169
25164
|
"@sarj/no-string-concat-in-loop": "error",
|
|
25170
25165
|
"@sarj/no-tautological-expect": "error",
|
|
25171
|
-
"@sarj/no-duplicate-test-case": "
|
|
25166
|
+
"@sarj/no-duplicate-test-case": "error",
|
|
25172
25167
|
"@sarj/no-typed-doc-sections": "error",
|
|
25173
25168
|
"@sarj/no-trailing-value-narration": "error",
|
|
25174
25169
|
"@sarj/no-declaration-comment-wall": "error",
|
|
@@ -25191,7 +25186,7 @@ var STRICT_RULES = {
|
|
|
25191
25186
|
"@sarj/prefer-module-level-refined-schema": "warn",
|
|
25192
25187
|
"@sarj/prefer-multi-value-zod-literal": ["warn", { zodMajorVersion: 4 }],
|
|
25193
25188
|
"@sarj/prefer-named-callback-domain": "error",
|
|
25194
|
-
"@sarj/prefer-nominal-id-types": "
|
|
25189
|
+
"@sarj/prefer-nominal-id-types": "error",
|
|
25195
25190
|
"@sarj/prefer-named-complex-return-type": "error",
|
|
25196
25191
|
"@sarj/prefer-node-crypto-hash": "warn",
|
|
25197
25192
|
"@sarj/prefer-node-fs-promises": "warn",
|
|
@@ -25210,8 +25205,8 @@ var STRICT_RULES = {
|
|
|
25210
25205
|
"@sarj/require-assert-never": "error",
|
|
25211
25206
|
"@sarj/require-fetch-timeout": "error",
|
|
25212
25207
|
"@sarj/require-explicit-contract-implementation": "error",
|
|
25213
|
-
"@sarj/require-explicit-service-contract": "
|
|
25214
|
-
"@sarj/require-interface-for-exported-class": "
|
|
25208
|
+
"@sarj/require-explicit-service-contract": "error",
|
|
25209
|
+
"@sarj/require-interface-for-exported-class": "error",
|
|
25215
25210
|
"@sarj/require-port-for-service": "error",
|
|
25216
25211
|
"@sarj/require-sql-access-class": "warn",
|
|
25217
25212
|
"@sarj/require-static-next-matcher": "error",
|
package/dist/index.d.cts
CHANGED
|
@@ -291,7 +291,7 @@ declare const RULES: {
|
|
|
291
291
|
/** @deprecated All repositories use one policy; retained for import compatibility. */
|
|
292
292
|
declare const APPLICATION_ONLY_RULES: readonly [];
|
|
293
293
|
/** Rules staged as non-blocking warnings while corpus adoption evidence accumulates. */
|
|
294
|
-
declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-
|
|
294
|
+
declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-restated-comment", "@sarj/no-restated-jsdoc", "@sarj/prefer-millisecond-control-duration-schema", "@sarj/prefer-module-level-refined-schema", "@sarj/prefer-multi-value-zod-literal", "@sarj/prefer-node-crypto-hash", "@sarj/prefer-node-fs-promises", "@sarj/prefer-shared-zod-enum", "@sarj/prefer-whole-object-assertion", "@sarj/require-camelcase-properties", "@sarj/require-sql-access-class"];
|
|
295
295
|
declare const RECOMMENDED_RULES: {
|
|
296
296
|
readonly "@sarj/named-child-schema-type": "error";
|
|
297
297
|
readonly "@sarj/no-conditional-empty-object-spread": "error";
|
|
@@ -522,7 +522,7 @@ declare const RECOMMENDED_RULES: {
|
|
|
522
522
|
readonly "@sarj/no-bare-return-from-test-catch": "error";
|
|
523
523
|
readonly "@sarj/no-bespoke-api-case-conversion": "warn";
|
|
524
524
|
readonly "@sarj/no-detached-global-fetch": "error";
|
|
525
|
-
readonly "@sarj/no-json-stringify-object-equality": "
|
|
525
|
+
readonly "@sarj/no-json-stringify-object-equality": "error";
|
|
526
526
|
readonly "@sarj/no-dangerously-allow-svg": "error";
|
|
527
527
|
readonly "@sarj/no-duplicate-lifecycle-refresh-listeners": "error";
|
|
528
528
|
readonly "@sarj/no-long-comment": "error";
|
|
@@ -544,7 +544,7 @@ declare const RECOMMENDED_RULES: {
|
|
|
544
544
|
readonly "@sarj/no-sleep-in-test-body": "error";
|
|
545
545
|
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
546
546
|
readonly "@sarj/no-tautological-expect": "error";
|
|
547
|
-
readonly "@sarj/no-duplicate-test-case": "
|
|
547
|
+
readonly "@sarj/no-duplicate-test-case": "error";
|
|
548
548
|
readonly "@sarj/no-typed-doc-sections": "error";
|
|
549
549
|
readonly "@sarj/no-trailing-value-narration": "error";
|
|
550
550
|
readonly "@sarj/no-declaration-comment-wall": "error";
|
|
@@ -569,7 +569,7 @@ declare const RECOMMENDED_RULES: {
|
|
|
569
569
|
readonly zodMajorVersion: 4;
|
|
570
570
|
}];
|
|
571
571
|
readonly "@sarj/prefer-named-callback-domain": "error";
|
|
572
|
-
readonly "@sarj/prefer-nominal-id-types": "
|
|
572
|
+
readonly "@sarj/prefer-nominal-id-types": "error";
|
|
573
573
|
readonly "@sarj/prefer-named-complex-return-type": "error";
|
|
574
574
|
readonly "@sarj/prefer-node-crypto-hash": "warn";
|
|
575
575
|
readonly "@sarj/prefer-node-fs-promises": "warn";
|
|
@@ -590,8 +590,8 @@ declare const RECOMMENDED_RULES: {
|
|
|
590
590
|
readonly "@sarj/require-assert-never": "error";
|
|
591
591
|
readonly "@sarj/require-fetch-timeout": "error";
|
|
592
592
|
readonly "@sarj/require-explicit-contract-implementation": "error";
|
|
593
|
-
readonly "@sarj/require-explicit-service-contract": "
|
|
594
|
-
readonly "@sarj/require-interface-for-exported-class": "
|
|
593
|
+
readonly "@sarj/require-explicit-service-contract": "error";
|
|
594
|
+
readonly "@sarj/require-interface-for-exported-class": "error";
|
|
595
595
|
readonly "@sarj/require-port-for-service": "error";
|
|
596
596
|
readonly "@sarj/require-sql-access-class": "warn";
|
|
597
597
|
readonly "@sarj/require-static-next-matcher": "error";
|
|
@@ -836,7 +836,7 @@ declare const STRICT_RULES: {
|
|
|
836
836
|
readonly "@sarj/no-bare-return-from-test-catch": "error";
|
|
837
837
|
readonly "@sarj/no-bespoke-api-case-conversion": "warn";
|
|
838
838
|
readonly "@sarj/no-detached-global-fetch": "error";
|
|
839
|
-
readonly "@sarj/no-json-stringify-object-equality": "
|
|
839
|
+
readonly "@sarj/no-json-stringify-object-equality": "error";
|
|
840
840
|
readonly "@sarj/no-dangerously-allow-svg": "error";
|
|
841
841
|
readonly "@sarj/no-duplicate-lifecycle-refresh-listeners": "error";
|
|
842
842
|
readonly "@sarj/no-long-comment": "error";
|
|
@@ -861,7 +861,7 @@ declare const STRICT_RULES: {
|
|
|
861
861
|
readonly "@sarj/no-storage-in-stateless-modules": "error";
|
|
862
862
|
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
863
863
|
readonly "@sarj/no-tautological-expect": "error";
|
|
864
|
-
readonly "@sarj/no-duplicate-test-case": "
|
|
864
|
+
readonly "@sarj/no-duplicate-test-case": "error";
|
|
865
865
|
readonly "@sarj/no-typed-doc-sections": "error";
|
|
866
866
|
readonly "@sarj/no-trailing-value-narration": "error";
|
|
867
867
|
readonly "@sarj/no-declaration-comment-wall": "error";
|
|
@@ -886,7 +886,7 @@ declare const STRICT_RULES: {
|
|
|
886
886
|
readonly zodMajorVersion: 4;
|
|
887
887
|
}];
|
|
888
888
|
readonly "@sarj/prefer-named-callback-domain": "error";
|
|
889
|
-
readonly "@sarj/prefer-nominal-id-types": "
|
|
889
|
+
readonly "@sarj/prefer-nominal-id-types": "error";
|
|
890
890
|
readonly "@sarj/prefer-named-complex-return-type": "error";
|
|
891
891
|
readonly "@sarj/prefer-node-crypto-hash": "warn";
|
|
892
892
|
readonly "@sarj/prefer-node-fs-promises": "warn";
|
|
@@ -907,8 +907,8 @@ declare const STRICT_RULES: {
|
|
|
907
907
|
readonly "@sarj/require-assert-never": "error";
|
|
908
908
|
readonly "@sarj/require-fetch-timeout": "error";
|
|
909
909
|
readonly "@sarj/require-explicit-contract-implementation": "error";
|
|
910
|
-
readonly "@sarj/require-explicit-service-contract": "
|
|
911
|
-
readonly "@sarj/require-interface-for-exported-class": "
|
|
910
|
+
readonly "@sarj/require-explicit-service-contract": "error";
|
|
911
|
+
readonly "@sarj/require-interface-for-exported-class": "error";
|
|
912
912
|
readonly "@sarj/require-port-for-service": "error";
|
|
913
913
|
readonly "@sarj/require-sql-access-class": "warn";
|
|
914
914
|
readonly "@sarj/require-static-next-matcher": "error";
|
package/dist/index.d.ts
CHANGED
|
@@ -291,7 +291,7 @@ declare const RULES: {
|
|
|
291
291
|
/** @deprecated All repositories use one policy; retained for import compatibility. */
|
|
292
292
|
declare const APPLICATION_ONLY_RULES: readonly [];
|
|
293
293
|
/** Rules staged as non-blocking warnings while corpus adoption evidence accumulates. */
|
|
294
|
-
declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-
|
|
294
|
+
declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-restated-comment", "@sarj/no-restated-jsdoc", "@sarj/prefer-millisecond-control-duration-schema", "@sarj/prefer-module-level-refined-schema", "@sarj/prefer-multi-value-zod-literal", "@sarj/prefer-node-crypto-hash", "@sarj/prefer-node-fs-promises", "@sarj/prefer-shared-zod-enum", "@sarj/prefer-whole-object-assertion", "@sarj/require-camelcase-properties", "@sarj/require-sql-access-class"];
|
|
295
295
|
declare const RECOMMENDED_RULES: {
|
|
296
296
|
readonly "@sarj/named-child-schema-type": "error";
|
|
297
297
|
readonly "@sarj/no-conditional-empty-object-spread": "error";
|
|
@@ -522,7 +522,7 @@ declare const RECOMMENDED_RULES: {
|
|
|
522
522
|
readonly "@sarj/no-bare-return-from-test-catch": "error";
|
|
523
523
|
readonly "@sarj/no-bespoke-api-case-conversion": "warn";
|
|
524
524
|
readonly "@sarj/no-detached-global-fetch": "error";
|
|
525
|
-
readonly "@sarj/no-json-stringify-object-equality": "
|
|
525
|
+
readonly "@sarj/no-json-stringify-object-equality": "error";
|
|
526
526
|
readonly "@sarj/no-dangerously-allow-svg": "error";
|
|
527
527
|
readonly "@sarj/no-duplicate-lifecycle-refresh-listeners": "error";
|
|
528
528
|
readonly "@sarj/no-long-comment": "error";
|
|
@@ -544,7 +544,7 @@ declare const RECOMMENDED_RULES: {
|
|
|
544
544
|
readonly "@sarj/no-sleep-in-test-body": "error";
|
|
545
545
|
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
546
546
|
readonly "@sarj/no-tautological-expect": "error";
|
|
547
|
-
readonly "@sarj/no-duplicate-test-case": "
|
|
547
|
+
readonly "@sarj/no-duplicate-test-case": "error";
|
|
548
548
|
readonly "@sarj/no-typed-doc-sections": "error";
|
|
549
549
|
readonly "@sarj/no-trailing-value-narration": "error";
|
|
550
550
|
readonly "@sarj/no-declaration-comment-wall": "error";
|
|
@@ -569,7 +569,7 @@ declare const RECOMMENDED_RULES: {
|
|
|
569
569
|
readonly zodMajorVersion: 4;
|
|
570
570
|
}];
|
|
571
571
|
readonly "@sarj/prefer-named-callback-domain": "error";
|
|
572
|
-
readonly "@sarj/prefer-nominal-id-types": "
|
|
572
|
+
readonly "@sarj/prefer-nominal-id-types": "error";
|
|
573
573
|
readonly "@sarj/prefer-named-complex-return-type": "error";
|
|
574
574
|
readonly "@sarj/prefer-node-crypto-hash": "warn";
|
|
575
575
|
readonly "@sarj/prefer-node-fs-promises": "warn";
|
|
@@ -590,8 +590,8 @@ declare const RECOMMENDED_RULES: {
|
|
|
590
590
|
readonly "@sarj/require-assert-never": "error";
|
|
591
591
|
readonly "@sarj/require-fetch-timeout": "error";
|
|
592
592
|
readonly "@sarj/require-explicit-contract-implementation": "error";
|
|
593
|
-
readonly "@sarj/require-explicit-service-contract": "
|
|
594
|
-
readonly "@sarj/require-interface-for-exported-class": "
|
|
593
|
+
readonly "@sarj/require-explicit-service-contract": "error";
|
|
594
|
+
readonly "@sarj/require-interface-for-exported-class": "error";
|
|
595
595
|
readonly "@sarj/require-port-for-service": "error";
|
|
596
596
|
readonly "@sarj/require-sql-access-class": "warn";
|
|
597
597
|
readonly "@sarj/require-static-next-matcher": "error";
|
|
@@ -836,7 +836,7 @@ declare const STRICT_RULES: {
|
|
|
836
836
|
readonly "@sarj/no-bare-return-from-test-catch": "error";
|
|
837
837
|
readonly "@sarj/no-bespoke-api-case-conversion": "warn";
|
|
838
838
|
readonly "@sarj/no-detached-global-fetch": "error";
|
|
839
|
-
readonly "@sarj/no-json-stringify-object-equality": "
|
|
839
|
+
readonly "@sarj/no-json-stringify-object-equality": "error";
|
|
840
840
|
readonly "@sarj/no-dangerously-allow-svg": "error";
|
|
841
841
|
readonly "@sarj/no-duplicate-lifecycle-refresh-listeners": "error";
|
|
842
842
|
readonly "@sarj/no-long-comment": "error";
|
|
@@ -861,7 +861,7 @@ declare const STRICT_RULES: {
|
|
|
861
861
|
readonly "@sarj/no-storage-in-stateless-modules": "error";
|
|
862
862
|
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
863
863
|
readonly "@sarj/no-tautological-expect": "error";
|
|
864
|
-
readonly "@sarj/no-duplicate-test-case": "
|
|
864
|
+
readonly "@sarj/no-duplicate-test-case": "error";
|
|
865
865
|
readonly "@sarj/no-typed-doc-sections": "error";
|
|
866
866
|
readonly "@sarj/no-trailing-value-narration": "error";
|
|
867
867
|
readonly "@sarj/no-declaration-comment-wall": "error";
|
|
@@ -886,7 +886,7 @@ declare const STRICT_RULES: {
|
|
|
886
886
|
readonly zodMajorVersion: 4;
|
|
887
887
|
}];
|
|
888
888
|
readonly "@sarj/prefer-named-callback-domain": "error";
|
|
889
|
-
readonly "@sarj/prefer-nominal-id-types": "
|
|
889
|
+
readonly "@sarj/prefer-nominal-id-types": "error";
|
|
890
890
|
readonly "@sarj/prefer-named-complex-return-type": "error";
|
|
891
891
|
readonly "@sarj/prefer-node-crypto-hash": "warn";
|
|
892
892
|
readonly "@sarj/prefer-node-fs-promises": "warn";
|
|
@@ -907,8 +907,8 @@ declare const STRICT_RULES: {
|
|
|
907
907
|
readonly "@sarj/require-assert-never": "error";
|
|
908
908
|
readonly "@sarj/require-fetch-timeout": "error";
|
|
909
909
|
readonly "@sarj/require-explicit-contract-implementation": "error";
|
|
910
|
-
readonly "@sarj/require-explicit-service-contract": "
|
|
911
|
-
readonly "@sarj/require-interface-for-exported-class": "
|
|
910
|
+
readonly "@sarj/require-explicit-service-contract": "error";
|
|
911
|
+
readonly "@sarj/require-interface-for-exported-class": "error";
|
|
912
912
|
readonly "@sarj/require-port-for-service": "error";
|
|
913
913
|
readonly "@sarj/require-sql-access-class": "warn";
|
|
914
914
|
readonly "@sarj/require-static-next-matcher": "error";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@sarj/eslint-plugin",
|
|
4
|
-
version: "16.
|
|
4
|
+
version: "16.8.0",
|
|
5
5
|
packageManager: "npm@12.1.0",
|
|
6
6
|
description: "Custom ESLint rules for hypermodern TypeScript / React / Next.js projects",
|
|
7
7
|
type: "module",
|
|
@@ -1518,7 +1518,7 @@ function abstractContractOperations(node, functionAliases) {
|
|
|
1518
1518
|
|
|
1519
1519
|
// src/rules/require-explicit-service-contract.ts
|
|
1520
1520
|
var REQUIRE_EXPLICIT_SERVICE_CONTRACT_DOCUMENTATION = {
|
|
1521
|
-
defaultLevel: "
|
|
1521
|
+
defaultLevel: "error",
|
|
1522
1522
|
summary: "Require explicit contracts for classes that invoke retained collaborators.",
|
|
1523
1523
|
rationale: "A one-operation service can orchestrate a collaborator without declaring the contract that callers consume and implementations and fakes satisfy.",
|
|
1524
1524
|
remediation: "Explicitly implement a focused interface or extend an abstract class covering the service operations. Export the contract only when its consumers need it.",
|
|
@@ -7527,7 +7527,7 @@ import {
|
|
|
7527
7527
|
} from "@typescript-eslint/utils";
|
|
7528
7528
|
import ts6 from "typescript";
|
|
7529
7529
|
var NO_JSON_STRINGIFY_OBJECT_EQUALITY_DOCUMENTATION = {
|
|
7530
|
-
defaultLevel: "
|
|
7530
|
+
defaultLevel: "error",
|
|
7531
7531
|
summary: "Do not use JSON serialization as structural object equality.",
|
|
7532
7532
|
rationale: "JSON text equality depends on property insertion order and serialization behavior, so semantically equal objects can compare unequal and distinct values can collapse together.",
|
|
7533
7533
|
remediation: "Compare an explicit domain projection structurally, or use a reviewed canonical serializer when JSON semantics are required.",
|
|
@@ -12761,7 +12761,7 @@ var TEST_MODULES = /* @__PURE__ */ new Set(["vitest", "@jest/globals", "bun:test
|
|
|
12761
12761
|
var TEST_NAMES2 = /* @__PURE__ */ new Set(["it", "test"]);
|
|
12762
12762
|
var MODIFIERS = /* @__PURE__ */ new Set(["only", "skip", "concurrent", "fails", "failing", "todo"]);
|
|
12763
12763
|
var NO_DUPLICATE_TEST_CASE_DOCUMENTATION = {
|
|
12764
|
-
defaultLevel: "
|
|
12764
|
+
defaultLevel: "error",
|
|
12765
12765
|
summary: "Report repeated literal rows in framework test.each or it.each tables.",
|
|
12766
12766
|
rationale: "Identical rows repeat the same inputs and expected values without exposing a distinct case. Accidental duplicates consume test time and hide a missing boundary vector.",
|
|
12767
12767
|
remediation: "Remove the accidental duplicate or replace it with the intended distinct boundary. Preserve intentional repeated or stateful scenarios with a local explanation; do not delete their coverage automatically.",
|
|
@@ -17639,7 +17639,7 @@ var OPERATIONAL_ROLES = /* @__PURE__ */ new Set([
|
|
|
17639
17639
|
]);
|
|
17640
17640
|
var MAX_ALIAS_DEPTH = 16;
|
|
17641
17641
|
var PREFER_NOMINAL_ID_TYPES_DOCUMENTATION = {
|
|
17642
|
-
defaultLevel: "
|
|
17642
|
+
defaultLevel: "error",
|
|
17643
17643
|
summary: "Distinguish identifier roles sharing primitive types at callable boundaries.",
|
|
17644
17644
|
rationale: "Two identifier roles represented by the same primitive accept each other's values, so swapped arguments survive type checking. Transparent aliases do not prevent this.",
|
|
17645
17645
|
remediation: "Introduce distinct branded identifier types at a validated domain boundary and use them in the callable contract. Keep wire representations primitive until validation; suppress a required external signature locally with a reason.",
|
|
@@ -22300,15 +22300,15 @@ var require_fetch_timeout_default = createRule({
|
|
|
22300
22300
|
// src/rules/require-interface-for-exported-class.ts
|
|
22301
22301
|
import { AST_NODE_TYPES as AST_NODE_TYPES104 } from "@typescript-eslint/utils";
|
|
22302
22302
|
var REQUIRE_INTERFACE_FOR_EXPORTED_CLASS_DOCUMENTATION = {
|
|
22303
|
-
defaultLevel: "
|
|
22303
|
+
defaultLevel: "error",
|
|
22304
22304
|
summary: "Require exported concrete classes with public behavior to declare a contract.",
|
|
22305
22305
|
rationale: "An explicit contract names the intended public capability separately from implementation details. TypeScript already supports structural compatibility; this is an architecture policy, not a prerequisite for substitution.",
|
|
22306
22306
|
remediation: "Declare a focused interface and add an implements clause, or inherit from an intentional base contract.",
|
|
22307
22307
|
category: "architecture",
|
|
22308
22308
|
limitations: [
|
|
22309
22309
|
"JavaScript files are excluded because implements is TypeScript syntax; imported framework base contracts still require manual policy review.",
|
|
22310
|
-
"An exported injected service may also receive require-port-for-service:
|
|
22311
|
-
"The
|
|
22310
|
+
"An exported injected service may also receive require-port-for-service: the two diagnostics intentionally enforce distinct service-boundary and general exported-contract policy scopes.",
|
|
22311
|
+
"The rule checks module-level class declarations and direct class-expression values exported directly, through local export specifiers, or through a default identifier; re-exports and expressions wrapped in other calls require review.",
|
|
22312
22312
|
"An extends clause satisfies the contract only when its target is a locally declared abstract class; imported base-class contracts require an explicit implements clause.",
|
|
22313
22313
|
"Static factories and data-only classes without public instance methods are outside the contract requirement."
|
|
22314
22314
|
],
|
|
@@ -24992,8 +24992,6 @@ var LIBRARY_IMPORT_POLICY = ["error", {
|
|
|
24992
24992
|
var ADVISORY_RULES = [
|
|
24993
24993
|
"@sarj/excessive-commentary",
|
|
24994
24994
|
"@sarj/no-bespoke-api-case-conversion",
|
|
24995
|
-
"@sarj/no-duplicate-test-case",
|
|
24996
|
-
"@sarj/no-json-stringify-object-equality",
|
|
24997
24995
|
"@sarj/no-restated-comment",
|
|
24998
24996
|
"@sarj/no-restated-jsdoc",
|
|
24999
24997
|
"@sarj/prefer-millisecond-control-duration-schema",
|
|
@@ -25001,12 +24999,9 @@ var ADVISORY_RULES = [
|
|
|
25001
24999
|
"@sarj/prefer-multi-value-zod-literal",
|
|
25002
25000
|
"@sarj/prefer-node-crypto-hash",
|
|
25003
25001
|
"@sarj/prefer-node-fs-promises",
|
|
25004
|
-
"@sarj/prefer-nominal-id-types",
|
|
25005
25002
|
"@sarj/prefer-shared-zod-enum",
|
|
25006
25003
|
"@sarj/prefer-whole-object-assertion",
|
|
25007
25004
|
"@sarj/require-camelcase-properties",
|
|
25008
|
-
"@sarj/require-explicit-service-contract",
|
|
25009
|
-
"@sarj/require-interface-for-exported-class",
|
|
25010
25005
|
"@sarj/require-sql-access-class"
|
|
25011
25006
|
];
|
|
25012
25007
|
var RECOMMENDED_RULES = {
|
|
@@ -25048,7 +25043,7 @@ var RECOMMENDED_RULES = {
|
|
|
25048
25043
|
"@sarj/no-bare-return-from-test-catch": "error",
|
|
25049
25044
|
"@sarj/no-bespoke-api-case-conversion": "warn",
|
|
25050
25045
|
"@sarj/no-detached-global-fetch": "error",
|
|
25051
|
-
"@sarj/no-json-stringify-object-equality": "
|
|
25046
|
+
"@sarj/no-json-stringify-object-equality": "error",
|
|
25052
25047
|
"@sarj/no-dangerously-allow-svg": "error",
|
|
25053
25048
|
"@sarj/no-duplicate-lifecycle-refresh-listeners": "error",
|
|
25054
25049
|
"@sarj/no-long-comment": "error",
|
|
@@ -25070,7 +25065,7 @@ var RECOMMENDED_RULES = {
|
|
|
25070
25065
|
"@sarj/no-sleep-in-test-body": "error",
|
|
25071
25066
|
"@sarj/no-string-concat-in-loop": "error",
|
|
25072
25067
|
"@sarj/no-tautological-expect": "error",
|
|
25073
|
-
"@sarj/no-duplicate-test-case": "
|
|
25068
|
+
"@sarj/no-duplicate-test-case": "error",
|
|
25074
25069
|
"@sarj/no-typed-doc-sections": "error",
|
|
25075
25070
|
"@sarj/no-trailing-value-narration": "error",
|
|
25076
25071
|
"@sarj/no-declaration-comment-wall": "error",
|
|
@@ -25093,7 +25088,7 @@ var RECOMMENDED_RULES = {
|
|
|
25093
25088
|
"@sarj/prefer-module-level-refined-schema": "warn",
|
|
25094
25089
|
"@sarj/prefer-multi-value-zod-literal": ["warn", { zodMajorVersion: 4 }],
|
|
25095
25090
|
"@sarj/prefer-named-callback-domain": "error",
|
|
25096
|
-
"@sarj/prefer-nominal-id-types": "
|
|
25091
|
+
"@sarj/prefer-nominal-id-types": "error",
|
|
25097
25092
|
"@sarj/prefer-named-complex-return-type": "error",
|
|
25098
25093
|
"@sarj/prefer-node-crypto-hash": "warn",
|
|
25099
25094
|
"@sarj/prefer-node-fs-promises": "warn",
|
|
@@ -25112,8 +25107,8 @@ var RECOMMENDED_RULES = {
|
|
|
25112
25107
|
"@sarj/require-assert-never": "error",
|
|
25113
25108
|
"@sarj/require-fetch-timeout": "error",
|
|
25114
25109
|
"@sarj/require-explicit-contract-implementation": "error",
|
|
25115
|
-
"@sarj/require-explicit-service-contract": "
|
|
25116
|
-
"@sarj/require-interface-for-exported-class": "
|
|
25110
|
+
"@sarj/require-explicit-service-contract": "error",
|
|
25111
|
+
"@sarj/require-interface-for-exported-class": "error",
|
|
25117
25112
|
"@sarj/require-port-for-service": "error",
|
|
25118
25113
|
"@sarj/require-sql-access-class": "warn",
|
|
25119
25114
|
"@sarj/require-static-next-matcher": "error",
|
|
@@ -25167,7 +25162,7 @@ var STRICT_RULES = {
|
|
|
25167
25162
|
"@sarj/no-bare-return-from-test-catch": "error",
|
|
25168
25163
|
"@sarj/no-bespoke-api-case-conversion": "warn",
|
|
25169
25164
|
"@sarj/no-detached-global-fetch": "error",
|
|
25170
|
-
"@sarj/no-json-stringify-object-equality": "
|
|
25165
|
+
"@sarj/no-json-stringify-object-equality": "error",
|
|
25171
25166
|
"@sarj/no-dangerously-allow-svg": "error",
|
|
25172
25167
|
"@sarj/no-duplicate-lifecycle-refresh-listeners": "error",
|
|
25173
25168
|
"@sarj/no-long-comment": "error",
|
|
@@ -25192,7 +25187,7 @@ var STRICT_RULES = {
|
|
|
25192
25187
|
"@sarj/no-storage-in-stateless-modules": "error",
|
|
25193
25188
|
"@sarj/no-string-concat-in-loop": "error",
|
|
25194
25189
|
"@sarj/no-tautological-expect": "error",
|
|
25195
|
-
"@sarj/no-duplicate-test-case": "
|
|
25190
|
+
"@sarj/no-duplicate-test-case": "error",
|
|
25196
25191
|
"@sarj/no-typed-doc-sections": "error",
|
|
25197
25192
|
"@sarj/no-trailing-value-narration": "error",
|
|
25198
25193
|
"@sarj/no-declaration-comment-wall": "error",
|
|
@@ -25215,7 +25210,7 @@ var STRICT_RULES = {
|
|
|
25215
25210
|
"@sarj/prefer-module-level-refined-schema": "warn",
|
|
25216
25211
|
"@sarj/prefer-multi-value-zod-literal": ["warn", { zodMajorVersion: 4 }],
|
|
25217
25212
|
"@sarj/prefer-named-callback-domain": "error",
|
|
25218
|
-
"@sarj/prefer-nominal-id-types": "
|
|
25213
|
+
"@sarj/prefer-nominal-id-types": "error",
|
|
25219
25214
|
"@sarj/prefer-named-complex-return-type": "error",
|
|
25220
25215
|
"@sarj/prefer-node-crypto-hash": "warn",
|
|
25221
25216
|
"@sarj/prefer-node-fs-promises": "warn",
|
|
@@ -25234,8 +25229,8 @@ var STRICT_RULES = {
|
|
|
25234
25229
|
"@sarj/require-assert-never": "error",
|
|
25235
25230
|
"@sarj/require-fetch-timeout": "error",
|
|
25236
25231
|
"@sarj/require-explicit-contract-implementation": "error",
|
|
25237
|
-
"@sarj/require-explicit-service-contract": "
|
|
25238
|
-
"@sarj/require-interface-for-exported-class": "
|
|
25232
|
+
"@sarj/require-explicit-service-contract": "error",
|
|
25233
|
+
"@sarj/require-interface-for-exported-class": "error",
|
|
25239
25234
|
"@sarj/require-port-for-service": "error",
|
|
25240
25235
|
"@sarj/require-sql-access-class": "warn",
|
|
25241
25236
|
"@sarj/require-static-next-matcher": "error",
|