@sarj/eslint-plugin 15.13.1 → 15.13.2
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 +214 -200
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +207 -200
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -30,15 +30,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
ADVISORY_RULES: () => ADVISORY_RULES,
|
|
34
|
+
APPLICATION_ONLY_RULES: () => APPLICATION_ONLY_RULES,
|
|
35
|
+
RECOMMENDED_RULES: () => RECOMMENDED_RULES,
|
|
36
|
+
RENAMED_RULES: () => RENAMED_RULES,
|
|
37
|
+
RETIRED_RULES: () => RETIRED_RULES,
|
|
38
|
+
RULES: () => RULES,
|
|
39
|
+
STRICT_RULES: () => STRICT_RULES,
|
|
40
|
+
advisoryRules: () => ADVISORY_RULES,
|
|
41
|
+
applicationOnlyRules: () => APPLICATION_ONLY_RULES,
|
|
35
42
|
default: () => index_default,
|
|
36
43
|
publicDocumentation: () => publicDocumentation,
|
|
37
|
-
recommendedRules: () =>
|
|
38
|
-
renamedRules: () =>
|
|
39
|
-
retiredRules: () =>
|
|
40
|
-
rules: () =>
|
|
41
|
-
strictRules: () =>
|
|
44
|
+
recommendedRules: () => RECOMMENDED_RULES,
|
|
45
|
+
renamedRules: () => RENAMED_RULES,
|
|
46
|
+
retiredRules: () => RETIRED_RULES,
|
|
47
|
+
rules: () => RULES,
|
|
48
|
+
strictRules: () => STRICT_RULES
|
|
42
49
|
});
|
|
43
50
|
module.exports = __toCommonJS(index_exports);
|
|
44
51
|
|
|
@@ -67,16 +74,16 @@ function createRule(config) {
|
|
|
67
74
|
}
|
|
68
75
|
return rule;
|
|
69
76
|
}
|
|
70
|
-
function documentationWarnings(
|
|
71
|
-
return Object.entries(
|
|
77
|
+
function documentationWarnings(rules) {
|
|
78
|
+
return Object.entries(rules).filter(([, rule]) => rule.documentation === void 0).map(([name]) => `${name}: source-owned documentation has not been migrated`).sort();
|
|
72
79
|
}
|
|
73
|
-
function publicDocumentation(
|
|
74
|
-
const missing = documentationWarnings(
|
|
80
|
+
function publicDocumentation(rules) {
|
|
81
|
+
const missing = documentationWarnings(rules);
|
|
75
82
|
if (missing.length > 0) {
|
|
76
83
|
throw new TypeError(`cannot publish an incomplete rule catalog:
|
|
77
84
|
${missing.join("\n")}`);
|
|
78
85
|
}
|
|
79
|
-
return Object.entries(
|
|
86
|
+
return Object.entries(rules).sort(([left], [right]) => left.localeCompare(right)).map(([ruleId, rule]) => {
|
|
80
87
|
const spec = rule.documentation;
|
|
81
88
|
if (spec === void 0 || spec.ruleId !== ruleId) {
|
|
82
89
|
throw new TypeError(`${ruleId}: native documentation identity mismatch`);
|
|
@@ -335,7 +342,7 @@ function isScriptFile(filename) {
|
|
|
335
342
|
}
|
|
336
343
|
|
|
337
344
|
// src/rules/enforce-file-structure.ts
|
|
338
|
-
var
|
|
345
|
+
var ENFORCE_FILE_STRUCTURE_DOCUMENTATION = {
|
|
339
346
|
summary: "Require imports before body statements and require `use server` to be the first statement.",
|
|
340
347
|
rationale: "Interleaved imports obscure module dependencies, while a displaced `use server` string is not an active directive.",
|
|
341
348
|
remediation: "Move `use server` to the first statement when present, then place imports before declarations and executable statements.",
|
|
@@ -385,7 +392,7 @@ var isUseServerDirective = (statement) => {
|
|
|
385
392
|
};
|
|
386
393
|
var enforce_file_structure_default = createRule({
|
|
387
394
|
name: "enforce-file-structure",
|
|
388
|
-
documentation:
|
|
395
|
+
documentation: ENFORCE_FILE_STRUCTURE_DOCUMENTATION,
|
|
389
396
|
meta: {
|
|
390
397
|
type: "suggestion",
|
|
391
398
|
docs: {
|
|
@@ -460,7 +467,7 @@ var OMITTED_AST_KEYS = /* @__PURE__ */ new Set([
|
|
|
460
467
|
var MIN_STATEMENTS = 3;
|
|
461
468
|
var MAX_NORMALIZED_STRING_LENGTH = 64;
|
|
462
469
|
var TEST_MODULES = /* @__PURE__ */ new Set(["@jest/globals", "@playwright/test", "bun:test", "node:test", "vitest"]);
|
|
463
|
-
var
|
|
470
|
+
var DUPLICATE_TEST_BODY_DOCUMENTATION = {
|
|
464
471
|
summary: "Disallow substantial sibling tests with the same body shape; express their differing inputs as a parameterized case table.",
|
|
465
472
|
rationale: "Copy-pasted test bodies hide the cases that differ and allow equivalent assertions to drift independently.",
|
|
466
473
|
remediation: "Move the varying inputs and expected values into a case table consumed by `test.each(...)` or `it.each(...)`.",
|
|
@@ -658,7 +665,7 @@ function isDuplicateTestFrameworkIdentifier(identifier, sourceCode) {
|
|
|
658
665
|
}
|
|
659
666
|
var duplicate_test_body_default = createRule({
|
|
660
667
|
name: "duplicate-test-body",
|
|
661
|
-
documentation:
|
|
668
|
+
documentation: DUPLICATE_TEST_BODY_DOCUMENTATION,
|
|
662
669
|
meta: {
|
|
663
670
|
type: "suggestion",
|
|
664
671
|
docs: {
|
|
@@ -692,7 +699,7 @@ var duplicate_test_body_default = createRule({
|
|
|
692
699
|
|
|
693
700
|
// src/rules/no-client-side-data-fetching.ts
|
|
694
701
|
var import_utils4 = require("@typescript-eslint/utils");
|
|
695
|
-
var
|
|
702
|
+
var NO_CLIENT_SIDE_DATA_FETCHING_DOCUMENTATION = {
|
|
696
703
|
summary: "Disallow direct data fetching inside `useEffect` or `useLayoutEffect`.",
|
|
697
704
|
rationale: "Effect-driven reads begin after rendering and can create request waterfalls, duplicate fetches, and loading-state layout shifts.",
|
|
698
705
|
remediation: "Fetch in a React Server Component or Server Action, or use a client cache such as SWR or React Query.",
|
|
@@ -819,7 +826,7 @@ function extractUrlString(node) {
|
|
|
819
826
|
}
|
|
820
827
|
var no_client_side_data_fetching_default = createRule({
|
|
821
828
|
name: "no-client-side-data-fetching",
|
|
822
|
-
documentation:
|
|
829
|
+
documentation: NO_CLIENT_SIDE_DATA_FETCHING_DOCUMENTATION,
|
|
823
830
|
meta: {
|
|
824
831
|
type: "problem",
|
|
825
832
|
docs: {
|
|
@@ -1044,7 +1051,7 @@ function headTokens(source) {
|
|
|
1044
1051
|
}
|
|
1045
1052
|
|
|
1046
1053
|
// src/rules/no-comment-cruft.ts
|
|
1047
|
-
var
|
|
1054
|
+
var NO_COMMENT_CRUFT_DOCUMENTATION = {
|
|
1048
1055
|
summary: "Flag commented-out code, section-banner comments, and leading file-header comment preambles.",
|
|
1049
1056
|
rationale: "Decorative, narrated, or dead-code comments obscure the constraints and rationale that comments should preserve.",
|
|
1050
1057
|
remediation: "Delete dead code and narration; express boundaries with named code and retain only comments that explain constraints or intent.",
|
|
@@ -1444,7 +1451,7 @@ function hasCommentedOutCode(texts, precedingProse, allowCall) {
|
|
|
1444
1451
|
}
|
|
1445
1452
|
var no_comment_cruft_default = createRule({
|
|
1446
1453
|
name: "no-comment-cruft",
|
|
1447
|
-
documentation:
|
|
1454
|
+
documentation: NO_COMMENT_CRUFT_DOCUMENTATION,
|
|
1448
1455
|
meta: {
|
|
1449
1456
|
type: "suggestion",
|
|
1450
1457
|
docs: {
|
|
@@ -1656,7 +1663,7 @@ var no_comment_cruft_default = createRule({
|
|
|
1656
1663
|
|
|
1657
1664
|
// src/rules/no-cors-wildcard-with-credentials.ts
|
|
1658
1665
|
var import_utils7 = require("@typescript-eslint/utils");
|
|
1659
|
-
var
|
|
1666
|
+
var NO_CORS_WILDCARD_WITH_CREDENTIALS_DOCUMENTATION = {
|
|
1660
1667
|
summary: "Disallow wildcard CORS origins when credentials are enabled.",
|
|
1661
1668
|
rationale: "Reflecting every origin while allowing credentials can let an untrusted site read authenticated cross-origin responses.",
|
|
1662
1669
|
remediation: "Enumerate the trusted origins that may receive credentialed responses.",
|
|
@@ -1828,7 +1835,7 @@ function enclosingScope(node) {
|
|
|
1828
1835
|
}
|
|
1829
1836
|
var no_cors_wildcard_with_credentials_default = createRule({
|
|
1830
1837
|
name: "no-cors-wildcard-with-credentials",
|
|
1831
|
-
documentation:
|
|
1838
|
+
documentation: NO_CORS_WILDCARD_WITH_CREDENTIALS_DOCUMENTATION,
|
|
1832
1839
|
meta: {
|
|
1833
1840
|
type: "problem",
|
|
1834
1841
|
docs: {
|
|
@@ -1928,7 +1935,7 @@ var no_cors_wildcard_with_credentials_default = createRule({
|
|
|
1928
1935
|
|
|
1929
1936
|
// src/rules/no-duplicate-lifecycle-refresh-listeners.ts
|
|
1930
1937
|
var import_utils8 = require("@typescript-eslint/utils");
|
|
1931
|
-
var
|
|
1938
|
+
var NO_DUPLICATE_LIFECYCLE_REFRESH_LISTENERS_DOCUMENTATION = {
|
|
1932
1939
|
summary: "Do not register one Next.js route-refresh callback for both focus and visibilitychange.",
|
|
1933
1940
|
rationale: "A browser tab activation can emit both lifecycle signals and invoke the same route-wide refresh twice.",
|
|
1934
1941
|
remediation: "Choose one lifecycle signal or route both signals through an explicitly debounced refresh policy.",
|
|
@@ -1973,7 +1980,7 @@ function enclosingFunction(sourceCode, node) {
|
|
|
1973
1980
|
}
|
|
1974
1981
|
var no_duplicate_lifecycle_refresh_listeners_default = createRule({
|
|
1975
1982
|
name: "no-duplicate-lifecycle-refresh-listeners",
|
|
1976
|
-
documentation:
|
|
1983
|
+
documentation: NO_DUPLICATE_LIFECYCLE_REFRESH_LISTENERS_DOCUMENTATION,
|
|
1977
1984
|
meta: {
|
|
1978
1985
|
type: "suggestion",
|
|
1979
1986
|
docs: { description: "Do not register one Next.js route-refresh callback for both focus and visibilitychange." },
|
|
@@ -2053,7 +2060,7 @@ var no_duplicate_lifecycle_refresh_listeners_default = createRule({
|
|
|
2053
2060
|
// src/rules/no-dangerously-allow-svg.ts
|
|
2054
2061
|
var import_utils9 = require("@typescript-eslint/utils");
|
|
2055
2062
|
var NEXT_CONFIG_RE = /(?:^|\/)next\.config\.[cm]?[jt]s$/;
|
|
2056
|
-
var
|
|
2063
|
+
var NO_DANGEROUSLY_ALLOW_SVG_DOCUMENTATION = {
|
|
2057
2064
|
summary: "Next.js image configuration enables unsanitized SVG rendering",
|
|
2058
2065
|
rationale: "SVG files can contain scripts and other active content; enabling dangerouslyAllowSVG makes the image optimizer serve that content from the application origin.",
|
|
2059
2066
|
remediation: "Keep dangerouslyAllowSVG disabled. If SVG delivery is unavoidable, use a separately reviewed asset path with restrictive Content-Disposition and Content-Security-Policy headers.",
|
|
@@ -2089,10 +2096,10 @@ function propertyName(node) {
|
|
|
2089
2096
|
}
|
|
2090
2097
|
var no_dangerously_allow_svg_default = createRule({
|
|
2091
2098
|
name: "no-dangerously-allow-svg",
|
|
2092
|
-
documentation:
|
|
2099
|
+
documentation: NO_DANGEROUSLY_ALLOW_SVG_DOCUMENTATION,
|
|
2093
2100
|
meta: {
|
|
2094
2101
|
type: "problem",
|
|
2095
|
-
docs: { description:
|
|
2102
|
+
docs: { description: NO_DANGEROUSLY_ALLOW_SVG_DOCUMENTATION.summary },
|
|
2096
2103
|
schema: [],
|
|
2097
2104
|
messages: {
|
|
2098
2105
|
noDangerouslyAllowSvg: "Do not enable dangerouslyAllowSVG. SVG can carry active content served from the application origin."
|
|
@@ -2258,7 +2265,7 @@ function createSqlListener(handler) {
|
|
|
2258
2265
|
}
|
|
2259
2266
|
|
|
2260
2267
|
// src/rules/no-dynamic-sql.ts
|
|
2261
|
-
var
|
|
2268
|
+
var NO_DYNAMIC_SQL_DOCUMENTATION = {
|
|
2262
2269
|
summary: "Disallow runtime values embedded inside quoted SQL values passed to statement-execution methods.",
|
|
2263
2270
|
rationale: "Embedding runtime values in SQL bypasses driver parameterization and can introduce injection defects or unstable query plans.",
|
|
2264
2271
|
remediation: "Use SQL placeholders and pass runtime values through the driver's binding API.",
|
|
@@ -2376,11 +2383,11 @@ function statementMethodName(node, methods) {
|
|
|
2376
2383
|
}
|
|
2377
2384
|
var no_dynamic_sql_default = createRule({
|
|
2378
2385
|
name: "no-dynamic-sql",
|
|
2379
|
-
documentation:
|
|
2386
|
+
documentation: NO_DYNAMIC_SQL_DOCUMENTATION,
|
|
2380
2387
|
meta: {
|
|
2381
2388
|
type: "problem",
|
|
2382
2389
|
docs: {
|
|
2383
|
-
description:
|
|
2390
|
+
description: NO_DYNAMIC_SQL_DOCUMENTATION.summary
|
|
2384
2391
|
},
|
|
2385
2392
|
schema: [
|
|
2386
2393
|
{
|
|
@@ -2427,7 +2434,7 @@ var no_dynamic_sql_default = createRule({
|
|
|
2427
2434
|
|
|
2428
2435
|
// src/rules/no-enum.ts
|
|
2429
2436
|
var import_utils12 = require("@typescript-eslint/utils");
|
|
2430
|
-
var
|
|
2437
|
+
var NO_ENUM_DOCUMENTATION = {
|
|
2431
2438
|
summary: "Disallow TypeScript `enum`; use string-literal unions or `as const` objects instead.",
|
|
2432
2439
|
rationale: "TypeScript enums emit runtime objects and numeric enums accept values outside their declared members, adding behavior where a type-only model is sufficient.",
|
|
2433
2440
|
remediation: "Replace the enum with a string-literal union or an `as const` object and derive its value type from that object.",
|
|
@@ -2464,7 +2471,7 @@ function matchesAnyPattern(filename, patterns) {
|
|
|
2464
2471
|
}
|
|
2465
2472
|
var no_enum_default = createRule({
|
|
2466
2473
|
name: "no-enum",
|
|
2467
|
-
documentation:
|
|
2474
|
+
documentation: NO_ENUM_DOCUMENTATION,
|
|
2468
2475
|
meta: {
|
|
2469
2476
|
type: "suggestion",
|
|
2470
2477
|
docs: {
|
|
@@ -2510,7 +2517,7 @@ var no_enum_default = createRule({
|
|
|
2510
2517
|
|
|
2511
2518
|
// src/rules/no-fat-try-blocks.ts
|
|
2512
2519
|
var import_utils13 = require("@typescript-eslint/utils");
|
|
2513
|
-
var
|
|
2520
|
+
var NO_FAT_TRY_BLOCKS_DOCUMENTATION = {
|
|
2514
2521
|
summary: "Disallow `try` blocks containing more than three top-level operations that can throw.",
|
|
2515
2522
|
rationale: "A broad `try` block obscures which operation failed and encourages one catch clause to recover from unrelated errors.",
|
|
2516
2523
|
remediation: "Keep only the operations that share one recovery policy inside the `try` block and move other work outside it.",
|
|
@@ -2899,7 +2906,7 @@ var handlerReturnsSuccessShaped = (handler) => subtreeMatches(
|
|
|
2899
2906
|
);
|
|
2900
2907
|
var no_fat_try_blocks_default = createRule({
|
|
2901
2908
|
name: "no-fat-try-blocks",
|
|
2902
|
-
documentation:
|
|
2909
|
+
documentation: NO_FAT_TRY_BLOCKS_DOCUMENTATION,
|
|
2903
2910
|
meta: {
|
|
2904
2911
|
type: "problem",
|
|
2905
2912
|
docs: {
|
|
@@ -2956,7 +2963,7 @@ var no_fat_try_blocks_default = createRule({
|
|
|
2956
2963
|
|
|
2957
2964
|
// src/rules/no-hand-rolled-sleep.ts
|
|
2958
2965
|
var import_utils14 = require("@typescript-eslint/utils");
|
|
2959
|
-
var
|
|
2966
|
+
var NO_HAND_ROLLED_SLEEP_DOCUMENTATION = {
|
|
2960
2967
|
summary: "Disallow uncancellable promisified timers and timeout arms.",
|
|
2961
2968
|
rationale: "A timer that outlives an aborted operation or a lost promise race retains work and can keep the process alive until it fires.",
|
|
2962
2969
|
remediation: "Use `node:timers/promises` with an abort signal for delays, or pass `AbortSignal.timeout(...)` to the timed operation.",
|
|
@@ -3067,7 +3074,7 @@ function isRaceArm(node) {
|
|
|
3067
3074
|
}
|
|
3068
3075
|
var no_hand_rolled_sleep_default = createRule({
|
|
3069
3076
|
name: "no-hand-rolled-sleep",
|
|
3070
|
-
documentation:
|
|
3077
|
+
documentation: NO_HAND_ROLLED_SLEEP_DOCUMENTATION,
|
|
3071
3078
|
meta: {
|
|
3072
3079
|
type: "problem",
|
|
3073
3080
|
docs: {
|
|
@@ -3164,7 +3171,7 @@ var no_hand_rolled_sleep_default = createRule({
|
|
|
3164
3171
|
|
|
3165
3172
|
// src/rules/no-hand-rolled-spinner.ts
|
|
3166
3173
|
var import_utils15 = require("@typescript-eslint/utils");
|
|
3167
|
-
var
|
|
3174
|
+
var NO_HAND_ROLLED_SPINNER_DOCUMENTATION = {
|
|
3168
3175
|
summary: "Disallow intrinsic elements styled as Tailwind border-ring spinners outside the design-system implementation.",
|
|
3169
3176
|
rationale: "One-off loading indicators duplicate a shared primitive and let accessibility and styling diverge.",
|
|
3170
3177
|
remediation: "Render the design-system Spinner component instead.",
|
|
@@ -3210,7 +3217,7 @@ function staticClassName(attribute) {
|
|
|
3210
3217
|
}
|
|
3211
3218
|
var no_hand_rolled_spinner_default = createRule({
|
|
3212
3219
|
name: "no-hand-rolled-spinner",
|
|
3213
|
-
documentation:
|
|
3220
|
+
documentation: NO_HAND_ROLLED_SPINNER_DOCUMENTATION,
|
|
3214
3221
|
meta: {
|
|
3215
3222
|
type: "suggestion",
|
|
3216
3223
|
docs: {
|
|
@@ -3248,7 +3255,7 @@ var no_hand_rolled_spinner_default = createRule({
|
|
|
3248
3255
|
|
|
3249
3256
|
// src/rules/no-insecure-random-id.ts
|
|
3250
3257
|
var import_utils16 = require("@typescript-eslint/utils");
|
|
3251
|
-
var
|
|
3258
|
+
var NO_INSECURE_RANDOM_ID_DOCUMENTATION = {
|
|
3252
3259
|
summary: "Disallow using `Math.random()` to generate identifiers, tokens, or secrets; use `crypto.randomUUID()` or `crypto.getRandomValues(...)` instead.",
|
|
3253
3260
|
rationale: "Math.random is predictable and lacks the entropy required for security-sensitive values.",
|
|
3254
3261
|
remediation: "Generate the value with crypto.randomUUID or crypto.getRandomValues.",
|
|
@@ -3439,7 +3446,7 @@ function collectStaticStringParts(node, out) {
|
|
|
3439
3446
|
}
|
|
3440
3447
|
var no_insecure_random_id_default = createRule({
|
|
3441
3448
|
name: "no-insecure-random-id",
|
|
3442
|
-
documentation:
|
|
3449
|
+
documentation: NO_INSECURE_RANDOM_ID_DOCUMENTATION,
|
|
3443
3450
|
meta: {
|
|
3444
3451
|
type: "problem",
|
|
3445
3452
|
docs: {
|
|
@@ -3478,7 +3485,7 @@ var no_insecure_random_id_default = createRule({
|
|
|
3478
3485
|
|
|
3479
3486
|
// src/rules/no-json-stringify-error.ts
|
|
3480
3487
|
var import_utils17 = require("@typescript-eslint/utils");
|
|
3481
|
-
var
|
|
3488
|
+
var NO_JSON_STRINGIFY_ERROR_DOCUMENTATION = {
|
|
3482
3489
|
summary: "Disallow `JSON.stringify` on an Error value; it yields `{}` because `message`/`stack` are non-enumerable.",
|
|
3483
3490
|
rationale: "Native Error details are non-enumerable, so generic JSON serialization discards diagnostic information.",
|
|
3484
3491
|
remediation: "Serialize explicit error fields or use an error-aware serializer.",
|
|
@@ -3671,7 +3678,7 @@ function memberSuggestsError(member, scope) {
|
|
|
3671
3678
|
}
|
|
3672
3679
|
var no_json_stringify_error_default = createRule({
|
|
3673
3680
|
name: "no-json-stringify-error",
|
|
3674
|
-
documentation:
|
|
3681
|
+
documentation: NO_JSON_STRINGIFY_ERROR_DOCUMENTATION,
|
|
3675
3682
|
meta: {
|
|
3676
3683
|
type: "problem",
|
|
3677
3684
|
docs: {
|
|
@@ -3721,7 +3728,7 @@ function isZodModule(source) {
|
|
|
3721
3728
|
}
|
|
3722
3729
|
|
|
3723
3730
|
// src/rules/no-impossible-zod-literal-bounds.ts
|
|
3724
|
-
var
|
|
3731
|
+
var NO_IMPOSSIBLE_ZOD_LITERAL_BOUNDS_DOCUMENTATION = {
|
|
3725
3732
|
summary: "Disallow same-chain literal Zod bounds whose accepted set is mathematically empty.",
|
|
3726
3733
|
rationale: "A schema with contradictory literal bounds rejects every input, turning validation into an unreachable contract that usually reflects a typo.",
|
|
3727
3734
|
remediation: "Choose compatible lower and upper bounds, or remove the constraint that does not express the intended domain.",
|
|
@@ -3825,7 +3832,7 @@ function isOutermostCall(node) {
|
|
|
3825
3832
|
}
|
|
3826
3833
|
var no_impossible_zod_literal_bounds_default = createRule({
|
|
3827
3834
|
name: "no-impossible-zod-literal-bounds",
|
|
3828
|
-
documentation:
|
|
3835
|
+
documentation: NO_IMPOSSIBLE_ZOD_LITERAL_BOUNDS_DOCUMENTATION,
|
|
3829
3836
|
meta: {
|
|
3830
3837
|
type: "problem",
|
|
3831
3838
|
docs: {
|
|
@@ -4104,7 +4111,7 @@ function convertibleMemberName(member) {
|
|
|
4104
4111
|
}
|
|
4105
4112
|
|
|
4106
4113
|
// src/rules/interface-contract-members-private.ts
|
|
4107
|
-
var
|
|
4114
|
+
var INTERFACE_CONTRACT_MEMBERS_PRIVATE_DOCUMENTATION = {
|
|
4108
4115
|
summary: "Require methods outside an implemented interface contract to use ECMAScript private names.",
|
|
4109
4116
|
rationale: "An implementing class should expose exactly its declared interface while keeping implementation helpers runtime-private.",
|
|
4110
4117
|
remediation: "Add the method to the interface when it is public API, or make it `#private` and remove external or inherited access.",
|
|
@@ -4183,7 +4190,7 @@ function interfaceNames(services, owner) {
|
|
|
4183
4190
|
}
|
|
4184
4191
|
var interface_contract_members_private_default = createRule({
|
|
4185
4192
|
name: "interface-contract-members-private",
|
|
4186
|
-
documentation:
|
|
4193
|
+
documentation: INTERFACE_CONTRACT_MEMBERS_PRIVATE_DOCUMENTATION,
|
|
4187
4194
|
meta: {
|
|
4188
4195
|
type: "problem",
|
|
4189
4196
|
docs: { description: "Require methods outside an implemented interface contract to use ECMAScript private names." },
|
|
@@ -4315,7 +4322,7 @@ function createLogMatcher(options = {}) {
|
|
|
4315
4322
|
}
|
|
4316
4323
|
|
|
4317
4324
|
// src/rules/no-log-only-catch.ts
|
|
4318
|
-
var
|
|
4325
|
+
var NO_LOG_ONLY_CATCH_DOCUMENTATION = {
|
|
4319
4326
|
summary: "Disallow `catch` clauses that only log (or silently do nothing) and then swallow the error; rethrow or handle it instead.",
|
|
4320
4327
|
rationale: "Swallowing an exception after logging lets execution continue as if the operation succeeded.",
|
|
4321
4328
|
remediation: "Rethrow the error, return an explicit fallback, or perform concrete recovery.",
|
|
@@ -4413,7 +4420,7 @@ function isSeedValue(node) {
|
|
|
4413
4420
|
}
|
|
4414
4421
|
var no_log_only_catch_default = createRule({
|
|
4415
4422
|
name: "no-log-only-catch",
|
|
4416
|
-
documentation:
|
|
4423
|
+
documentation: NO_LOG_ONLY_CATCH_DOCUMENTATION,
|
|
4417
4424
|
meta: {
|
|
4418
4425
|
type: "problem",
|
|
4419
4426
|
docs: {
|
|
@@ -4488,7 +4495,7 @@ var no_log_only_catch_default = createRule({
|
|
|
4488
4495
|
|
|
4489
4496
|
// src/rules/no-bare-return-from-test-catch.ts
|
|
4490
4497
|
var import_utils23 = require("@typescript-eslint/utils");
|
|
4491
|
-
var
|
|
4498
|
+
var NO_BARE_RETURN_FROM_TEST_CATCH_DOCUMENTATION = {
|
|
4492
4499
|
summary: "Disallow a bare return from a test catch block when it skips a later assertion.",
|
|
4493
4500
|
rationale: "The caught failure turns into a passing test without executing the assertion that follows it.",
|
|
4494
4501
|
remediation: "Rethrow the error, assert on it, or use the runner's explicit skip mechanism when the capability is optional.",
|
|
@@ -4572,7 +4579,7 @@ function isExplicitSkip(node, context) {
|
|
|
4572
4579
|
}
|
|
4573
4580
|
var no_bare_return_from_test_catch_default = createRule({
|
|
4574
4581
|
name: "no-bare-return-from-test-catch",
|
|
4575
|
-
documentation:
|
|
4582
|
+
documentation: NO_BARE_RETURN_FROM_TEST_CATCH_DOCUMENTATION,
|
|
4576
4583
|
meta: {
|
|
4577
4584
|
type: "problem",
|
|
4578
4585
|
docs: { description: "Disallow a bare return from a test catch block when it skips a later assertion." },
|
|
@@ -4716,7 +4723,7 @@ function typedFunction(node) {
|
|
|
4716
4723
|
}
|
|
4717
4724
|
|
|
4718
4725
|
// src/rules/no-long-comment.ts
|
|
4719
|
-
var
|
|
4726
|
+
var NO_LONG_COMMENT_DOCUMENTATION = {
|
|
4720
4727
|
summary: "Flag unusually large unstructured JSDoc blocks in implementation code.",
|
|
4721
4728
|
rationale: "Large narrative comments become stale and obscure the local facts that belong beside the code.",
|
|
4722
4729
|
remediation: "Keep only durable local constraints and express the remaining behavior in code.",
|
|
@@ -4789,7 +4796,7 @@ function wordUnits(text) {
|
|
|
4789
4796
|
}
|
|
4790
4797
|
var no_long_comment_default = createRule({
|
|
4791
4798
|
name: "no-long-comment",
|
|
4792
|
-
documentation:
|
|
4799
|
+
documentation: NO_LONG_COMMENT_DOCUMENTATION,
|
|
4793
4800
|
meta: {
|
|
4794
4801
|
type: "suggestion",
|
|
4795
4802
|
docs: { description: "Flag unusually large unstructured JSDoc blocks in implementation code." },
|
|
@@ -4816,7 +4823,7 @@ var no_long_comment_default = createRule({
|
|
|
4816
4823
|
// src/rules/no-vague-suppression-description.ts
|
|
4817
4824
|
var DIRECTIVE_WITH_DESCRIPTION_RE = /^(?:eslint-(?:disable|disable-next-line|disable-line)\b[^:\n]*?|@ts-expect-error\b)\s*(?::|--)\s*(.+?)\s*$/iu;
|
|
4818
4825
|
var VAGUE_RE = /^(?:needed|required|intentional(?:ly)?|ignore(?:d)?|false positive|type error|typescript|to satisfy (?:the )?(?:linter|typescript|type checker))\.?$/iu;
|
|
4819
|
-
var
|
|
4826
|
+
var NO_VAGUE_SUPPRESSION_DESCRIPTION_DOCUMENTATION = {
|
|
4820
4827
|
summary: "Require suppression descriptions to name the concrete mismatch or invariant instead of a generic non-reason.",
|
|
4821
4828
|
rationale: "Generic phrases satisfy require-description mechanically while leaving reviewers unable to audit the risk or remove stale debt.",
|
|
4822
4829
|
remediation: "Name the exact type/runtime mismatch, external contract, or safety invariant that makes this suppression acceptable.",
|
|
@@ -4859,7 +4866,7 @@ var noVagueSuppressionDescriptionDocumentation = {
|
|
|
4859
4866
|
};
|
|
4860
4867
|
var no_vague_suppression_description_default = createRule({
|
|
4861
4868
|
name: "no-vague-suppression-description",
|
|
4862
|
-
documentation:
|
|
4869
|
+
documentation: NO_VAGUE_SUPPRESSION_DESCRIPTION_DOCUMENTATION,
|
|
4863
4870
|
meta: {
|
|
4864
4871
|
type: "suggestion",
|
|
4865
4872
|
docs: {
|
|
@@ -4894,7 +4901,7 @@ var no_vague_suppression_description_default = createRule({
|
|
|
4894
4901
|
|
|
4895
4902
|
// src/rules/no-generic-single-export-module.ts
|
|
4896
4903
|
var import_utils26 = require("@typescript-eslint/utils");
|
|
4897
|
-
var
|
|
4904
|
+
var NO_GENERIC_SINGLE_EXPORT_MODULE_DOCUMENTATION = {
|
|
4898
4905
|
summary: "Disallow generic module stems when one runtime export already names the responsibility.",
|
|
4899
4906
|
rationale: "A generic filename hides the sole exported responsibility and makes navigation less descriptive.",
|
|
4900
4907
|
remediation: "Choose a responsibility-bearing module name or colocate the export with its domain.",
|
|
@@ -5032,7 +5039,7 @@ function memberPropertyName(node) {
|
|
|
5032
5039
|
}
|
|
5033
5040
|
var no_generic_single_export_module_default = createRule({
|
|
5034
5041
|
name: "no-generic-single-export-module",
|
|
5035
|
-
documentation:
|
|
5042
|
+
documentation: NO_GENERIC_SINGLE_EXPORT_MODULE_DOCUMENTATION,
|
|
5036
5043
|
meta: {
|
|
5037
5044
|
type: "suggestion",
|
|
5038
5045
|
docs: { description: "Disallow generic module stems when one runtime export already names the responsibility." },
|
|
@@ -5079,7 +5086,7 @@ var no_generic_single_export_module_default = createRule({
|
|
|
5079
5086
|
|
|
5080
5087
|
// src/rules/no-offset-pagination.ts
|
|
5081
5088
|
var import_utils27 = require("@typescript-eslint/utils");
|
|
5082
|
-
var
|
|
5089
|
+
var NO_OFFSET_PAGINATION_DOCUMENTATION = {
|
|
5083
5090
|
summary: "Disallow OFFSET pagination in embedded SQL; it is O(N) per page and drops or repeats rows under concurrent writes. Use a keyset cursor.",
|
|
5084
5091
|
rationale: "Offset pagination scans skipped rows and shifts page boundaries under concurrent writes.",
|
|
5085
5092
|
remediation: "Page with a stable ordered key and a cursor predicate.",
|
|
@@ -5094,7 +5101,7 @@ var OFFSET_PAGINATION = /\bOFFSET\s+(?:%s|%\(\w+\)s|\?\d*|:\w+|@\w+|\$\d+|\d+)/i
|
|
|
5094
5101
|
var OFFSET_GATE = /offset/i;
|
|
5095
5102
|
var no_offset_pagination_default = createRule({
|
|
5096
5103
|
name: "no-offset-pagination",
|
|
5097
|
-
documentation:
|
|
5104
|
+
documentation: NO_OFFSET_PAGINATION_DOCUMENTATION,
|
|
5098
5105
|
meta: {
|
|
5099
5106
|
type: "problem",
|
|
5100
5107
|
docs: {
|
|
@@ -5121,7 +5128,7 @@ var no_offset_pagination_default = createRule({
|
|
|
5121
5128
|
|
|
5122
5129
|
// src/rules/no-positional-tuple-return.ts
|
|
5123
5130
|
var import_utils28 = require("@typescript-eslint/utils");
|
|
5124
|
-
var
|
|
5131
|
+
var NO_POSITIONAL_TUPLE_RETURN_DOCUMENTATION = {
|
|
5125
5132
|
summary: "Disallow returning a multi-field tuple from a named function; return a named object so call sites cannot mismatch slots.",
|
|
5126
5133
|
rationale: "Tuple fields are identified only by position, so reordering can preserve types while changing meaning.",
|
|
5127
5134
|
remediation: "Return an object whose property names describe each value.",
|
|
@@ -5365,7 +5372,7 @@ function isExportedInterface(node, exports2) {
|
|
|
5365
5372
|
}
|
|
5366
5373
|
var no_positional_tuple_return_default = createRule({
|
|
5367
5374
|
name: "no-positional-tuple-return",
|
|
5368
|
-
documentation:
|
|
5375
|
+
documentation: NO_POSITIONAL_TUPLE_RETURN_DOCUMENTATION,
|
|
5369
5376
|
meta: {
|
|
5370
5377
|
type: "suggestion",
|
|
5371
5378
|
docs: {
|
|
@@ -5494,7 +5501,7 @@ var no_positional_tuple_return_default = createRule({
|
|
|
5494
5501
|
// src/rules/no-production-browser-source-maps.ts
|
|
5495
5502
|
var import_utils29 = require("@typescript-eslint/utils");
|
|
5496
5503
|
var NEXT_CONFIG_RE2 = /(?:^|\/)next\.config\.[cm]?[jt]s$/;
|
|
5497
|
-
var
|
|
5504
|
+
var NO_PRODUCTION_BROWSER_SOURCE_MAPS_DOCUMENTATION = {
|
|
5498
5505
|
summary: "Next.js production browser source maps expose application source",
|
|
5499
5506
|
rationale: "Next.js production browser source maps publish original client source and implementation details to every browser that can load the deployment.",
|
|
5500
5507
|
remediation: "Leave productionBrowserSourceMaps disabled and upload private source maps directly to the error-monitoring service during the build.",
|
|
@@ -5530,10 +5537,10 @@ function propertyName2(node) {
|
|
|
5530
5537
|
}
|
|
5531
5538
|
var no_production_browser_source_maps_default = createRule({
|
|
5532
5539
|
name: "no-production-browser-source-maps",
|
|
5533
|
-
documentation:
|
|
5540
|
+
documentation: NO_PRODUCTION_BROWSER_SOURCE_MAPS_DOCUMENTATION,
|
|
5534
5541
|
meta: {
|
|
5535
5542
|
type: "problem",
|
|
5536
|
-
docs: { description:
|
|
5543
|
+
docs: { description: NO_PRODUCTION_BROWSER_SOURCE_MAPS_DOCUMENTATION.summary },
|
|
5537
5544
|
schema: [],
|
|
5538
5545
|
messages: {
|
|
5539
5546
|
noProductionBrowserSourceMaps: "Do not publish production browser source maps. Upload private maps to your monitoring service instead."
|
|
@@ -5554,7 +5561,7 @@ var no_production_browser_source_maps_default = createRule({
|
|
|
5554
5561
|
|
|
5555
5562
|
// src/rules/no-raw-env.ts
|
|
5556
5563
|
var import_utils30 = require("@typescript-eslint/utils");
|
|
5557
|
-
var
|
|
5564
|
+
var NO_RAW_ENV_DOCUMENTATION = {
|
|
5558
5565
|
summary: "Disallow direct `process.env` and `import.meta.env` reads outside validated boundaries.",
|
|
5559
5566
|
rationale: "Raw environment reads are untyped and defer invalid configuration failures until use.",
|
|
5560
5567
|
remediation: "Validate environment values at startup and import the typed configuration object.",
|
|
@@ -5611,7 +5618,7 @@ function isWholeEnvSpread(node) {
|
|
|
5611
5618
|
}
|
|
5612
5619
|
var no_raw_env_default = createRule({
|
|
5613
5620
|
name: "no-raw-env",
|
|
5614
|
-
documentation:
|
|
5621
|
+
documentation: NO_RAW_ENV_DOCUMENTATION,
|
|
5615
5622
|
meta: {
|
|
5616
5623
|
type: "problem",
|
|
5617
5624
|
docs: {
|
|
@@ -5643,7 +5650,7 @@ var no_raw_env_default = createRule({
|
|
|
5643
5650
|
|
|
5644
5651
|
// src/rules/no-raw-fetch-outside-clients.ts
|
|
5645
5652
|
var import_utils31 = require("@typescript-eslint/utils");
|
|
5646
|
-
var
|
|
5653
|
+
var NO_RAW_FETCH_OUTSIDE_CLIENTS_DOCUMENTATION = {
|
|
5647
5654
|
summary: "Disallow calling the global `fetch` outside the client layer; route outbound HTTP through a client module that owns retry, timeout and status handling.",
|
|
5648
5655
|
rationale: "Scattered fetch calls bypass shared transport policy and are harder to stub and observe consistently.",
|
|
5649
5656
|
remediation: "Move the request into a client module and call that abstraction from application code.",
|
|
@@ -5775,7 +5782,7 @@ function compile(patterns) {
|
|
|
5775
5782
|
}
|
|
5776
5783
|
var no_raw_fetch_outside_clients_default = createRule({
|
|
5777
5784
|
name: "no-raw-fetch-outside-clients",
|
|
5778
|
-
documentation:
|
|
5785
|
+
documentation: NO_RAW_FETCH_OUTSIDE_CLIENTS_DOCUMENTATION,
|
|
5779
5786
|
meta: {
|
|
5780
5787
|
type: "problem",
|
|
5781
5788
|
docs: {
|
|
@@ -5905,7 +5912,7 @@ var no_raw_fetch_outside_clients_default = createRule({
|
|
|
5905
5912
|
|
|
5906
5913
|
// src/rules/no-restricted-library-load.ts
|
|
5907
5914
|
var import_utils32 = require("@typescript-eslint/utils");
|
|
5908
|
-
var
|
|
5915
|
+
var NO_RESTRICTED_LIBRARY_LOAD_DOCUMENTATION = {
|
|
5909
5916
|
summary: "Apply a configured library-replacement policy to literal dynamic imports, CommonJS loads, and TypeScript import-equals declarations.",
|
|
5910
5917
|
rationale: "Runtime module loads can bypass the replacement policy enforced for static imports.",
|
|
5911
5918
|
remediation: "Load the configured replacement library instead of the restricted module.",
|
|
@@ -5924,7 +5931,7 @@ function matchesModule(source, module2) {
|
|
|
5924
5931
|
}
|
|
5925
5932
|
var no_restricted_library_load_default = createRule({
|
|
5926
5933
|
name: "no-restricted-library-load",
|
|
5927
|
-
documentation:
|
|
5934
|
+
documentation: NO_RESTRICTED_LIBRARY_LOAD_DOCUMENTATION,
|
|
5928
5935
|
meta: {
|
|
5929
5936
|
type: "problem",
|
|
5930
5937
|
docs: {
|
|
@@ -6010,7 +6017,7 @@ var no_restricted_library_load_default = createRule({
|
|
|
6010
6017
|
|
|
6011
6018
|
// src/rules/no-router-refresh-polling.ts
|
|
6012
6019
|
var import_utils33 = require("@typescript-eslint/utils");
|
|
6013
|
-
var
|
|
6020
|
+
var NO_ROUTER_REFRESH_POLLING_DOCUMENTATION = {
|
|
6014
6021
|
summary: "Do not poll by calling a Next.js router's refresh method from a timer.",
|
|
6015
6022
|
rationale: "A route refresh refetches and rerenders the whole route on every tick instead of loading the named resource that changed.",
|
|
6016
6023
|
remediation: "Call the dedicated fetch or server action from the timer and keep the polling interval in a named constant.",
|
|
@@ -6043,7 +6050,7 @@ function isUnshadowedGlobal2(sourceCode, node) {
|
|
|
6043
6050
|
}
|
|
6044
6051
|
var no_router_refresh_polling_default = createRule({
|
|
6045
6052
|
name: "no-router-refresh-polling",
|
|
6046
|
-
documentation:
|
|
6053
|
+
documentation: NO_ROUTER_REFRESH_POLLING_DOCUMENTATION,
|
|
6047
6054
|
meta: {
|
|
6048
6055
|
type: "suggestion",
|
|
6049
6056
|
docs: { description: "Do not poll by calling a Next.js router's refresh method from a timer." },
|
|
@@ -6103,7 +6110,7 @@ var FUNCTION_TYPES4 = /* @__PURE__ */ new Set([
|
|
|
6103
6110
|
import_utils34.AST_NODE_TYPES.FunctionExpression,
|
|
6104
6111
|
import_utils34.AST_NODE_TYPES.ArrowFunctionExpression
|
|
6105
6112
|
]);
|
|
6106
|
-
var
|
|
6113
|
+
var NO_REPEATED_STRING_LITERAL_DOCUMENTATION = {
|
|
6107
6114
|
summary: "Disallow a long structured string literal repeated across functions; the copies drift when one is edited. Extract a module-level constant.",
|
|
6108
6115
|
rationale: "Independent copies of a query, route template, or identifier can diverge and silently change behavior.",
|
|
6109
6116
|
remediation: "Extract the repeated value to one module-level constant and reference it from each function.",
|
|
@@ -6140,7 +6147,7 @@ function isScaffolding(node) {
|
|
|
6140
6147
|
}
|
|
6141
6148
|
var no_repeated_string_literal_default = createRule({
|
|
6142
6149
|
name: "no-repeated-string-literal",
|
|
6143
|
-
documentation:
|
|
6150
|
+
documentation: NO_REPEATED_STRING_LITERAL_DOCUMENTATION,
|
|
6144
6151
|
meta: {
|
|
6145
6152
|
type: "suggestion",
|
|
6146
6153
|
docs: {
|
|
@@ -6258,7 +6265,7 @@ var NON_ASCII_LETTER_RE = /[^\p{ASCII}\p{N}\p{P}\p{Z}]/u;
|
|
|
6258
6265
|
var WALL_NARRATION_RE2 = /^(?:(?:\d+[.)]|(?:phase|step)\s+\d+\s*:?)\s*)?(?:add|build|call|check|compute|copy|count|create|fetch|filter|find|get|handle|load|map|merge|parse|process|read|remove|return|save|send|set|sort|store|update|validate|write)(?:s|es|d|ed|ing)?\b/i;
|
|
6259
6266
|
var WALL_CLUSTER_MAX_LINE_GAP = 8;
|
|
6260
6267
|
var WALL_CLUSTER_MIN_COMMENTS = 3;
|
|
6261
|
-
var
|
|
6268
|
+
var NO_RESTATED_COMMENT_DOCUMENTATION = {
|
|
6262
6269
|
summary: "Flag a single-line comment whose every word already appears on the statement below it.",
|
|
6263
6270
|
rationale: "A comment that only repeats code adds no context and can become stale independently.",
|
|
6264
6271
|
remediation: "Delete the comment or replace it with the reason, constraint, or consequence absent from the code.",
|
|
@@ -6284,7 +6291,7 @@ function headsSiblingRun(node) {
|
|
|
6284
6291
|
}
|
|
6285
6292
|
var no_restated_comment_default = createRule({
|
|
6286
6293
|
name: "no-restated-comment",
|
|
6287
|
-
documentation:
|
|
6294
|
+
documentation: NO_RESTATED_COMMENT_DOCUMENTATION,
|
|
6288
6295
|
meta: {
|
|
6289
6296
|
type: "suggestion",
|
|
6290
6297
|
hasSuggestions: true,
|
|
@@ -6382,7 +6389,7 @@ var no_restated_comment_default = createRule({
|
|
|
6382
6389
|
|
|
6383
6390
|
// src/rules/no-restated-jsdoc.ts
|
|
6384
6391
|
var import_utils37 = require("@typescript-eslint/utils");
|
|
6385
|
-
var
|
|
6392
|
+
var NO_RESTATED_JSDOC_DOCUMENTATION = {
|
|
6386
6393
|
summary: "Flag a JSDoc block whose description and tags only re-spell the signature they document.",
|
|
6387
6394
|
rationale: "Signature-only JSDoc duplicates type information and drifts without helping callers.",
|
|
6388
6395
|
remediation: "Delete the block or document behavior, constraints, failures, or context the signature cannot express.",
|
|
@@ -6494,7 +6501,7 @@ function tokensOf(names) {
|
|
|
6494
6501
|
}
|
|
6495
6502
|
var no_restated_jsdoc_default = createRule({
|
|
6496
6503
|
name: "no-restated-jsdoc",
|
|
6497
|
-
documentation:
|
|
6504
|
+
documentation: NO_RESTATED_JSDOC_DOCUMENTATION,
|
|
6498
6505
|
meta: {
|
|
6499
6506
|
type: "suggestion",
|
|
6500
6507
|
hasSuggestions: true,
|
|
@@ -6737,7 +6744,7 @@ function isAuthSecretName(identifier) {
|
|
|
6737
6744
|
}
|
|
6738
6745
|
|
|
6739
6746
|
// src/rules/no-secret-in-log.ts
|
|
6740
|
-
var
|
|
6747
|
+
var NO_SECRET_IN_LOG_DOCUMENTATION = {
|
|
6741
6748
|
summary: "Disallow passing a secret-named value or a raw request/response blob to a logging call; both leak to log sinks. Redact or omit.",
|
|
6742
6749
|
rationale: "Logs are widely retained and distributed, so credentials and raw bodies can become durable data leaks.",
|
|
6743
6750
|
remediation: "Omit the value or log an explicitly redacted, truncated, or derived non-sensitive field.",
|
|
@@ -6872,7 +6879,7 @@ function propertyKeyName2(prop) {
|
|
|
6872
6879
|
}
|
|
6873
6880
|
var no_secret_in_log_default = createRule({
|
|
6874
6881
|
name: "no-secret-in-log",
|
|
6875
|
-
documentation:
|
|
6882
|
+
documentation: NO_SECRET_IN_LOG_DOCUMENTATION,
|
|
6876
6883
|
meta: {
|
|
6877
6884
|
type: "problem",
|
|
6878
6885
|
docs: {
|
|
@@ -6948,7 +6955,7 @@ var no_secret_in_log_default = createRule({
|
|
|
6948
6955
|
// src/rules/no-server-env-in-client-component.ts
|
|
6949
6956
|
var import_utils39 = require("@typescript-eslint/utils");
|
|
6950
6957
|
var SERVER_ENV_MODULE_RE = /(?:^|\/)(?:server-env|server-settings)(?:\.[cm]?[jt]sx?)?$/;
|
|
6951
|
-
var
|
|
6958
|
+
var NO_SERVER_ENV_IN_CLIENT_COMPONENT_DOCUMENTATION = {
|
|
6952
6959
|
summary: "server-only environment settings imported by a client component",
|
|
6953
6960
|
rationale: "Next.js client modules run in the browser, where server-only environment values are unavailable; importing a server settings module can produce undefined configuration or bundle a secret-bearing module into the client graph.",
|
|
6954
6961
|
remediation: "Pass an explicitly public value from a Server Component, or import it from a separately validated client-settings module backed only by NEXT_PUBLIC_* values.",
|
|
@@ -6999,10 +7006,10 @@ function isTypeOnlyImport(node) {
|
|
|
6999
7006
|
}
|
|
7000
7007
|
var no_server_env_in_client_component_default = createRule({
|
|
7001
7008
|
name: "no-server-env-in-client-component",
|
|
7002
|
-
documentation:
|
|
7009
|
+
documentation: NO_SERVER_ENV_IN_CLIENT_COMPONENT_DOCUMENTATION,
|
|
7003
7010
|
meta: {
|
|
7004
7011
|
type: "problem",
|
|
7005
|
-
docs: { description:
|
|
7012
|
+
docs: { description: NO_SERVER_ENV_IN_CLIENT_COMPONENT_DOCUMENTATION.summary },
|
|
7006
7013
|
schema: [],
|
|
7007
7014
|
messages: {
|
|
7008
7015
|
noServerEnvInClientComponent: "A 'use client' module cannot import server-only settings. Pass public data from a Server Component or use a validated client-settings module."
|
|
@@ -7026,7 +7033,7 @@ var no_server_env_in_client_component_default = createRule({
|
|
|
7026
7033
|
|
|
7027
7034
|
// src/rules/no-select-star.ts
|
|
7028
7035
|
var import_utils40 = require("@typescript-eslint/utils");
|
|
7029
|
-
var
|
|
7036
|
+
var NO_SELECT_STAR_DOCUMENTATION = {
|
|
7030
7037
|
summary: "Disallow SELECT * in embedded SQL; it over-fetches and leaves the row contract implicit, so a schema change breaks row parsing silently.",
|
|
7031
7038
|
rationale: "Wildcard projections couple row shape and query cost to unrelated schema changes.",
|
|
7032
7039
|
remediation: "List every required column explicitly in the projection.",
|
|
@@ -7078,7 +7085,7 @@ function isProjectionStar(sql, pos) {
|
|
|
7078
7085
|
}
|
|
7079
7086
|
var no_select_star_default = createRule({
|
|
7080
7087
|
name: "no-select-star",
|
|
7081
|
-
documentation:
|
|
7088
|
+
documentation: NO_SELECT_STAR_DOCUMENTATION,
|
|
7082
7089
|
meta: {
|
|
7083
7090
|
type: "problem",
|
|
7084
7091
|
docs: {
|
|
@@ -7105,7 +7112,7 @@ var no_select_star_default = createRule({
|
|
|
7105
7112
|
|
|
7106
7113
|
// src/rules/no-sentinel-return-on-catch.ts
|
|
7107
7114
|
var import_utils41 = require("@typescript-eslint/utils");
|
|
7108
|
-
var
|
|
7115
|
+
var NO_SENTINEL_RETURN_ON_CATCH_DOCUMENTATION = {
|
|
7109
7116
|
summary: "Disallow swallowing a caught error by returning an empty sentinel unless the error is handled or the sentinel is part of the function contract.",
|
|
7110
7117
|
rationale: "An unreported fallback makes operational failure indistinguishable from a legitimate empty result.",
|
|
7111
7118
|
remediation: "Rethrow, report the error before returning, or model expected absence with an explicit predicate, safe-parse, or result contract.",
|
|
@@ -7477,7 +7484,7 @@ function isWithin(node, ancestor) {
|
|
|
7477
7484
|
}
|
|
7478
7485
|
var no_sentinel_return_on_catch_default = createRule({
|
|
7479
7486
|
name: "no-sentinel-return-on-catch",
|
|
7480
|
-
documentation:
|
|
7487
|
+
documentation: NO_SENTINEL_RETURN_ON_CATCH_DOCUMENTATION,
|
|
7481
7488
|
meta: {
|
|
7482
7489
|
type: "problem",
|
|
7483
7490
|
docs: {
|
|
@@ -7559,7 +7566,7 @@ var no_sentinel_return_on_catch_default = createRule({
|
|
|
7559
7566
|
|
|
7560
7567
|
// src/rules/no-silent-promise-catch.ts
|
|
7561
7568
|
var import_utils42 = require("@typescript-eslint/utils");
|
|
7562
|
-
var
|
|
7569
|
+
var NO_SILENT_PROMISE_CATCH_DOCUMENTATION = {
|
|
7563
7570
|
summary: "Disallow `.catch()` and second-argument `.then()` handlers that silently swallow a rejection; log, rethrow, or handle the error.",
|
|
7564
7571
|
rationale: "A swallowed rejection hides failures and gives callers an indistinguishable fallback value.",
|
|
7565
7572
|
remediation: "Log, rethrow, or explicitly recover from the rejection; explain intentional teardown suppression.",
|
|
@@ -7635,7 +7642,7 @@ function isSilentExpression(node) {
|
|
|
7635
7642
|
}
|
|
7636
7643
|
var no_silent_promise_catch_default = createRule({
|
|
7637
7644
|
name: "no-silent-promise-catch",
|
|
7638
|
-
documentation:
|
|
7645
|
+
documentation: NO_SILENT_PROMISE_CATCH_DOCUMENTATION,
|
|
7639
7646
|
meta: {
|
|
7640
7647
|
type: "problem",
|
|
7641
7648
|
docs: {
|
|
@@ -7708,7 +7715,7 @@ var no_silent_promise_catch_default = createRule({
|
|
|
7708
7715
|
|
|
7709
7716
|
// src/rules/no-sleep-in-test-body.ts
|
|
7710
7717
|
var import_utils43 = require("@typescript-eslint/utils");
|
|
7711
|
-
var
|
|
7718
|
+
var NO_SLEEP_IN_TEST_BODY_DOCUMENTATION = {
|
|
7712
7719
|
summary: "Disallow a fixed timed sleep directly in a test body; it flakes under CI load. Synchronize on the signal or use fake timers.",
|
|
7713
7720
|
rationale: "Wall-clock delays make test correctness depend on scheduler and machine speed.",
|
|
7714
7721
|
remediation: "Await the observable signal or advance deterministic fake timers.",
|
|
@@ -7802,7 +7809,7 @@ function testCallerName(callee) {
|
|
|
7802
7809
|
}
|
|
7803
7810
|
var no_sleep_in_test_body_default = createRule({
|
|
7804
7811
|
name: "no-sleep-in-test-body",
|
|
7805
|
-
documentation:
|
|
7812
|
+
documentation: NO_SLEEP_IN_TEST_BODY_DOCUMENTATION,
|
|
7806
7813
|
meta: {
|
|
7807
7814
|
type: "problem",
|
|
7808
7815
|
docs: {
|
|
@@ -7851,7 +7858,7 @@ var DEFAULT_METHODS2 = [
|
|
|
7851
7858
|
"getWithMetadata"
|
|
7852
7859
|
];
|
|
7853
7860
|
var MIN_ARGUMENTS = /* @__PURE__ */ new Map([["put", 2]]);
|
|
7854
|
-
var
|
|
7861
|
+
var NO_STORAGE_IN_STATELESS_MODULES_DOCUMENTATION = {
|
|
7855
7862
|
summary: "Disallow SQL or key/value access inside configured stateless modules; derive state from a system of record instead.",
|
|
7856
7863
|
rationale: "Private storage in a stateless workflow creates another source of truth that can silently diverge.",
|
|
7857
7864
|
remediation: "Read from the system of record or derive state from an artifact the workflow already produces.",
|
|
@@ -7914,7 +7921,7 @@ function identifierWords(name) {
|
|
|
7914
7921
|
}
|
|
7915
7922
|
var no_storage_in_stateless_modules_default = createRule({
|
|
7916
7923
|
name: "no-storage-in-stateless-modules",
|
|
7917
|
-
documentation:
|
|
7924
|
+
documentation: NO_STORAGE_IN_STATELESS_MODULES_DOCUMENTATION,
|
|
7918
7925
|
meta: {
|
|
7919
7926
|
type: "problem",
|
|
7920
7927
|
docs: {
|
|
@@ -7973,7 +7980,7 @@ var no_storage_in_stateless_modules_default = createRule({
|
|
|
7973
7980
|
|
|
7974
7981
|
// src/rules/no-string-concat-in-loop.ts
|
|
7975
7982
|
var import_utils45 = require("@typescript-eslint/utils");
|
|
7976
|
-
var
|
|
7983
|
+
var NO_STRING_CONCAT_IN_LOOP_DOCUMENTATION = {
|
|
7977
7984
|
summary: "Disallow O(n^2) string building via `+=` on a string variable inside a loop; push parts to an array and `join` instead.",
|
|
7978
7985
|
rationale: "Repeatedly rebuilding a growing string can copy all prior content on each iteration, making total work grow quadratically.",
|
|
7979
7986
|
remediation: "Collect each fragment in an array, then join the fragments after the loop.",
|
|
@@ -8142,7 +8149,7 @@ function isStringSeededReduce(node) {
|
|
|
8142
8149
|
}
|
|
8143
8150
|
var no_string_concat_in_loop_default = createRule({
|
|
8144
8151
|
name: "no-string-concat-in-loop",
|
|
8145
|
-
documentation:
|
|
8152
|
+
documentation: NO_STRING_CONCAT_IN_LOOP_DOCUMENTATION,
|
|
8146
8153
|
meta: {
|
|
8147
8154
|
type: "suggestion",
|
|
8148
8155
|
docs: {
|
|
@@ -8212,7 +8219,7 @@ var no_string_concat_in_loop_default = createRule({
|
|
|
8212
8219
|
|
|
8213
8220
|
// src/rules/no-tautological-expect.ts
|
|
8214
8221
|
var import_utils46 = require("@typescript-eslint/utils");
|
|
8215
|
-
var
|
|
8222
|
+
var NO_TAUTOLOGICAL_EXPECT_DOCUMENTATION = {
|
|
8216
8223
|
summary: "Disallow an assertion whose operands are all literals; its outcome is fixed before the code runs, so it can never fail.",
|
|
8217
8224
|
rationale: "An assertion determined entirely by literals does not observe the code under test and can keep passing after that code is removed.",
|
|
8218
8225
|
remediation: "Assert on a value produced by the behavior under test, or remove the assertion.",
|
|
@@ -8282,7 +8289,7 @@ function expectOperand(callee) {
|
|
|
8282
8289
|
}
|
|
8283
8290
|
var no_tautological_expect_default = createRule({
|
|
8284
8291
|
name: "no-tautological-expect",
|
|
8285
|
-
documentation:
|
|
8292
|
+
documentation: NO_TAUTOLOGICAL_EXPECT_DOCUMENTATION,
|
|
8286
8293
|
meta: {
|
|
8287
8294
|
type: "problem",
|
|
8288
8295
|
docs: {
|
|
@@ -8420,7 +8427,7 @@ function canonicalWord(word) {
|
|
|
8420
8427
|
if (word.endsWith("s") && word.length > 3) return word.slice(0, -1);
|
|
8421
8428
|
return word;
|
|
8422
8429
|
}
|
|
8423
|
-
var
|
|
8430
|
+
var NO_TYPED_DOC_SECTIONS_DOCUMENTATION = {
|
|
8424
8431
|
summary: "Reject typed-signature repetition while preserving behavior that types cannot express.",
|
|
8425
8432
|
rationale: "Parameter and return tags repeat typed signatures and can drift without adding runtime behavior or constraints.",
|
|
8426
8433
|
remediation: "Remove repeated parameter and return tags; retain documentation for behavior, failures, and external contracts.",
|
|
@@ -8449,7 +8456,7 @@ var noTypedDocSectionsDocumentation = {
|
|
|
8449
8456
|
};
|
|
8450
8457
|
var no_typed_doc_sections_default = createRule({
|
|
8451
8458
|
name: "no-typed-doc-sections",
|
|
8452
|
-
documentation:
|
|
8459
|
+
documentation: NO_TYPED_DOC_SECTIONS_DOCUMENTATION,
|
|
8453
8460
|
meta: {
|
|
8454
8461
|
type: "suggestion",
|
|
8455
8462
|
docs: { description: "Reject typed-signature repetition while preserving behavior that types cannot express." },
|
|
@@ -8474,7 +8481,7 @@ var no_typed_doc_sections_default = createRule({
|
|
|
8474
8481
|
|
|
8475
8482
|
// src/rules/no-trailing-value-narration.ts
|
|
8476
8483
|
var import_utils47 = require("@typescript-eslint/utils");
|
|
8477
|
-
var
|
|
8484
|
+
var NO_TRAILING_VALUE_NARRATION_DOCUMENTATION = {
|
|
8478
8485
|
summary: "Flag a trailing comment that repeats the line's numeric value only to name its unit.",
|
|
8479
8486
|
rationale: "A repeated value can disagree with the expression after either the code or comment changes.",
|
|
8480
8487
|
remediation: "Put the unit in the identifier and keep comments only when they explain a constraint or non-obvious conversion.",
|
|
@@ -8593,7 +8600,7 @@ function nameAlreadyCarriesUnit(code) {
|
|
|
8593
8600
|
}
|
|
8594
8601
|
var no_trailing_value_narration_default = createRule({
|
|
8595
8602
|
name: "no-trailing-value-narration",
|
|
8596
|
-
documentation:
|
|
8603
|
+
documentation: NO_TRAILING_VALUE_NARRATION_DOCUMENTATION,
|
|
8597
8604
|
meta: {
|
|
8598
8605
|
type: "suggestion",
|
|
8599
8606
|
hasSuggestions: true,
|
|
@@ -8787,7 +8794,7 @@ function bodyOf(member) {
|
|
|
8787
8794
|
}
|
|
8788
8795
|
|
|
8789
8796
|
// src/rules/no-declaration-comment-wall.ts
|
|
8790
|
-
var
|
|
8797
|
+
var NO_DECLARATION_COMMENT_WALL_DOCUMENTATION = {
|
|
8791
8798
|
summary: "Flag an enum body or class body whose member comments mostly re-spell the members' own names.",
|
|
8792
8799
|
rationale: "A dense block of repetitive member comments obscures the few comments that add information and drifts with renamed members.",
|
|
8793
8800
|
remediation: "Delete comments that restate member names and retain comments that explain constraints, lifecycle, or behavior.",
|
|
@@ -8829,7 +8836,7 @@ function named(node) {
|
|
|
8829
8836
|
}
|
|
8830
8837
|
var no_declaration_comment_wall_default = createRule({
|
|
8831
8838
|
name: "no-declaration-comment-wall",
|
|
8832
|
-
documentation:
|
|
8839
|
+
documentation: NO_DECLARATION_COMMENT_WALL_DOCUMENTATION,
|
|
8833
8840
|
meta: {
|
|
8834
8841
|
type: "suggestion",
|
|
8835
8842
|
docs: {
|
|
@@ -8929,7 +8936,7 @@ var no_declaration_comment_wall_default = createRule({
|
|
|
8929
8936
|
|
|
8930
8937
|
// src/rules/no-union-in-comment.ts
|
|
8931
8938
|
var import_utils50 = require("@typescript-eslint/utils");
|
|
8932
|
-
var
|
|
8939
|
+
var NO_UNION_IN_COMMENT_DOCUMENTATION = {
|
|
8933
8940
|
summary: "Flag a comment that lists a `string` field's allowed values instead of the type listing them.",
|
|
8934
8941
|
rationale: "A comment cannot prevent callers from supplying strings outside the listed set, and the list can drift from runtime behavior.",
|
|
8935
8942
|
remediation: "Move the allowed values into a string-literal union and remove the redundant comment.",
|
|
@@ -9044,7 +9051,7 @@ function unionLiterals(body2) {
|
|
|
9044
9051
|
}
|
|
9045
9052
|
var no_union_in_comment_default = createRule({
|
|
9046
9053
|
name: "no-union-in-comment",
|
|
9047
|
-
documentation:
|
|
9054
|
+
documentation: NO_UNION_IN_COMMENT_DOCUMENTATION,
|
|
9048
9055
|
meta: {
|
|
9049
9056
|
type: "suggestion",
|
|
9050
9057
|
docs: {
|
|
@@ -9105,7 +9112,7 @@ var no_union_in_comment_default = createRule({
|
|
|
9105
9112
|
|
|
9106
9113
|
// src/rules/no-type-member-comment-wall.ts
|
|
9107
9114
|
var import_utils51 = require("@typescript-eslint/utils");
|
|
9108
|
-
var
|
|
9115
|
+
var NO_TYPE_MEMBER_COMMENT_WALL_DOCUMENTATION = {
|
|
9109
9116
|
summary: "Flag an object type whose member comments mostly re-spell the members' own names and types.",
|
|
9110
9117
|
rationale: "Repetitive member comments add scanning cost while hiding the comments that describe facts absent from the type.",
|
|
9111
9118
|
remediation: "Delete comments that restate member names or types and keep comments that add constraints or behavior.",
|
|
@@ -9137,7 +9144,7 @@ function isNamedMember(node) {
|
|
|
9137
9144
|
}
|
|
9138
9145
|
var no_type_member_comment_wall_default = createRule({
|
|
9139
9146
|
name: "no-type-member-comment-wall",
|
|
9140
|
-
documentation:
|
|
9147
|
+
documentation: NO_TYPE_MEMBER_COMMENT_WALL_DOCUMENTATION,
|
|
9141
9148
|
meta: {
|
|
9142
9149
|
type: "suggestion",
|
|
9143
9150
|
docs: {
|
|
@@ -9230,7 +9237,7 @@ var no_type_member_comment_wall_default = createRule({
|
|
|
9230
9237
|
|
|
9231
9238
|
// src/rules/no-unnecessary-use-client.ts
|
|
9232
9239
|
var import_utils52 = require("@typescript-eslint/utils");
|
|
9233
|
-
var
|
|
9240
|
+
var NO_UNNECESSARY_USE_CLIENT_DOCUMENTATION = {
|
|
9234
9241
|
summary: "Flag `'use client'` files with no hooks or event handlers \u2014 they could be RSC.",
|
|
9235
9242
|
rationale: "An unnecessary client boundary sends the component and its transitive dependencies to the browser without using client-only behavior.",
|
|
9236
9243
|
remediation: "Remove the directive, or keep it only when the module uses a supported client-side API or boundary dependency.",
|
|
@@ -9343,7 +9350,7 @@ var isGlobalReference = (node, context) => {
|
|
|
9343
9350
|
};
|
|
9344
9351
|
var no_unnecessary_use_client_default = createRule({
|
|
9345
9352
|
name: "no-unnecessary-use-client",
|
|
9346
|
-
documentation:
|
|
9353
|
+
documentation: NO_UNNECESSARY_USE_CLIENT_DOCUMENTATION,
|
|
9347
9354
|
meta: {
|
|
9348
9355
|
type: "suggestion",
|
|
9349
9356
|
docs: {
|
|
@@ -9486,7 +9493,7 @@ var MOCK_MODULES = /* @__PURE__ */ new Set([
|
|
|
9486
9493
|
"jest-mock",
|
|
9487
9494
|
"@jest/globals"
|
|
9488
9495
|
]);
|
|
9489
|
-
var
|
|
9496
|
+
var NO_UNSAFE_MOCK_CASTING_DOCUMENTATION = {
|
|
9490
9497
|
summary: "Disallow casting to mock types like `jest.Mock` or `vi.Mock`. Use `vi.mocked()` or `jest.mocked()` instead.",
|
|
9491
9498
|
rationale: "A type assertion can claim an unmocked value is a mock and bypass checking between the original callable and the mock API.",
|
|
9492
9499
|
remediation: "Use the test framework's `mocked` helper to obtain the typed mock reference.",
|
|
@@ -9515,7 +9522,7 @@ var noUnsafeMockCastingDocumentation = {
|
|
|
9515
9522
|
};
|
|
9516
9523
|
var no_unsafe_mock_casting_default = createRule({
|
|
9517
9524
|
name: "no-unsafe-mock-casting",
|
|
9518
|
-
documentation:
|
|
9525
|
+
documentation: NO_UNSAFE_MOCK_CASTING_DOCUMENTATION,
|
|
9519
9526
|
meta: {
|
|
9520
9527
|
type: "problem",
|
|
9521
9528
|
docs: {
|
|
@@ -9583,7 +9590,7 @@ var no_unsafe_mock_casting_default = createRule({
|
|
|
9583
9590
|
// src/rules/no-zod-native-enum.ts
|
|
9584
9591
|
var import_utils54 = require("@typescript-eslint/utils");
|
|
9585
9592
|
var ts2 = __toESM(require("typescript"), 1);
|
|
9586
|
-
var
|
|
9593
|
+
var NO_ZOD_NATIVE_ENUM_DOCUMENTATION = {
|
|
9587
9594
|
summary: 'Disallow `z.nativeEnum()` (and `z.enum()` over a TypeScript enum); use `z.enum(["a", "b"])` with a string-literal union instead.',
|
|
9588
9595
|
rationale: "Wrapping a TypeScript enum preserves its emitted runtime object and duplicates the schema's value definition across two constructs.",
|
|
9589
9596
|
remediation: "Pass string literals directly to `z.enum` and derive the TypeScript type with `z.infer`.",
|
|
@@ -9681,7 +9688,7 @@ function resolvesToImportedEnum(node, services) {
|
|
|
9681
9688
|
}
|
|
9682
9689
|
var no_zod_native_enum_default = createRule({
|
|
9683
9690
|
name: "no-zod-native-enum",
|
|
9684
|
-
documentation:
|
|
9691
|
+
documentation: NO_ZOD_NATIVE_ENUM_DOCUMENTATION,
|
|
9685
9692
|
meta: {
|
|
9686
9693
|
type: "suggestion",
|
|
9687
9694
|
fixable: "code",
|
|
@@ -9805,7 +9812,7 @@ var no_zod_native_enum_default = createRule({
|
|
|
9805
9812
|
|
|
9806
9813
|
// src/rules/test-loops-over-literal-cases.ts
|
|
9807
9814
|
var import_utils55 = require("@typescript-eslint/utils");
|
|
9808
|
-
var
|
|
9815
|
+
var TEST_LOOPS_OVER_LITERAL_CASES_DOCUMENTATION = {
|
|
9809
9816
|
summary: "Disallow assertions over an inline literal case loop in a test; parameterization reports and names every case independently.",
|
|
9810
9817
|
rationale: "A loop is reported as one test, so failures hide the individual case name and may stop later cases from running.",
|
|
9811
9818
|
remediation: "Create one named parameterized test or runner-aware subtest for each literal case.",
|
|
@@ -9950,7 +9957,7 @@ var LOOP_CARRIED_CONTROL = /* @__PURE__ */ new Set([
|
|
|
9950
9957
|
]);
|
|
9951
9958
|
var test_loops_over_literal_cases_default = createRule({
|
|
9952
9959
|
name: "test-loops-over-literal-cases",
|
|
9953
|
-
documentation:
|
|
9960
|
+
documentation: TEST_LOOPS_OVER_LITERAL_CASES_DOCUMENTATION,
|
|
9954
9961
|
meta: {
|
|
9955
9962
|
type: "suggestion",
|
|
9956
9963
|
docs: {
|
|
@@ -10015,7 +10022,7 @@ var PHASE_RE = new RegExp(
|
|
|
10015
10022
|
String.raw`^[-=~*_#.\s]{0,40}(?:${PHASE_WORD})(?:\s*(?:[/&+,|]|->|and)\s*(?:${PHASE_WORD}))*[-=~*_#.\s:;!–—]{0,40}$`,
|
|
10016
10023
|
"iu"
|
|
10017
10024
|
);
|
|
10018
|
-
var
|
|
10025
|
+
var TEST_PHASE_LABEL_COMMENT_DOCUMENTATION = {
|
|
10019
10026
|
summary: "Tests must not use bare Arrange, Act, Assert, Given, When, or Then phase comments.",
|
|
10020
10027
|
rationale: "Phase labels narrate test structure without explaining behavior and often hide unclear names or oversized tests.",
|
|
10021
10028
|
remediation: "Delete the label; if the phases remain hard to follow, extract a named helper or split the test.",
|
|
@@ -10067,11 +10074,11 @@ function continuesProseRun(comments, index) {
|
|
|
10067
10074
|
}
|
|
10068
10075
|
var test_phase_label_comment_default = createRule({
|
|
10069
10076
|
name: "test-phase-label-comment",
|
|
10070
|
-
documentation:
|
|
10077
|
+
documentation: TEST_PHASE_LABEL_COMMENT_DOCUMENTATION,
|
|
10071
10078
|
meta: {
|
|
10072
10079
|
type: "suggestion",
|
|
10073
10080
|
fixable: "code",
|
|
10074
|
-
docs: { description:
|
|
10081
|
+
docs: { description: TEST_PHASE_LABEL_COMMENT_DOCUMENTATION.summary },
|
|
10075
10082
|
schema: [],
|
|
10076
10083
|
messages: { removeLabel: "Bare test phase label \u2014 delete it and let the test names and helpers carry the structure." }
|
|
10077
10084
|
},
|
|
@@ -10100,7 +10107,7 @@ var test_phase_label_comment_default = createRule({
|
|
|
10100
10107
|
|
|
10101
10108
|
// src/rules/prefer-constant-time-secret-compare.ts
|
|
10102
10109
|
var import_utils57 = require("@typescript-eslint/utils");
|
|
10103
|
-
var
|
|
10110
|
+
var PREFER_CONSTANT_TIME_SECRET_COMPARE_DOCUMENTATION = {
|
|
10104
10111
|
summary: "Disallow `===`/`!==` on a secret-like value; short-circuiting comparison leaks the secret through timing. Use a constant-time compare.",
|
|
10105
10112
|
rationale: "Ordinary equality stops at the first differing byte, allowing repeated measurements to reveal secret material.",
|
|
10106
10113
|
remediation: "Compare equal-length cryptographic digests with a constant-time comparison primitive.",
|
|
@@ -10165,7 +10172,7 @@ function secretNameOf(node) {
|
|
|
10165
10172
|
}
|
|
10166
10173
|
var prefer_constant_time_secret_compare_default = createRule({
|
|
10167
10174
|
name: "prefer-constant-time-secret-compare",
|
|
10168
|
-
documentation:
|
|
10175
|
+
documentation: PREFER_CONSTANT_TIME_SECRET_COMPARE_DOCUMENTATION,
|
|
10169
10176
|
meta: {
|
|
10170
10177
|
type: "problem",
|
|
10171
10178
|
docs: {
|
|
@@ -10311,7 +10318,7 @@ var prefer_ecmascript_private_members_default = createRule({
|
|
|
10311
10318
|
// src/rules/prefer-discriminated-union.ts
|
|
10312
10319
|
var import_utils59 = require("@typescript-eslint/utils");
|
|
10313
10320
|
var import_utils60 = require("@typescript-eslint/utils");
|
|
10314
|
-
var
|
|
10321
|
+
var PREFER_DISCRIMINATED_UNION_DOCUMENTATION = {
|
|
10315
10322
|
summary: "Flag flat result objects with a required positive boolean status and optional success/failure payloads.",
|
|
10316
10323
|
rationale: "A boolean status plus optional branch data permits contradictory and incomplete states.",
|
|
10317
10324
|
remediation: "Represent each result branch as a discriminated union member with its required payload.",
|
|
@@ -10408,7 +10415,7 @@ function inlineReturnTypeLiteral(node) {
|
|
|
10408
10415
|
}
|
|
10409
10416
|
var prefer_discriminated_union_default = createRule({
|
|
10410
10417
|
name: "prefer-discriminated-union",
|
|
10411
|
-
documentation:
|
|
10418
|
+
documentation: PREFER_DISCRIMINATED_UNION_DOCUMENTATION,
|
|
10412
10419
|
meta: {
|
|
10413
10420
|
type: "suggestion",
|
|
10414
10421
|
docs: {
|
|
@@ -10457,7 +10464,7 @@ var prefer_discriminated_union_default = createRule({
|
|
|
10457
10464
|
|
|
10458
10465
|
// src/rules/prefer-input-group-search.ts
|
|
10459
10466
|
var import_utils61 = require("@typescript-eslint/utils");
|
|
10460
|
-
var
|
|
10467
|
+
var PREFER_INPUT_GROUP_SEARCH_DOCUMENTATION = {
|
|
10461
10468
|
summary: "Require search icons and shared Input controls in the same visual wrapper to use InputGroup.",
|
|
10462
10469
|
rationale: "The shared compound control provides consistent spacing, focus behavior, and accessible composition.",
|
|
10463
10470
|
remediation: "Compose the search icon and field with InputGroup, InputGroupAddon, and InputGroupInput.",
|
|
@@ -10522,7 +10529,7 @@ function isActionIcon(search, wrapper) {
|
|
|
10522
10529
|
}
|
|
10523
10530
|
var prefer_input_group_search_default = createRule({
|
|
10524
10531
|
name: "prefer-input-group-search",
|
|
10525
|
-
documentation:
|
|
10532
|
+
documentation: PREFER_INPUT_GROUP_SEARCH_DOCUMENTATION,
|
|
10526
10533
|
meta: {
|
|
10527
10534
|
type: "suggestion",
|
|
10528
10535
|
docs: {
|
|
@@ -10599,7 +10606,7 @@ var prefer_input_group_search_default = createRule({
|
|
|
10599
10606
|
|
|
10600
10607
|
// src/rules/prefer-immutable-module-constant.ts
|
|
10601
10608
|
var import_utils62 = require("@typescript-eslint/utils");
|
|
10602
|
-
var
|
|
10609
|
+
var PREFER_IMMUTABLE_MODULE_CONSTANT_DOCUMENTATION = {
|
|
10603
10610
|
summary: "Require module-level constant collections to expose readonly state.",
|
|
10604
10611
|
rationale: "A const binding prevents reassignment but does not stop callers from mutating its array, object, Set, or Map contents.",
|
|
10605
10612
|
remediation: "Expose literals with `as const` or a readonly type, and expose Set or Map values through ReadonlySet or ReadonlyMap.",
|
|
@@ -10735,7 +10742,7 @@ function referenceMutates(identifier, isUnshadowedGlobal3) {
|
|
|
10735
10742
|
}
|
|
10736
10743
|
var prefer_immutable_module_constant_default = createRule({
|
|
10737
10744
|
name: "prefer-immutable-module-constant",
|
|
10738
|
-
documentation:
|
|
10745
|
+
documentation: PREFER_IMMUTABLE_MODULE_CONSTANT_DOCUMENTATION,
|
|
10739
10746
|
meta: {
|
|
10740
10747
|
type: "suggestion",
|
|
10741
10748
|
docs: {
|
|
@@ -10841,7 +10848,7 @@ function unwrapTransparentExport(node) {
|
|
|
10841
10848
|
|
|
10842
10849
|
// src/rules/prefer-shadcn-primitives.ts
|
|
10843
10850
|
var import_utils63 = require("@typescript-eslint/utils");
|
|
10844
|
-
var
|
|
10851
|
+
var PREFER_SHADCN_PRIMITIVES_DOCUMENTATION = {
|
|
10845
10852
|
summary: "Require visible raw JSX controls to use the corresponding shared shadcn primitive.",
|
|
10846
10853
|
rationale: "Shared primitives centralize interaction, accessibility, and visual behavior across the product.",
|
|
10847
10854
|
remediation: "Replace the raw visible control with the corresponding shared shadcn component.",
|
|
@@ -10968,7 +10975,7 @@ function replacementFor(node, element) {
|
|
|
10968
10975
|
}
|
|
10969
10976
|
var prefer_shadcn_primitives_default = createRule({
|
|
10970
10977
|
name: "prefer-shadcn-primitives",
|
|
10971
|
-
documentation:
|
|
10978
|
+
documentation: PREFER_SHADCN_PRIMITIVES_DOCUMENTATION,
|
|
10972
10979
|
meta: {
|
|
10973
10980
|
type: "suggestion",
|
|
10974
10981
|
docs: {
|
|
@@ -11025,7 +11032,7 @@ var prefer_shadcn_primitives_default = createRule({
|
|
|
11025
11032
|
|
|
11026
11033
|
// src/rules/prefer-module-level-constant.ts
|
|
11027
11034
|
var import_utils64 = require("@typescript-eslint/utils");
|
|
11028
|
-
var
|
|
11035
|
+
var PREFER_MODULE_LEVEL_CONSTANT_DOCUMENTATION = {
|
|
11029
11036
|
summary: "Hoist literal-only constant collections and regexes out of function bodies to module scope so they are allocated once.",
|
|
11030
11037
|
rationale: "Recreating immutable lookup data on every call wastes allocations and obscures its constant nature.",
|
|
11031
11038
|
remediation: "Declare immutable literal collections and non-stateful regular expressions once at module scope.",
|
|
@@ -11241,7 +11248,7 @@ function isNonRetainingBuiltinCall(node, argument) {
|
|
|
11241
11248
|
}
|
|
11242
11249
|
var prefer_module_level_constant_default = createRule({
|
|
11243
11250
|
name: "prefer-module-level-constant",
|
|
11244
|
-
documentation:
|
|
11251
|
+
documentation: PREFER_MODULE_LEVEL_CONSTANT_DOCUMENTATION,
|
|
11245
11252
|
meta: {
|
|
11246
11253
|
type: "suggestion",
|
|
11247
11254
|
docs: {
|
|
@@ -11333,7 +11340,7 @@ var prefer_module_level_constant_default = createRule({
|
|
|
11333
11340
|
|
|
11334
11341
|
// src/rules/prefer-module-level-schema.ts
|
|
11335
11342
|
var import_utils65 = require("@typescript-eslint/utils");
|
|
11336
|
-
var
|
|
11343
|
+
var PREFER_MODULE_LEVEL_SCHEMA_DOCUMENTATION = {
|
|
11337
11344
|
summary: "Declare a Zod schema at module scope when it closes over nothing in the enclosing function",
|
|
11338
11345
|
rationale: "A closed schema created inside a function is rebuilt on every call and cannot be reused or exported for inference.",
|
|
11339
11346
|
remediation: "Move the closed schema declaration to module scope and reference it from the function.",
|
|
@@ -11490,7 +11497,7 @@ function collectReferences(scope, out) {
|
|
|
11490
11497
|
}
|
|
11491
11498
|
var prefer_module_level_schema_default = createRule({
|
|
11492
11499
|
name: "prefer-module-level-schema",
|
|
11493
|
-
documentation:
|
|
11500
|
+
documentation: PREFER_MODULE_LEVEL_SCHEMA_DOCUMENTATION,
|
|
11494
11501
|
meta: {
|
|
11495
11502
|
type: "problem",
|
|
11496
11503
|
docs: {
|
|
@@ -11692,7 +11699,7 @@ var prefer_module_level_schema_default = createRule({
|
|
|
11692
11699
|
|
|
11693
11700
|
// src/rules/prefer-native-random-uuid.ts
|
|
11694
11701
|
var import_utils66 = require("@typescript-eslint/utils");
|
|
11695
|
-
var
|
|
11702
|
+
var PREFER_NATIVE_RANDOM_UUID_DOCUMENTATION = {
|
|
11696
11703
|
summary: "Prefer `globalThis.crypto.randomUUID()` over resolved zero-argument UUID v4 bindings from the `uuid` package.",
|
|
11697
11704
|
rationale: "The platform implementation avoids an unnecessary dependency for standard random UUID generation.",
|
|
11698
11705
|
remediation: "Call `globalThis.crypto.randomUUID()` and remove the unused `uuid` v4 import when possible.",
|
|
@@ -11709,7 +11716,7 @@ function requireUuid(node) {
|
|
|
11709
11716
|
}
|
|
11710
11717
|
var prefer_native_random_uuid_default = createRule({
|
|
11711
11718
|
name: "prefer-native-random-uuid",
|
|
11712
|
-
documentation:
|
|
11719
|
+
documentation: PREFER_NATIVE_RANDOM_UUID_DOCUMENTATION,
|
|
11713
11720
|
meta: {
|
|
11714
11721
|
type: "suggestion",
|
|
11715
11722
|
docs: {
|
|
@@ -11791,7 +11798,7 @@ var prefer_native_random_uuid_default = createRule({
|
|
|
11791
11798
|
|
|
11792
11799
|
// src/rules/prefer-non-nullable-collection.ts
|
|
11793
11800
|
var import_utils67 = require("@typescript-eslint/utils");
|
|
11794
|
-
var
|
|
11801
|
+
var PREFER_NON_NULLABLE_COLLECTION_DOCUMENTATION = {
|
|
11795
11802
|
summary: "Suggest non-null arrays only when local control flow proves the nullish state is equivalent to an empty collection.",
|
|
11796
11803
|
rationale: "A redundant nullish collection state spreads defaults and guards through consumers without carrying information.",
|
|
11797
11804
|
remediation: "Use a non-null collection type and normalize omitted input to an empty collection at the boundary.",
|
|
@@ -11939,7 +11946,7 @@ function memberIsOnlyCoalesced(context, object, property, fn) {
|
|
|
11939
11946
|
}
|
|
11940
11947
|
var prefer_non_nullable_collection_default = createRule({
|
|
11941
11948
|
name: "prefer-non-nullable-collection",
|
|
11942
|
-
documentation:
|
|
11949
|
+
documentation: PREFER_NON_NULLABLE_COLLECTION_DOCUMENTATION,
|
|
11943
11950
|
meta: {
|
|
11944
11951
|
type: "suggestion",
|
|
11945
11952
|
docs: {
|
|
@@ -12037,7 +12044,7 @@ var prefer_non_nullable_collection_default = createRule({
|
|
|
12037
12044
|
// src/rules/prefer-await-in-async-return.ts
|
|
12038
12045
|
var import_utils68 = require("@typescript-eslint/utils");
|
|
12039
12046
|
var ts3 = __toESM(require("typescript"), 1);
|
|
12040
|
-
var
|
|
12047
|
+
var PREFER_AWAIT_IN_ASYNC_RETURN_DOCUMENTATION = {
|
|
12041
12048
|
summary: "Prefer explicit `await` when an async function directly returns one typed Promise `.then` transform.",
|
|
12042
12049
|
rationale: "Mixing a directly returned Promise callback into otherwise async control flow makes sequencing and failures harder to read.",
|
|
12043
12050
|
remediation: "Await the Promise, then return the transformed value with ordinary async statements.",
|
|
@@ -12124,7 +12131,7 @@ function isProvenPromiseLike(node, services) {
|
|
|
12124
12131
|
}
|
|
12125
12132
|
var prefer_await_in_async_return_default = createRule({
|
|
12126
12133
|
name: "prefer-await-in-async-return",
|
|
12127
|
-
documentation:
|
|
12134
|
+
documentation: PREFER_AWAIT_IN_ASYNC_RETURN_DOCUMENTATION,
|
|
12128
12135
|
meta: {
|
|
12129
12136
|
type: "suggestion",
|
|
12130
12137
|
docs: {
|
|
@@ -12183,7 +12190,7 @@ var prefer_await_in_async_return_default = createRule({
|
|
|
12183
12190
|
|
|
12184
12191
|
// src/rules/prefer-schema-for-api-payload.ts
|
|
12185
12192
|
var import_utils69 = require("@typescript-eslint/utils");
|
|
12186
|
-
var
|
|
12193
|
+
var PREFER_SCHEMA_FOR_API_PAYLOAD_DOCUMENTATION = {
|
|
12187
12194
|
summary: "Require Zod (or similar) schema validation on `response.json()` / `JSON.parse()` results before property access.",
|
|
12188
12195
|
rationale: "External JSON is untrusted at runtime even when its expected TypeScript shape is known statically.",
|
|
12189
12196
|
remediation: "Parse the payload through a schema or establish a recognized runtime validation guard before reading fields.",
|
|
@@ -12498,7 +12505,7 @@ var unvalidatedVariableRef = (node, scope, tracked) => {
|
|
|
12498
12505
|
};
|
|
12499
12506
|
var prefer_schema_for_api_payload_default = createRule({
|
|
12500
12507
|
name: "prefer-schema-for-api-payload",
|
|
12501
|
-
documentation:
|
|
12508
|
+
documentation: PREFER_SCHEMA_FOR_API_PAYLOAD_DOCUMENTATION,
|
|
12502
12509
|
meta: {
|
|
12503
12510
|
type: "problem",
|
|
12504
12511
|
docs: {
|
|
@@ -12708,7 +12715,7 @@ var tailwindBase = (token) => token.replace(/^(?:[a-z0-9-]+:)+/i, "").replace(/^
|
|
|
12708
12715
|
var classTokens = (value) => value.split(/\s+/).filter(Boolean);
|
|
12709
12716
|
|
|
12710
12717
|
// src/rules/prefer-semantic-colors.ts
|
|
12711
|
-
var
|
|
12718
|
+
var PREFER_SEMANTIC_COLORS_DOCUMENTATION = {
|
|
12712
12719
|
summary: "Enforce semantic color tokens over raw Tailwind palette classes, arbitrary color values, and inline color literals.",
|
|
12713
12720
|
rationale: "Semantic tokens keep themes and product meaning consistent while raw colors couple components to a palette value.",
|
|
12714
12721
|
remediation: "Replace raw palette and literal colors with the closest semantic design-system token or CSS variable.",
|
|
@@ -12787,9 +12794,9 @@ var WORKSPACE_ROOT_FILES = [
|
|
|
12787
12794
|
];
|
|
12788
12795
|
var DEFAULT_WORKSPACE_GLOBS = ["packages/*", "apps/*"];
|
|
12789
12796
|
var MAX_WORKSPACE_PACKAGES = 512;
|
|
12790
|
-
var
|
|
12791
|
-
var
|
|
12792
|
-
var
|
|
12797
|
+
var ANCESTRY_CACHE = /* @__PURE__ */ new Map();
|
|
12798
|
+
var WORKSPACE_SCAN_CACHE = /* @__PURE__ */ new Map();
|
|
12799
|
+
var WORKSPACE_ROOT_CACHE = /* @__PURE__ */ new Map();
|
|
12793
12800
|
var SVG_DEFS_CONTAINERS = /* @__PURE__ */ new Set([
|
|
12794
12801
|
"mask",
|
|
12795
12802
|
"clipPath",
|
|
@@ -12905,7 +12912,7 @@ var hasMarkerAtOrAbove = (startDir) => {
|
|
|
12905
12912
|
const visited = [];
|
|
12906
12913
|
let answer;
|
|
12907
12914
|
for (; ; ) {
|
|
12908
|
-
const cached =
|
|
12915
|
+
const cached = ANCESTRY_CACHE.get(dir);
|
|
12909
12916
|
if (cached !== void 0) {
|
|
12910
12917
|
answer = cached;
|
|
12911
12918
|
break;
|
|
@@ -12922,7 +12929,7 @@ var hasMarkerAtOrAbove = (startDir) => {
|
|
|
12922
12929
|
}
|
|
12923
12930
|
dir = parent;
|
|
12924
12931
|
}
|
|
12925
|
-
for (const seen of visited)
|
|
12932
|
+
for (const seen of visited) ANCESTRY_CACHE.set(seen, answer);
|
|
12926
12933
|
return answer;
|
|
12927
12934
|
};
|
|
12928
12935
|
var findWorkspaceRoot = (startDir) => {
|
|
@@ -12931,7 +12938,7 @@ var findWorkspaceRoot = (startDir) => {
|
|
|
12931
12938
|
const visited = [];
|
|
12932
12939
|
let answer;
|
|
12933
12940
|
for (; ; ) {
|
|
12934
|
-
const cached =
|
|
12941
|
+
const cached = WORKSPACE_ROOT_CACHE.get(dir);
|
|
12935
12942
|
if (cached !== void 0) {
|
|
12936
12943
|
answer = cached;
|
|
12937
12944
|
break;
|
|
@@ -12948,11 +12955,11 @@ var findWorkspaceRoot = (startDir) => {
|
|
|
12948
12955
|
}
|
|
12949
12956
|
dir = parent;
|
|
12950
12957
|
}
|
|
12951
|
-
for (const seen of visited)
|
|
12958
|
+
for (const seen of visited) WORKSPACE_ROOT_CACHE.set(seen, answer);
|
|
12952
12959
|
return answer;
|
|
12953
12960
|
};
|
|
12954
12961
|
var workspaceHasMarker = (root) => {
|
|
12955
|
-
const cached =
|
|
12962
|
+
const cached = WORKSPACE_SCAN_CACHE.get(root);
|
|
12956
12963
|
if (cached !== void 0) return cached;
|
|
12957
12964
|
const globs = readWorkspaceGlobs(root);
|
|
12958
12965
|
const candidates = /* @__PURE__ */ new Set();
|
|
@@ -12970,7 +12977,7 @@ var workspaceHasMarker = (root) => {
|
|
|
12970
12977
|
break;
|
|
12971
12978
|
}
|
|
12972
12979
|
}
|
|
12973
|
-
|
|
12980
|
+
WORKSPACE_SCAN_CACHE.set(root, found);
|
|
12974
12981
|
return found;
|
|
12975
12982
|
};
|
|
12976
12983
|
var expandWorkspaceGlob = (root, glob) => {
|
|
@@ -12994,7 +13001,7 @@ var staticallyImportsEmailOrPdfRenderer = (program) => program.body.some((statem
|
|
|
12994
13001
|
});
|
|
12995
13002
|
var prefer_semantic_colors_default = createRule({
|
|
12996
13003
|
name: "prefer-semantic-colors",
|
|
12997
|
-
documentation:
|
|
13004
|
+
documentation: PREFER_SEMANTIC_COLORS_DOCUMENTATION,
|
|
12998
13005
|
meta: {
|
|
12999
13006
|
type: "suggestion",
|
|
13000
13007
|
docs: {
|
|
@@ -13133,7 +13140,7 @@ var prefer_semantic_colors_default = createRule({
|
|
|
13133
13140
|
|
|
13134
13141
|
// src/rules/prefer-server-actions.ts
|
|
13135
13142
|
var import_utils71 = require("@typescript-eslint/utils");
|
|
13136
|
-
var
|
|
13143
|
+
var PREFER_SERVER_ACTIONS_DOCUMENTATION = {
|
|
13137
13144
|
summary: "Prefer Next.js Server Actions over /api/* mutations.",
|
|
13138
13145
|
rationale: "Server Actions preserve typed application calls and avoid an internal JSON request-response boundary.",
|
|
13139
13146
|
remediation: "Move the mutation into a Server Action and invoke that action from the React client.",
|
|
@@ -13242,7 +13249,7 @@ function getPropertyNode(objNode, propName2) {
|
|
|
13242
13249
|
}
|
|
13243
13250
|
var prefer_server_actions_default = createRule({
|
|
13244
13251
|
name: "prefer-server-actions",
|
|
13245
|
-
documentation:
|
|
13252
|
+
documentation: PREFER_SERVER_ACTIONS_DOCUMENTATION,
|
|
13246
13253
|
meta: {
|
|
13247
13254
|
type: "suggestion",
|
|
13248
13255
|
docs: {
|
|
@@ -13332,7 +13339,7 @@ var COLLECTION_PROPERTIES = /* @__PURE__ */ new Set(["length", "size"]);
|
|
|
13332
13339
|
var LITERAL_KEY_HAZARDS = /* @__PURE__ */ new Set(["__proto__"]);
|
|
13333
13340
|
var NUMERIC_SIGNS2 = /* @__PURE__ */ new Set(["-", "+"]);
|
|
13334
13341
|
var MIN_RUN_LENGTH = 2;
|
|
13335
|
-
var
|
|
13342
|
+
var PREFER_WHOLE_OBJECT_ASSERTION_DOCUMENTATION = {
|
|
13336
13343
|
summary: "Collapse consecutive assertions on one object into a whole-object assertion so related mismatches are reported together.",
|
|
13337
13344
|
rationale: "One whole-object assertion presents related expectations together and produces a complete structural diff.",
|
|
13338
13345
|
remediation: "Replace consecutive member assertions with one `toMatchObject` assertion.",
|
|
@@ -13391,7 +13398,7 @@ function propertyAccess(node) {
|
|
|
13391
13398
|
}
|
|
13392
13399
|
var prefer_whole_object_assertion_default = createRule({
|
|
13393
13400
|
name: "prefer-whole-object-assertion",
|
|
13394
|
-
documentation:
|
|
13401
|
+
documentation: PREFER_WHOLE_OBJECT_ASSERTION_DOCUMENTATION,
|
|
13395
13402
|
meta: {
|
|
13396
13403
|
type: "suggestion",
|
|
13397
13404
|
docs: {
|
|
@@ -13599,7 +13606,7 @@ var prefer_whole_object_assertion_default = createRule({
|
|
|
13599
13606
|
|
|
13600
13607
|
// src/rules/repeated-static-call-cases.ts
|
|
13601
13608
|
var import_utils73 = require("@typescript-eslint/utils");
|
|
13602
|
-
var
|
|
13609
|
+
var REPEATED_STATIC_CALL_CASES_DOCUMENTATION = {
|
|
13603
13610
|
summary: "Report three or more consecutive literal call assertions that should be independently named test cases.",
|
|
13604
13611
|
rationale: "Copy-pasted cases obscure the input table and stop later cases from being reported after the first failure.",
|
|
13605
13612
|
remediation: "Replace the repeated assertions with a named `test.each` or `it.each` table.",
|
|
@@ -13714,7 +13721,7 @@ function expectCallFromMatcher(node) {
|
|
|
13714
13721
|
}
|
|
13715
13722
|
var repeated_static_call_cases_default = createRule({
|
|
13716
13723
|
name: "repeated-static-call-cases",
|
|
13717
|
-
documentation:
|
|
13724
|
+
documentation: REPEATED_STATIC_CALL_CASES_DOCUMENTATION,
|
|
13718
13725
|
meta: {
|
|
13719
13726
|
type: "suggestion",
|
|
13720
13727
|
docs: { description: "Report three or more consecutive literal call assertions that should be independently named test cases." },
|
|
@@ -13782,7 +13789,7 @@ var repeated_static_call_cases_default = createRule({
|
|
|
13782
13789
|
|
|
13783
13790
|
// src/rules/prefer-zod-infer.ts
|
|
13784
13791
|
var import_utils74 = require("@typescript-eslint/utils");
|
|
13785
|
-
var
|
|
13792
|
+
var PREFER_ZOD_INFER_DOCUMENTATION = {
|
|
13786
13793
|
summary: "Derive a type from its Zod schema with `z.infer` instead of hand-writing a twin declaration beside it.",
|
|
13787
13794
|
rationale: "A derived type stays synchronized when the runtime schema changes.",
|
|
13788
13795
|
remediation: "Replace the hand-written twin with `z.infer<typeof Schema>`.",
|
|
@@ -14075,7 +14082,7 @@ function endsWithTokens(candidate2, suffix) {
|
|
|
14075
14082
|
}
|
|
14076
14083
|
var prefer_zod_infer_default = createRule({
|
|
14077
14084
|
name: "prefer-zod-infer",
|
|
14078
|
-
documentation:
|
|
14085
|
+
documentation: PREFER_ZOD_INFER_DOCUMENTATION,
|
|
14079
14086
|
meta: {
|
|
14080
14087
|
type: "problem",
|
|
14081
14088
|
docs: {
|
|
@@ -14505,7 +14512,7 @@ var prefer_zod_infer_default = createRule({
|
|
|
14505
14512
|
// src/rules/require-assert-never.ts
|
|
14506
14513
|
var import_utils75 = require("@typescript-eslint/utils");
|
|
14507
14514
|
var import_typescript = __toESM(require("typescript"), 1);
|
|
14508
|
-
var
|
|
14515
|
+
var REQUIRE_ASSERT_NEVER_DOCUMENTATION = {
|
|
14509
14516
|
summary: "Require an empty switch default to call `assertNever` so discriminated unions remain exhaustive at compile time.",
|
|
14510
14517
|
rationale: "An empty default silently accepts new union members instead of making the compiler identify the missing case.",
|
|
14511
14518
|
remediation: "Call `assertNever` with the discriminant in the exhaustive switch default.",
|
|
@@ -14580,7 +14587,7 @@ function finiteTypeKey(type, checker) {
|
|
|
14580
14587
|
}
|
|
14581
14588
|
var require_assert_never_default = createRule({
|
|
14582
14589
|
name: "require-assert-never",
|
|
14583
|
-
documentation:
|
|
14590
|
+
documentation: REQUIRE_ASSERT_NEVER_DOCUMENTATION,
|
|
14584
14591
|
meta: {
|
|
14585
14592
|
type: "problem",
|
|
14586
14593
|
docs: {
|
|
@@ -14623,7 +14630,7 @@ var require_assert_never_default = createRule({
|
|
|
14623
14630
|
|
|
14624
14631
|
// src/rules/require-fetch-timeout.ts
|
|
14625
14632
|
var import_utils76 = require("@typescript-eslint/utils");
|
|
14626
|
-
var
|
|
14633
|
+
var REQUIRE_FETCH_TIMEOUT_DOCUMENTATION = {
|
|
14627
14634
|
summary: "Require an abort `signal` (e.g. `AbortSignal.timeout(ms)`) on global `fetch()` calls so stalled upstreams cannot hang the caller forever.",
|
|
14628
14635
|
rationale: "An unbounded request can occupy work indefinitely when an upstream stalls.",
|
|
14629
14636
|
remediation: "Pass an abort signal, such as `AbortSignal.timeout(ms)`, in the fetch init.",
|
|
@@ -14669,7 +14676,7 @@ function isInlineUrl(node, resolvesToGlobal) {
|
|
|
14669
14676
|
}
|
|
14670
14677
|
var require_fetch_timeout_default = createRule({
|
|
14671
14678
|
name: "require-fetch-timeout",
|
|
14672
|
-
documentation:
|
|
14679
|
+
documentation: REQUIRE_FETCH_TIMEOUT_DOCUMENTATION,
|
|
14673
14680
|
meta: {
|
|
14674
14681
|
type: "problem",
|
|
14675
14682
|
docs: {
|
|
@@ -14751,7 +14758,7 @@ var require_fetch_timeout_default = createRule({
|
|
|
14751
14758
|
|
|
14752
14759
|
// src/rules/require-port-for-service.ts
|
|
14753
14760
|
var import_utils77 = require("@typescript-eslint/utils");
|
|
14754
|
-
var
|
|
14761
|
+
var REQUIRE_PORT_FOR_SERVICE_DOCUMENTATION = {
|
|
14755
14762
|
summary: "Advise when an exported service with injected collaborators has public methods not covered by its declared ports.",
|
|
14756
14763
|
rationale: "A declared port keeps consumers coupled to the service capability instead of its concrete implementation.",
|
|
14757
14764
|
remediation: "Declare and implement an interface covering the service's public methods.",
|
|
@@ -15231,7 +15238,7 @@ function hasServicePort(node, methods, classes, interfaces) {
|
|
|
15231
15238
|
}
|
|
15232
15239
|
var require_port_for_service_default = createRule({
|
|
15233
15240
|
name: "require-port-for-service",
|
|
15234
|
-
documentation:
|
|
15241
|
+
documentation: REQUIRE_PORT_FOR_SERVICE_DOCUMENTATION,
|
|
15235
15242
|
meta: {
|
|
15236
15243
|
type: "suggestion",
|
|
15237
15244
|
docs: {
|
|
@@ -15296,7 +15303,7 @@ var require_port_for_service_default = createRule({
|
|
|
15296
15303
|
|
|
15297
15304
|
// src/rules/require-static-next-matcher.ts
|
|
15298
15305
|
var import_utils78 = require("@typescript-eslint/utils");
|
|
15299
|
-
var
|
|
15306
|
+
var REQUIRE_STATIC_NEXT_MATCHER_DOCUMENTATION = {
|
|
15300
15307
|
summary: "Require Next.js middleware and proxy matcher configuration to contain only build-time literals.",
|
|
15301
15308
|
rationale: "Next.js must statically analyze matcher values at build time; computed values are ignored.",
|
|
15302
15309
|
remediation: "Write matcher strings, arrays, and object fields as literals in the exported config.",
|
|
@@ -15340,7 +15347,7 @@ function propertyName4(property) {
|
|
|
15340
15347
|
}
|
|
15341
15348
|
var require_static_next_matcher_default = createRule({
|
|
15342
15349
|
name: "require-static-next-matcher",
|
|
15343
|
-
documentation:
|
|
15350
|
+
documentation: REQUIRE_STATIC_NEXT_MATCHER_DOCUMENTATION,
|
|
15344
15351
|
meta: {
|
|
15345
15352
|
type: "problem",
|
|
15346
15353
|
docs: {
|
|
@@ -15385,7 +15392,7 @@ var require_static_next_matcher_default = createRule({
|
|
|
15385
15392
|
|
|
15386
15393
|
// src/rules/require-use-form-default-values.ts
|
|
15387
15394
|
var import_utils79 = require("@typescript-eslint/utils");
|
|
15388
|
-
var
|
|
15395
|
+
var REQUIRE_USE_FORM_DEFAULT_VALUES_DOCUMENTATION = {
|
|
15389
15396
|
summary: "react-hook-form useForm call without defaultValues",
|
|
15390
15397
|
rationale: "Without an explicit initial value, fields can change from uncontrolled to controlled as data arrives, reset behavior becomes ambiguous, and the form's initial shape no longer documents the values users can edit.",
|
|
15391
15398
|
remediation: "Pass an object with a defaultValues property to useForm; use empty strings, nulls, or schema-appropriate values deliberately for every controlled field.",
|
|
@@ -15421,10 +15428,10 @@ function hasDefaultValues(options) {
|
|
|
15421
15428
|
}
|
|
15422
15429
|
var require_use_form_default_values_default = createRule({
|
|
15423
15430
|
name: "require-use-form-default-values",
|
|
15424
|
-
documentation:
|
|
15431
|
+
documentation: REQUIRE_USE_FORM_DEFAULT_VALUES_DOCUMENTATION,
|
|
15425
15432
|
meta: {
|
|
15426
15433
|
type: "problem",
|
|
15427
|
-
docs: { description:
|
|
15434
|
+
docs: { description: REQUIRE_USE_FORM_DEFAULT_VALUES_DOCUMENTATION.summary },
|
|
15428
15435
|
schema: [],
|
|
15429
15436
|
messages: {
|
|
15430
15437
|
requireUseFormDefaultValues: "Pass explicit defaultValues to useForm so fields have a stable initial shape and reset behavior."
|
|
@@ -15456,7 +15463,7 @@ var require_use_form_default_values_default = createRule({
|
|
|
15456
15463
|
// src/rules/require-use-server-in-actions-file.ts
|
|
15457
15464
|
var import_utils80 = require("@typescript-eslint/utils");
|
|
15458
15465
|
var ACTION_MODULE_RE = /(?:^|\/)app\/.*\/(?:actions|[^/]+-actions)\.[cm]?[jt]s$/u;
|
|
15459
|
-
var
|
|
15466
|
+
var REQUIRE_USE_SERVER_IN_ACTIONS_FILE_DOCUMENTATION = {
|
|
15460
15467
|
summary: "route action module missing the use server directive",
|
|
15461
15468
|
rationale: "An exported async function is not callable as a Server Action merely because its file is named actions.ts. Without the module directive, a client import can fail or pull server-only implementation details across the client boundary.",
|
|
15462
15469
|
remediation: "Put 'use server' at the start of the route action module.",
|
|
@@ -15494,10 +15501,10 @@ function isExportedAsyncFunction(node) {
|
|
|
15494
15501
|
}
|
|
15495
15502
|
var require_use_server_in_actions_file_default = createRule({
|
|
15496
15503
|
name: "require-use-server-in-actions-file",
|
|
15497
|
-
documentation:
|
|
15504
|
+
documentation: REQUIRE_USE_SERVER_IN_ACTIONS_FILE_DOCUMENTATION,
|
|
15498
15505
|
meta: {
|
|
15499
15506
|
type: "problem",
|
|
15500
|
-
docs: { description:
|
|
15507
|
+
docs: { description: REQUIRE_USE_SERVER_IN_ACTIONS_FILE_DOCUMENTATION.summary },
|
|
15501
15508
|
schema: [],
|
|
15502
15509
|
messages: {
|
|
15503
15510
|
requireUseServerInActionsFile: "This route action module exports an async function but is missing a leading 'use server' directive."
|
|
@@ -15521,7 +15528,7 @@ var require_use_server_in_actions_file_default = createRule({
|
|
|
15521
15528
|
|
|
15522
15529
|
// src/rules/require-zod-form-validation.ts
|
|
15523
15530
|
var import_utils81 = require("@typescript-eslint/utils");
|
|
15524
|
-
var
|
|
15531
|
+
var REQUIRE_ZOD_FORM_VALIDATION_DOCUMENTATION = {
|
|
15525
15532
|
summary: "Require Zod validation (`Schema.parse(...)` / `Schema.safeParse(...)`) when reading values out of a `FormData` object.",
|
|
15526
15533
|
rationale: "FormData values are untrusted strings or files and need runtime validation before use.",
|
|
15527
15534
|
remediation: "Read the value inside a Zod schema's `parse` or `safeParse` input.",
|
|
@@ -15570,7 +15577,7 @@ var isFormDataMethodCall = (node) => {
|
|
|
15570
15577
|
};
|
|
15571
15578
|
var require_zod_form_validation_default = createRule({
|
|
15572
15579
|
name: "require-zod-form-validation",
|
|
15573
|
-
documentation:
|
|
15580
|
+
documentation: REQUIRE_ZOD_FORM_VALIDATION_DOCUMENTATION,
|
|
15574
15581
|
meta: {
|
|
15575
15582
|
type: "problem",
|
|
15576
15583
|
docs: {
|
|
@@ -15821,7 +15828,7 @@ var require_zod_form_validation_default = createRule({
|
|
|
15821
15828
|
|
|
15822
15829
|
// src/rules/store-insert-requires-on-conflict.ts
|
|
15823
15830
|
var import_utils82 = require("@typescript-eslint/utils");
|
|
15824
|
-
var
|
|
15831
|
+
var STORE_INSERT_REQUIRES_ON_CONFLICT_DOCUMENTATION = {
|
|
15825
15832
|
summary: "Require embedded inserts in explicitly replayable callables to carry conflict handling.",
|
|
15826
15833
|
rationale: "A callable named as an enqueue, seed, migration, schedule, ensure, or upsert promises replay safety.",
|
|
15827
15834
|
remediation: "Add an appropriate `ON CONFLICT` action or supported replay-safe insert form.",
|
|
@@ -15854,7 +15861,7 @@ function owningCallableName(node) {
|
|
|
15854
15861
|
var INSERT_GATE = /insert/i;
|
|
15855
15862
|
var store_insert_requires_on_conflict_default = createRule({
|
|
15856
15863
|
name: "store-insert-requires-on-conflict",
|
|
15857
|
-
documentation:
|
|
15864
|
+
documentation: STORE_INSERT_REQUIRES_ON_CONFLICT_DOCUMENTATION,
|
|
15858
15865
|
meta: {
|
|
15859
15866
|
type: "problem",
|
|
15860
15867
|
docs: {
|
|
@@ -15885,7 +15892,7 @@ var store_insert_requires_on_conflict_default = createRule({
|
|
|
15885
15892
|
|
|
15886
15893
|
// src/rules/stepdown.ts
|
|
15887
15894
|
var import_utils83 = require("@typescript-eslint/utils");
|
|
15888
|
-
var
|
|
15895
|
+
var STEPDOWN_DOCUMENTATION = {
|
|
15889
15896
|
summary: "Place a private helper below its sole direct same-scope caller.",
|
|
15890
15897
|
rationale: "Caller-first ordering lets a reader follow the main flow before descending into implementation details.",
|
|
15891
15898
|
remediation: "Move the private helper below its sole caller.",
|
|
@@ -16304,7 +16311,7 @@ function isClassRuntimeBarrier(member) {
|
|
|
16304
16311
|
}
|
|
16305
16312
|
var stepdown_default = createRule({
|
|
16306
16313
|
name: "stepdown",
|
|
16307
|
-
documentation:
|
|
16314
|
+
documentation: STEPDOWN_DOCUMENTATION,
|
|
16308
16315
|
meta: {
|
|
16309
16316
|
type: "suggestion",
|
|
16310
16317
|
docs: { description: "Place a private helper below its sole direct same-scope caller." },
|
|
@@ -16376,7 +16383,7 @@ var EXPECT_MATCHERS = /* @__PURE__ */ new Set([
|
|
|
16376
16383
|
]);
|
|
16377
16384
|
var EXPECT_MODIFIERS2 = /* @__PURE__ */ new Set(["not", "rejects", "resolves"]);
|
|
16378
16385
|
var ASSERT_MATCHERS = /* @__PURE__ */ new Set(["deepEqual", "doesNotMatch", "equal", "match", "notDeepEqual", "notEqual", "notStrictEqual", "ok", "strictEqual"]);
|
|
16379
|
-
var
|
|
16386
|
+
var SOURCE_COUPLED_TEST_DOCUMENTATION = {
|
|
16380
16387
|
summary: "Disallow raw repository source text as a test oracle; parse or execute the artifact instead.",
|
|
16381
16388
|
rationale: "Substring and regex checks can pass on comments or unreachable configuration and fail after behavior-preserving formatting changes.",
|
|
16382
16389
|
remediation: "Parse the artifact, execute its validator, or assert on another runtime contract.",
|
|
@@ -16634,13 +16641,13 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
|
|
|
16634
16641
|
}
|
|
16635
16642
|
var source_coupled_test_default = createSourceCoupledRule(
|
|
16636
16643
|
"source-coupled-test",
|
|
16637
|
-
|
|
16644
|
+
SOURCE_COUPLED_TEST_DOCUMENTATION,
|
|
16638
16645
|
GENERAL_SOURCE_SUFFIX_RE
|
|
16639
16646
|
);
|
|
16640
16647
|
|
|
16641
16648
|
// src/rules/iac-source-coupled-test.ts
|
|
16642
16649
|
var IAC_SOURCE_SUFFIX_RE = /(?:\.tf\.json|\.tftest\.(?:hcl|json)|\.(?:hcl|tf|tfvars))$/iu;
|
|
16643
|
-
var
|
|
16650
|
+
var IAC_SOURCE_COUPLED_TEST_DOCUMENTATION = {
|
|
16644
16651
|
summary: "Disallow raw IaC source text as a test oracle; inspect a rendered plan, provider state, or runtime behavior.",
|
|
16645
16652
|
rationale: "Substring and regex checks can pass on comments, formatting, or unreachable Terraform configuration while clients fail silently.",
|
|
16646
16653
|
remediation: "Parse rendered plan JSON, query the provider, or exercise the deployed runtime contract.",
|
|
@@ -16672,13 +16679,13 @@ var iacSourceCoupledTestDocumentation = {
|
|
|
16672
16679
|
};
|
|
16673
16680
|
var iac_source_coupled_test_default = createSourceCoupledRule(
|
|
16674
16681
|
"iac-source-coupled-test",
|
|
16675
|
-
|
|
16682
|
+
IAC_SOURCE_COUPLED_TEST_DOCUMENTATION,
|
|
16676
16683
|
IAC_SOURCE_SUFFIX_RE
|
|
16677
16684
|
);
|
|
16678
16685
|
|
|
16679
16686
|
// src/rules/zod-naming-convention.ts
|
|
16680
16687
|
var import_utils85 = require("@typescript-eslint/utils");
|
|
16681
|
-
var
|
|
16688
|
+
var ZOD_NAMING_CONVENTION_DOCUMENTATION = {
|
|
16682
16689
|
summary: "Enforce a consistent Zod schema naming convention \u2014 a `Z` prefix (`ZUser`) or a `Schema` suffix (`userSchema`); both are accepted by default.",
|
|
16683
16690
|
rationale: "A recognizable schema name distinguishes runtime validators from ordinary values at each use site.",
|
|
16684
16691
|
remediation: "Rename the schema with a `Z` prefix or `Schema` suffix, according to the configured convention.",
|
|
@@ -16738,7 +16745,7 @@ var calleeChainRoot = (node) => {
|
|
|
16738
16745
|
};
|
|
16739
16746
|
var zod_naming_convention_default = createRule({
|
|
16740
16747
|
name: "zod-naming-convention",
|
|
16741
|
-
documentation:
|
|
16748
|
+
documentation: ZOD_NAMING_CONVENTION_DOCUMENTATION,
|
|
16742
16749
|
meta: {
|
|
16743
16750
|
type: "suggestion",
|
|
16744
16751
|
docs: {
|
|
@@ -16818,7 +16825,7 @@ var zod_naming_convention_default = createRule({
|
|
|
16818
16825
|
});
|
|
16819
16826
|
|
|
16820
16827
|
// src/rules/_renames.ts
|
|
16821
|
-
var
|
|
16828
|
+
var RENAMED_RULES = {
|
|
16822
16829
|
"jsdoc-restates-signature": "no-restated-jsdoc",
|
|
16823
16830
|
"require-interface-for-injected-service": "require-port-for-service",
|
|
16824
16831
|
"strict-test-assertions": "prefer-whole-object-assertion",
|
|
@@ -16826,7 +16833,7 @@ var renamedRules = {
|
|
|
16826
16833
|
};
|
|
16827
16834
|
|
|
16828
16835
|
// src/rules/_retired.ts
|
|
16829
|
-
var
|
|
16836
|
+
var RETIRED_RULES = {
|
|
16830
16837
|
"ban-loose-type-guards-in-tests": {
|
|
16831
16838
|
removedIn: "5.0.0",
|
|
16832
16839
|
reason: "Delete the config entry and suppressions; there is no replacement."
|
|
@@ -16898,7 +16905,7 @@ var retiredRules = {
|
|
|
16898
16905
|
};
|
|
16899
16906
|
|
|
16900
16907
|
// src/index.ts
|
|
16901
|
-
var
|
|
16908
|
+
var RULES = {
|
|
16902
16909
|
"iac-source-coupled-test": iac_source_coupled_test_default,
|
|
16903
16910
|
"duplicate-test-body": duplicate_test_body_default,
|
|
16904
16911
|
"enforce-file-structure": enforce_file_structure_default,
|
|
@@ -16981,15 +16988,15 @@ var rules = {
|
|
|
16981
16988
|
};
|
|
16982
16989
|
var meta = {
|
|
16983
16990
|
name: "@sarj/eslint-plugin",
|
|
16984
|
-
version: "15.13.
|
|
16991
|
+
version: "15.13.2"
|
|
16985
16992
|
};
|
|
16986
|
-
var
|
|
16993
|
+
var APPLICATION_ONLY_RULES = [
|
|
16987
16994
|
"no-restricted-library-load",
|
|
16988
16995
|
"prefer-native-random-uuid",
|
|
16989
16996
|
"prefer-shadcn-primitives"
|
|
16990
16997
|
];
|
|
16991
|
-
var
|
|
16992
|
-
var
|
|
16998
|
+
var ADVISORY_RULES = [];
|
|
16999
|
+
var RECOMMENDED_RULES = {
|
|
16993
17000
|
"@sarj/interface-contract-members-private": "error",
|
|
16994
17001
|
"@sarj/iac-source-coupled-test": "error",
|
|
16995
17002
|
"@sarj/duplicate-test-body": "error",
|
|
@@ -17063,7 +17070,7 @@ var recommendedRules = {
|
|
|
17063
17070
|
"@sarj/test-phase-label-comment": "error",
|
|
17064
17071
|
"@sarj/zod-naming-convention": "error"
|
|
17065
17072
|
};
|
|
17066
|
-
var
|
|
17073
|
+
var STRICT_RULES = {
|
|
17067
17074
|
"@sarj/interface-contract-members-private": "error",
|
|
17068
17075
|
"@sarj/iac-source-coupled-test": "error",
|
|
17069
17076
|
"@sarj/duplicate-test-body": "error",
|
|
@@ -17141,28 +17148,35 @@ var strictRules = {
|
|
|
17141
17148
|
"@sarj/test-phase-label-comment": "error",
|
|
17142
17149
|
"@sarj/zod-naming-convention": "error"
|
|
17143
17150
|
};
|
|
17144
|
-
var
|
|
17151
|
+
var PLUGIN = {
|
|
17145
17152
|
meta,
|
|
17146
|
-
rules,
|
|
17147
|
-
retiredRules,
|
|
17153
|
+
rules: RULES,
|
|
17154
|
+
retiredRules: RETIRED_RULES,
|
|
17148
17155
|
get configs() {
|
|
17149
17156
|
return {
|
|
17150
17157
|
recommended: {
|
|
17151
17158
|
name: "@sarj/recommended",
|
|
17152
|
-
plugins: { "@sarj":
|
|
17153
|
-
rules:
|
|
17159
|
+
plugins: { "@sarj": PLUGIN },
|
|
17160
|
+
rules: RECOMMENDED_RULES
|
|
17154
17161
|
},
|
|
17155
17162
|
strict: {
|
|
17156
17163
|
name: "@sarj/strict",
|
|
17157
|
-
plugins: { "@sarj":
|
|
17158
|
-
rules:
|
|
17164
|
+
plugins: { "@sarj": PLUGIN },
|
|
17165
|
+
rules: STRICT_RULES
|
|
17159
17166
|
}
|
|
17160
17167
|
};
|
|
17161
17168
|
}
|
|
17162
17169
|
};
|
|
17163
|
-
var index_default =
|
|
17170
|
+
var index_default = PLUGIN;
|
|
17164
17171
|
// Annotate the CommonJS export names for ESM import in node:
|
|
17165
17172
|
0 && (module.exports = {
|
|
17173
|
+
ADVISORY_RULES,
|
|
17174
|
+
APPLICATION_ONLY_RULES,
|
|
17175
|
+
RECOMMENDED_RULES,
|
|
17176
|
+
RENAMED_RULES,
|
|
17177
|
+
RETIRED_RULES,
|
|
17178
|
+
RULES,
|
|
17179
|
+
STRICT_RULES,
|
|
17166
17180
|
advisoryRules,
|
|
17167
17181
|
applicationOnlyRules,
|
|
17168
17182
|
publicDocumentation,
|