@sarj/eslint-plugin 19.16.0 → 19.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.js +284 -2
- package/dist/{chunk-F6SYEJAW.js → chunk-4USNCXB3.js} +647 -281
- package/dist/index.js +1 -1
- package/dist/stylelint.js +96 -0
- package/package.json +11 -1
|
@@ -3623,6 +3623,110 @@ var no_bespoke_api_case_conversion_default = defineRule({
|
|
|
3623
3623
|
}
|
|
3624
3624
|
});
|
|
3625
3625
|
|
|
3626
|
+
// src/rules/_web-jsx.ts
|
|
3627
|
+
var TEXT_INPUTS = /* @__PURE__ */ new Set([
|
|
3628
|
+
"",
|
|
3629
|
+
"text",
|
|
3630
|
+
"password",
|
|
3631
|
+
"email",
|
|
3632
|
+
"search",
|
|
3633
|
+
"tel",
|
|
3634
|
+
"url",
|
|
3635
|
+
"number"
|
|
3636
|
+
]);
|
|
3637
|
+
function isEditableTextControl(node, source) {
|
|
3638
|
+
if (node.name.type !== "JSXIdentifier" || !["input", "textarea"].includes(node.name.name))
|
|
3639
|
+
return false;
|
|
3640
|
+
if (mayHaveBooleanAttribute(node, ["disabled"]) || mayHaveBooleanAttribute(node, ["readOnly", "readonly"]))
|
|
3641
|
+
return false;
|
|
3642
|
+
if (node.name.name === "textarea") return true;
|
|
3643
|
+
const type = attributeString(node, source, ["type"])?.toLowerCase();
|
|
3644
|
+
return type !== void 0 && TEXT_INPUTS.has(type);
|
|
3645
|
+
}
|
|
3646
|
+
function effectiveAttribute(node, names) {
|
|
3647
|
+
return node.attributes.findLast(
|
|
3648
|
+
(attribute) => attribute.type === "JSXSpreadAttribute" || attribute.name.type === "JSXIdentifier" && names.includes(attribute.name.name)
|
|
3649
|
+
);
|
|
3650
|
+
}
|
|
3651
|
+
function attributeString(node, source, names) {
|
|
3652
|
+
const attribute = effectiveAttribute(node, names);
|
|
3653
|
+
if (attribute === void 0) return "";
|
|
3654
|
+
if (attribute.type === "JSXSpreadAttribute") return null;
|
|
3655
|
+
if (attribute.value === null) return "";
|
|
3656
|
+
const value = attribute.value.type === "JSXExpressionContainer" ? attribute.value.expression : attribute.value;
|
|
3657
|
+
return scopedStaticString(value, source);
|
|
3658
|
+
}
|
|
3659
|
+
function mayHaveBooleanAttribute(node, names) {
|
|
3660
|
+
const attribute = effectiveAttribute(node, names);
|
|
3661
|
+
if (attribute === void 0) return false;
|
|
3662
|
+
if (attribute.type === "JSXAttribute" && attribute.value?.type === "JSXExpressionContainer") {
|
|
3663
|
+
const value = attribute.value.expression;
|
|
3664
|
+
if (value.type === "Literal" && (value.value === false || value.value === null)) return false;
|
|
3665
|
+
}
|
|
3666
|
+
return true;
|
|
3667
|
+
}
|
|
3668
|
+
|
|
3669
|
+
// src/rules/no-blocked-input-paste.ts
|
|
3670
|
+
var NAME14 = "no-blocked-input-paste";
|
|
3671
|
+
var no_blocked_input_paste_default = defineRule({
|
|
3672
|
+
meta: {
|
|
3673
|
+
type: "problem",
|
|
3674
|
+
docs: {
|
|
3675
|
+
description: "Allow clipboard input when a text control has no replacement paste handling.",
|
|
3676
|
+
url: docsUrl(NAME14)
|
|
3677
|
+
},
|
|
3678
|
+
schema: [],
|
|
3679
|
+
messages: {
|
|
3680
|
+
blockedPaste: "This handler only cancels pasting into an editable text control. Allow clipboard and password-manager input, or provide explicit replacement paste handling."
|
|
3681
|
+
}
|
|
3682
|
+
},
|
|
3683
|
+
createOnce(context) {
|
|
3684
|
+
return {
|
|
3685
|
+
before() {
|
|
3686
|
+
if (isGeneratedFile({ filename: context.filename, cwd: context.cwd }, context.sourceCode.text))
|
|
3687
|
+
return false;
|
|
3688
|
+
},
|
|
3689
|
+
JSXOpeningElement(node) {
|
|
3690
|
+
if (!isEditableTextControl(node, context.sourceCode)) return;
|
|
3691
|
+
const blocker = blockingAttribute(node);
|
|
3692
|
+
if (blocker !== null) context.report({ node: blocker, messageId: "blockedPaste" });
|
|
3693
|
+
}
|
|
3694
|
+
};
|
|
3695
|
+
}
|
|
3696
|
+
});
|
|
3697
|
+
function blockingAttribute(node) {
|
|
3698
|
+
let blocker = null;
|
|
3699
|
+
for (const name of ["onPaste", "onPasteCapture"]) {
|
|
3700
|
+
const attribute = effectiveAttribute(node, [name]);
|
|
3701
|
+
if (attribute === void 0) continue;
|
|
3702
|
+
if (attribute.type !== "JSXAttribute" || attribute.value?.type !== "JSXExpressionContainer" || !onlyCancelsPaste(attribute.value.expression))
|
|
3703
|
+
return null;
|
|
3704
|
+
blocker ??= attribute;
|
|
3705
|
+
}
|
|
3706
|
+
return blocker;
|
|
3707
|
+
}
|
|
3708
|
+
function onlyCancelsPaste(expression) {
|
|
3709
|
+
const callback = unwrapExpression(expression);
|
|
3710
|
+
if (callback.type !== "ArrowFunctionExpression" && callback.type !== "FunctionExpression")
|
|
3711
|
+
return false;
|
|
3712
|
+
if (callback.body === null) return false;
|
|
3713
|
+
const [event] = callback.params;
|
|
3714
|
+
if (event?.type !== "Identifier") return false;
|
|
3715
|
+
let body3 = callback.body;
|
|
3716
|
+
if (body3.type === "BlockStatement") {
|
|
3717
|
+
if (body3.body.length !== 1) return false;
|
|
3718
|
+
const statement = body3.body[0];
|
|
3719
|
+
if (statement?.type === "ExpressionStatement") body3 = statement.expression;
|
|
3720
|
+
else if (statement?.type === "ReturnStatement" && statement.argument !== null)
|
|
3721
|
+
body3 = statement.argument;
|
|
3722
|
+
else return false;
|
|
3723
|
+
}
|
|
3724
|
+
body3 = unwrapExpression(body3);
|
|
3725
|
+
if (body3.type !== "CallExpression" || body3.optional || body3.arguments.length !== 0) return false;
|
|
3726
|
+
const callee = unwrapExpression(body3.callee);
|
|
3727
|
+
return callee.type === "MemberExpression" && !callee.optional && getPropertyName(callee) === "preventDefault" && callee.object.type === "Identifier" && callee.object.name === event.name;
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3626
3730
|
// src/utils/has-side-effect.ts
|
|
3627
3731
|
var BINARY_CONVERSIONS = /* @__PURE__ */ new Set([
|
|
3628
3732
|
"==",
|
|
@@ -4052,7 +4156,7 @@ function selectorChoice(sourceCode2, call, binding3) {
|
|
|
4052
4156
|
}
|
|
4053
4157
|
|
|
4054
4158
|
// src/rules/no-boolean-selector-parameter.ts
|
|
4055
|
-
var
|
|
4159
|
+
var NAME15 = "no-boolean-selector-parameter";
|
|
4056
4160
|
function preservesBlockObjectCallback(owner) {
|
|
4057
4161
|
const property = parentOf(owner);
|
|
4058
4162
|
if (property?.type !== "Property" || property.computed) return false;
|
|
@@ -4080,7 +4184,7 @@ var no_boolean_selector_parameter_default = defineRule({
|
|
|
4080
4184
|
type: "suggestion",
|
|
4081
4185
|
docs: {
|
|
4082
4186
|
description: "Prefer intention-revealing operations over a boolean parameter selecting between actions.",
|
|
4083
|
-
url: docsUrl(
|
|
4187
|
+
url: docsUrl(NAME15)
|
|
4084
4188
|
},
|
|
4085
4189
|
schema: [],
|
|
4086
4190
|
fixable: "code",
|
|
@@ -4149,7 +4253,7 @@ var no_boolean_selector_parameter_default = defineRule({
|
|
|
4149
4253
|
});
|
|
4150
4254
|
|
|
4151
4255
|
// src/rules/no-broad-return-type.ts
|
|
4152
|
-
var
|
|
4256
|
+
var NAME16 = "no-broad-return-type";
|
|
4153
4257
|
function isBroad(type, facts, flags) {
|
|
4154
4258
|
if ((type.flags & (flags.Unknown | flags.NonPrimitive)) !== 0) return true;
|
|
4155
4259
|
const indexes = facts.indexValueFlags.get(type) ?? [];
|
|
@@ -4206,7 +4310,7 @@ var no_broad_return_type_default = defineRule({
|
|
|
4206
4310
|
fixable: "code",
|
|
4207
4311
|
docs: {
|
|
4208
4312
|
description: "Report explicit broad return annotations that erase a known return value.",
|
|
4209
|
-
url: docsUrl(
|
|
4313
|
+
url: docsUrl(NAME16)
|
|
4210
4314
|
},
|
|
4211
4315
|
schema: [],
|
|
4212
4316
|
messages: {
|
|
@@ -4294,7 +4398,7 @@ var no_broad_return_type_default = defineRule({
|
|
|
4294
4398
|
});
|
|
4295
4399
|
|
|
4296
4400
|
// src/rules/no-client-side-data-fetching.ts
|
|
4297
|
-
var
|
|
4401
|
+
var NAME17 = "no-client-side-data-fetching";
|
|
4298
4402
|
var FETCH_LIBS = /* @__PURE__ */ new Set(["axios", "ky", "superagent"]);
|
|
4299
4403
|
var HTTP_METHOD_NAMES = /* @__PURE__ */ new Set([
|
|
4300
4404
|
"get",
|
|
@@ -4374,7 +4478,7 @@ var no_client_side_data_fetching_default = defineRule({
|
|
|
4374
4478
|
type: "problem",
|
|
4375
4479
|
docs: {
|
|
4376
4480
|
description: "Disallow direct data fetching inside `useEffect` or `useLayoutEffect`.",
|
|
4377
|
-
url: docsUrl(
|
|
4481
|
+
url: docsUrl(NAME17)
|
|
4378
4482
|
},
|
|
4379
4483
|
schema: [],
|
|
4380
4484
|
messages: {
|
|
@@ -5023,7 +5127,7 @@ var no_comment_cruft_default = defineRule({
|
|
|
5023
5127
|
});
|
|
5024
5128
|
|
|
5025
5129
|
// src/rules/no-conditional-empty-object-spread.ts
|
|
5026
|
-
var
|
|
5130
|
+
var NAME18 = "no-conditional-empty-object-spread";
|
|
5027
5131
|
function isEmptyObject(node) {
|
|
5028
5132
|
return node.type === "ObjectExpression" && node.properties.length === 0;
|
|
5029
5133
|
}
|
|
@@ -5033,7 +5137,7 @@ var no_conditional_empty_object_spread_default = defineRule({
|
|
|
5033
5137
|
fixable: "code",
|
|
5034
5138
|
docs: {
|
|
5035
5139
|
description: "Build conditional properties explicitly instead of spreading an empty-object branch.",
|
|
5036
|
-
url: docsUrl(
|
|
5140
|
+
url: docsUrl(NAME18)
|
|
5037
5141
|
},
|
|
5038
5142
|
schema: [],
|
|
5039
5143
|
messages: {
|
|
@@ -5240,7 +5344,7 @@ function overloadProof(file) {
|
|
|
5240
5344
|
}
|
|
5241
5345
|
|
|
5242
5346
|
// src/rules/no-contradictory-overload-return.ts
|
|
5243
|
-
var
|
|
5347
|
+
var NAME19 = "no-contradictory-overload-return";
|
|
5244
5348
|
var TOP_LEVEL_PARENTS = /* @__PURE__ */ new Set(["Program", "ExportNamedDeclaration", "ExportDefaultDeclaration"]);
|
|
5245
5349
|
function candidateShape(node) {
|
|
5246
5350
|
const parent = parentOf(node);
|
|
@@ -5256,7 +5360,7 @@ var no_contradictory_overload_return_default = defineRule({
|
|
|
5256
5360
|
fixable: "code",
|
|
5257
5361
|
docs: {
|
|
5258
5362
|
description: "Preserve the input/result relationship promised by literal overloads.",
|
|
5259
|
-
url: docsUrl(
|
|
5363
|
+
url: docsUrl(NAME19)
|
|
5260
5364
|
},
|
|
5261
5365
|
schema: [],
|
|
5262
5366
|
messages: {
|
|
@@ -5465,7 +5569,7 @@ function ordinaryHostReference(reference) {
|
|
|
5465
5569
|
}
|
|
5466
5570
|
|
|
5467
5571
|
// src/rules/no-contradictory-type-predicate.ts
|
|
5468
|
-
var
|
|
5572
|
+
var NAME20 = "no-contradictory-type-predicate";
|
|
5469
5573
|
var RUNTIME_KINDS = ["string", "number", "bigint", "boolean", "symbol", "undefined", "object", "function"];
|
|
5470
5574
|
var ANY_RUNTIME_KIND = new Set(RUNTIME_KINDS);
|
|
5471
5575
|
function parameterPredicate(node) {
|
|
@@ -5479,7 +5583,7 @@ var no_contradictory_type_predicate_default = defineRule({
|
|
|
5479
5583
|
fixable: "code",
|
|
5480
5584
|
docs: {
|
|
5481
5585
|
description: "Keep explicit type predicates consistent with their primitive, array or record membership check.",
|
|
5482
|
-
url: docsUrl(
|
|
5586
|
+
url: docsUrl(NAME20)
|
|
5483
5587
|
},
|
|
5484
5588
|
schema: [],
|
|
5485
5589
|
messages: {
|
|
@@ -5697,7 +5801,7 @@ function primitiveKind(type, native, allowLiterals) {
|
|
|
5697
5801
|
}
|
|
5698
5802
|
|
|
5699
5803
|
// src/rules/no-cors-wildcard-with-credentials.ts
|
|
5700
|
-
var
|
|
5804
|
+
var NAME21 = "no-cors-wildcard-with-credentials";
|
|
5701
5805
|
var ACAO_HEADER = "access-control-allow-origin";
|
|
5702
5806
|
var ACAC_HEADER = "access-control-allow-credentials";
|
|
5703
5807
|
var HEADER_METHODS = /* @__PURE__ */ new Set(["set", "setHeader", "append", "delete", "removeHeader"]);
|
|
@@ -5730,7 +5834,7 @@ var no_cors_wildcard_with_credentials_default = defineRule({
|
|
|
5730
5834
|
type: "problem",
|
|
5731
5835
|
docs: {
|
|
5732
5836
|
description: "Review wildcard CORS origins combined with an explicit credentials opt-in.",
|
|
5733
|
-
url: docsUrl(
|
|
5837
|
+
url: docsUrl(NAME21)
|
|
5734
5838
|
},
|
|
5735
5839
|
schema: [],
|
|
5736
5840
|
messages: {
|
|
@@ -6118,7 +6222,7 @@ function isAuthSecretName(identifier) {
|
|
|
6118
6222
|
}
|
|
6119
6223
|
|
|
6120
6224
|
// src/rules/no-credential-in-browser-storage.ts
|
|
6121
|
-
var
|
|
6225
|
+
var NAME22 = "no-credential-in-browser-storage";
|
|
6122
6226
|
var STORAGE_NAMES = /* @__PURE__ */ new Set(["localStorage", "sessionStorage"]);
|
|
6123
6227
|
var METADATA_WORDS = /* @__PURE__ */ new Set(["page", "cursor", "next", "hint", "expires", "expiry", "expiration"]);
|
|
6124
6228
|
var GLOBAL_OBJECTS = /* @__PURE__ */ new Set(["window", "globalThis", "self"]);
|
|
@@ -6127,7 +6231,7 @@ var no_credential_in_browser_storage_default = defineRule({
|
|
|
6127
6231
|
type: "problem",
|
|
6128
6232
|
docs: {
|
|
6129
6233
|
description: "Do not write credential-named values to browser storage or script-readable cookies.",
|
|
6130
|
-
url: docsUrl(
|
|
6234
|
+
url: docsUrl(NAME22)
|
|
6131
6235
|
},
|
|
6132
6236
|
schema: [],
|
|
6133
6237
|
messages: {
|
|
@@ -6263,7 +6367,7 @@ function canAutofixNextConfigLiteral(sourceCode2) {
|
|
|
6263
6367
|
}
|
|
6264
6368
|
|
|
6265
6369
|
// src/rules/no-dangerously-allow-svg.ts
|
|
6266
|
-
var
|
|
6370
|
+
var NAME23 = "no-dangerously-allow-svg";
|
|
6267
6371
|
var NEXT_CONFIG_RE = /(?:^|\/)next\.config\.[cm]?[jt]s$/;
|
|
6268
6372
|
function literalString(node) {
|
|
6269
6373
|
if (node?.value.type === "Literal" && typeof node.value.value === "string") return node.value.value;
|
|
@@ -6287,7 +6391,7 @@ var no_dangerously_allow_svg_default = defineRule({
|
|
|
6287
6391
|
meta: {
|
|
6288
6392
|
type: "problem",
|
|
6289
6393
|
fixable: "code",
|
|
6290
|
-
docs: { description: "Require an explicit hardening policy for Next Image SVG delivery", url: docsUrl(
|
|
6394
|
+
docs: { description: "Require an explicit hardening policy for Next Image SVG delivery", url: docsUrl(NAME23) },
|
|
6291
6395
|
schema: [],
|
|
6292
6396
|
messages: {
|
|
6293
6397
|
noDangerouslyAllowSvg: "SVG opt-in requires a recognized explicit script-blocking sandbox CSP and attachment disposition under this policy."
|
|
@@ -6761,7 +6865,7 @@ var no_detached_global_fetch_default = defineRule({
|
|
|
6761
6865
|
});
|
|
6762
6866
|
|
|
6763
6867
|
// src/rules/no-discarded-validation-result.ts
|
|
6764
|
-
var
|
|
6868
|
+
var NAME24 = "no-discarded-validation-result";
|
|
6765
6869
|
var CHANGING = /* @__PURE__ */ new Set(["transform", "default", "prefault", "catch", "coerce", "trim", "toLowerCase", "toUpperCase", "normalize", "preprocess"]);
|
|
6766
6870
|
var VALIDATION_METHODS = /* @__PURE__ */ new Set(["parse", "parseAsync", "safeParse", "safeParseAsync"]);
|
|
6767
6871
|
var no_discarded_validation_result_default = defineRule({
|
|
@@ -6769,7 +6873,7 @@ var no_discarded_validation_result_default = defineRule({
|
|
|
6769
6873
|
type: "problem",
|
|
6770
6874
|
docs: {
|
|
6771
6875
|
description: "Consume Zod validation outcomes and transformed outputs instead of discarding them.",
|
|
6772
|
-
url: docsUrl(
|
|
6876
|
+
url: docsUrl(NAME24)
|
|
6773
6877
|
},
|
|
6774
6878
|
schema: [],
|
|
6775
6879
|
messages: { discarded: "Consume this validation result; its outcome or transformed value is currently discarded." }
|
|
@@ -6846,7 +6950,7 @@ function zodValueImport(definition) {
|
|
|
6846
6950
|
}
|
|
6847
6951
|
|
|
6848
6952
|
// src/rules/no-duplicate-lifecycle-refresh-listeners.ts
|
|
6849
|
-
var
|
|
6953
|
+
var NAME25 = "no-duplicate-lifecycle-refresh-listeners";
|
|
6850
6954
|
var ROUTER_MODULE = "next/navigation";
|
|
6851
6955
|
var RECEIVER_EVENTS = /* @__PURE__ */ new Map([["window", "focus"], ["document", "visibilitychange"]]);
|
|
6852
6956
|
function importsRouterHook(body3) {
|
|
@@ -6881,7 +6985,7 @@ var no_duplicate_lifecycle_refresh_listeners_default = defineRule({
|
|
|
6881
6985
|
type: "suggestion",
|
|
6882
6986
|
docs: {
|
|
6883
6987
|
description: "Do not register one Next.js route-refresh callback for both focus and visibilitychange.",
|
|
6884
|
-
url: docsUrl(
|
|
6988
|
+
url: docsUrl(NAME25)
|
|
6885
6989
|
},
|
|
6886
6990
|
schema: [],
|
|
6887
6991
|
messages: {
|
|
@@ -7006,7 +7110,7 @@ var no_duplicate_lifecycle_refresh_listeners_default = defineRule({
|
|
|
7006
7110
|
});
|
|
7007
7111
|
|
|
7008
7112
|
// src/rules/no-duplicate-test-case.ts
|
|
7009
|
-
var
|
|
7113
|
+
var NAME26 = "no-duplicate-test-case";
|
|
7010
7114
|
var TEST_MODULES = /* @__PURE__ */ new Set(["vitest", "@jest/globals", "bun:test"]);
|
|
7011
7115
|
var TEST_NAMES2 = /* @__PURE__ */ new Set(["it", "test"]);
|
|
7012
7116
|
var MODIFIERS = /* @__PURE__ */ new Set(["only", "skip", "concurrent", "sequential", "fails", "failing", "todo"]);
|
|
@@ -7084,7 +7188,7 @@ function objectKey(node) {
|
|
|
7084
7188
|
var no_duplicate_test_case_default = defineRule({
|
|
7085
7189
|
meta: {
|
|
7086
7190
|
type: "suggestion",
|
|
7087
|
-
docs: { description: "Report repeated literal rows in framework each tables and Vitest for tables.", url: docsUrl(
|
|
7191
|
+
docs: { description: "Report repeated literal rows in framework each tables and Vitest for tables.", url: docsUrl(NAME26) },
|
|
7088
7192
|
schema: [],
|
|
7089
7193
|
messages: { duplicateCase: "This literal row repeats case {{first}} with the same inputs and expected values. Remove the accidental copy or add the intended distinct boundary; preserve intentional repetition explicitly." }
|
|
7090
7194
|
},
|
|
@@ -7358,7 +7462,7 @@ function isDiscardedSqlText(node) {
|
|
|
7358
7462
|
}
|
|
7359
7463
|
|
|
7360
7464
|
// src/rules/no-dynamic-sql.ts
|
|
7361
|
-
var
|
|
7465
|
+
var NAME27 = "no-dynamic-sql";
|
|
7362
7466
|
var DEFAULT_METHODS = ["prepare", "exec", "query"];
|
|
7363
7467
|
var CONSTANT_CASE_RE = /^[A-Z][A-Z0-9_]*$/;
|
|
7364
7468
|
function runtimeInterpolations(template) {
|
|
@@ -7455,7 +7559,7 @@ var no_dynamic_sql_default = defineRule({
|
|
|
7455
7559
|
type: "problem",
|
|
7456
7560
|
docs: {
|
|
7457
7561
|
description: "Disallow runtime values and fragments interpolated into SQL passed to statement-execution methods.",
|
|
7458
|
-
url: docsUrl(
|
|
7562
|
+
url: docsUrl(NAME27)
|
|
7459
7563
|
},
|
|
7460
7564
|
schema: [
|
|
7461
7565
|
{
|
|
@@ -7510,7 +7614,7 @@ var no_dynamic_sql_default = defineRule({
|
|
|
7510
7614
|
});
|
|
7511
7615
|
|
|
7512
7616
|
// src/rules/no-enum.ts
|
|
7513
|
-
var
|
|
7617
|
+
var NAME28 = "no-enum";
|
|
7514
7618
|
var no_enum_default = defineRule({
|
|
7515
7619
|
meta: {
|
|
7516
7620
|
defaultOptions: [{}],
|
|
@@ -7518,7 +7622,7 @@ var no_enum_default = defineRule({
|
|
|
7518
7622
|
fixable: "code",
|
|
7519
7623
|
docs: {
|
|
7520
7624
|
description: "Disallow TypeScript `enum`; use string-literal unions or `as const` objects instead.",
|
|
7521
|
-
url: docsUrl(
|
|
7625
|
+
url: docsUrl(NAME28)
|
|
7522
7626
|
},
|
|
7523
7627
|
schema: [
|
|
7524
7628
|
{
|
|
@@ -8531,7 +8635,7 @@ function transfers(node, sourceCode2) {
|
|
|
8531
8635
|
}
|
|
8532
8636
|
|
|
8533
8637
|
// src/rules/no-exception-text-in-5xx-response.ts
|
|
8534
|
-
var
|
|
8638
|
+
var NAME29 = "no-exception-text-in-5xx-response";
|
|
8535
8639
|
function nextResponseLocals(program) {
|
|
8536
8640
|
return program.body.flatMap((statement) => statement.type === "ImportDeclaration" && statement.source.value === "next/server" ? statement.specifiers.flatMap((specifier) => specifier.type === "ImportSpecifier" && specifier.imported.type === "Identifier" && specifier.imported.name === "NextResponse" ? [specifier.local.name] : []) : []);
|
|
8537
8641
|
}
|
|
@@ -8553,7 +8657,7 @@ var no_exception_text_in_5xx_response_default = defineRule({
|
|
|
8553
8657
|
type: "problem",
|
|
8554
8658
|
docs: {
|
|
8555
8659
|
description: "Keep caught exception messages and stacks out of returned 5xx JSON responses and Server Action results.",
|
|
8556
|
-
url: docsUrl(
|
|
8660
|
+
url: docsUrl(NAME29)
|
|
8557
8661
|
},
|
|
8558
8662
|
schema: [],
|
|
8559
8663
|
messages: {
|
|
@@ -9470,7 +9574,7 @@ function directCalls(binding3, arity) {
|
|
|
9470
9574
|
}
|
|
9471
9575
|
|
|
9472
9576
|
// src/rules/no-excess-jsx-props.ts
|
|
9473
|
-
var
|
|
9577
|
+
var NAME30 = "no-excess-jsx-props";
|
|
9474
9578
|
var RESERVED_PROPS = /* @__PURE__ */ new Set(["key", "ref", "__self", "__source"]);
|
|
9475
9579
|
var JSX_DIRECTIVE = /@jsx(?:ImportSource|Runtime|Frag)?(?:\s|$)/iu;
|
|
9476
9580
|
var MAX_VALUE_DEPTH = 64;
|
|
@@ -9792,7 +9896,7 @@ function closedObjectType(native) {
|
|
|
9792
9896
|
var no_excess_jsx_props_default = defineRule({
|
|
9793
9897
|
meta: {
|
|
9794
9898
|
type: "suggestion",
|
|
9795
|
-
docs: { description: "Report statically known fields spread outside a resolved component props contract.", url: docsUrl(
|
|
9899
|
+
docs: { description: "Report statically known fields spread outside a resolved component props contract.", url: docsUrl(NAME30) },
|
|
9796
9900
|
schema: [],
|
|
9797
9901
|
messages: {
|
|
9798
9902
|
excess: "This spread forwards fields outside the receiving component's declared contract: {{fields}}. Forward the needed fields explicitly or review the contract; an annotation alone does not remove runtime fields."
|
|
@@ -9872,7 +9976,7 @@ var no_excess_jsx_props_default = defineRule({
|
|
|
9872
9976
|
});
|
|
9873
9977
|
|
|
9874
9978
|
// src/rules/no-excessive-cognitive-complexity.ts
|
|
9875
|
-
var
|
|
9979
|
+
var NAME31 = "no-excessive-cognitive-complexity";
|
|
9876
9980
|
var SEPARATELY_SCORED = /* @__PURE__ */ new Set([
|
|
9877
9981
|
"FunctionDeclaration",
|
|
9878
9982
|
"FunctionExpression",
|
|
@@ -9991,7 +10095,7 @@ var no_excessive_cognitive_complexity_default = defineRule({
|
|
|
9991
10095
|
type: "suggestion",
|
|
9992
10096
|
docs: {
|
|
9993
10097
|
description: `Report an error for function bodies with cognitive complexity above ${ERROR_COMPLEXITY}.`,
|
|
9994
|
-
url: docsUrl(
|
|
10098
|
+
url: docsUrl(NAME31)
|
|
9995
10099
|
},
|
|
9996
10100
|
schema: [],
|
|
9997
10101
|
defaultOptions: [],
|
|
@@ -10021,13 +10125,13 @@ var no_excessive_cognitive_complexity_default = defineRule({
|
|
|
10021
10125
|
});
|
|
10022
10126
|
|
|
10023
10127
|
// src/rules/no-explicit-type-predicate.ts
|
|
10024
|
-
var
|
|
10128
|
+
var NAME32 = "no-explicit-type-predicate";
|
|
10025
10129
|
var no_explicit_type_predicate_default = defineRule({
|
|
10026
10130
|
meta: {
|
|
10027
10131
|
type: "suggestion",
|
|
10028
10132
|
docs: {
|
|
10029
10133
|
description: "Use compiler-checked narrowing instead of handwritten type predicates.",
|
|
10030
|
-
url: docsUrl(
|
|
10134
|
+
url: docsUrl(NAME32)
|
|
10031
10135
|
},
|
|
10032
10136
|
schema: [],
|
|
10033
10137
|
messages: { noExplicitTypePredicate: "Replace this handwritten type predicate with a direct discriminator check or compiler-inferred narrowing. Parse unknown data with a schema and consume the validated result; preserve required external callable contracts." }
|
|
@@ -10046,7 +10150,7 @@ var no_explicit_type_predicate_default = defineRule({
|
|
|
10046
10150
|
});
|
|
10047
10151
|
|
|
10048
10152
|
// src/rules/no-fat-try-blocks.ts
|
|
10049
|
-
var
|
|
10153
|
+
var NAME33 = "no-fat-try-blocks";
|
|
10050
10154
|
var MAX_TRY_BODY_STATEMENTS = 3;
|
|
10051
10155
|
var NESTED_FUNCTION_TYPES = /* @__PURE__ */ new Set([
|
|
10052
10156
|
"FunctionDeclaration",
|
|
@@ -10382,7 +10486,7 @@ var no_fat_try_blocks_default = defineRule({
|
|
|
10382
10486
|
type: "problem",
|
|
10383
10487
|
docs: {
|
|
10384
10488
|
description: "Review try blocks exceeding the configured count of syntactically selected operations.",
|
|
10385
|
-
url: docsUrl(
|
|
10489
|
+
url: docsUrl(NAME33)
|
|
10386
10490
|
},
|
|
10387
10491
|
schema: [
|
|
10388
10492
|
{
|
|
@@ -10437,7 +10541,7 @@ var no_fat_try_blocks_default = defineRule({
|
|
|
10437
10541
|
});
|
|
10438
10542
|
|
|
10439
10543
|
// src/rules/no-first-party-module-mock.ts
|
|
10440
|
-
var
|
|
10544
|
+
var NAME34 = "no-first-party-module-mock";
|
|
10441
10545
|
var MOCK_METHODS = /* @__PURE__ */ new Set(["mock", "doMock", "unstable_mockModule"]);
|
|
10442
10546
|
function isFirstParty(source, prefixes) {
|
|
10443
10547
|
return source.startsWith("./") || source.startsWith("../") || prefixes.some((prefix) => source.startsWith(prefix));
|
|
@@ -10455,7 +10559,7 @@ var no_first_party_module_mock_default = defineRule({
|
|
|
10455
10559
|
meta: {
|
|
10456
10560
|
defaultOptions: [{ additionalModulePrefixes: [] }],
|
|
10457
10561
|
type: "problem",
|
|
10458
|
-
docs: { description: "Prefer injected collaborators over mocking maintained first-party modules in tests.", url: docsUrl(
|
|
10562
|
+
docs: { description: "Prefer injected collaborators over mocking maintained first-party modules in tests.", url: docsUrl(NAME34) },
|
|
10459
10563
|
schema: [{ type: "object", additionalProperties: false, properties: { additionalModulePrefixes: { description: "Additional maintained module prefixes that tests must not mock.", type: "array", items: { type: "string", minLength: 1 }, uniqueItems: true } } }],
|
|
10460
10564
|
messages: { noFirstPartyModuleMock: "This test replaces the maintained module `{{module}}`. Inject a narrow collaborator or test the real module; suppress locally only when module lookup or bootstrap behavior is the contract." }
|
|
10461
10565
|
},
|
|
@@ -10786,7 +10890,7 @@ function abrupt(node) {
|
|
|
10786
10890
|
}
|
|
10787
10891
|
|
|
10788
10892
|
// src/rules/no-generic-json-parser.ts
|
|
10789
|
-
var
|
|
10893
|
+
var NAME35 = "no-generic-json-parser";
|
|
10790
10894
|
var OPEN_FACTORIES = /* @__PURE__ */ new Set(["any", "unknown", "json", "record", "partialRecord"]);
|
|
10791
10895
|
var WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish", "default", "catch", "readonly", "brand", "describe", "meta"]);
|
|
10792
10896
|
var PARSE_METHODS = /* @__PURE__ */ new Set(["parse", "parseAsync", "safeParse", "safeParseAsync"]);
|
|
@@ -10797,7 +10901,7 @@ var no_generic_json_parser_default = defineRule({
|
|
|
10797
10901
|
type: "suggestion",
|
|
10798
10902
|
docs: {
|
|
10799
10903
|
description: "Parse known JSON fields with an object schema instead of an open JSON or record parser.",
|
|
10800
|
-
url: docsUrl(
|
|
10904
|
+
url: docsUrl(NAME35)
|
|
10801
10905
|
},
|
|
10802
10906
|
schema: [],
|
|
10803
10907
|
messages: { genericParser: "The generic parser does not declare `{{field}}`; parse a focused object schema for the fields this code reads." }
|
|
@@ -11177,7 +11281,7 @@ function memberPropertyName(node) {
|
|
|
11177
11281
|
}
|
|
11178
11282
|
|
|
11179
11283
|
// src/rules/no-generic-single-export-module.ts
|
|
11180
|
-
var
|
|
11284
|
+
var NAME36 = "no-generic-single-export-module";
|
|
11181
11285
|
function fileParts(filename) {
|
|
11182
11286
|
const base = filename.replaceAll("\\", "/").split("/").at(-1) ?? "";
|
|
11183
11287
|
const extension = base.match(/(\.[cm]?[jt]sx?)$/u)?.[1] ?? ".ts";
|
|
@@ -11193,7 +11297,7 @@ var no_generic_single_export_module_default = defineRule({
|
|
|
11193
11297
|
type: "suggestion",
|
|
11194
11298
|
docs: {
|
|
11195
11299
|
description: "Disallow generic module stems when one runtime export already names the responsibility.",
|
|
11196
|
-
url: docsUrl(
|
|
11300
|
+
url: docsUrl(NAME36)
|
|
11197
11301
|
},
|
|
11198
11302
|
schema: [],
|
|
11199
11303
|
messages: {
|
|
@@ -11348,7 +11452,7 @@ var no_growing_array_spread_in_loop_default = defineRule({
|
|
|
11348
11452
|
});
|
|
11349
11453
|
|
|
11350
11454
|
// src/rules/no-hand-rolled-sleep.ts
|
|
11351
|
-
var
|
|
11455
|
+
var NAME37 = "no-hand-rolled-sleep";
|
|
11352
11456
|
var GLOBAL_OBJECTS3 = /* @__PURE__ */ new Set([
|
|
11353
11457
|
"globalThis",
|
|
11354
11458
|
"window",
|
|
@@ -11410,7 +11514,7 @@ var no_hand_rolled_sleep_default = defineRule({
|
|
|
11410
11514
|
type: "problem",
|
|
11411
11515
|
docs: {
|
|
11412
11516
|
description: "Disallow uncancellable promisified timers and timeout arms.",
|
|
11413
|
-
url: docsUrl(
|
|
11517
|
+
url: docsUrl(NAME37)
|
|
11414
11518
|
},
|
|
11415
11519
|
schema: [
|
|
11416
11520
|
{
|
|
@@ -11548,7 +11652,7 @@ var tailwindBase = (token) => token.slice(tailwindVariantPrefix(token).length).r
|
|
|
11548
11652
|
var classTokens = (value) => value.split(/\s+/).filter(Boolean);
|
|
11549
11653
|
|
|
11550
11654
|
// src/rules/no-hand-rolled-spinner.ts
|
|
11551
|
-
var
|
|
11655
|
+
var NAME38 = "no-hand-rolled-spinner";
|
|
11552
11656
|
var DESIGN_SYSTEM_PATH = /(?:^|[/\\])components[/\\]ui[/\\]/u;
|
|
11553
11657
|
var DIRECTIONAL_BORDER = /^border-([trblsexy])-(.+)$/u;
|
|
11554
11658
|
var CSS_LENGTH = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:cap|ch|cm|dvh|dvw|em|ex|ic|in|lh|lvh|lvw|mm|pc|pt|px|q|rcap|rch|rem|rex|ric|rlh|svh|svw|vb|vh|vi|vmax|vmin|vw|%)$/u;
|
|
@@ -11591,7 +11695,7 @@ var no_hand_rolled_spinner_default = defineRule({
|
|
|
11591
11695
|
type: "suggestion",
|
|
11592
11696
|
docs: {
|
|
11593
11697
|
description: "Disallow intrinsic elements styled as Tailwind border-ring spinners outside the design-system implementation.",
|
|
11594
|
-
url: docsUrl(
|
|
11698
|
+
url: docsUrl(NAME38)
|
|
11595
11699
|
},
|
|
11596
11700
|
schema: [],
|
|
11597
11701
|
messages: {
|
|
@@ -11627,7 +11731,7 @@ var no_hand_rolled_spinner_default = defineRule({
|
|
|
11627
11731
|
});
|
|
11628
11732
|
|
|
11629
11733
|
// src/rules/no-impossible-zod-literal-bounds.ts
|
|
11630
|
-
var
|
|
11734
|
+
var NAME39 = "no-impossible-zod-literal-bounds";
|
|
11631
11735
|
var KINDS = /* @__PURE__ */ new Map([
|
|
11632
11736
|
["array", "array"],
|
|
11633
11737
|
["number", "number"],
|
|
@@ -11713,7 +11817,7 @@ var no_impossible_zod_literal_bounds_default = defineRule({
|
|
|
11713
11817
|
type: "problem",
|
|
11714
11818
|
docs: {
|
|
11715
11819
|
description: "Disallow same-chain literal Zod bounds whose accepted set is mathematically empty.",
|
|
11716
|
-
url: docsUrl(
|
|
11820
|
+
url: docsUrl(NAME39)
|
|
11717
11821
|
},
|
|
11718
11822
|
schema: [
|
|
11719
11823
|
{
|
|
@@ -11920,7 +12024,7 @@ function collectionPropertyFix(sourceCode2, node) {
|
|
|
11920
12024
|
}
|
|
11921
12025
|
|
|
11922
12026
|
// src/rules/no-in-operator-on-built-in-collections.ts
|
|
11923
|
-
var
|
|
12027
|
+
var NAME40 = "no-in-operator-on-built-in-collections";
|
|
11924
12028
|
var COLLECTION_NAMES = /* @__PURE__ */ new Set([
|
|
11925
12029
|
"Map",
|
|
11926
12030
|
"ReadonlyMap",
|
|
@@ -11944,7 +12048,7 @@ var no_in_operator_on_built_in_collections_default = defineRule({
|
|
|
11944
12048
|
fixable: "code",
|
|
11945
12049
|
docs: {
|
|
11946
12050
|
description: "Do not use the `in` operator to test entries in built-in Map and Set collections.",
|
|
11947
|
-
url: docsUrl(
|
|
12051
|
+
url: docsUrl(NAME40)
|
|
11948
12052
|
},
|
|
11949
12053
|
schema: [],
|
|
11950
12054
|
messages: {
|
|
@@ -12106,7 +12210,7 @@ function isUuidRecipe(sourceCode2, node, reported) {
|
|
|
12106
12210
|
}
|
|
12107
12211
|
|
|
12108
12212
|
// src/rules/no-insecure-random-id.ts
|
|
12109
|
-
var
|
|
12213
|
+
var NAME41 = "no-insecure-random-id";
|
|
12110
12214
|
var STRONG_SECURITY_WORDS = /* @__PURE__ */ new Set([
|
|
12111
12215
|
"apikey",
|
|
12112
12216
|
"csrf",
|
|
@@ -12188,7 +12292,7 @@ var no_insecure_random_id_default = defineRule({
|
|
|
12188
12292
|
type: "problem",
|
|
12189
12293
|
docs: {
|
|
12190
12294
|
description: "Disallow using `Math.random()` to generate identifiers, tokens, or secrets; use `crypto.randomUUID()` or `crypto.getRandomValues(...)` instead.",
|
|
12191
|
-
url: docsUrl(
|
|
12295
|
+
url: docsUrl(NAME41)
|
|
12192
12296
|
},
|
|
12193
12297
|
fixable: "code",
|
|
12194
12298
|
schema: [],
|
|
@@ -12282,7 +12386,7 @@ function incompatibleWrite(file, exactOptionalPropertyTypes, call, targetNode, w
|
|
|
12282
12386
|
}
|
|
12283
12387
|
|
|
12284
12388
|
// src/rules/no-invalid-typed-mutation.ts
|
|
12285
|
-
var
|
|
12389
|
+
var NAME42 = "no-invalid-typed-mutation";
|
|
12286
12390
|
var GLOBAL_RECEIVERS2 = /* @__PURE__ */ new Set(["globalThis", "window", "self"]);
|
|
12287
12391
|
var NAMESPACE_OR_RECEIVER = /* @__PURE__ */ new Set(["Object", "Reflect", ...GLOBAL_RECEIVERS2]);
|
|
12288
12392
|
var SUPPORTED_METHODS = {
|
|
@@ -12416,7 +12520,7 @@ var no_invalid_typed_mutation_default = defineRule({
|
|
|
12416
12520
|
type: "problem",
|
|
12417
12521
|
docs: {
|
|
12418
12522
|
description: "Keep native object mutation APIs from writing incompatible values into declared property types.",
|
|
12419
|
-
url: docsUrl(
|
|
12523
|
+
url: docsUrl(NAME42)
|
|
12420
12524
|
},
|
|
12421
12525
|
schema: [],
|
|
12422
12526
|
messages: {
|
|
@@ -12525,8 +12629,61 @@ var no_invalid_typed_mutation_default = defineRule({
|
|
|
12525
12629
|
}
|
|
12526
12630
|
});
|
|
12527
12631
|
|
|
12632
|
+
// src/rules/no-invalid-web-resource-hints.ts
|
|
12633
|
+
var NAME43 = "no-invalid-web-resource-hints";
|
|
12634
|
+
var RESOURCE_TAGS = /* @__PURE__ */ new Set(["img", "iframe", "link", "script"]);
|
|
12635
|
+
var LAZY_TAGS = /* @__PURE__ */ new Set(["img", "iframe", "video", "audio"]);
|
|
12636
|
+
var no_invalid_web_resource_hints_default = defineRule({
|
|
12637
|
+
meta: {
|
|
12638
|
+
type: "problem",
|
|
12639
|
+
docs: {
|
|
12640
|
+
description: "Keep native resource hints consistent with browser loading and preload request modes.",
|
|
12641
|
+
url: docsUrl(NAME43)
|
|
12642
|
+
},
|
|
12643
|
+
schema: [],
|
|
12644
|
+
messages: {
|
|
12645
|
+
criticalLazy: "This image is marked high priority and lazy-loaded. Review whether it is critical and load it eagerly, or keep lazy loading and remove the priority boost.",
|
|
12646
|
+
obsoleteImportance: "The importance attribute is obsolete. Review whether fetchPriority is needed for this resource.",
|
|
12647
|
+
invalidLoading: 'loading="auto" is unsupported. Omit loading for the default eager behavior, or select lazy loading deliberately.',
|
|
12648
|
+
preloadAs: "A preload needs its resource destination in as so the browser can reuse it for the matching request.",
|
|
12649
|
+
fontCors: 'Font preloads need anonymous CORS, including same-origin fonts. Set crossOrigin="anonymous" so the preload matches the font request.'
|
|
12650
|
+
}
|
|
12651
|
+
},
|
|
12652
|
+
createOnce(context) {
|
|
12653
|
+
return {
|
|
12654
|
+
before() {
|
|
12655
|
+
if (isGeneratedFile({ filename: context.filename, cwd: context.cwd }, context.sourceCode.text))
|
|
12656
|
+
return false;
|
|
12657
|
+
},
|
|
12658
|
+
JSXOpeningElement(node) {
|
|
12659
|
+
if (node.name.type !== "JSXIdentifier") return;
|
|
12660
|
+
const tag = node.name.name;
|
|
12661
|
+
const text = (names) => attributeString(node, context.sourceCode, names);
|
|
12662
|
+
const importance = text(["importance"]);
|
|
12663
|
+
if (RESOURCE_TAGS.has(tag) && importance !== null && importance !== "")
|
|
12664
|
+
context.report({ node, messageId: "obsoleteImportance" });
|
|
12665
|
+
const loading = text(["loading"])?.toLowerCase();
|
|
12666
|
+
if (LAZY_TAGS.has(tag) && loading === "auto")
|
|
12667
|
+
context.report({ node, messageId: "invalidLoading" });
|
|
12668
|
+
if (tag === "img" && loading === "lazy" && text(["fetchPriority", "fetchpriority"])?.toLowerCase() === "high") {
|
|
12669
|
+
context.report({ node, messageId: "criticalLazy" });
|
|
12670
|
+
}
|
|
12671
|
+
if (tag !== "link" || !text(["rel"])?.toLowerCase().split(/\s+/u).includes("preload"))
|
|
12672
|
+
return;
|
|
12673
|
+
const destination = text(["as"])?.toLowerCase();
|
|
12674
|
+
if (destination === "") context.report({ node, messageId: "preloadAs" });
|
|
12675
|
+
if (destination !== "font") return;
|
|
12676
|
+
const cors = effectiveAttribute(node, ["crossOrigin", "crossorigin"]);
|
|
12677
|
+
if (cors === void 0 || text(["crossOrigin", "crossorigin"])?.toLowerCase() === "use-credentials") {
|
|
12678
|
+
context.report({ node, messageId: "fontCors" });
|
|
12679
|
+
}
|
|
12680
|
+
}
|
|
12681
|
+
};
|
|
12682
|
+
}
|
|
12683
|
+
});
|
|
12684
|
+
|
|
12528
12685
|
// src/rules/no-invalid-zod-custom-parse.ts
|
|
12529
|
-
var
|
|
12686
|
+
var NAME44 = "no-invalid-zod-custom-parse";
|
|
12530
12687
|
var ZOD_MODULES = /* @__PURE__ */ new Set(["zod", "zod/v4"]);
|
|
12531
12688
|
var DECLARATION_FILE_RE = /\.d\.(?:[cm]?ts|[^/.]+\.ts)$/;
|
|
12532
12689
|
function nativeZodDeclaration(declaration) {
|
|
@@ -12604,7 +12761,7 @@ var no_invalid_zod_custom_parse_default = defineRule({
|
|
|
12604
12761
|
type: "problem",
|
|
12605
12762
|
docs: {
|
|
12606
12763
|
description: "Do not parse an incompatible primitive literal through an unvalidated Zod custom schema.",
|
|
12607
|
-
url: docsUrl(
|
|
12764
|
+
url: docsUrl(NAME44)
|
|
12608
12765
|
},
|
|
12609
12766
|
schema: [],
|
|
12610
12767
|
messages: {
|
|
@@ -12672,7 +12829,7 @@ var no_invalid_zod_custom_parse_default = defineRule({
|
|
|
12672
12829
|
});
|
|
12673
12830
|
|
|
12674
12831
|
// src/rules/no-json-stringify-error.ts
|
|
12675
|
-
var
|
|
12832
|
+
var NAME45 = "no-json-stringify-error";
|
|
12676
12833
|
var BUILTIN_ERROR_CONSTRUCTORS = /* @__PURE__ */ new Set([
|
|
12677
12834
|
"AggregateError",
|
|
12678
12835
|
"DOMException",
|
|
@@ -13031,7 +13188,7 @@ var no_json_stringify_error_default = defineRule({
|
|
|
13031
13188
|
type: "problem",
|
|
13032
13189
|
docs: {
|
|
13033
13190
|
description: "Avoid generic JSON serialization that can omit native Error details.",
|
|
13034
|
-
url: docsUrl(
|
|
13191
|
+
url: docsUrl(NAME45)
|
|
13035
13192
|
},
|
|
13036
13193
|
schema: [],
|
|
13037
13194
|
messages: {
|
|
@@ -13191,7 +13348,7 @@ function serializedLiteral(sourceCode2, node, fields2) {
|
|
|
13191
13348
|
}
|
|
13192
13349
|
|
|
13193
13350
|
// src/rules/no-json-stringify-object-equality.ts
|
|
13194
|
-
var
|
|
13351
|
+
var NAME46 = "no-json-stringify-object-equality";
|
|
13195
13352
|
var EQUALITY_OPERATORS = /* @__PURE__ */ new Set(["!=", "!==", "==", "==="]);
|
|
13196
13353
|
function unwrapComparisonExpression(node) {
|
|
13197
13354
|
let current = unwrapExpression(node);
|
|
@@ -13279,7 +13436,7 @@ var no_json_stringify_object_equality_default = defineRule({
|
|
|
13279
13436
|
type: "problem",
|
|
13280
13437
|
docs: {
|
|
13281
13438
|
description: "Do not use JSON serialization as structural object equality.",
|
|
13282
|
-
url: docsUrl(
|
|
13439
|
+
url: docsUrl(NAME46)
|
|
13283
13440
|
},
|
|
13284
13441
|
schema: [],
|
|
13285
13442
|
fixable: "code",
|
|
@@ -13299,13 +13456,13 @@ var no_json_stringify_object_equality_default = defineRule({
|
|
|
13299
13456
|
const nodes = pending.flatMap(({ left, right }) => [left, right]);
|
|
13300
13457
|
const types = file.typesOf(nodes);
|
|
13301
13458
|
const checker = file.checker;
|
|
13302
|
-
const
|
|
13459
|
+
const contains3 = (node, i) => {
|
|
13303
13460
|
const syntax = syntaxMayContainObject(node);
|
|
13304
13461
|
if (syntax !== null) return syntax;
|
|
13305
13462
|
const type = types[i];
|
|
13306
13463
|
return type === void 0 || typeMayContainObject(type, checker, flags);
|
|
13307
13464
|
};
|
|
13308
|
-
return pending.map(({ left, right }, i) =>
|
|
13465
|
+
return pending.map(({ left, right }, i) => contains3(left, 2 * i) || contains3(right, 2 * i + 1));
|
|
13309
13466
|
}
|
|
13310
13467
|
return {
|
|
13311
13468
|
before() {
|
|
@@ -13345,7 +13502,7 @@ var no_json_stringify_object_equality_default = defineRule({
|
|
|
13345
13502
|
});
|
|
13346
13503
|
|
|
13347
13504
|
// src/rules/no-known-value-widening.ts
|
|
13348
|
-
var
|
|
13505
|
+
var NAME47 = "no-known-value-widening";
|
|
13349
13506
|
var PROPERTIED_ANNOTATIONS = /* @__PURE__ */ new Set([
|
|
13350
13507
|
"TSAnyKeyword",
|
|
13351
13508
|
"TSArrayType",
|
|
@@ -13517,7 +13674,7 @@ var no_known_value_widening_default = defineRule({
|
|
|
13517
13674
|
fixable: "code",
|
|
13518
13675
|
docs: {
|
|
13519
13676
|
description: "Preserve a known value's contract instead of widening a local binding to unknown, object, or an unknown-valued dictionary.",
|
|
13520
|
-
url: docsUrl(
|
|
13677
|
+
url: docsUrl(NAME47)
|
|
13521
13678
|
},
|
|
13522
13679
|
schema: [],
|
|
13523
13680
|
messages: {
|
|
@@ -13707,7 +13864,7 @@ function createLogMatcher(options = {}) {
|
|
|
13707
13864
|
}
|
|
13708
13865
|
|
|
13709
13866
|
// src/rules/no-log-only-catch.ts
|
|
13710
|
-
var
|
|
13867
|
+
var NAME48 = "no-log-only-catch";
|
|
13711
13868
|
var BENCHMARK_DIR_RE = /(?:^|[\\/])benchmarks?[\\/]/;
|
|
13712
13869
|
var SINGLE_STATEMENT_HOSTS = /* @__PURE__ */ new Set([
|
|
13713
13870
|
"DoWhileStatement",
|
|
@@ -13806,7 +13963,7 @@ var no_log_only_catch_default = defineRule({
|
|
|
13806
13963
|
type: "problem",
|
|
13807
13964
|
docs: {
|
|
13808
13965
|
description: "Disallow `catch` clauses that only log (or silently do nothing) and then swallow the error; rethrow or handle it instead.",
|
|
13809
|
-
url: docsUrl(
|
|
13966
|
+
url: docsUrl(NAME48)
|
|
13810
13967
|
},
|
|
13811
13968
|
schema: [
|
|
13812
13969
|
{
|
|
@@ -13902,7 +14059,7 @@ var no_log_only_catch_default = defineRule({
|
|
|
13902
14059
|
});
|
|
13903
14060
|
|
|
13904
14061
|
// src/rules/no-logical-or-fallback.ts
|
|
13905
|
-
var
|
|
14062
|
+
var NAME49 = "no-logical-or-fallback";
|
|
13906
14063
|
var GLOBAL_RECEIVERS3 = /* @__PURE__ */ new Set(["globalThis", "window", "self"]);
|
|
13907
14064
|
var PRIMITIVE = 1;
|
|
13908
14065
|
var FALLBACK = 2;
|
|
@@ -13954,7 +14111,7 @@ var no_logical_or_fallback_default = defineRule({
|
|
|
13954
14111
|
type: "suggestion",
|
|
13955
14112
|
docs: {
|
|
13956
14113
|
description: "Use nullish defaults or explicit falsy-value checks instead of logical OR fallbacks.",
|
|
13957
|
-
url: docsUrl(
|
|
14114
|
+
url: docsUrl(NAME49)
|
|
13958
14115
|
},
|
|
13959
14116
|
schema: [],
|
|
13960
14117
|
messages: {
|
|
@@ -14050,7 +14207,7 @@ var no_logical_or_fallback_default = defineRule({
|
|
|
14050
14207
|
});
|
|
14051
14208
|
|
|
14052
14209
|
// src/rules/no-long-comment.ts
|
|
14053
|
-
var
|
|
14210
|
+
var NAME50 = "no-long-comment";
|
|
14054
14211
|
var EXCESSIVE_SENTENCE_COUNT = 8;
|
|
14055
14212
|
var EXCESSIVE_WORD_COUNT = 120;
|
|
14056
14213
|
var PROSE_WORD_RE = /[\p{L}\p{N}][\p{L}\p{N}'’-]*/gu;
|
|
@@ -14082,7 +14239,7 @@ var no_long_comment_default = defineRule({
|
|
|
14082
14239
|
fixable: "code",
|
|
14083
14240
|
docs: {
|
|
14084
14241
|
description: "Flag unusually large unstructured JSDoc blocks in implementation code.",
|
|
14085
|
-
url: docsUrl(
|
|
14242
|
+
url: docsUrl(NAME50)
|
|
14086
14243
|
},
|
|
14087
14244
|
schema: [],
|
|
14088
14245
|
messages: {
|
|
@@ -14107,6 +14264,69 @@ var no_long_comment_default = defineRule({
|
|
|
14107
14264
|
}
|
|
14108
14265
|
});
|
|
14109
14266
|
|
|
14267
|
+
// src/rules/no-message-origin-string-matching.ts
|
|
14268
|
+
var NAME51 = "no-message-origin-string-matching";
|
|
14269
|
+
var GLOBALS = /* @__PURE__ */ new Set(["window", "self", "globalThis"]);
|
|
14270
|
+
var STRING_MATCHERS = /* @__PURE__ */ new Set(["startsWith", "endsWith", "includes"]);
|
|
14271
|
+
var no_message_origin_string_matching_default = defineRule({
|
|
14272
|
+
meta: {
|
|
14273
|
+
type: "problem",
|
|
14274
|
+
docs: {
|
|
14275
|
+
description: "Compare incoming browser message origins against exact trusted origins.",
|
|
14276
|
+
url: docsUrl(NAME51)
|
|
14277
|
+
},
|
|
14278
|
+
schema: [],
|
|
14279
|
+
messages: {
|
|
14280
|
+
originMatch: "A prefix, suffix or substring match does not establish a trusted message origin. Compare exact allowlisted origins, or parse the origin and validate the intended scheme, host and port."
|
|
14281
|
+
}
|
|
14282
|
+
},
|
|
14283
|
+
createOnce(context) {
|
|
14284
|
+
let events;
|
|
14285
|
+
return {
|
|
14286
|
+
before() {
|
|
14287
|
+
events = /* @__PURE__ */ new Set();
|
|
14288
|
+
if (isGeneratedFile({ filename: context.filename, cwd: context.cwd }, context.sourceCode.text))
|
|
14289
|
+
return false;
|
|
14290
|
+
},
|
|
14291
|
+
CallExpression(node) {
|
|
14292
|
+
const source = context.sourceCode;
|
|
14293
|
+
const event = messageParameter(node, source);
|
|
14294
|
+
if (event !== null) events.add(event);
|
|
14295
|
+
const callee = unwrapExpression(node.callee);
|
|
14296
|
+
if (callee.type !== "MemberExpression" || !STRING_MATCHERS.has(getPropertyName(callee) ?? ""))
|
|
14297
|
+
return;
|
|
14298
|
+
const origin = unwrapExpression(callee.object);
|
|
14299
|
+
if (origin.type !== "MemberExpression" || getPropertyName(origin) !== "origin") return;
|
|
14300
|
+
const receiver = unwrapExpression(origin.object);
|
|
14301
|
+
if (receiver.type !== "Identifier") return;
|
|
14302
|
+
const binding3 = findVariable(source.getScope(receiver), receiver.name);
|
|
14303
|
+
if (binding3 !== null && events.has(binding3))
|
|
14304
|
+
context.report({ node, messageId: "originMatch" });
|
|
14305
|
+
}
|
|
14306
|
+
};
|
|
14307
|
+
}
|
|
14308
|
+
});
|
|
14309
|
+
function messageParameter(call, source) {
|
|
14310
|
+
const callee = unwrapExpression(call.callee);
|
|
14311
|
+
const ambientCall = callee.type === "Identifier" && callee.name === "addEventListener" && isAmbient(callee, source);
|
|
14312
|
+
const globalCall = callee.type === "MemberExpression" && getPropertyName(callee) === "addEventListener" && callee.object.type === "Identifier" && GLOBALS.has(callee.object.name) && isAmbient(callee.object, source);
|
|
14313
|
+
const [type, listener] = call.arguments;
|
|
14314
|
+
if (!ambientCall && !globalCall || type === void 0 || scopedStaticString(type, source) !== "message" || listener === void 0)
|
|
14315
|
+
return null;
|
|
14316
|
+
const callback = unwrapExpression(listener);
|
|
14317
|
+
if (callback.type !== "ArrowFunctionExpression" && callback.type !== "FunctionExpression")
|
|
14318
|
+
return null;
|
|
14319
|
+
if (callback.body === null) return null;
|
|
14320
|
+
const [parameter] = callback.params;
|
|
14321
|
+
if (parameter?.type !== "Identifier") return null;
|
|
14322
|
+
const binding3 = findVariable(source.getScope(callback.body), parameter.name);
|
|
14323
|
+
return binding3?.references.some((reference) => reference.isWrite()) ? null : binding3;
|
|
14324
|
+
}
|
|
14325
|
+
function isAmbient(node, source) {
|
|
14326
|
+
const binding3 = findVariable(source.getScope(node), node.name);
|
|
14327
|
+
return binding3 === null || binding3.defs.length === 0;
|
|
14328
|
+
}
|
|
14329
|
+
|
|
14110
14330
|
// src/rules/no-mutating-container-transform.ts
|
|
14111
14331
|
var MUTATORS = /* @__PURE__ */ new Set(["copyWithin", "fill", "pop", "push", "reverse", "shift", "sort", "splice", "unshift"]);
|
|
14112
14332
|
var PRIMITIVES = /* @__PURE__ */ new Set([
|
|
@@ -14306,7 +14526,7 @@ var no_mutating_container_transform_default = defineRule({
|
|
|
14306
14526
|
});
|
|
14307
14527
|
|
|
14308
14528
|
// src/rules/no-mutating-input-with-result.ts
|
|
14309
|
-
var
|
|
14529
|
+
var NAME52 = "no-mutating-input-with-result";
|
|
14310
14530
|
function command(annotation) {
|
|
14311
14531
|
if (annotation.type === "TSVoidKeyword" || annotation.type === "TSUndefinedKeyword" || annotation.type === "TSNeverKeyword") return true;
|
|
14312
14532
|
if (annotation.type === "TSTypeReference" && annotation.typeName.type === "Identifier" && annotation.typeName.name === "Promise" && annotation.typeArguments?.params.length === 1) {
|
|
@@ -14384,7 +14604,7 @@ var no_mutating_input_with_result_default = defineRule({
|
|
|
14384
14604
|
type: "suggestion",
|
|
14385
14605
|
docs: {
|
|
14386
14606
|
description: "Return replacement object values instead of writing input fields in result-returning functions.",
|
|
14387
|
-
url: docsUrl(
|
|
14607
|
+
url: docsUrl(NAME52)
|
|
14388
14608
|
},
|
|
14389
14609
|
schema: [],
|
|
14390
14610
|
messages: { inputWrite: "This result-returning function writes input `{{name}}`; return a replacement value or declare an in-place command returning void." }
|
|
@@ -14460,7 +14680,7 @@ function globalReceiver(node, sourceCode2) {
|
|
|
14460
14680
|
}
|
|
14461
14681
|
|
|
14462
14682
|
// src/rules/no-negative-only-http-status-assertion.ts
|
|
14463
|
-
var
|
|
14683
|
+
var NAME53 = "no-negative-only-http-status-assertion";
|
|
14464
14684
|
var SERVER_ERROR_MIN = 500;
|
|
14465
14685
|
var SERVER_ERROR_MAX = 599;
|
|
14466
14686
|
var HTTP_STATUS_MIN = 100;
|
|
@@ -14560,7 +14780,7 @@ var no_negative_only_http_status_assertion_default = defineRule({
|
|
|
14560
14780
|
type: "problem",
|
|
14561
14781
|
docs: {
|
|
14562
14782
|
description: "Assert the intended HTTP status instead of only excluding a server error.",
|
|
14563
|
-
url: docsUrl(
|
|
14783
|
+
url: docsUrl(NAME53)
|
|
14564
14784
|
},
|
|
14565
14785
|
schema: [],
|
|
14566
14786
|
messages: { expectedStatus: "This assertion only excludes a server error; assert the intended HTTP status for the same response." }
|
|
@@ -14585,7 +14805,7 @@ var no_negative_only_http_status_assertion_default = defineRule({
|
|
|
14585
14805
|
});
|
|
14586
14806
|
|
|
14587
14807
|
// src/rules/no-numeric-search-param-coercion.ts
|
|
14588
|
-
var
|
|
14808
|
+
var NAME54 = "no-numeric-search-param-coercion";
|
|
14589
14809
|
var GLOBAL_PARSERS = /* @__PURE__ */ new Set(["parseInt", "parseFloat", "Number"]);
|
|
14590
14810
|
var NUMBER_PARSERS = /* @__PURE__ */ new Set(["parseInt", "parseFloat"]);
|
|
14591
14811
|
var SEARCH_PARAM_TYPES = /* @__PURE__ */ new Set(["URLSearchParams", "ReadonlyURLSearchParams"]);
|
|
@@ -14626,7 +14846,7 @@ var no_numeric_search_param_coercion_default = defineRule({
|
|
|
14626
14846
|
type: "problem",
|
|
14627
14847
|
docs: {
|
|
14628
14848
|
description: "Parse numeric URL search parameters with a schema instead of parseInt or Number.",
|
|
14629
|
-
url: docsUrl(
|
|
14849
|
+
url: docsUrl(NAME54)
|
|
14630
14850
|
},
|
|
14631
14851
|
schema: [],
|
|
14632
14852
|
messages: {
|
|
@@ -14670,7 +14890,7 @@ var no_numeric_search_param_coercion_default = defineRule({
|
|
|
14670
14890
|
});
|
|
14671
14891
|
|
|
14672
14892
|
// src/rules/no-offset-pagination.ts
|
|
14673
|
-
var
|
|
14893
|
+
var NAME55 = "no-offset-pagination";
|
|
14674
14894
|
var OFFSET_PAGINATION = /\bOFFSET\s+(?:%s|%\(\w+\)s|\?\d*|:\w+|@\w+|\$\d+|\d+)/i;
|
|
14675
14895
|
var PAGINATION_CONTEXT = /\bSELECT\b[\s\S]*\bFROM\b[\s\S]*\bOFFSET\b|\bLIMIT\s+(?:%s|%\(\w+\)s|\?\d*|:\w+|@\w+|\$\d+|\d+)\s+OFFSET\b/i;
|
|
14676
14896
|
var no_offset_pagination_default = defineRule({
|
|
@@ -14678,7 +14898,7 @@ var no_offset_pagination_default = defineRule({
|
|
|
14678
14898
|
type: "problem",
|
|
14679
14899
|
docs: {
|
|
14680
14900
|
description: "Prefer keyset pagination for embedded SQL queries using OFFSET.",
|
|
14681
|
-
url: docsUrl(
|
|
14901
|
+
url: docsUrl(NAME55)
|
|
14682
14902
|
},
|
|
14683
14903
|
schema: [],
|
|
14684
14904
|
messages: {
|
|
@@ -14704,7 +14924,7 @@ var no_offset_pagination_default = defineRule({
|
|
|
14704
14924
|
});
|
|
14705
14925
|
|
|
14706
14926
|
// src/rules/no-oxlint-directive.ts
|
|
14707
|
-
var
|
|
14927
|
+
var NAME56 = "no-oxlint-directive";
|
|
14708
14928
|
var OXLINT_DIRECTIVE_RE = /^(\s*)oxlint-(disable-next-line|disable-line|disable|enable)(?=\s|$)/u;
|
|
14709
14929
|
var no_oxlint_directive_default = defineRule({
|
|
14710
14930
|
meta: {
|
|
@@ -14712,7 +14932,7 @@ var no_oxlint_directive_default = defineRule({
|
|
|
14712
14932
|
fixable: "code",
|
|
14713
14933
|
docs: {
|
|
14714
14934
|
description: "Write every suppression directive with the `eslint-*` spelling.",
|
|
14715
|
-
url: docsUrl(
|
|
14935
|
+
url: docsUrl(NAME56)
|
|
14716
14936
|
},
|
|
14717
14937
|
schema: [],
|
|
14718
14938
|
messages: {
|
|
@@ -14825,7 +15045,7 @@ function closedNamespace(namespace, initializer) {
|
|
|
14825
15045
|
}
|
|
14826
15046
|
|
|
14827
15047
|
// src/rules/no-partial-type-predicate.ts
|
|
14828
|
-
var
|
|
15048
|
+
var NAME57 = "no-partial-type-predicate";
|
|
14829
15049
|
var MAX_LENGTH_WITNESS = 256;
|
|
14830
15050
|
function predicateCandidate(node) {
|
|
14831
15051
|
const annotation = node.returnType?.typeAnnotation;
|
|
@@ -14869,7 +15089,7 @@ var no_partial_type_predicate_default = defineRule({
|
|
|
14869
15089
|
fixable: "code",
|
|
14870
15090
|
docs: {
|
|
14871
15091
|
description: "Do not give a partial primitive filter an explicit type predicate that excludes valid values in the false branch.",
|
|
14872
|
-
url: docsUrl(
|
|
15092
|
+
url: docsUrl(NAME57)
|
|
14873
15093
|
},
|
|
14874
15094
|
schema: [],
|
|
14875
15095
|
messages: { partialPredicate: "This predicate returns false for {{witness}}, which still belongs to `{{target}}`. Its false branch can therefore narrow unsafely. Use a boolean value filter or a predicate that recognizes every promised value." }
|
|
@@ -15033,6 +15253,65 @@ function showWitness(value) {
|
|
|
15033
15253
|
return `\`${JSON.stringify(value)}\``;
|
|
15034
15254
|
}
|
|
15035
15255
|
|
|
15256
|
+
// src/rules/no-password-get-form.ts
|
|
15257
|
+
var NAME58 = "no-password-get-form";
|
|
15258
|
+
var no_password_get_form_default = defineRule({
|
|
15259
|
+
meta: {
|
|
15260
|
+
type: "problem",
|
|
15261
|
+
docs: {
|
|
15262
|
+
description: "Keep named password controls out of native GET form submissions.",
|
|
15263
|
+
url: docsUrl(NAME58)
|
|
15264
|
+
},
|
|
15265
|
+
schema: [],
|
|
15266
|
+
messages: {
|
|
15267
|
+
passwordGet: "This native GET form can put a named password in the URL. Review the endpoint contract and submit credentials with POST."
|
|
15268
|
+
}
|
|
15269
|
+
},
|
|
15270
|
+
createOnce(context) {
|
|
15271
|
+
return {
|
|
15272
|
+
before() {
|
|
15273
|
+
if (isGeneratedFile({ filename: context.filename, cwd: context.cwd }, context.sourceCode.text))
|
|
15274
|
+
return false;
|
|
15275
|
+
},
|
|
15276
|
+
JSXElement(node) {
|
|
15277
|
+
const opening = node.openingElement;
|
|
15278
|
+
if (opening.name.type !== "JSXIdentifier" || opening.name.name !== "form") return;
|
|
15279
|
+
const method = attributeString(opening, context.sourceCode, ["method"])?.toLowerCase();
|
|
15280
|
+
if (method === void 0 || method === "post" || method === "dialog") return;
|
|
15281
|
+
if (attributeString(opening, context.sourceCode, ["action"]) === null || effectiveAttribute(opening, ["onSubmit", "onSubmitCapture"]) !== void 0)
|
|
15282
|
+
return;
|
|
15283
|
+
if (!hasSubmissionOverride(node) && containsPassword(node.children, context.sourceCode))
|
|
15284
|
+
context.report({ node: opening, messageId: "passwordGet" });
|
|
15285
|
+
}
|
|
15286
|
+
};
|
|
15287
|
+
}
|
|
15288
|
+
});
|
|
15289
|
+
function containsPassword(children, source) {
|
|
15290
|
+
for (const child of children) {
|
|
15291
|
+
if (child.type === "JSXFragment") {
|
|
15292
|
+
if (containsPassword(child.children, source)) return true;
|
|
15293
|
+
continue;
|
|
15294
|
+
}
|
|
15295
|
+
if (child.type !== "JSXElement" || child.openingElement.name.type !== "JSXIdentifier") continue;
|
|
15296
|
+
const opening = child.openingElement;
|
|
15297
|
+
const tag = opening.name.type === "JSXIdentifier" ? opening.name.name : "";
|
|
15298
|
+
if (!/^[a-z]/u.test(tag) || tag === "form" || tag === "fieldset" && mayHaveBooleanAttribute(opening, ["disabled"]))
|
|
15299
|
+
continue;
|
|
15300
|
+
if (tag === "input" && isSubmittedPassword(opening, source)) return true;
|
|
15301
|
+
if (containsPassword(child.children, source)) return true;
|
|
15302
|
+
}
|
|
15303
|
+
return false;
|
|
15304
|
+
}
|
|
15305
|
+
function isSubmittedPassword(opening, source) {
|
|
15306
|
+
const name = attributeString(opening, source, ["name"]);
|
|
15307
|
+
return attributeString(opening, source, ["type"])?.toLowerCase() === "password" && name !== null && name !== "" && !mayHaveBooleanAttribute(opening, ["disabled"]) && effectiveAttribute(opening, ["form"]) === void 0;
|
|
15308
|
+
}
|
|
15309
|
+
function hasSubmissionOverride(node) {
|
|
15310
|
+
if (node.type === "JSXOpeningElement" && node.name.type === "JSXIdentifier" && ["button", "input"].includes(node.name.name) && effectiveAttribute(node, ["formMethod", "formmethod", "formAction", "formaction"]) !== void 0)
|
|
15311
|
+
return true;
|
|
15312
|
+
return forEachOwnAstChild(node, hasSubmissionOverride);
|
|
15313
|
+
}
|
|
15314
|
+
|
|
15036
15315
|
// src/rules/_labeled-tuple-object-fix.ts
|
|
15037
15316
|
var UNSAFE_NAMES = /* @__PURE__ */ new Set([
|
|
15038
15317
|
"__proto__",
|
|
@@ -15135,7 +15414,7 @@ function matchingReturn(object, fields2) {
|
|
|
15135
15414
|
}
|
|
15136
15415
|
|
|
15137
15416
|
// src/rules/no-positional-tuple-return.ts
|
|
15138
|
-
var
|
|
15417
|
+
var NAME59 = "no-positional-tuple-return";
|
|
15139
15418
|
var MIN_ELEMENTS = 2;
|
|
15140
15419
|
var AWAITABLE_TYPES = /* @__PURE__ */ new Set([
|
|
15141
15420
|
"Promise",
|
|
@@ -15391,7 +15670,7 @@ var no_positional_tuple_return_default = defineRule({
|
|
|
15391
15670
|
fixable: "code",
|
|
15392
15671
|
docs: {
|
|
15393
15672
|
description: "Disallow returning a multi-field tuple from a named function; return a named object so call sites cannot mismatch slots.",
|
|
15394
|
-
url: docsUrl(
|
|
15673
|
+
url: docsUrl(NAME59)
|
|
15395
15674
|
},
|
|
15396
15675
|
schema: [],
|
|
15397
15676
|
messages: {
|
|
@@ -15523,13 +15802,13 @@ var no_positional_tuple_return_default = defineRule({
|
|
|
15523
15802
|
});
|
|
15524
15803
|
|
|
15525
15804
|
// src/rules/no-production-browser-source-maps.ts
|
|
15526
|
-
var
|
|
15805
|
+
var NAME60 = "no-production-browser-source-maps";
|
|
15527
15806
|
var NEXT_CONFIG_RE2 = /(?:^|\/)next\.config\.[cm]?[jt]s$/;
|
|
15528
15807
|
var no_production_browser_source_maps_default = defineRule({
|
|
15529
15808
|
meta: {
|
|
15530
15809
|
type: "problem",
|
|
15531
15810
|
fixable: "code",
|
|
15532
|
-
docs: { description: "Next.js production browser source maps expose application source", url: docsUrl(
|
|
15811
|
+
docs: { description: "Next.js production browser source maps expose application source", url: docsUrl(NAME60) },
|
|
15533
15812
|
schema: [],
|
|
15534
15813
|
messages: {
|
|
15535
15814
|
noProductionBrowserSourceMaps: "Do not publish production browser source maps. Upload private maps to your monitoring service instead."
|
|
@@ -15922,7 +16201,7 @@ var no_raw_env_default = defineRule({
|
|
|
15922
16201
|
});
|
|
15923
16202
|
|
|
15924
16203
|
// src/rules/no-raw-fetch-outside-clients.ts
|
|
15925
|
-
var
|
|
16204
|
+
var NAME61 = "no-raw-fetch-outside-clients";
|
|
15926
16205
|
var DEFAULT_ALLOW = [
|
|
15927
16206
|
"[\\\\/]clients?[\\\\/]",
|
|
15928
16207
|
"-client\\.[cm]?[jt]sx?$",
|
|
@@ -16049,7 +16328,7 @@ var no_raw_fetch_outside_clients_default = defineRule({
|
|
|
16049
16328
|
type: "problem",
|
|
16050
16329
|
docs: {
|
|
16051
16330
|
description: "Disallow calling the global `fetch` outside the client layer; route outbound HTTP through a client module that owns retry, timeout and status handling.",
|
|
16052
|
-
url: docsUrl(
|
|
16331
|
+
url: docsUrl(NAME61)
|
|
16053
16332
|
},
|
|
16054
16333
|
schema: [
|
|
16055
16334
|
{
|
|
@@ -16311,7 +16590,7 @@ function functionNode2(node) {
|
|
|
16311
16590
|
}
|
|
16312
16591
|
|
|
16313
16592
|
// src/rules/no-readonly-prop-state.ts
|
|
16314
|
-
var
|
|
16593
|
+
var NAME62 = "no-readonly-prop-state";
|
|
16315
16594
|
var MAX_TYPE_DEPTH = 16;
|
|
16316
16595
|
function isReadonlyUseState(source, node) {
|
|
16317
16596
|
if (node.optional || node.arguments.length !== 1 || !reactHook(source, node.callee, "useState")) return false;
|
|
@@ -16351,7 +16630,7 @@ function isPrimitiveType(native, type, depth = 0) {
|
|
|
16351
16630
|
var no_readonly_prop_state_default = defineRule({
|
|
16352
16631
|
meta: {
|
|
16353
16632
|
type: "suggestion",
|
|
16354
|
-
docs: { description: "Review props copied into state without a usable updater.", url: docsUrl(
|
|
16633
|
+
docs: { description: "Review props copied into state without a usable updater.", url: docsUrl(NAME62) },
|
|
16355
16634
|
schema: [],
|
|
16356
16635
|
messages: {
|
|
16357
16636
|
readonlyPropState: "This prop is copied into state without an observed updater. Derive it from current props, or make an intentional initial snapshot explicit; review the lifecycle before changing it."
|
|
@@ -16426,7 +16705,7 @@ function identitySpread(sourceCode2, callback) {
|
|
|
16426
16705
|
}
|
|
16427
16706
|
|
|
16428
16707
|
// src/rules/no-reduce-accumulator-copy.ts
|
|
16429
|
-
var
|
|
16708
|
+
var NAME63 = "no-reduce-accumulator-copy";
|
|
16430
16709
|
var COPY_METHODS = /* @__PURE__ */ new Set(["concat", "slice", "toSpliced", "toSorted", "toReversed", "with"]);
|
|
16431
16710
|
var REDUCE_METHODS = /* @__PURE__ */ new Set(["reduce", "reduceRight"]);
|
|
16432
16711
|
var ARRAY_INTERFACES = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
|
|
@@ -16449,7 +16728,7 @@ var no_reduce_accumulator_copy_default = defineRule({
|
|
|
16449
16728
|
fixable: "code",
|
|
16450
16729
|
docs: {
|
|
16451
16730
|
description: "Review copies of the accumulated collection inside a built-in reduce callback.",
|
|
16452
|
-
url: docsUrl(
|
|
16731
|
+
url: docsUrl(NAME63)
|
|
16453
16732
|
},
|
|
16454
16733
|
schema: [],
|
|
16455
16734
|
messages: {
|
|
@@ -16663,7 +16942,7 @@ function minimalConsumerFix(sourceCode2, annotation, removed) {
|
|
|
16663
16942
|
}
|
|
16664
16943
|
|
|
16665
16944
|
// src/rules/no-redundant-consumer-union.ts
|
|
16666
|
-
var
|
|
16945
|
+
var NAME64 = "no-redundant-consumer-union";
|
|
16667
16946
|
function scalarFields(native, type) {
|
|
16668
16947
|
const { ast, sync } = native;
|
|
16669
16948
|
if (!closedObjectContract(native, type, true)) return null;
|
|
@@ -16784,7 +17063,7 @@ var no_redundant_consumer_union_default = defineRule({
|
|
|
16784
17063
|
meta: {
|
|
16785
17064
|
type: "suggestion",
|
|
16786
17065
|
fixable: "code",
|
|
16787
|
-
docs: { description: "Keep the covering object contract in a private scalar consumer union.", url: docsUrl(
|
|
17066
|
+
docs: { description: "Keep the covering object contract in a private scalar consumer union.", url: docsUrl(NAME64) },
|
|
16788
17067
|
schema: [],
|
|
16789
17068
|
messages: {
|
|
16790
17069
|
redundant: "{{covered}} is already accepted by {{covering}} in this private scalar consumer. Review keeping the covering {{covering}} contract; preserve producer information and runtime objects."
|
|
@@ -16841,7 +17120,7 @@ var no_redundant_consumer_union_default = defineRule({
|
|
|
16841
17120
|
});
|
|
16842
17121
|
|
|
16843
17122
|
// src/rules/no-redundant-local-alias.ts
|
|
16844
|
-
var
|
|
17123
|
+
var NAME65 = "no-redundant-local-alias";
|
|
16845
17124
|
function stableSource(variable, alias) {
|
|
16846
17125
|
const definition = variable.defs[0];
|
|
16847
17126
|
if (variable.defs.length !== 1 || definition === void 0 || variable.references.some((reference) => reference.isWrite() && !reference.init)) return false;
|
|
@@ -16914,7 +17193,7 @@ var no_redundant_local_alias_default = defineRule({
|
|
|
16914
17193
|
fixable: "code",
|
|
16915
17194
|
docs: {
|
|
16916
17195
|
description: "Pass the original local into an object field instead of creating a single-use rename.",
|
|
16917
|
-
url: docsUrl(
|
|
17196
|
+
url: docsUrl(NAME65)
|
|
16918
17197
|
},
|
|
16919
17198
|
schema: [],
|
|
16920
17199
|
messages: { redundantAlias: "This alias is read only by its matching object field; pass `{{source}}` directly as `{{target}}: {{source}}`." }
|
|
@@ -16982,7 +17261,7 @@ function methodReceiver(node, method, argumentCount) {
|
|
|
16982
17261
|
}
|
|
16983
17262
|
|
|
16984
17263
|
// src/rules/no-redundant-optional-array-default.ts
|
|
16985
|
-
var
|
|
17264
|
+
var NAME66 = "no-redundant-optional-array-default";
|
|
16986
17265
|
function hasArrayFallback(node) {
|
|
16987
17266
|
const argument = node.arguments[0];
|
|
16988
17267
|
if (node.arguments.length !== 1 || argument === void 0) return false;
|
|
@@ -17002,7 +17281,7 @@ var no_redundant_optional_array_default_default = defineRule({
|
|
|
17002
17281
|
type: "problem",
|
|
17003
17282
|
docs: {
|
|
17004
17283
|
description: "Remove `.optional()` immediately inside a Zod array default.",
|
|
17005
|
-
url: docsUrl(
|
|
17284
|
+
url: docsUrl(NAME66)
|
|
17006
17285
|
},
|
|
17007
17286
|
fixable: "code",
|
|
17008
17287
|
schema: [],
|
|
@@ -17147,7 +17426,7 @@ function ownedStringReturn(sourceCode2, entry, binding3, value) {
|
|
|
17147
17426
|
}
|
|
17148
17427
|
|
|
17149
17428
|
// src/rules/no-repeated-string-literal.ts
|
|
17150
|
-
var
|
|
17429
|
+
var NAME67 = "no-repeated-string-literal";
|
|
17151
17430
|
var MIN_LENGTH = 40;
|
|
17152
17431
|
var MIN_DISTINCT_SCOPES = 2;
|
|
17153
17432
|
var PREVIEW_LENGTH = 40;
|
|
@@ -17183,7 +17462,7 @@ var no_repeated_string_literal_default = defineRule({
|
|
|
17183
17462
|
fixable: "code",
|
|
17184
17463
|
docs: {
|
|
17185
17464
|
description: "Disallow a long structured string literal repeated across functions; the copies drift when one is edited. Extract a module-level constant.",
|
|
17186
|
-
url: docsUrl(
|
|
17465
|
+
url: docsUrl(NAME67)
|
|
17187
17466
|
},
|
|
17188
17467
|
schema: [],
|
|
17189
17468
|
messages: {
|
|
@@ -17253,7 +17532,7 @@ var no_repeated_string_literal_default = defineRule({
|
|
|
17253
17532
|
});
|
|
17254
17533
|
|
|
17255
17534
|
// src/rules/no-restated-comment.ts
|
|
17256
|
-
var
|
|
17535
|
+
var NAME68 = "no-restated-comment";
|
|
17257
17536
|
var MAX_WORDS = 8;
|
|
17258
17537
|
var MIN_CONTENT_TOKENS = 2;
|
|
17259
17538
|
var DIRECTIVE_RE3 = /^(eslint\b|eslint-|sarj-noqa\b|@ts-|prettier-ignore|prettier\b|biome-|c8\b|v8\b|istanbul\b|@type\b|@vite|webpack|<reference|<amd|global\b|noinspection|todo\b|fixme\b|hack\b|xxx\b)/i;
|
|
@@ -17317,7 +17596,7 @@ var no_restated_comment_default = defineRule({
|
|
|
17317
17596
|
fixable: "code",
|
|
17318
17597
|
docs: {
|
|
17319
17598
|
description: "Flag short standalone comments that repeat the adjacent statement's identifiers.",
|
|
17320
|
-
url: docsUrl(
|
|
17599
|
+
url: docsUrl(NAME68)
|
|
17321
17600
|
},
|
|
17322
17601
|
schema: [],
|
|
17323
17602
|
messages: {
|
|
@@ -17414,7 +17693,7 @@ function isRestatableLabel(body3) {
|
|
|
17414
17693
|
}
|
|
17415
17694
|
|
|
17416
17695
|
// src/rules/no-restated-jsdoc.ts
|
|
17417
|
-
var
|
|
17696
|
+
var NAME69 = "no-restated-jsdoc";
|
|
17418
17697
|
var MODELLED_TAGS = /* @__PURE__ */ new Set([
|
|
17419
17698
|
"arg",
|
|
17420
17699
|
"argument",
|
|
@@ -17488,7 +17767,7 @@ var no_restated_jsdoc_default = defineRule({
|
|
|
17488
17767
|
fixable: "code",
|
|
17489
17768
|
docs: {
|
|
17490
17769
|
description: "Flag JSDoc prose that appears to repeat declaration names without adding behavioral information.",
|
|
17491
|
-
url: docsUrl(
|
|
17770
|
+
url: docsUrl(NAME69)
|
|
17492
17771
|
},
|
|
17493
17772
|
schema: [],
|
|
17494
17773
|
messages: {
|
|
@@ -17626,7 +17905,7 @@ function proseTokens(text) {
|
|
|
17626
17905
|
}
|
|
17627
17906
|
|
|
17628
17907
|
// src/rules/no-restricted-library-load.ts
|
|
17629
|
-
var
|
|
17908
|
+
var NAME70 = "no-restricted-library-load";
|
|
17630
17909
|
function matchesModule(source, module) {
|
|
17631
17910
|
return source === module || source.startsWith(`${module}/`);
|
|
17632
17911
|
}
|
|
@@ -17640,7 +17919,7 @@ var no_restricted_library_load_default = defineRule({
|
|
|
17640
17919
|
type: "problem",
|
|
17641
17920
|
docs: {
|
|
17642
17921
|
description: "Apply configured library restrictions to literal runtime loads and CommonJS resolution references.",
|
|
17643
|
-
url: docsUrl(
|
|
17922
|
+
url: docsUrl(NAME70)
|
|
17644
17923
|
},
|
|
17645
17924
|
schema: [
|
|
17646
17925
|
{
|
|
@@ -17724,7 +18003,7 @@ var no_restricted_library_load_default = defineRule({
|
|
|
17724
18003
|
});
|
|
17725
18004
|
|
|
17726
18005
|
// src/rules/no-return-disposed-resource.ts
|
|
17727
|
-
var
|
|
18006
|
+
var NAME71 = "no-return-disposed-resource";
|
|
17728
18007
|
function resourceOwner(source, value, seen = /* @__PURE__ */ new Set()) {
|
|
17729
18008
|
const node = unwrapExpression(value);
|
|
17730
18009
|
if (node.type !== "Identifier") return null;
|
|
@@ -17739,7 +18018,7 @@ function resourceOwner(source, value, seen = /* @__PURE__ */ new Set()) {
|
|
|
17739
18018
|
var no_return_disposed_resource_default = defineRule({
|
|
17740
18019
|
meta: {
|
|
17741
18020
|
type: "problem",
|
|
17742
|
-
docs: { description: "Do not return a resource whose using declaration disposes it before the caller receives it.", url: docsUrl(
|
|
18021
|
+
docs: { description: "Do not return a resource whose using declaration disposes it before the caller receives it.", url: docsUrl(NAME71) },
|
|
17743
18022
|
schema: [],
|
|
17744
18023
|
messages: { disposedReturn: "This using resource is disposed when its function returns; keep the consumer inside its lifetime or transfer ownership explicitly." }
|
|
17745
18024
|
},
|
|
@@ -17760,7 +18039,7 @@ var no_return_disposed_resource_default = defineRule({
|
|
|
17760
18039
|
});
|
|
17761
18040
|
|
|
17762
18041
|
// src/rules/no-router-refresh-polling.ts
|
|
17763
|
-
var
|
|
18042
|
+
var NAME72 = "no-router-refresh-polling";
|
|
17764
18043
|
function enclosingIntervalCallback(sourceCode2, node) {
|
|
17765
18044
|
for (let ancestor = parentOf(node); ancestor !== null; ancestor = parentOf(ancestor)) {
|
|
17766
18045
|
if (ancestor.type === "FunctionDeclaration") return null;
|
|
@@ -17783,7 +18062,7 @@ var no_router_refresh_polling_default = defineRule({
|
|
|
17783
18062
|
type: "suggestion",
|
|
17784
18063
|
docs: {
|
|
17785
18064
|
description: "Do not poll by calling a Next.js router's refresh method from a timer.",
|
|
17786
|
-
url: docsUrl(
|
|
18065
|
+
url: docsUrl(NAME72)
|
|
17787
18066
|
},
|
|
17788
18067
|
schema: [],
|
|
17789
18068
|
messages: { routerRefreshPolling: "Poll the named fetch or server action instead of calling router.refresh() from a timer." }
|
|
@@ -17840,14 +18119,14 @@ var no_router_refresh_polling_default = defineRule({
|
|
|
17840
18119
|
});
|
|
17841
18120
|
|
|
17842
18121
|
// src/rules/no-runtime-typeof.ts
|
|
17843
|
-
var
|
|
18122
|
+
var NAME73 = "no-runtime-typeof";
|
|
17844
18123
|
var EQUALITY_OPERATORS2 = /* @__PURE__ */ new Set(["===", "!==", "==", "!="]);
|
|
17845
18124
|
var no_runtime_typeof_default = defineRule({
|
|
17846
18125
|
meta: {
|
|
17847
18126
|
type: "suggestion",
|
|
17848
18127
|
docs: {
|
|
17849
18128
|
description: "Prefer Zod boundary schemas or discriminated unions over runtime typeof checks.",
|
|
17850
|
-
url: docsUrl(
|
|
18129
|
+
url: docsUrl(NAME73)
|
|
17851
18130
|
},
|
|
17852
18131
|
schema: [],
|
|
17853
18132
|
messages: {
|
|
@@ -17875,7 +18154,7 @@ var no_runtime_typeof_default = defineRule({
|
|
|
17875
18154
|
});
|
|
17876
18155
|
|
|
17877
18156
|
// src/rules/no-secret-in-log.ts
|
|
17878
|
-
var
|
|
18157
|
+
var NAME74 = "no-secret-in-log";
|
|
17879
18158
|
var LOG_INNOCUOUS_WORDS = /* @__PURE__ */ new Set([
|
|
17880
18159
|
...INNOCUOUS_WORDS,
|
|
17881
18160
|
"name",
|
|
@@ -18036,7 +18315,7 @@ var no_secret_in_log_default = defineRule({
|
|
|
18036
18315
|
type: "problem",
|
|
18037
18316
|
docs: {
|
|
18038
18317
|
description: "Disallow passing a secret-named value or a raw request/response blob to a logging call; both leak to log sinks. Redact or omit.",
|
|
18039
|
-
url: docsUrl(
|
|
18318
|
+
url: docsUrl(NAME74)
|
|
18040
18319
|
},
|
|
18041
18320
|
schema: [
|
|
18042
18321
|
{
|
|
@@ -18300,7 +18579,7 @@ function ownedBindings(sourceCode2, owner) {
|
|
|
18300
18579
|
}
|
|
18301
18580
|
|
|
18302
18581
|
// src/rules/no-select-star.ts
|
|
18303
|
-
var
|
|
18582
|
+
var NAME75 = "no-select-star";
|
|
18304
18583
|
var QUERY_SELECT = /\bSELECT\b/i;
|
|
18305
18584
|
var QUERY_FROM = /\bFROM\b/i;
|
|
18306
18585
|
var SQL_TOKEN = /[A-Za-z_\u0080-\u{10FFFF}][A-Za-z0-9_$\u0080-\u{10FFFF}]*|\d+(?:\.\d+)?|\.[ \t\r\n\f\v]*\[(?:[^\]]|\]\])*\]|[-+*/<>=~!@#%^&|\x60?]+|[(),.;]/gu;
|
|
@@ -18430,7 +18709,7 @@ var no_select_star_default = defineRule({
|
|
|
18430
18709
|
type: "problem",
|
|
18431
18710
|
docs: {
|
|
18432
18711
|
description: "Prefer explicit column projections over SELECT * in embedded SQL.",
|
|
18433
|
-
url: docsUrl(
|
|
18712
|
+
url: docsUrl(NAME75)
|
|
18434
18713
|
},
|
|
18435
18714
|
schema: [],
|
|
18436
18715
|
fixable: "code",
|
|
@@ -18460,7 +18739,7 @@ var no_select_star_default = defineRule({
|
|
|
18460
18739
|
});
|
|
18461
18740
|
|
|
18462
18741
|
// src/rules/no-sentinel-return-on-catch.ts
|
|
18463
|
-
var
|
|
18742
|
+
var NAME76 = "no-sentinel-return-on-catch";
|
|
18464
18743
|
function unwrapSentinelExpression(arg) {
|
|
18465
18744
|
let current = arg;
|
|
18466
18745
|
while (current?.type === "TSAsExpression" || current?.type === "TSTypeAssertion" || current?.type === "TSSatisfiesExpression") {
|
|
@@ -18694,7 +18973,7 @@ var no_sentinel_return_on_catch_default = defineRule({
|
|
|
18694
18973
|
type: "problem",
|
|
18695
18974
|
docs: {
|
|
18696
18975
|
description: "Disallow swallowing a caught error by returning an empty sentinel unless the error is handled or the sentinel is part of the function contract.",
|
|
18697
|
-
url: docsUrl(
|
|
18976
|
+
url: docsUrl(NAME76)
|
|
18698
18977
|
},
|
|
18699
18978
|
schema: [
|
|
18700
18979
|
{
|
|
@@ -18810,7 +19089,7 @@ var no_server_env_in_client_component_default = defineRule({
|
|
|
18810
19089
|
});
|
|
18811
19090
|
|
|
18812
19091
|
// src/rules/no-server-file-uploads.ts
|
|
18813
|
-
var
|
|
19092
|
+
var NAME77 = "no-server-file-uploads";
|
|
18814
19093
|
function hasDirective(statements, directive2) {
|
|
18815
19094
|
for (const statement of statements) {
|
|
18816
19095
|
if (statement.type !== "ExpressionStatement" || typeof statement.directive !== "string") return false;
|
|
@@ -18838,7 +19117,7 @@ function isBufferImport(node) {
|
|
|
18838
19117
|
var no_server_file_uploads_default = defineRule({
|
|
18839
19118
|
meta: {
|
|
18840
19119
|
type: "problem",
|
|
18841
|
-
docs: { description: "Keep native File handling outside explicit server boundaries.", url: docsUrl(
|
|
19120
|
+
docs: { description: "Keep native File handling outside explicit server boundaries.", url: docsUrl(NAME77) },
|
|
18842
19121
|
schema: [],
|
|
18843
19122
|
messages: { serverFile: "Keep File handling in the browser and upload directly to object storage with an authorized signed URL; accept object keys and metadata on the server." }
|
|
18844
19123
|
},
|
|
@@ -18917,7 +19196,7 @@ var no_server_file_uploads_default = defineRule({
|
|
|
18917
19196
|
});
|
|
18918
19197
|
|
|
18919
19198
|
// src/rules/no-silent-promise-catch.ts
|
|
18920
|
-
var
|
|
19199
|
+
var NAME78 = "no-silent-promise-catch";
|
|
18921
19200
|
var BODY_PARSE_METHODS = /* @__PURE__ */ new Set([
|
|
18922
19201
|
"arrayBuffer",
|
|
18923
19202
|
"blob",
|
|
@@ -19109,7 +19388,7 @@ var no_silent_promise_catch_default = defineRule({
|
|
|
19109
19388
|
type: "problem",
|
|
19110
19389
|
docs: {
|
|
19111
19390
|
description: "Disallow `.catch()` and second-argument `.then()` handlers that silently swallow a rejection; log, rethrow, or handle the error.",
|
|
19112
|
-
url: docsUrl(
|
|
19391
|
+
url: docsUrl(NAME78)
|
|
19113
19392
|
},
|
|
19114
19393
|
schema: [],
|
|
19115
19394
|
messages: {
|
|
@@ -19150,7 +19429,7 @@ var no_silent_promise_catch_default = defineRule({
|
|
|
19150
19429
|
});
|
|
19151
19430
|
|
|
19152
19431
|
// src/rules/no-sleep-in-test-body.ts
|
|
19153
|
-
var
|
|
19432
|
+
var NAME79 = "no-sleep-in-test-body";
|
|
19154
19433
|
var SLEEP_HELPERS = /* @__PURE__ */ new Set(["sleep", "delay", "wait", "pause"]);
|
|
19155
19434
|
var TEST_CALLERS2 = /* @__PURE__ */ new Set([
|
|
19156
19435
|
"it",
|
|
@@ -19241,7 +19520,7 @@ var no_sleep_in_test_body_default = defineRule({
|
|
|
19241
19520
|
type: "problem",
|
|
19242
19521
|
docs: {
|
|
19243
19522
|
description: "Avoid fixed timed sleeps directly in test bodies; synchronize on observable behavior or use controlled timers.",
|
|
19244
|
-
url: docsUrl(
|
|
19523
|
+
url: docsUrl(NAME79)
|
|
19245
19524
|
},
|
|
19246
19525
|
schema: [],
|
|
19247
19526
|
messages: {
|
|
@@ -19285,7 +19564,7 @@ var no_sleep_in_test_body_default = defineRule({
|
|
|
19285
19564
|
});
|
|
19286
19565
|
|
|
19287
19566
|
// src/rules/no-storage-in-stateless-modules.ts
|
|
19288
|
-
var
|
|
19567
|
+
var NAME80 = "no-storage-in-stateless-modules";
|
|
19289
19568
|
var DEFAULT_METHODS2 = [
|
|
19290
19569
|
"prepare",
|
|
19291
19570
|
"put",
|
|
@@ -19357,7 +19636,7 @@ var no_storage_in_stateless_modules_default = defineRule({
|
|
|
19357
19636
|
type: "problem",
|
|
19358
19637
|
docs: {
|
|
19359
19638
|
description: "Disallow SQL or key/value access inside configured stateless modules; derive state from a system of record instead.",
|
|
19360
|
-
url: docsUrl(
|
|
19639
|
+
url: docsUrl(NAME80)
|
|
19361
19640
|
},
|
|
19362
19641
|
schema: [
|
|
19363
19642
|
{
|
|
@@ -19462,7 +19741,7 @@ function named2(node, name) {
|
|
|
19462
19741
|
}
|
|
19463
19742
|
|
|
19464
19743
|
// src/rules/no-string-concat-in-loop.ts
|
|
19465
|
-
var
|
|
19744
|
+
var NAME81 = "no-string-concat-in-loop";
|
|
19466
19745
|
var LOOP_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
19467
19746
|
"ForStatement",
|
|
19468
19747
|
"ForOfStatement",
|
|
@@ -19610,7 +19889,7 @@ var no_string_concat_in_loop_default = defineRule({
|
|
|
19610
19889
|
fixable: "code",
|
|
19611
19890
|
docs: {
|
|
19612
19891
|
description: "Prefer collecting string fragments over repeatedly accumulating a growing string inside a loop.",
|
|
19613
|
-
url: docsUrl(
|
|
19892
|
+
url: docsUrl(NAME81)
|
|
19614
19893
|
},
|
|
19615
19894
|
schema: [],
|
|
19616
19895
|
messages: {
|
|
@@ -19657,7 +19936,7 @@ var no_string_concat_in_loop_default = defineRule({
|
|
|
19657
19936
|
});
|
|
19658
19937
|
|
|
19659
19938
|
// src/rules/no-tautological-expect.ts
|
|
19660
|
-
var
|
|
19939
|
+
var NAME82 = "no-tautological-expect";
|
|
19661
19940
|
var EQUALITY_MATCHERS2 = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
|
|
19662
19941
|
var ZERO_ARG_MATCHERS = /* @__PURE__ */ new Map([
|
|
19663
19942
|
["toBeDefined", (value) => value !== void 0],
|
|
@@ -19833,7 +20112,7 @@ var no_tautological_expect_default = defineRule({
|
|
|
19833
20112
|
type: "problem",
|
|
19834
20113
|
docs: {
|
|
19835
20114
|
description: "Disallow supported assertions fixed by literal setup or immutable self identity.",
|
|
19836
|
-
url: docsUrl(
|
|
20115
|
+
url: docsUrl(NAME82)
|
|
19837
20116
|
},
|
|
19838
20117
|
schema: [],
|
|
19839
20118
|
messages: {
|
|
@@ -19870,7 +20149,7 @@ var no_tautological_expect_default = defineRule({
|
|
|
19870
20149
|
});
|
|
19871
20150
|
|
|
19872
20151
|
// src/rules/no-trailing-value-narration.ts
|
|
19873
|
-
var
|
|
20152
|
+
var NAME83 = "no-trailing-value-narration";
|
|
19874
20153
|
var NUMBER_RE = /(?<![\w.])(\d+(?:\.\d+)?)(?![\w.])/g;
|
|
19875
20154
|
var WORD_RE4 = /[\p{L}\p{M}]+(?:'[\p{L}\p{M}]+)?|\d+(?:\.\d+)?/gu;
|
|
19876
20155
|
var UNIT_WORDS = /* @__PURE__ */ new Set([
|
|
@@ -19993,7 +20272,7 @@ var no_trailing_value_narration_default = defineRule({
|
|
|
19993
20272
|
fixable: "code",
|
|
19994
20273
|
docs: {
|
|
19995
20274
|
description: "Flag a trailing comment that repeats the line's numeric value only to name its unit.",
|
|
19996
|
-
url: docsUrl(
|
|
20275
|
+
url: docsUrl(NAME83)
|
|
19997
20276
|
},
|
|
19998
20277
|
schema: [],
|
|
19999
20278
|
messages: {
|
|
@@ -20209,7 +20488,7 @@ var no_type_member_comment_wall_default = defineRule({
|
|
|
20209
20488
|
});
|
|
20210
20489
|
|
|
20211
20490
|
// src/rules/no-typed-doc-sections.ts
|
|
20212
|
-
var
|
|
20491
|
+
var NAME84 = "no-typed-doc-sections";
|
|
20213
20492
|
var TYPED_TAG_RE3 = /^\s*@(arg|argument|param|return|returns|yield|yields)\b(.*)$/iu;
|
|
20214
20493
|
var PARAM_TAGS2 = /* @__PURE__ */ new Set(["arg", "argument", "param"]);
|
|
20215
20494
|
var PARAMETER_FILLER = /* @__PURE__ */ new Set([
|
|
@@ -20381,7 +20660,7 @@ var no_typed_doc_sections_default = defineRule({
|
|
|
20381
20660
|
fixable: "code",
|
|
20382
20661
|
docs: {
|
|
20383
20662
|
description: "Reject typed-signature repetition while preserving behavior that types cannot express.",
|
|
20384
|
-
url: docsUrl(
|
|
20663
|
+
url: docsUrl(NAME84)
|
|
20385
20664
|
},
|
|
20386
20665
|
schema: [],
|
|
20387
20666
|
messages: {
|
|
@@ -20743,7 +21022,7 @@ function translationExemptElement(opening, isText) {
|
|
|
20743
21022
|
}
|
|
20744
21023
|
|
|
20745
21024
|
// src/rules/no-unlocalized-jsx-attributes.ts
|
|
20746
|
-
var
|
|
21025
|
+
var NAME85 = "no-unlocalized-jsx-attributes";
|
|
20747
21026
|
var DEFAULT_ATTRIBUTES = ["title", "placeholder", "alt", "aria-label", "aria-description"];
|
|
20748
21027
|
var ID_REFERENCES = /* @__PURE__ */ new Set([
|
|
20749
21028
|
"aria-labelledby",
|
|
@@ -20763,7 +21042,7 @@ var no_unlocalized_jsx_attributes_default = defineRule({
|
|
|
20763
21042
|
type: "suggestion",
|
|
20764
21043
|
docs: {
|
|
20765
21044
|
description: "Require translation for literal user-visible JSX attributes in opted-in localized interfaces.",
|
|
20766
|
-
url: docsUrl(
|
|
21045
|
+
url: docsUrl(NAME85)
|
|
20767
21046
|
},
|
|
20768
21047
|
schema: [
|
|
20769
21048
|
{
|
|
@@ -20812,14 +21091,14 @@ var no_unlocalized_jsx_attributes_default = defineRule({
|
|
|
20812
21091
|
});
|
|
20813
21092
|
|
|
20814
21093
|
// src/rules/no-unlocalized-jsx-text.ts
|
|
20815
|
-
var
|
|
21094
|
+
var NAME86 = "no-unlocalized-jsx-text";
|
|
20816
21095
|
var no_unlocalized_jsx_text_default = defineRule({
|
|
20817
21096
|
meta: {
|
|
20818
21097
|
defaultOptions: [{ enabled: true }],
|
|
20819
21098
|
type: "suggestion",
|
|
20820
21099
|
docs: {
|
|
20821
21100
|
description: "Require translation for literal JSX text in opted-in localized interfaces.",
|
|
20822
|
-
url: docsUrl(
|
|
21101
|
+
url: docsUrl(NAME86)
|
|
20823
21102
|
},
|
|
20824
21103
|
schema: [
|
|
20825
21104
|
{
|
|
@@ -20856,7 +21135,7 @@ var no_unlocalized_jsx_text_default = defineRule({
|
|
|
20856
21135
|
});
|
|
20857
21136
|
|
|
20858
21137
|
// src/rules/no-unlocalized-toast.ts
|
|
20859
|
-
var
|
|
21138
|
+
var NAME87 = "no-unlocalized-toast";
|
|
20860
21139
|
var DEFAULT_FUNCTIONS = [
|
|
20861
21140
|
{ module: "sonner", export: "toast" },
|
|
20862
21141
|
{ module: "react-hot-toast", export: "default" }
|
|
@@ -20868,7 +21147,7 @@ var no_unlocalized_toast_default = defineRule({
|
|
|
20868
21147
|
type: "suggestion",
|
|
20869
21148
|
docs: {
|
|
20870
21149
|
description: "Require translation for literal toast messages in opted-in localized interfaces.",
|
|
20871
|
-
url: docsUrl(
|
|
21150
|
+
url: docsUrl(NAME87)
|
|
20872
21151
|
},
|
|
20873
21152
|
schema: [
|
|
20874
21153
|
{
|
|
@@ -20926,7 +21205,7 @@ var no_unlocalized_toast_default = defineRule({
|
|
|
20926
21205
|
});
|
|
20927
21206
|
|
|
20928
21207
|
// src/rules/no-unnecessary-use-client.ts
|
|
20929
|
-
var
|
|
21208
|
+
var NAME88 = "no-unnecessary-use-client";
|
|
20930
21209
|
var HOOK_REGEX = /^use([A-Z]|$)/;
|
|
20931
21210
|
var EVENT_PROP_REGEX = /^on[A-Z]/;
|
|
20932
21211
|
var ERROR_FILE_REGEX = /(?:^|[\\/])(?:global-)?error\.[jt]sx?$/;
|
|
@@ -21015,7 +21294,7 @@ var no_unnecessary_use_client_default = defineRule({
|
|
|
21015
21294
|
type: "suggestion",
|
|
21016
21295
|
docs: {
|
|
21017
21296
|
description: "Flag `'use client'` files with no hooks or event handlers \u2014 they could be RSC.",
|
|
21018
|
-
url: docsUrl(
|
|
21297
|
+
url: docsUrl(NAME88)
|
|
21019
21298
|
},
|
|
21020
21299
|
schema: [],
|
|
21021
21300
|
messages: {
|
|
@@ -21107,7 +21386,7 @@ var no_unnecessary_use_client_default = defineRule({
|
|
|
21107
21386
|
});
|
|
21108
21387
|
|
|
21109
21388
|
// src/rules/no-unsafe-mock-casting.ts
|
|
21110
|
-
var
|
|
21389
|
+
var NAME89 = "no-unsafe-mock-casting";
|
|
21111
21390
|
var MOCK_TYPE_NAMES = /* @__PURE__ */ new Set([
|
|
21112
21391
|
"Mock",
|
|
21113
21392
|
"Mocked",
|
|
@@ -21139,7 +21418,7 @@ var no_unsafe_mock_casting_default = defineRule({
|
|
|
21139
21418
|
fixable: "code",
|
|
21140
21419
|
docs: {
|
|
21141
21420
|
description: "Disallow casting to mock types like `jest.Mock` or `vi.Mock`. Use `vi.mocked()` or `jest.mocked()` instead.",
|
|
21142
|
-
url: docsUrl(
|
|
21421
|
+
url: docsUrl(NAME89)
|
|
21143
21422
|
},
|
|
21144
21423
|
schema: [],
|
|
21145
21424
|
messages: {
|
|
@@ -21200,7 +21479,7 @@ var no_unsafe_mock_casting_default = defineRule({
|
|
|
21200
21479
|
});
|
|
21201
21480
|
|
|
21202
21481
|
// src/rules/no-unsafe-test-double-cast.ts
|
|
21203
|
-
var
|
|
21482
|
+
var NAME90 = "no-unsafe-test-double-cast";
|
|
21204
21483
|
var MOCK_FACTORIES = /* @__PURE__ */ new Set(["fn", "spyOn"]);
|
|
21205
21484
|
var SIMPLE_LITERAL_TYPES = /* @__PURE__ */ new Set(["string", "number", "boolean", "bigint"]);
|
|
21206
21485
|
function containsMockFactory(node, source) {
|
|
@@ -21227,7 +21506,7 @@ var no_unsafe_test_double_cast_default = defineRule({
|
|
|
21227
21506
|
fixable: "code",
|
|
21228
21507
|
docs: {
|
|
21229
21508
|
description: "Disallow mock-backed test doubles that bypass collaborator contracts through double assertions.",
|
|
21230
|
-
url: docsUrl(
|
|
21509
|
+
url: docsUrl(NAME90)
|
|
21231
21510
|
},
|
|
21232
21511
|
schema: [],
|
|
21233
21512
|
messages: { noUnsafeTestDoubleCast: "This mock-backed partial object bypasses the collaborator contract through `unknown`. Use a narrow injected port and typed recording fake, or make the fixture satisfy the real contract." }
|
|
@@ -21273,7 +21552,7 @@ function simpleMockObject(node, sourceCode2) {
|
|
|
21273
21552
|
}
|
|
21274
21553
|
|
|
21275
21554
|
// src/rules/no-vague-suppression-description.ts
|
|
21276
|
-
var
|
|
21555
|
+
var NAME91 = "no-vague-suppression-description";
|
|
21277
21556
|
var DIRECTIVE_WITH_DESCRIPTION_RE = /^(?:eslint|oxlint)-(?:disable|disable-next-line|disable-line)\b[^:\n]*?\s*(?::|--)\s*(.+?)\s*$/iu;
|
|
21278
21557
|
var TS_EXPECT_ERROR_WITH_DESCRIPTION_RE = /^@ts-expect-error\b(?:(?:\s*(?::|--)\s*)|\s+)(.+?)\s*$/iu;
|
|
21279
21558
|
var VAGUE_RE = /^(?:needed|required|same|n\/a|legacy|intentional(?:ly)?|ignore(?:d)?|false positive|type error|typescript|to satisfy (?:the )?(?:linter|typescript|type checker))\.?$/iu;
|
|
@@ -21285,7 +21564,7 @@ var no_vague_suppression_description_default = defineRule({
|
|
|
21285
21564
|
type: "suggestion",
|
|
21286
21565
|
docs: {
|
|
21287
21566
|
description: "Require suppression descriptions to name the concrete mismatch or invariant instead of a generic non-reason.",
|
|
21288
|
-
url: docsUrl(
|
|
21567
|
+
url: docsUrl(NAME91)
|
|
21289
21568
|
},
|
|
21290
21569
|
schema: [],
|
|
21291
21570
|
messages: {
|
|
@@ -21312,7 +21591,7 @@ var no_vague_suppression_description_default = defineRule({
|
|
|
21312
21591
|
});
|
|
21313
21592
|
|
|
21314
21593
|
// src/rules/no-zod-native-enum.ts
|
|
21315
|
-
var
|
|
21594
|
+
var NAME92 = "no-zod-native-enum";
|
|
21316
21595
|
function unwrap3(node) {
|
|
21317
21596
|
if (node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression") return unwrap3(node.expression);
|
|
21318
21597
|
return node;
|
|
@@ -21331,7 +21610,7 @@ var no_zod_native_enum_default = defineRule({
|
|
|
21331
21610
|
type: "suggestion",
|
|
21332
21611
|
docs: {
|
|
21333
21612
|
description: 'Disallow `z.nativeEnum()` (and `z.enum()` over a TypeScript enum); use `z.enum(["a", "b"])` with a string-literal union instead.',
|
|
21334
|
-
url: docsUrl(
|
|
21613
|
+
url: docsUrl(NAME92)
|
|
21335
21614
|
},
|
|
21336
21615
|
schema: [],
|
|
21337
21616
|
messages: {
|
|
@@ -21430,7 +21709,7 @@ var no_zod_native_enum_default = defineRule({
|
|
|
21430
21709
|
});
|
|
21431
21710
|
|
|
21432
21711
|
// src/rules/no-zod-parse-typed-object.ts
|
|
21433
|
-
var
|
|
21712
|
+
var NAME93 = "no-zod-parse-typed-object";
|
|
21434
21713
|
var PARSE_METHODS2 = /* @__PURE__ */ new Set(["parse", "parseAsync", "safeParse", "safeParseAsync"]);
|
|
21435
21714
|
var DECLARATION_FILE3 = /\.d\.[cm]?ts$/u;
|
|
21436
21715
|
function isAssignable(env, source, target) {
|
|
@@ -21582,7 +21861,7 @@ function isZodDeclaration(signature) {
|
|
|
21582
21861
|
var no_zod_parse_typed_object_default = defineRule({
|
|
21583
21862
|
meta: {
|
|
21584
21863
|
type: "suggestion",
|
|
21585
|
-
docs: { description: "Reuse known object contracts instead of parsing them again with Zod.", url: docsUrl(
|
|
21864
|
+
docs: { description: "Reuse known object contracts instead of parsing them again with Zod.", url: docsUrl(NAME93) },
|
|
21586
21865
|
schema: [],
|
|
21587
21866
|
messages: {
|
|
21588
21867
|
typedObject: "This object already has a compatible TypeScript contract. Reuse the typed value and make defaults or normalization explicit; reserve Zod parsing for unknown boundary data."
|
|
@@ -21642,7 +21921,7 @@ var no_zod_parse_typed_object_default = defineRule({
|
|
|
21642
21921
|
});
|
|
21643
21922
|
|
|
21644
21923
|
// src/rules/prefer-await-in-async-return.ts
|
|
21645
|
-
var
|
|
21924
|
+
var NAME94 = "prefer-await-in-async-return";
|
|
21646
21925
|
function directAsyncReturnOwner(node) {
|
|
21647
21926
|
const parent = parentOf(node);
|
|
21648
21927
|
if (parent?.type === "ArrowFunctionExpression" && parent.body === node) {
|
|
@@ -21697,7 +21976,7 @@ var prefer_await_in_async_return_default = defineRule({
|
|
|
21697
21976
|
type: "suggestion",
|
|
21698
21977
|
docs: {
|
|
21699
21978
|
description: "Prefer explicit `await` for proven Promise `.then` calls; the default scope checks direct async returns.",
|
|
21700
|
-
url: docsUrl(
|
|
21979
|
+
url: docsUrl(NAME94)
|
|
21701
21980
|
},
|
|
21702
21981
|
schema: [{
|
|
21703
21982
|
type: "object",
|
|
@@ -21776,7 +22055,7 @@ var prefer_await_in_async_return_default = defineRule({
|
|
|
21776
22055
|
});
|
|
21777
22056
|
|
|
21778
22057
|
// src/rules/prefer-coded-error-result.ts
|
|
21779
|
-
var
|
|
22058
|
+
var NAME95 = "prefer-coded-error-result";
|
|
21780
22059
|
var MAX_DEPTH = 16;
|
|
21781
22060
|
var MAX_VARIANTS = 64;
|
|
21782
22061
|
var MAX_TYPE_STEPS = 256;
|
|
@@ -22257,7 +22536,7 @@ var prefer_coded_error_result_default = defineRule({
|
|
|
22257
22536
|
type: "suggestion",
|
|
22258
22537
|
docs: {
|
|
22259
22538
|
description: "Return a stable error code and typed context instead of only a rendered failure message.",
|
|
22260
|
-
url: docsUrl(
|
|
22539
|
+
url: docsUrl(NAME95)
|
|
22261
22540
|
},
|
|
22262
22541
|
schema: [],
|
|
22263
22542
|
messages: {
|
|
@@ -22318,7 +22597,7 @@ var prefer_coded_error_result_default = defineRule({
|
|
|
22318
22597
|
|
|
22319
22598
|
// src/rules/prefer-configured-cloud-scope.ts
|
|
22320
22599
|
import { URL as NativeURL } from "url";
|
|
22321
|
-
var
|
|
22600
|
+
var NAME96 = "prefer-configured-cloud-scope";
|
|
22322
22601
|
var ACCOUNT_PREFIX = "https://api.cloudflare.com/client/v4/accounts/";
|
|
22323
22602
|
var ACCOUNT_URL = /^https:\/\/api\.cloudflare\.com\/client\/v4\/accounts\/[a-fA-F\d]{32}(?=\/|[?#]|$)/u;
|
|
22324
22603
|
var GLOBAL_RECEIVERS5 = /* @__PURE__ */ new Set(["globalThis", "global", "self", "window"]);
|
|
@@ -22340,7 +22619,7 @@ var prefer_configured_cloud_scope_default = defineRule({
|
|
|
22340
22619
|
type: "suggestion",
|
|
22341
22620
|
docs: {
|
|
22342
22621
|
description: "Prefer validated deployment configuration for account scope in outgoing cloud management requests.",
|
|
22343
|
-
url: docsUrl(
|
|
22622
|
+
url: docsUrl(NAME96)
|
|
22344
22623
|
},
|
|
22345
22624
|
schema: [],
|
|
22346
22625
|
messages: {
|
|
@@ -22569,7 +22848,7 @@ var prefer_configured_cloud_scope_default = defineRule({
|
|
|
22569
22848
|
});
|
|
22570
22849
|
|
|
22571
22850
|
// src/rules/prefer-constant-time-secret-compare.ts
|
|
22572
|
-
var
|
|
22851
|
+
var NAME97 = "prefer-constant-time-secret-compare";
|
|
22573
22852
|
var EQUALITY_OPERATORS3 = /* @__PURE__ */ new Set(["===", "!==", "==", "!="]);
|
|
22574
22853
|
var AUTH_TOKEN_QUALIFIERS = /* @__PURE__ */ new Set(["access", "refresh", "session", "admin", "csrf", "xsrf", "auth", "authentication", "signing", "api"]);
|
|
22575
22854
|
var SENTINEL_IDENTIFIERS = /* @__PURE__ */ new Set(["undefined", "NaN"]);
|
|
@@ -22633,7 +22912,7 @@ var prefer_constant_time_secret_compare_default = defineRule({
|
|
|
22633
22912
|
type: "problem",
|
|
22634
22913
|
docs: {
|
|
22635
22914
|
description: "Prefer a supported constant-time comparison primitive for secret-like values.",
|
|
22636
|
-
url: docsUrl(
|
|
22915
|
+
url: docsUrl(NAME97)
|
|
22637
22916
|
},
|
|
22638
22917
|
schema: [],
|
|
22639
22918
|
messages: {
|
|
@@ -22721,7 +23000,7 @@ function constInitializer4(definition) {
|
|
|
22721
23000
|
}
|
|
22722
23001
|
|
|
22723
23002
|
// src/rules/prefer-dependency-interface.ts
|
|
22724
|
-
var
|
|
23003
|
+
var NAME98 = "prefer-dependency-interface";
|
|
22725
23004
|
function readsInterfaceMember(use, members2) {
|
|
22726
23005
|
const parent = parentOf(use);
|
|
22727
23006
|
if (parent?.type !== "MemberExpression" || parent.object !== use || !members2.has(getPropertyName(parent) ?? "")) return false;
|
|
@@ -22751,7 +23030,7 @@ var prefer_dependency_interface_default = defineRule({
|
|
|
22751
23030
|
type: "suggestion",
|
|
22752
23031
|
docs: {
|
|
22753
23032
|
description: "Annotate retained collaborators with their existing interface when the consumer uses only that contract.",
|
|
22754
|
-
url: docsUrl(
|
|
23033
|
+
url: docsUrl(NAME98)
|
|
22755
23034
|
},
|
|
22756
23035
|
schema: [],
|
|
22757
23036
|
messages: { interface: "Use the existing `{{contract}}` interface for this dependency; its consumer uses only that contract." }
|
|
@@ -23133,14 +23412,14 @@ function literalTag(node) {
|
|
|
23133
23412
|
}
|
|
23134
23413
|
|
|
23135
23414
|
// src/rules/prefer-discriminated-union.ts
|
|
23136
|
-
var
|
|
23415
|
+
var NAME99 = "prefer-discriminated-union";
|
|
23137
23416
|
var prefer_discriminated_union_default = defineRule({
|
|
23138
23417
|
meta: {
|
|
23139
23418
|
type: "suggestion",
|
|
23140
23419
|
fixable: "code",
|
|
23141
23420
|
docs: {
|
|
23142
23421
|
description: "Preserve producer-proven tag/payload and Boolean state relationships in return types.",
|
|
23143
|
-
url: docsUrl(
|
|
23422
|
+
url: docsUrl(NAME99)
|
|
23144
23423
|
},
|
|
23145
23424
|
schema: [],
|
|
23146
23425
|
messages: {
|
|
@@ -23221,7 +23500,7 @@ function privateVariantType(properties2, result, sourceCode2) {
|
|
|
23221
23500
|
}
|
|
23222
23501
|
|
|
23223
23502
|
// src/rules/prefer-ecmascript-private-members.ts
|
|
23224
|
-
var
|
|
23503
|
+
var NAME100 = "prefer-ecmascript-private-members";
|
|
23225
23504
|
function isConvertible(member3) {
|
|
23226
23505
|
return member3.accessibility === "private" && !(member3.type === "MethodDefinition" && member3.kind === "constructor") && !member3.computed && member3.key.type === "Identifier" && (member3.decorators?.length ?? 0) === 0 && !("declare" in member3 && member3.declare) && !member3.override && !(member3.type === "MethodDefinition" && (member3.value.body ?? null) === null);
|
|
23227
23506
|
}
|
|
@@ -23231,7 +23510,7 @@ var prefer_ecmascript_private_members_default = defineRule({
|
|
|
23231
23510
|
fixable: "code",
|
|
23232
23511
|
docs: {
|
|
23233
23512
|
description: "Prefer ECMAScript `#private` class members over TypeScript-only `private` members.",
|
|
23234
|
-
url: docsUrl(
|
|
23513
|
+
url: docsUrl(NAME100)
|
|
23235
23514
|
},
|
|
23236
23515
|
schema: [],
|
|
23237
23516
|
messages: {
|
|
@@ -23285,7 +23564,7 @@ var prefer_ecmascript_private_members_default = defineRule({
|
|
|
23285
23564
|
});
|
|
23286
23565
|
|
|
23287
23566
|
// src/rules/prefer-immutable-module-constant.ts
|
|
23288
|
-
var
|
|
23567
|
+
var NAME101 = "prefer-immutable-module-constant";
|
|
23289
23568
|
var CONSTANT_NAME = /^_?[A-Z][A-Z0-9_]*$/;
|
|
23290
23569
|
var JAVASCRIPT_FILE_RE = /\.[cm]?jsx?$/i;
|
|
23291
23570
|
var MUTATING_METHODS = /* @__PURE__ */ new Set([
|
|
@@ -23458,7 +23737,7 @@ var prefer_immutable_module_constant_default = defineRule({
|
|
|
23458
23737
|
fixable: "code",
|
|
23459
23738
|
docs: {
|
|
23460
23739
|
description: "Require module-level constant collections to expose readonly state.",
|
|
23461
|
-
url: docsUrl(
|
|
23740
|
+
url: docsUrl(NAME101)
|
|
23462
23741
|
},
|
|
23463
23742
|
schema: [],
|
|
23464
23743
|
defaultOptions: [],
|
|
@@ -23564,7 +23843,7 @@ function unwrapTransparentExport(node) {
|
|
|
23564
23843
|
}
|
|
23565
23844
|
|
|
23566
23845
|
// src/rules/prefer-input-group-search.ts
|
|
23567
|
-
var
|
|
23846
|
+
var NAME102 = "prefer-input-group-search";
|
|
23568
23847
|
var INPUT_MODULE = /(?:^|\/)components\/ui\/input$/u;
|
|
23569
23848
|
var INPUT_GROUP_MODULE = /(?:^|\/)components\/ui\/input-group$/u;
|
|
23570
23849
|
var MAX_JSX_DISTANCE = 2;
|
|
@@ -23635,7 +23914,7 @@ var prefer_input_group_search_default = defineRule({
|
|
|
23635
23914
|
type: "suggestion",
|
|
23636
23915
|
docs: {
|
|
23637
23916
|
description: "Require search icons and shared Input controls in the same visual wrapper to use InputGroup.",
|
|
23638
|
-
url: docsUrl(
|
|
23917
|
+
url: docsUrl(NAME102)
|
|
23639
23918
|
},
|
|
23640
23919
|
schema: [],
|
|
23641
23920
|
messages: {
|
|
@@ -23719,7 +23998,7 @@ var prefer_input_group_search_default = defineRule({
|
|
|
23719
23998
|
});
|
|
23720
23999
|
|
|
23721
24000
|
// src/rules/prefer-logical-tailwind-utilities.ts
|
|
23722
|
-
var
|
|
24001
|
+
var NAME103 = "prefer-logical-tailwind-utilities";
|
|
23723
24002
|
var PREFIXES = {
|
|
23724
24003
|
ml: "ms",
|
|
23725
24004
|
mr: "me",
|
|
@@ -23773,7 +24052,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
|
|
|
23773
24052
|
type: "suggestion",
|
|
23774
24053
|
docs: {
|
|
23775
24054
|
description: "Prefer logical Tailwind utilities in explicitly opted-in bidirectional interfaces.",
|
|
23776
|
-
url: docsUrl(
|
|
24055
|
+
url: docsUrl(NAME103)
|
|
23777
24056
|
},
|
|
23778
24057
|
schema: [
|
|
23779
24058
|
{
|
|
@@ -23840,7 +24119,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
|
|
|
23840
24119
|
});
|
|
23841
24120
|
|
|
23842
24121
|
// src/rules/prefer-millisecond-control-duration-schema.ts
|
|
23843
|
-
var
|
|
24122
|
+
var NAME104 = "prefer-millisecond-control-duration-schema";
|
|
23844
24123
|
var CONTROL_SECONDS_RE = /(?:^|_)(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)_seconds$/i;
|
|
23845
24124
|
var CONTROL_SECONDS_CAMEL_RE = /(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)Seconds$/i;
|
|
23846
24125
|
var NUMERIC_REFINEMENTS = /* @__PURE__ */ new Set(["int", "min", "max", "positive", "nonnegative", "finite", "multipleOf", "optional", "nullable", "nullish", "default", "describe", "brand", "readonly"]);
|
|
@@ -23852,7 +24131,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
|
|
|
23852
24131
|
type: "suggestion",
|
|
23853
24132
|
docs: {
|
|
23854
24133
|
description: "Require application-owned Zod control-duration fields to use millisecond granularity.",
|
|
23855
|
-
url: docsUrl(
|
|
24134
|
+
url: docsUrl(NAME104)
|
|
23856
24135
|
},
|
|
23857
24136
|
schema: [],
|
|
23858
24137
|
messages: {
|
|
@@ -23938,7 +24217,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
|
|
|
23938
24217
|
});
|
|
23939
24218
|
|
|
23940
24219
|
// src/rules/prefer-minimal-parameter-contract.ts
|
|
23941
|
-
var
|
|
24220
|
+
var NAME105 = "prefer-minimal-parameter-contract";
|
|
23942
24221
|
function inlineFields(ast, node, reads) {
|
|
23943
24222
|
const fields2 = /* @__PURE__ */ new Map();
|
|
23944
24223
|
for (const member3 of node.members) {
|
|
@@ -23957,7 +24236,7 @@ var prefer_minimal_parameter_contract_default = defineRule({
|
|
|
23957
24236
|
meta: {
|
|
23958
24237
|
type: "suggestion",
|
|
23959
24238
|
fixable: "code",
|
|
23960
|
-
docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(
|
|
24239
|
+
docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(NAME105) },
|
|
23961
24240
|
schema: [],
|
|
23962
24241
|
messages: {
|
|
23963
24242
|
minimal: "This private consumer reads only {{used}} but also requires {{unused}}. Review a smaller consumer contract; preserve the original runtime object and producer type."
|
|
@@ -24356,7 +24635,7 @@ var prefer_module_level_constant_default = defineRule({
|
|
|
24356
24635
|
});
|
|
24357
24636
|
|
|
24358
24637
|
// src/rules/prefer-module-level-schema.ts
|
|
24359
|
-
var
|
|
24638
|
+
var NAME106 = "prefer-module-level-schema";
|
|
24360
24639
|
var DEFAULT_FACTORIES = [
|
|
24361
24640
|
"discriminatedUnion",
|
|
24362
24641
|
"intersection",
|
|
@@ -24538,7 +24817,7 @@ var prefer_module_level_schema_default = defineRule({
|
|
|
24538
24817
|
type: "problem",
|
|
24539
24818
|
docs: {
|
|
24540
24819
|
description: "Declare a Zod schema at module scope when it closes over nothing in the enclosing function",
|
|
24541
|
-
url: docsUrl(
|
|
24820
|
+
url: docsUrl(NAME106)
|
|
24542
24821
|
},
|
|
24543
24822
|
schema: [
|
|
24544
24823
|
{
|
|
@@ -24688,7 +24967,7 @@ var prefer_module_level_schema_default = defineRule({
|
|
|
24688
24967
|
});
|
|
24689
24968
|
|
|
24690
24969
|
// src/rules/prefer-module-level-refined-schema.ts
|
|
24691
|
-
var
|
|
24970
|
+
var NAME107 = "prefer-module-level-refined-schema";
|
|
24692
24971
|
var BENCHMARK_PATH_RE = /(^|[/\\])(?:benchmarks?|bench)[/\\]/;
|
|
24693
24972
|
var FACTORIES = /* @__PURE__ */ new Set([
|
|
24694
24973
|
"array",
|
|
@@ -24838,7 +25117,7 @@ var prefer_module_level_refined_schema_default = defineRule({
|
|
|
24838
25117
|
type: "suggestion",
|
|
24839
25118
|
docs: {
|
|
24840
25119
|
description: "Declare closed Zod scalar, format, and wrapper schemas at module scope.",
|
|
24841
|
-
url: docsUrl(
|
|
25120
|
+
url: docsUrl(NAME107)
|
|
24842
25121
|
},
|
|
24843
25122
|
schema: [],
|
|
24844
25123
|
messages: {
|
|
@@ -24936,7 +25215,7 @@ var prefer_module_level_refined_schema_default = defineRule({
|
|
|
24936
25215
|
});
|
|
24937
25216
|
|
|
24938
25217
|
// src/rules/prefer-multi-value-zod-literal.ts
|
|
24939
|
-
var
|
|
25218
|
+
var NAME108 = "prefer-multi-value-zod-literal";
|
|
24940
25219
|
function isStaticPrimitive(node, sourceCode2) {
|
|
24941
25220
|
node = unwrapExpression(node);
|
|
24942
25221
|
if (node.type === "Literal") {
|
|
@@ -24963,7 +25242,7 @@ var prefer_multi_value_zod_literal_default = defineRule({
|
|
|
24963
25242
|
type: "suggestion",
|
|
24964
25243
|
docs: {
|
|
24965
25244
|
description: "Use the Zod 4 multi-value literal API instead of a union of literal schemas.",
|
|
24966
|
-
url: docsUrl(
|
|
25245
|
+
url: docsUrl(NAME108)
|
|
24967
25246
|
},
|
|
24968
25247
|
schema: [
|
|
24969
25248
|
{
|
|
@@ -25126,7 +25405,7 @@ function closedType(node) {
|
|
|
25126
25405
|
}
|
|
25127
25406
|
|
|
25128
25407
|
// src/rules/prefer-named-callback-domain.ts
|
|
25129
|
-
var
|
|
25408
|
+
var NAME109 = "prefer-named-callback-domain";
|
|
25130
25409
|
function isLiteralUnion(node) {
|
|
25131
25410
|
return node.type === "TSUnionType" && node.types.length >= 2 && node.types.every((part) => part.type === "TSLiteralType");
|
|
25132
25411
|
}
|
|
@@ -25146,7 +25425,7 @@ var prefer_named_callback_domain_default = defineRule({
|
|
|
25146
25425
|
fixable: "code",
|
|
25147
25426
|
docs: {
|
|
25148
25427
|
description: "Name literal-union domains used by callbacks in exported contracts.",
|
|
25149
|
-
url: docsUrl(
|
|
25428
|
+
url: docsUrl(NAME109)
|
|
25150
25429
|
},
|
|
25151
25430
|
schema: [],
|
|
25152
25431
|
messages: {
|
|
@@ -25185,7 +25464,7 @@ var prefer_named_callback_domain_default = defineRule({
|
|
|
25185
25464
|
});
|
|
25186
25465
|
|
|
25187
25466
|
// src/rules/prefer-named-complex-return-type.ts
|
|
25188
|
-
var
|
|
25467
|
+
var NAME110 = "prefer-named-complex-return-type";
|
|
25189
25468
|
function unwrap5(node) {
|
|
25190
25469
|
if (node.type === "TSTypeReference" && node.typeArguments?.params.length === 1) {
|
|
25191
25470
|
const [inner] = node.typeArguments.params;
|
|
@@ -25223,7 +25502,7 @@ var prefer_named_complex_return_type_default = defineRule({
|
|
|
25223
25502
|
fixable: "code",
|
|
25224
25503
|
docs: {
|
|
25225
25504
|
description: "Prefer a named contract for structurally complex function return types.",
|
|
25226
|
-
url: docsUrl(
|
|
25505
|
+
url: docsUrl(NAME110)
|
|
25227
25506
|
},
|
|
25228
25507
|
schema: [],
|
|
25229
25508
|
messages: {
|
|
@@ -25246,14 +25525,14 @@ var prefer_named_complex_return_type_default = defineRule({
|
|
|
25246
25525
|
});
|
|
25247
25526
|
|
|
25248
25527
|
// src/rules/prefer-native-fetch-in-server-actions.ts
|
|
25249
|
-
var
|
|
25528
|
+
var NAME111 = "prefer-native-fetch-in-server-actions";
|
|
25250
25529
|
var KY_MODULE = /^ky(?:\/.*)?$/u;
|
|
25251
25530
|
var prefer_native_fetch_in_server_actions_default = defineRule({
|
|
25252
25531
|
meta: {
|
|
25253
25532
|
type: "problem",
|
|
25254
25533
|
docs: {
|
|
25255
25534
|
description: "Server action modules should call native fetch instead of importing ky.",
|
|
25256
|
-
url: docsUrl(
|
|
25535
|
+
url: docsUrl(NAME111)
|
|
25257
25536
|
},
|
|
25258
25537
|
schema: [],
|
|
25259
25538
|
defaultOptions: [],
|
|
@@ -25289,7 +25568,7 @@ function isTypeOnly(node) {
|
|
|
25289
25568
|
}
|
|
25290
25569
|
|
|
25291
25570
|
// src/rules/prefer-native-random-uuid.ts
|
|
25292
|
-
var
|
|
25571
|
+
var NAME112 = "prefer-native-random-uuid";
|
|
25293
25572
|
function requireUuidCallee(node) {
|
|
25294
25573
|
return node?.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "require" && node.arguments.length === 1 && node.arguments[0]?.type === "Literal" && node.arguments[0].value === "uuid" ? node.callee : null;
|
|
25295
25574
|
}
|
|
@@ -25302,7 +25581,7 @@ var prefer_native_random_uuid_default = defineRule({
|
|
|
25302
25581
|
type: "suggestion",
|
|
25303
25582
|
docs: {
|
|
25304
25583
|
description: "Prefer `globalThis.crypto.randomUUID()` over resolved zero-argument UUID v4 bindings from the `uuid` package.",
|
|
25305
|
-
url: docsUrl(
|
|
25584
|
+
url: docsUrl(NAME112)
|
|
25306
25585
|
},
|
|
25307
25586
|
hasSuggestions: true,
|
|
25308
25587
|
fixable: "code",
|
|
@@ -25390,7 +25669,7 @@ var prefer_native_random_uuid_default = defineRule({
|
|
|
25390
25669
|
});
|
|
25391
25670
|
|
|
25392
25671
|
// src/rules/prefer-node-crypto-hash.ts
|
|
25393
|
-
var
|
|
25672
|
+
var NAME113 = "prefer-node-crypto-hash";
|
|
25394
25673
|
var UNSAFE_NAMESPACE_METHODS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "valueOf"]);
|
|
25395
25674
|
var UNSAFE_AUTHORITY_IDENTIFIERS = [
|
|
25396
25675
|
"eval",
|
|
@@ -25494,7 +25773,7 @@ var prefer_node_crypto_hash_default = defineRule({
|
|
|
25494
25773
|
fixable: "code",
|
|
25495
25774
|
docs: {
|
|
25496
25775
|
description: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary.",
|
|
25497
|
-
url: docsUrl(
|
|
25776
|
+
url: docsUrl(NAME113)
|
|
25498
25777
|
},
|
|
25499
25778
|
schema: [],
|
|
25500
25779
|
messages: { preferNodeCryptoHash: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary." }
|
|
@@ -25724,7 +26003,7 @@ function hasRetainedFactoryCall(binding3, removed) {
|
|
|
25724
26003
|
}
|
|
25725
26004
|
|
|
25726
26005
|
// src/rules/prefer-node-fs-promises.ts
|
|
25727
|
-
var
|
|
26006
|
+
var NAME114 = "prefer-node-fs-promises";
|
|
25728
26007
|
function memberName3(node) {
|
|
25729
26008
|
if (!node.computed && node.property.type === "Identifier") return node.property.name;
|
|
25730
26009
|
if (node.computed && node.property.type === "Literal" && typeof node.property.value === "string") {
|
|
@@ -25757,7 +26036,7 @@ var prefer_node_fs_promises_default = defineRule({
|
|
|
25757
26036
|
type: "suggestion",
|
|
25758
26037
|
docs: {
|
|
25759
26038
|
description: "Prefer promise-based Node.js filesystem APIs over synchronous calls in production modules.",
|
|
25760
|
-
url: docsUrl(
|
|
26039
|
+
url: docsUrl(NAME114)
|
|
25761
26040
|
},
|
|
25762
26041
|
schema: [],
|
|
25763
26042
|
messages: {
|
|
@@ -25900,7 +26179,7 @@ function sameTypeBinding(sourceCode2, alias, annotation, parameter) {
|
|
|
25900
26179
|
}
|
|
25901
26180
|
|
|
25902
26181
|
// src/rules/prefer-nominal-id-types.ts
|
|
25903
|
-
var
|
|
26182
|
+
var NAME115 = "prefer-nominal-id-types";
|
|
25904
26183
|
var OPERATIONAL_ROLES = /* @__PURE__ */ new Set([
|
|
25905
26184
|
"request",
|
|
25906
26185
|
"trace",
|
|
@@ -26016,7 +26295,7 @@ var prefer_nominal_id_types_default = defineRule({
|
|
|
26016
26295
|
fixable: "code",
|
|
26017
26296
|
docs: {
|
|
26018
26297
|
description: "Distinguish identifier roles sharing primitive types at callable boundaries.",
|
|
26019
|
-
url: docsUrl(
|
|
26298
|
+
url: docsUrl(NAME115)
|
|
26020
26299
|
},
|
|
26021
26300
|
schema: [],
|
|
26022
26301
|
messages: {
|
|
@@ -26045,7 +26324,7 @@ var prefer_nominal_id_types_default = defineRule({
|
|
|
26045
26324
|
});
|
|
26046
26325
|
|
|
26047
26326
|
// src/rules/prefer-non-nullable-collection.ts
|
|
26048
|
-
var
|
|
26327
|
+
var NAME116 = "prefer-non-nullable-collection";
|
|
26049
26328
|
var ARRAY_TYPE_NAMES2 = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
|
|
26050
26329
|
var NULL_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "==="]);
|
|
26051
26330
|
var EMPTY_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "===", "<="]);
|
|
@@ -26400,7 +26679,7 @@ var prefer_non_nullable_collection_default = defineRule({
|
|
|
26400
26679
|
fixable: "code",
|
|
26401
26680
|
docs: {
|
|
26402
26681
|
description: "Suggest reviewing nullish arrays that use local empty-array defaults or a shared null-or-empty guard.",
|
|
26403
|
-
url: docsUrl(
|
|
26682
|
+
url: docsUrl(NAME116)
|
|
26404
26683
|
},
|
|
26405
26684
|
schema: [],
|
|
26406
26685
|
messages: {
|
|
@@ -26511,7 +26790,7 @@ var prefer_non_nullable_collection_default = defineRule({
|
|
|
26511
26790
|
});
|
|
26512
26791
|
|
|
26513
26792
|
// src/rules/prefer-nullish-filter-predicate.ts
|
|
26514
|
-
var
|
|
26793
|
+
var NAME117 = "prefer-nullish-filter-predicate";
|
|
26515
26794
|
var SUMMARY = "Prefer an explicit nullish predicate when `filter(Boolean)` removes only nullish values but does not narrow the result type.";
|
|
26516
26795
|
function isBuiltinArrayFilter(native, symbol) {
|
|
26517
26796
|
const kinds2 = native.ast.SyntaxKind;
|
|
@@ -26568,7 +26847,7 @@ function isLiteralValue(node) {
|
|
|
26568
26847
|
var prefer_nullish_filter_predicate_default = defineRule({
|
|
26569
26848
|
meta: {
|
|
26570
26849
|
type: "suggestion",
|
|
26571
|
-
docs: { description: SUMMARY, url: docsUrl(
|
|
26850
|
+
docs: { description: SUMMARY, url: docsUrl(NAME117) },
|
|
26572
26851
|
hasSuggestions: true,
|
|
26573
26852
|
fixable: "code",
|
|
26574
26853
|
schema: [],
|
|
@@ -26661,7 +26940,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
|
|
|
26661
26940
|
});
|
|
26662
26941
|
|
|
26663
26942
|
// src/rules/prefer-schema-for-api-payload.ts
|
|
26664
|
-
var
|
|
26943
|
+
var NAME118 = "prefer-schema-for-api-payload";
|
|
26665
26944
|
var unwrap6 = (node) => {
|
|
26666
26945
|
let current = node ?? null;
|
|
26667
26946
|
while (current !== null && (isErasedExpression(current) || current.type === "ChainExpression")) current = current.expression;
|
|
@@ -26944,7 +27223,7 @@ var prefer_schema_for_api_payload_default = defineRule({
|
|
|
26944
27223
|
type: "problem",
|
|
26945
27224
|
docs: {
|
|
26946
27225
|
description: "Require Zod (or similar) schema validation on `response.json()` / `JSON.parse()` results before property access.",
|
|
26947
|
-
url: docsUrl(
|
|
27226
|
+
url: docsUrl(NAME118)
|
|
26948
27227
|
},
|
|
26949
27228
|
schema: [],
|
|
26950
27229
|
messages: {
|
|
@@ -27127,7 +27406,7 @@ var prefer_schema_for_api_payload_default = defineRule({
|
|
|
27127
27406
|
// src/rules/prefer-semantic-colors.ts
|
|
27128
27407
|
import { existsSync as existsSync3, lstatSync, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "fs";
|
|
27129
27408
|
import { dirname as dirname3, join as join3, parse } from "path";
|
|
27130
|
-
var
|
|
27409
|
+
var NAME119 = "prefer-semantic-colors";
|
|
27131
27410
|
var COLOR_PREFIXES = "text|bg|border(?:-[trblxyse])?|ring(?:-offset)?|fill|stroke|from|via|to|divide|decoration|placeholder|accent|caret|shadow|outline";
|
|
27132
27411
|
var PALETTE = "red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone";
|
|
27133
27412
|
var COLOR_FN = "rgba?|hsla?|hwb|oklch|oklab|lab|lch|color";
|
|
@@ -27459,7 +27738,7 @@ var prefer_semantic_colors_default = defineRule({
|
|
|
27459
27738
|
type: "suggestion",
|
|
27460
27739
|
docs: {
|
|
27461
27740
|
description: "Enforce semantic color tokens over raw Tailwind palette classes, arbitrary color values, and inline color literals.",
|
|
27462
|
-
url: docsUrl(
|
|
27741
|
+
url: docsUrl(NAME119)
|
|
27463
27742
|
},
|
|
27464
27743
|
schema: [
|
|
27465
27744
|
{
|
|
@@ -27646,7 +27925,7 @@ function packageWorkspaceGlobs(parsed) {
|
|
|
27646
27925
|
}
|
|
27647
27926
|
|
|
27648
27927
|
// src/rules/prefer-server-actions.ts
|
|
27649
|
-
var
|
|
27928
|
+
var NAME120 = "prefer-server-actions";
|
|
27650
27929
|
var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "DELETE", "PATCH"]);
|
|
27651
27930
|
var AXIOS_MUTATION_METHODS = /* @__PURE__ */ new Set(["post", "put", "delete", "patch"]);
|
|
27652
27931
|
var SKIP_FILE_REGEX = /(?:\.test\.[jt]sx?$|\.spec\.[jt]sx?$|-(?:test|spec)\.[jt]sx?$|\/tests?\/|\/__tests__\/|\/__testfixtures__\/|\/scripts?\/|(?:^|\/)app(?:\/.*)?\/route\.[jt]sx?$|(?:^|\/)middleware\.[jt]sx?$|\/pages\/api\/)/;
|
|
@@ -27785,7 +28064,7 @@ var prefer_server_actions_default = defineRule({
|
|
|
27785
28064
|
type: "suggestion",
|
|
27786
28065
|
docs: {
|
|
27787
28066
|
description: "Prefer Next.js Server Actions over same-origin API mutations.",
|
|
27788
|
-
url: docsUrl(
|
|
28067
|
+
url: docsUrl(NAME120)
|
|
27789
28068
|
},
|
|
27790
28069
|
schema: [
|
|
27791
28070
|
{
|
|
@@ -27871,7 +28150,7 @@ var prefer_server_actions_default = defineRule({
|
|
|
27871
28150
|
});
|
|
27872
28151
|
|
|
27873
28152
|
// src/rules/prefer-server-data-preparation.ts
|
|
27874
|
-
var
|
|
28153
|
+
var NAME121 = "prefer-server-data-preparation";
|
|
27875
28154
|
var METHODS = /* @__PURE__ */ new Set(["map", "filter", "flatMap"]);
|
|
27876
28155
|
var DOM_EVENTS = /* @__PURE__ */ new Set(["onClick", "onChange", "onInput", "onSubmit"]);
|
|
27877
28156
|
var BINARY = /* @__PURE__ */ new Set(["===", "!==", "==", "!=", ">", ">=", "<", "<=", "+", "-", "*", "/", "%"]);
|
|
@@ -28003,7 +28282,7 @@ function typedProofs(native) {
|
|
|
28003
28282
|
var prefer_server_data_preparation_default = defineRule({
|
|
28004
28283
|
meta: {
|
|
28005
28284
|
type: "suggestion",
|
|
28006
|
-
docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(
|
|
28285
|
+
docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(NAME121) },
|
|
28007
28286
|
schema: [],
|
|
28008
28287
|
messages: {
|
|
28009
28288
|
prepareData: "Review preparing this prop-only collection in its producer or Server Component when the inputs are available there. Keep operations depending on unsaved edits or browser interaction reactive in the client."
|
|
@@ -28921,7 +29200,7 @@ var ParseErrorCode;
|
|
|
28921
29200
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
28922
29201
|
|
|
28923
29202
|
// src/rules/prefer-shadcn-primitives.ts
|
|
28924
|
-
var
|
|
29203
|
+
var NAME122 = "prefer-shadcn-primitives";
|
|
28925
29204
|
var RAW_PRIMITIVES = {
|
|
28926
29205
|
button: { capability: "Button", replacement: "Button" },
|
|
28927
29206
|
dialog: { capability: "Dialog", replacement: "Dialog or AlertDialog family" },
|
|
@@ -29130,7 +29409,7 @@ function rawElementName(node) {
|
|
|
29130
29409
|
const name = node.name.name;
|
|
29131
29410
|
return Object.hasOwn(RAW_PRIMITIVES, name) ? name : null;
|
|
29132
29411
|
}
|
|
29133
|
-
function
|
|
29412
|
+
function effectiveAttribute2(node, attributeName) {
|
|
29134
29413
|
for (const attribute of node.attributes.toReversed()) {
|
|
29135
29414
|
if (attribute.type === "JSXSpreadAttribute") {
|
|
29136
29415
|
return { kind: "unknown" };
|
|
@@ -29173,7 +29452,7 @@ function isLabelableElement(node) {
|
|
|
29173
29452
|
const name = node.openingElement.name.name;
|
|
29174
29453
|
if (!LABELABLE_ELEMENTS.has(name)) return false;
|
|
29175
29454
|
if (name !== "input") return true;
|
|
29176
|
-
const typeAttribute =
|
|
29455
|
+
const typeAttribute = effectiveAttribute2(node.openingElement, "type");
|
|
29177
29456
|
if (typeAttribute.kind === "unknown") return false;
|
|
29178
29457
|
return !(typeAttribute.kind === "known" && typeAttribute.value.toLowerCase() === "hidden");
|
|
29179
29458
|
}
|
|
@@ -29189,14 +29468,14 @@ function containsLabelableElement(node) {
|
|
|
29189
29468
|
});
|
|
29190
29469
|
}
|
|
29191
29470
|
function isStaticallyAssociatedLabel(node) {
|
|
29192
|
-
const htmlFor =
|
|
29471
|
+
const htmlFor = effectiveAttribute2(node, "htmlFor");
|
|
29193
29472
|
if (htmlFor.kind === "known" && htmlFor.value.trim().length > 0) return true;
|
|
29194
29473
|
return node.parent.type === "JSXElement" && containsLabelableElement(node.parent);
|
|
29195
29474
|
}
|
|
29196
29475
|
function replacementFor2(node, element) {
|
|
29197
|
-
if (element === "select" &&
|
|
29476
|
+
if (element === "select" && mayHaveBooleanAttribute2(node, "multiple")) return null;
|
|
29198
29477
|
if (element !== "input") return RAW_PRIMITIVES[element];
|
|
29199
|
-
const typeAttribute =
|
|
29478
|
+
const typeAttribute = effectiveAttribute2(node, "type");
|
|
29200
29479
|
if (typeAttribute.kind === "unknown") return null;
|
|
29201
29480
|
const inputType = typeAttribute.kind === "known" ? typeAttribute.value.toLowerCase() : "text";
|
|
29202
29481
|
if (inputType === "hidden" || inputType === "file") return null;
|
|
@@ -29209,7 +29488,7 @@ function replacementFor2(node, element) {
|
|
|
29209
29488
|
if (AMBIGUOUS_INPUT_TYPES.has(inputType)) return null;
|
|
29210
29489
|
return RAW_PRIMITIVES.input;
|
|
29211
29490
|
}
|
|
29212
|
-
function
|
|
29491
|
+
function mayHaveBooleanAttribute2(node, name) {
|
|
29213
29492
|
for (const attribute of node.attributes.toReversed()) {
|
|
29214
29493
|
if (attribute.type === "JSXSpreadAttribute") return true;
|
|
29215
29494
|
if (attribute.name.type !== "JSXIdentifier" || attribute.name.name !== name) continue;
|
|
@@ -29223,7 +29502,7 @@ var prefer_shadcn_primitives_default = defineRule({
|
|
|
29223
29502
|
type: "suggestion",
|
|
29224
29503
|
docs: {
|
|
29225
29504
|
description: "Require visible raw JSX controls to use the corresponding shared shadcn primitive.",
|
|
29226
|
-
url: docsUrl(
|
|
29505
|
+
url: docsUrl(NAME122)
|
|
29227
29506
|
},
|
|
29228
29507
|
schema: [
|
|
29229
29508
|
{
|
|
@@ -29271,7 +29550,7 @@ var prefer_shadcn_primitives_default = defineRule({
|
|
|
29271
29550
|
JSXOpeningElement(node) {
|
|
29272
29551
|
const element = rawElementName(node);
|
|
29273
29552
|
if (element === null) return;
|
|
29274
|
-
if (
|
|
29553
|
+
if (mayHaveBooleanAttribute2(node, "hidden") || hasHiddenAncestor2(node)) return;
|
|
29275
29554
|
if (element === "label" && !isStaticallyAssociatedLabel(node)) return;
|
|
29276
29555
|
const replacement = replacementFor2(node, element);
|
|
29277
29556
|
if (replacement === null) return;
|
|
@@ -29296,7 +29575,7 @@ var prefer_shadcn_primitives_default = defineRule({
|
|
|
29296
29575
|
});
|
|
29297
29576
|
function hasHiddenAncestor2(node) {
|
|
29298
29577
|
for (let ancestor = parentOf(node); ancestor !== null; ancestor = parentOf(ancestor)) {
|
|
29299
|
-
if (ancestor.type === "JSXElement" &&
|
|
29578
|
+
if (ancestor.type === "JSXElement" && mayHaveBooleanAttribute2(ancestor.openingElement, "hidden")) return true;
|
|
29300
29579
|
}
|
|
29301
29580
|
return false;
|
|
29302
29581
|
}
|
|
@@ -29330,7 +29609,7 @@ function matchingAliasTargets(paths, alias) {
|
|
|
29330
29609
|
}
|
|
29331
29610
|
|
|
29332
29611
|
// src/rules/prefer-shared-zod-enum.ts
|
|
29333
|
-
var
|
|
29612
|
+
var NAME123 = "prefer-shared-zod-enum";
|
|
29334
29613
|
function literalDomain(node) {
|
|
29335
29614
|
if (node.arguments.length !== 1) return null;
|
|
29336
29615
|
const first = node.arguments[0];
|
|
@@ -29369,7 +29648,7 @@ var prefer_shared_zod_enum_default = defineRule({
|
|
|
29369
29648
|
type: "suggestion",
|
|
29370
29649
|
docs: {
|
|
29371
29650
|
description: "Give repeated literal Zod enum domains one reusable module-level schema.",
|
|
29372
|
-
url: docsUrl(
|
|
29651
|
+
url: docsUrl(NAME123)
|
|
29373
29652
|
},
|
|
29374
29653
|
schema: [],
|
|
29375
29654
|
messages: {
|
|
@@ -29426,7 +29705,7 @@ var prefer_shared_zod_enum_default = defineRule({
|
|
|
29426
29705
|
});
|
|
29427
29706
|
|
|
29428
29707
|
// src/rules/prefer-switch-for-repeated-equality.ts
|
|
29429
|
-
var
|
|
29708
|
+
var NAME124 = "prefer-switch-for-repeated-equality";
|
|
29430
29709
|
function discriminantName(test) {
|
|
29431
29710
|
if (test.type !== "BinaryExpression" || test.operator !== "===") return null;
|
|
29432
29711
|
const leftIsCase = isCaseValue(test.left);
|
|
@@ -29503,7 +29782,7 @@ var prefer_switch_for_repeated_equality_default = defineRule({
|
|
|
29503
29782
|
fixable: "code",
|
|
29504
29783
|
docs: {
|
|
29505
29784
|
description: "Prefer switch over long if/else-if chains that compare one value for strict equality.",
|
|
29506
|
-
url: docsUrl(
|
|
29785
|
+
url: docsUrl(NAME124)
|
|
29507
29786
|
},
|
|
29508
29787
|
schema: [],
|
|
29509
29788
|
messages: {
|
|
@@ -29553,7 +29832,7 @@ var prefer_switch_for_repeated_equality_default = defineRule({
|
|
|
29553
29832
|
});
|
|
29554
29833
|
|
|
29555
29834
|
// src/rules/prefer-test-fixture-reuse.ts
|
|
29556
|
-
var
|
|
29835
|
+
var NAME125 = "prefer-test-fixture-reuse";
|
|
29557
29836
|
var MAX_DEPTH2 = 8;
|
|
29558
29837
|
var FRAMEWORKS = /* @__PURE__ */ new Set(["vitest", "@playwright/test"]);
|
|
29559
29838
|
var TEST_MODIFIERS4 = /* @__PURE__ */ new Set(["only", "skip", "concurrent", "sequential"]);
|
|
@@ -29682,7 +29961,7 @@ var prefer_test_fixture_reuse_default = defineRule({
|
|
|
29682
29961
|
type: "suggestion",
|
|
29683
29962
|
docs: {
|
|
29684
29963
|
description: "Reuse a requested test fixture instead of constructing another instance of its class.",
|
|
29685
|
-
url: docsUrl(
|
|
29964
|
+
url: docsUrl(NAME125)
|
|
29686
29965
|
},
|
|
29687
29966
|
schema: [],
|
|
29688
29967
|
messages: { reuseFixture: "This class is already supplied by the requested `{{fixture}}` fixture; reuse it or request a typed factory for independent instances." }
|
|
@@ -29716,7 +29995,7 @@ var prefer_test_fixture_reuse_default = defineRule({
|
|
|
29716
29995
|
});
|
|
29717
29996
|
|
|
29718
29997
|
// src/rules/prefer-typed-reflection.ts
|
|
29719
|
-
var
|
|
29998
|
+
var NAME126 = "prefer-typed-reflection";
|
|
29720
29999
|
function knownType(native, type) {
|
|
29721
30000
|
if (type.isUnionType()) return type.getTypes().every((part) => knownType(native, part));
|
|
29722
30001
|
const flags = native.sync.TypeFlags;
|
|
@@ -29746,7 +30025,7 @@ var prefer_typed_reflection_default = defineRule({
|
|
|
29746
30025
|
fixable: "code",
|
|
29747
30026
|
docs: {
|
|
29748
30027
|
description: "Prefer typed access when Reflect.get or Reflect.apply discards a known contract.",
|
|
29749
|
-
url: docsUrl(
|
|
30028
|
+
url: docsUrl(NAME126)
|
|
29750
30029
|
},
|
|
29751
30030
|
schema: [],
|
|
29752
30031
|
messages: {
|
|
@@ -29912,7 +30191,7 @@ var prefer_typed_reflection_default = defineRule({
|
|
|
29912
30191
|
});
|
|
29913
30192
|
|
|
29914
30193
|
// src/rules/prefer-whole-object-assertion.ts
|
|
29915
|
-
var
|
|
30194
|
+
var NAME127 = "prefer-whole-object-assertion";
|
|
29916
30195
|
var MERGEABLE_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
|
|
29917
30196
|
var SYNTHETIC_LITERAL_MATCHERS = /* @__PURE__ */ new Map([
|
|
29918
30197
|
["toBeNull", "null"]
|
|
@@ -30002,7 +30281,7 @@ var prefer_whole_object_assertion_default = defineRule({
|
|
|
30002
30281
|
type: "suggestion",
|
|
30003
30282
|
docs: {
|
|
30004
30283
|
description: "Collapse consecutive assertions on one object into a whole-object assertion so related mismatches are reported together.",
|
|
30005
|
-
url: docsUrl(
|
|
30284
|
+
url: docsUrl(NAME127)
|
|
30006
30285
|
},
|
|
30007
30286
|
messages: {
|
|
30008
30287
|
combineAssertions: "Consider combining these {{count}} assertions on `{{receiver}}` with `toMatchObject` when structural matching preserves property presence and getter or proxy behavior.",
|
|
@@ -30149,7 +30428,7 @@ var prefer_whole_object_assertion_default = defineRule({
|
|
|
30149
30428
|
});
|
|
30150
30429
|
|
|
30151
30430
|
// src/rules/prefer-zod-enum-validator.ts
|
|
30152
|
-
var
|
|
30431
|
+
var NAME128 = "prefer-zod-enum-validator";
|
|
30153
30432
|
function isInput(node, name) {
|
|
30154
30433
|
if (node == null) return false;
|
|
30155
30434
|
const value = unwrapExpression(node);
|
|
@@ -30240,7 +30519,7 @@ var prefer_zod_enum_validator_default = defineRule({
|
|
|
30240
30519
|
type: "suggestion",
|
|
30241
30520
|
docs: {
|
|
30242
30521
|
description: "Express closed string validators with a reusable Zod enum schema.",
|
|
30243
|
-
url: docsUrl(
|
|
30522
|
+
url: docsUrl(NAME128)
|
|
30244
30523
|
},
|
|
30245
30524
|
schema: [],
|
|
30246
30525
|
messages: { useEnumSchema: "Replace this closed string validator with a named z.enum([\u2026]) schema and derive its type with z.infer. Use parse for parsing or safeParse for a boolean check; preserve intentional failure behavior." }
|
|
@@ -30268,7 +30547,7 @@ var prefer_zod_enum_validator_default = defineRule({
|
|
|
30268
30547
|
});
|
|
30269
30548
|
|
|
30270
30549
|
// src/rules/prefer-zod-infer.ts
|
|
30271
|
-
var
|
|
30550
|
+
var NAME129 = "prefer-zod-infer";
|
|
30272
30551
|
function absent(value) {
|
|
30273
30552
|
return value === void 0 || value === null;
|
|
30274
30553
|
}
|
|
@@ -30644,7 +30923,7 @@ var prefer_zod_infer_default = defineRule({
|
|
|
30644
30923
|
fixable: "code",
|
|
30645
30924
|
docs: {
|
|
30646
30925
|
description: "Derive a type from its Zod schema with `z.infer` instead of hand-writing a twin declaration beside it.",
|
|
30647
|
-
url: docsUrl(
|
|
30926
|
+
url: docsUrl(NAME129)
|
|
30648
30927
|
},
|
|
30649
30928
|
schema: [
|
|
30650
30929
|
{
|
|
@@ -31094,7 +31373,7 @@ function returnsContract(authority, returned2) {
|
|
|
31094
31373
|
}
|
|
31095
31374
|
|
|
31096
31375
|
// src/rules/prefer-zod-parse-output-type.ts
|
|
31097
|
-
var
|
|
31376
|
+
var NAME130 = "prefer-zod-parse-output-type";
|
|
31098
31377
|
function isLocalZodObjectSchema(node, namespaces) {
|
|
31099
31378
|
let current = node;
|
|
31100
31379
|
while (current.type === "CallExpression") {
|
|
@@ -31240,7 +31519,7 @@ var prefer_zod_parse_output_type_default = defineRule({
|
|
|
31240
31519
|
fixable: "code",
|
|
31241
31520
|
docs: {
|
|
31242
31521
|
description: "Consider deriving validated return contracts from the Zod schema when the schema owns the contract.",
|
|
31243
|
-
url: docsUrl(
|
|
31522
|
+
url: docsUrl(NAME130)
|
|
31244
31523
|
},
|
|
31245
31524
|
schema: [],
|
|
31246
31525
|
messages: {
|
|
@@ -31528,7 +31807,7 @@ var production_derived_test_cases_default = defineRule({
|
|
|
31528
31807
|
});
|
|
31529
31808
|
|
|
31530
31809
|
// src/rules/repeated-static-call-cases.ts
|
|
31531
|
-
var
|
|
31810
|
+
var NAME131 = "repeated-static-call-cases";
|
|
31532
31811
|
var TEST_MODULES2 = /* @__PURE__ */ new Set(["@jest/globals", "@playwright/test", "bun:test", "node:test", "vitest"]);
|
|
31533
31812
|
var TEST_NAMES3 = /* @__PURE__ */ new Set(["it", "test"]);
|
|
31534
31813
|
var TEST_MODIFIERS5 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
|
|
@@ -31652,7 +31931,7 @@ var repeated_static_call_cases_default = defineRule({
|
|
|
31652
31931
|
type: "suggestion",
|
|
31653
31932
|
docs: {
|
|
31654
31933
|
description: "Review three or more consecutive static-input call assertions as potential named cases.",
|
|
31655
|
-
url: docsUrl(
|
|
31934
|
+
url: docsUrl(NAME131)
|
|
31656
31935
|
},
|
|
31657
31936
|
schema: [],
|
|
31658
31937
|
messages: { repeatedStaticCallCases: "These {{count}} consecutive assertions repeat a call with static inputs. If independent, use named parameterized cases or subtests; preserve ordered scenarios as one test." }
|
|
@@ -31795,7 +32074,7 @@ function isPrimitiveReturn(node, annotation) {
|
|
|
31795
32074
|
}
|
|
31796
32075
|
|
|
31797
32076
|
// src/rules/require-assert-never.ts
|
|
31798
|
-
var
|
|
32077
|
+
var NAME132 = "require-assert-never";
|
|
31799
32078
|
function isRuntimeHandlingStatement(statement) {
|
|
31800
32079
|
if (statement.type === "EmptyStatement") return false;
|
|
31801
32080
|
if (statement.type === "BreakStatement") return statement.label !== null;
|
|
@@ -31865,7 +32144,7 @@ var require_assert_never_default = defineRule({
|
|
|
31865
32144
|
fixable: "code",
|
|
31866
32145
|
docs: {
|
|
31867
32146
|
description: "Require a never witness in empty switch defaults so discriminated unions remain exhaustive at compile time.",
|
|
31868
|
-
url: docsUrl(
|
|
32147
|
+
url: docsUrl(NAME132)
|
|
31869
32148
|
},
|
|
31870
32149
|
schema: [],
|
|
31871
32150
|
messages: {
|
|
@@ -31909,7 +32188,7 @@ var require_assert_never_default = defineRule({
|
|
|
31909
32188
|
});
|
|
31910
32189
|
|
|
31911
32190
|
// src/rules/require-button-accessible-name.ts
|
|
31912
|
-
var
|
|
32191
|
+
var NAME133 = "require-button-accessible-name";
|
|
31913
32192
|
var DELEGATING_PROPS = /* @__PURE__ */ new Set(["render", "asChild"]);
|
|
31914
32193
|
function delegatesRendering(opening) {
|
|
31915
32194
|
return opening.attributes.some(
|
|
@@ -31922,7 +32201,7 @@ var require_button_accessible_name_default = defineRule({
|
|
|
31922
32201
|
type: "problem",
|
|
31923
32202
|
docs: {
|
|
31924
32203
|
description: "Require an accessible name on statically unnamed native or configured JSX buttons.",
|
|
31925
|
-
url: docsUrl(
|
|
32204
|
+
url: docsUrl(NAME133)
|
|
31926
32205
|
},
|
|
31927
32206
|
schema: [
|
|
31928
32207
|
{
|
|
@@ -31976,7 +32255,7 @@ var require_button_accessible_name_default = defineRule({
|
|
|
31976
32255
|
});
|
|
31977
32256
|
|
|
31978
32257
|
// src/rules/require-camelcase-properties.ts
|
|
31979
|
-
var
|
|
32258
|
+
var NAME134 = "require-camelcase-properties";
|
|
31980
32259
|
var SNAKE_CASE_RE2 = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)+$/u;
|
|
31981
32260
|
function blocksRename(member3, name) {
|
|
31982
32261
|
if (member3.type === "TSIndexSignature" || "computed" in member3 && member3.computed) return true;
|
|
@@ -31990,7 +32269,7 @@ var require_camelcase_properties_default = defineRule({
|
|
|
31990
32269
|
fixable: "code",
|
|
31991
32270
|
docs: {
|
|
31992
32271
|
description: "Require unquoted lower snake_case TypeScript properties and dot access to use camelCase.",
|
|
31993
|
-
url: docsUrl(
|
|
32272
|
+
url: docsUrl(NAME134)
|
|
31994
32273
|
},
|
|
31995
32274
|
schema: [],
|
|
31996
32275
|
defaultOptions: [],
|
|
@@ -32054,7 +32333,7 @@ var require_camelcase_properties_default = defineRule({
|
|
|
32054
32333
|
});
|
|
32055
32334
|
|
|
32056
32335
|
// src/rules/require-constrained-schema-integer.ts
|
|
32057
|
-
var
|
|
32336
|
+
var NAME135 = "require-constrained-schema-integer";
|
|
32058
32337
|
var FIELD_MINIMUMS = /* @__PURE__ */ new Map([["limit", 1], ["version", 0]]);
|
|
32059
32338
|
var NUMBER_FACTORIES = /* @__PURE__ */ new Set(["number", "int", "int32", "uint32"]);
|
|
32060
32339
|
var OBJECT_FACTORIES = /* @__PURE__ */ new Set(["object", "strictObject", "looseObject"]);
|
|
@@ -32096,7 +32375,7 @@ var require_constrained_schema_integer_default = defineRule({
|
|
|
32096
32375
|
type: "suggestion",
|
|
32097
32376
|
docs: {
|
|
32098
32377
|
description: "Declare integer and lower-bound validation for numeric limit and version schema fields.",
|
|
32099
|
-
url: docsUrl(
|
|
32378
|
+
url: docsUrl(NAME135)
|
|
32100
32379
|
},
|
|
32101
32380
|
schema: [],
|
|
32102
32381
|
messages: { constrainInteger: "Declare `{{field}}` as an integer with a lower bound of {{minimum}} or greater, or reuse its named domain schema." }
|
|
@@ -32575,14 +32854,14 @@ function closedNominalInheritanceFix(sourceCode2, file, call, consumer, implemen
|
|
|
32575
32854
|
}
|
|
32576
32855
|
|
|
32577
32856
|
// src/rules/require-explicit-contract-implementation.ts
|
|
32578
|
-
var
|
|
32857
|
+
var NAME136 = "require-explicit-contract-implementation";
|
|
32579
32858
|
var require_explicit_contract_implementation_default = defineRule({
|
|
32580
32859
|
meta: {
|
|
32581
32860
|
type: "problem",
|
|
32582
32861
|
fixable: "code",
|
|
32583
32862
|
docs: {
|
|
32584
32863
|
description: "Require nominal inheritance when an injected abstract class is rejected by an instanceof guard.",
|
|
32585
|
-
url: docsUrl(
|
|
32864
|
+
url: docsUrl(NAME136)
|
|
32586
32865
|
},
|
|
32587
32866
|
schema: [],
|
|
32588
32867
|
messages: {
|
|
@@ -33273,7 +33552,7 @@ function abstractContractOperations(node, functionAliases) {
|
|
|
33273
33552
|
}
|
|
33274
33553
|
|
|
33275
33554
|
// src/rules/require-explicit-service-contract.ts
|
|
33276
|
-
var
|
|
33555
|
+
var NAME137 = "require-explicit-service-contract";
|
|
33277
33556
|
var JAVASCRIPT_FILE_RE2 = /\.(?:js|jsx|mjs|cjs)$/iu;
|
|
33278
33557
|
var BOUNDARY_SUFFIX = /(?:Service|ServiceImpl|Store|Repository|Provider|Executor|Enqueuer|Runner|Platform|Manager|ManagerImpl|Detector|Control|Refresher|Reader|Settlement|Retry|Stop|Catalog|DAO)$/u;
|
|
33279
33558
|
var NON_SERVICE_SUFFIX = /(?:Router|Middleware|Builder)$/u;
|
|
@@ -33289,7 +33568,7 @@ var require_explicit_service_contract_default = defineRule({
|
|
|
33289
33568
|
type: "problem",
|
|
33290
33569
|
docs: {
|
|
33291
33570
|
description: "Require explicit contracts for classes that invoke retained collaborators.",
|
|
33292
|
-
url: docsUrl(
|
|
33571
|
+
url: docsUrl(NAME137)
|
|
33293
33572
|
},
|
|
33294
33573
|
schema: [],
|
|
33295
33574
|
fixable: "code",
|
|
@@ -33325,7 +33604,7 @@ var require_explicit_service_contract_default = defineRule({
|
|
|
33325
33604
|
});
|
|
33326
33605
|
|
|
33327
33606
|
// src/rules/require-fetch-timeout.ts
|
|
33328
|
-
var
|
|
33607
|
+
var NAME138 = "require-fetch-timeout";
|
|
33329
33608
|
function emptySignal(expression, resolvesToGlobal) {
|
|
33330
33609
|
const value = unwrapExpression(expression);
|
|
33331
33610
|
if (value.type === "Literal" && value.value === null)
|
|
@@ -33387,7 +33666,7 @@ var require_fetch_timeout_default = defineRule({
|
|
|
33387
33666
|
type: "problem",
|
|
33388
33667
|
docs: {
|
|
33389
33668
|
description: "Require an explicit abort signal on locally analyzable global fetch calls.",
|
|
33390
|
-
url: docsUrl(
|
|
33669
|
+
url: docsUrl(NAME138)
|
|
33391
33670
|
},
|
|
33392
33671
|
schema: [
|
|
33393
33672
|
{
|
|
@@ -33478,8 +33757,90 @@ var require_fetch_timeout_default = defineRule({
|
|
|
33478
33757
|
}
|
|
33479
33758
|
});
|
|
33480
33759
|
|
|
33760
|
+
// src/rules/require-ime-safe-enter-handler.ts
|
|
33761
|
+
var NAME139 = "require-ime-safe-enter-handler";
|
|
33762
|
+
var require_ime_safe_enter_handler_default = defineRule({
|
|
33763
|
+
meta: {
|
|
33764
|
+
type: "problem",
|
|
33765
|
+
docs: {
|
|
33766
|
+
description: "Preserve IME composition before Enter submits or blurs a native text control.",
|
|
33767
|
+
url: docsUrl(NAME139)
|
|
33768
|
+
},
|
|
33769
|
+
schema: [],
|
|
33770
|
+
messages: {
|
|
33771
|
+
composition: "Enter also confirms IME composition. Guard composition before submitting the form or blurring this control; retain the required Safari fallback for your supported browsers."
|
|
33772
|
+
}
|
|
33773
|
+
},
|
|
33774
|
+
createOnce(context) {
|
|
33775
|
+
return {
|
|
33776
|
+
before() {
|
|
33777
|
+
if (isGeneratedFile({ filename: context.filename, cwd: context.cwd }, context.sourceCode.text))
|
|
33778
|
+
return false;
|
|
33779
|
+
},
|
|
33780
|
+
JSXOpeningElement(node) {
|
|
33781
|
+
if (!isEditableTextControl(node, context.sourceCode)) return;
|
|
33782
|
+
if (effectiveAttribute(node, ["onCompositionStart", "onCompositionEnd"]) !== void 0)
|
|
33783
|
+
return;
|
|
33784
|
+
const attribute = effectiveAttribute(node, ["onKeyDown"]);
|
|
33785
|
+
if (attribute?.type !== "JSXAttribute" || attribute.value?.type !== "JSXExpressionContainer")
|
|
33786
|
+
return;
|
|
33787
|
+
const callback = unwrapExpression(attribute.value.expression);
|
|
33788
|
+
if (callback.type !== "ArrowFunctionExpression" && callback.type !== "FunctionExpression")
|
|
33789
|
+
return;
|
|
33790
|
+
const [event] = callback.params;
|
|
33791
|
+
if (event?.type !== "Identifier" || callback.body === null) return;
|
|
33792
|
+
const binding3 = findVariable(context.sourceCode.getScope(callback.body), event.name);
|
|
33793
|
+
if (binding3 === null || binding3.references.some((reference) => reference.isWrite())) return;
|
|
33794
|
+
const matches = (identifier) => findVariable(context.sourceCode.getScope(identifier), identifier.name) === binding3;
|
|
33795
|
+
if (contains2(callback.body, (part) => isGuard(part, matches))) return;
|
|
33796
|
+
if (contains2(
|
|
33797
|
+
callback.body,
|
|
33798
|
+
(part) => part.type === "IfStatement" && positiveEnterGate(part.test, matches) && contains2(part.consequent, (action) => nativeAction(action, matches))
|
|
33799
|
+
)) {
|
|
33800
|
+
context.report({ node: attribute, messageId: "composition" });
|
|
33801
|
+
}
|
|
33802
|
+
}
|
|
33803
|
+
};
|
|
33804
|
+
}
|
|
33805
|
+
});
|
|
33806
|
+
function contains2(node, predicate) {
|
|
33807
|
+
if (["FunctionExpression", "ArrowFunctionExpression", "FunctionDeclaration"].includes(node.type))
|
|
33808
|
+
return false;
|
|
33809
|
+
return predicate(node) || forEachOwnAstChild(node, (child) => contains2(child, predicate));
|
|
33810
|
+
}
|
|
33811
|
+
function eventMember(node, event, property) {
|
|
33812
|
+
const value = unwrapExpression(node);
|
|
33813
|
+
return value.type === "MemberExpression" && getPropertyName(value) === property && value.object.type === "Identifier" && event(value.object);
|
|
33814
|
+
}
|
|
33815
|
+
function isGuard(node, event) {
|
|
33816
|
+
if (node.type !== "MemberExpression") return false;
|
|
33817
|
+
const property = getPropertyName(node);
|
|
33818
|
+
if (!["isComposing", "keyCode", "ctrlKey", "metaKey"].includes(property ?? "")) return false;
|
|
33819
|
+
return node.object.type === "Identifier" && event(node.object) || eventMember(node.object, event, "nativeEvent");
|
|
33820
|
+
}
|
|
33821
|
+
function positiveEnterGate(node, event) {
|
|
33822
|
+
const test = unwrapExpression(node);
|
|
33823
|
+
if (isEnter(test, event)) return true;
|
|
33824
|
+
if (test.type !== "LogicalExpression" || test.operator !== "&&") return false;
|
|
33825
|
+
const unshifted = (part) => part.type === "UnaryExpression" && part.operator === "!" && eventMember(part.argument, event, "shiftKey");
|
|
33826
|
+
return isEnter(test.left, event) && unshifted(test.right) || isEnter(test.right, event) && unshifted(test.left);
|
|
33827
|
+
}
|
|
33828
|
+
function isEnter(node, event) {
|
|
33829
|
+
if (node.type !== "BinaryExpression" || !["===", "=="].includes(node.operator)) return false;
|
|
33830
|
+
return eventMember(node.left, event, "key") && node.right.type === "Literal" && node.right.value === "Enter" || eventMember(node.right, event, "key") && node.left.type === "Literal" && node.left.value === "Enter";
|
|
33831
|
+
}
|
|
33832
|
+
function nativeAction(node, event) {
|
|
33833
|
+
if (node.type !== "CallExpression") return false;
|
|
33834
|
+
const callee = unwrapExpression(node.callee);
|
|
33835
|
+
if (callee.type !== "MemberExpression") return false;
|
|
33836
|
+
const property = getPropertyName(callee);
|
|
33837
|
+
if (property === "blur") return eventMember(callee.object, event, "currentTarget");
|
|
33838
|
+
const form = unwrapExpression(callee.object);
|
|
33839
|
+
return property === "requestSubmit" && form.type === "MemberExpression" && getPropertyName(form) === "form" && eventMember(form.object, event, "currentTarget");
|
|
33840
|
+
}
|
|
33841
|
+
|
|
33481
33842
|
// src/rules/require-interface-for-exported-class.ts
|
|
33482
|
-
var
|
|
33843
|
+
var NAME140 = "require-interface-for-exported-class";
|
|
33483
33844
|
var JAVASCRIPT_FILE_RE3 = /\.(?:js|jsx|mjs|cjs)$/iu;
|
|
33484
33845
|
function isPublicInstanceMember2(member3) {
|
|
33485
33846
|
return !member3.static && member3.accessibility !== "private" && member3.accessibility !== "protected" && member3.key.type !== "PrivateIdentifier";
|
|
@@ -33540,7 +33901,7 @@ var require_interface_for_exported_class_default = defineRule({
|
|
|
33540
33901
|
type: "suggestion",
|
|
33541
33902
|
docs: {
|
|
33542
33903
|
description: "Require exported concrete classes with public behavior to declare a contract.",
|
|
33543
|
-
url: docsUrl(
|
|
33904
|
+
url: docsUrl(NAME140)
|
|
33544
33905
|
},
|
|
33545
33906
|
schema: [],
|
|
33546
33907
|
fixable: "code",
|
|
@@ -33582,7 +33943,7 @@ var require_interface_for_exported_class_default = defineRule({
|
|
|
33582
33943
|
});
|
|
33583
33944
|
|
|
33584
33945
|
// src/rules/require-jwt-lifetime.ts
|
|
33585
|
-
var
|
|
33946
|
+
var NAME141 = "require-jwt-lifetime";
|
|
33586
33947
|
function isJoseValueImport(declaration) {
|
|
33587
33948
|
return declaration.type === "ImportDeclaration" && declaration.importKind !== "type" && declaration.source.value === "jose";
|
|
33588
33949
|
}
|
|
@@ -33591,7 +33952,7 @@ var require_jwt_lifetime_default = defineRule({
|
|
|
33591
33952
|
type: "problem",
|
|
33592
33953
|
docs: {
|
|
33593
33954
|
description: "Require an expiration claim or a maximum token age when returning a verified JWT.",
|
|
33594
|
-
url: docsUrl(
|
|
33955
|
+
url: docsUrl(NAME141)
|
|
33595
33956
|
},
|
|
33596
33957
|
schema: [],
|
|
33597
33958
|
messages: { lifetime: "Require the JWT exp claim or set maxTokenAge before returning this verification result." }
|
|
@@ -33650,7 +34011,7 @@ var require_jwt_lifetime_default = defineRule({
|
|
|
33650
34011
|
});
|
|
33651
34012
|
|
|
33652
34013
|
// src/rules/require-pascal-case-zod-schema-name.ts
|
|
33653
|
-
var
|
|
34014
|
+
var NAME142 = "require-pascal-case-zod-schema-name";
|
|
33654
34015
|
var PASCAL_SCHEMA_NAME_RE = /^[A-Z][A-Za-z0-9]*Schema$/;
|
|
33655
34016
|
var BENCHMARK_PATH_RE2 = /(^|[\\/])(?:benchmarks?|bench)[\\/]/;
|
|
33656
34017
|
var NON_SCHEMA_TERMINALS2 = /* @__PURE__ */ new Set([
|
|
@@ -33821,7 +34182,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
|
|
|
33821
34182
|
fixable: "code",
|
|
33822
34183
|
docs: {
|
|
33823
34184
|
description: "Require confirmed module-level Zod schema contracts to use PascalCase with a `Schema` suffix.",
|
|
33824
|
-
url: docsUrl(
|
|
34185
|
+
url: docsUrl(NAME142)
|
|
33825
34186
|
},
|
|
33826
34187
|
schema: [],
|
|
33827
34188
|
defaultOptions: [],
|
|
@@ -33931,7 +34292,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
|
|
|
33931
34292
|
});
|
|
33932
34293
|
|
|
33933
34294
|
// src/rules/require-port-for-service.ts
|
|
33934
|
-
var
|
|
34295
|
+
var NAME143 = "require-port-for-service";
|
|
33935
34296
|
var HTTP_TRANSPORT_TYPE_RE = /^(?:KyInstance|AxiosInstance|Session)$/;
|
|
33936
34297
|
var TRANSPORT_WRAPPER_NAME_RE = /(?:Client$|^Http[A-Z])/;
|
|
33937
34298
|
var ERROR_VALUE_NAME_RE = /Error$/;
|
|
@@ -34065,7 +34426,7 @@ var require_port_for_service_default = defineRule({
|
|
|
34065
34426
|
type: "suggestion",
|
|
34066
34427
|
docs: {
|
|
34067
34428
|
description: "Advise when an exported service with injected collaborators has public methods not covered by its declared ports.",
|
|
34068
|
-
url: docsUrl(
|
|
34429
|
+
url: docsUrl(NAME143)
|
|
34069
34430
|
},
|
|
34070
34431
|
schema: [],
|
|
34071
34432
|
fixable: "code",
|
|
@@ -34105,7 +34466,7 @@ var require_port_for_service_default = defineRule({
|
|
|
34105
34466
|
});
|
|
34106
34467
|
|
|
34107
34468
|
// src/rules/require-sql-access-class.ts
|
|
34108
|
-
var
|
|
34469
|
+
var NAME144 = "require-sql-access-class";
|
|
34109
34470
|
var DIRECT_EXECUTION_METHODS = /* @__PURE__ */ new Set([
|
|
34110
34471
|
"all",
|
|
34111
34472
|
"batch",
|
|
@@ -34303,7 +34664,7 @@ var require_sql_access_class_default = defineRule({
|
|
|
34303
34664
|
type: "suggestion",
|
|
34304
34665
|
docs: {
|
|
34305
34666
|
description: "Keep SQL reads and writes inside a class that receives its database dependency.",
|
|
34306
|
-
url: docsUrl(
|
|
34667
|
+
url: docsUrl(NAME144)
|
|
34307
34668
|
},
|
|
34308
34669
|
schema: [],
|
|
34309
34670
|
messages: {
|
|
@@ -34375,7 +34736,7 @@ function staticMatcherFix(sourceCode2, property) {
|
|
|
34375
34736
|
}
|
|
34376
34737
|
|
|
34377
34738
|
// src/rules/require-static-next-matcher.ts
|
|
34378
|
-
var
|
|
34739
|
+
var NAME145 = "require-static-next-matcher";
|
|
34379
34740
|
var NEXT_ENTRY_FILE = /(?:^|[/\\])(?:middleware|proxy)\.[cm]?[jt]sx?$/u;
|
|
34380
34741
|
function isStaticValue(node) {
|
|
34381
34742
|
const value = unwrapExpression(node);
|
|
@@ -34407,7 +34768,7 @@ var require_static_next_matcher_default = defineRule({
|
|
|
34407
34768
|
fixable: "code",
|
|
34408
34769
|
docs: {
|
|
34409
34770
|
description: "Require Next.js middleware and proxy matcher configuration to contain only build-time literals.",
|
|
34410
|
-
url: docsUrl(
|
|
34771
|
+
url: docsUrl(NAME145)
|
|
34411
34772
|
},
|
|
34412
34773
|
schema: [],
|
|
34413
34774
|
messages: {
|
|
@@ -34451,7 +34812,7 @@ var require_static_next_matcher_default = defineRule({
|
|
|
34451
34812
|
});
|
|
34452
34813
|
|
|
34453
34814
|
// src/rules/require-svg-accessible-name.ts
|
|
34454
|
-
var
|
|
34815
|
+
var NAME146 = "require-svg-accessible-name";
|
|
34455
34816
|
var DECORATIVE_ROLES = /* @__PURE__ */ new Set(["none", "presentation"]);
|
|
34456
34817
|
var NAME_ATTRIBUTES = ["aria-label", "aria-labelledby"];
|
|
34457
34818
|
var NO_ICON_MODULES = [];
|
|
@@ -34460,7 +34821,7 @@ var require_svg_accessible_name_default = defineRule({
|
|
|
34460
34821
|
type: "problem",
|
|
34461
34822
|
docs: {
|
|
34462
34823
|
description: "Require a name or explicit decorative semantics on inline SVG elements.",
|
|
34463
|
-
url: docsUrl(
|
|
34824
|
+
url: docsUrl(NAME146)
|
|
34464
34825
|
},
|
|
34465
34826
|
schema: [],
|
|
34466
34827
|
messages: {
|
|
@@ -34492,7 +34853,7 @@ var require_svg_accessible_name_default = defineRule({
|
|
|
34492
34853
|
});
|
|
34493
34854
|
|
|
34494
34855
|
// src/rules/require-use-form-default-values.ts
|
|
34495
|
-
var
|
|
34856
|
+
var NAME147 = "require-use-form-default-values";
|
|
34496
34857
|
var UNSAFE_FORM_MEMBERS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "__proto__", "valueOf"]);
|
|
34497
34858
|
function staticPropertyName2(property) {
|
|
34498
34859
|
return property.computed ? null : getPropertyName(property);
|
|
@@ -34535,7 +34896,7 @@ var require_use_form_default_values_default = defineRule({
|
|
|
34535
34896
|
type: "problem",
|
|
34536
34897
|
docs: {
|
|
34537
34898
|
description: "Require explicit form-level initialization or a field default for directly bound Controller fields.",
|
|
34538
|
-
url: docsUrl(
|
|
34899
|
+
url: docsUrl(NAME147)
|
|
34539
34900
|
},
|
|
34540
34901
|
schema: [],
|
|
34541
34902
|
messages: { requireUseFormDefaultValues: "Add non-undefined defaultValues/values to the associated useForm call or non-undefined defaultValue to this field." }
|
|
@@ -34674,7 +35035,7 @@ var require_use_form_default_values_default = defineRule({
|
|
|
34674
35035
|
});
|
|
34675
35036
|
|
|
34676
35037
|
// src/rules/require-use-server-in-actions-file.ts
|
|
34677
|
-
var
|
|
35038
|
+
var NAME148 = "require-use-server-in-actions-file";
|
|
34678
35039
|
var ACTION_MODULE_RE = /(?:^|\/)app\/.*\/(?:actions|[^/]+-actions)\.[cm]?[jt]s$/u;
|
|
34679
35040
|
function isUseServerDirective2(statement) {
|
|
34680
35041
|
return statement.type === "ExpressionStatement" && statement.directive === "use server";
|
|
@@ -34695,7 +35056,7 @@ var require_use_server_in_actions_file_default = defineRule({
|
|
|
34695
35056
|
type: "problem",
|
|
34696
35057
|
docs: {
|
|
34697
35058
|
description: "route action module missing the use server directive",
|
|
34698
|
-
url: docsUrl(
|
|
35059
|
+
url: docsUrl(NAME148)
|
|
34699
35060
|
},
|
|
34700
35061
|
schema: [],
|
|
34701
35062
|
messages: {
|
|
@@ -34721,7 +35082,7 @@ var require_use_server_in_actions_file_default = defineRule({
|
|
|
34721
35082
|
});
|
|
34722
35083
|
|
|
34723
35084
|
// src/rules/require-zod-form-validation.ts
|
|
34724
|
-
var
|
|
35085
|
+
var NAME149 = "require-zod-form-validation";
|
|
34725
35086
|
var ZOD_PARSE_METHODS = /* @__PURE__ */ new Set([
|
|
34726
35087
|
"parse",
|
|
34727
35088
|
"safeParse",
|
|
@@ -34780,7 +35141,7 @@ var require_zod_form_validation_default = defineRule({
|
|
|
34780
35141
|
type: "problem",
|
|
34781
35142
|
docs: {
|
|
34782
35143
|
description: "Require Zod validation (`Schema.parse(...)` / `Schema.safeParse(...)`) when reading values out of a `FormData` object.",
|
|
34783
|
-
url: docsUrl(
|
|
35144
|
+
url: docsUrl(NAME149)
|
|
34784
35145
|
},
|
|
34785
35146
|
schema: [],
|
|
34786
35147
|
messages: {
|
|
@@ -35068,7 +35429,7 @@ function declaresFramework(metadata, name) {
|
|
|
35068
35429
|
}
|
|
35069
35430
|
|
|
35070
35431
|
// src/rules/sole-export-matches-filename.ts
|
|
35071
|
-
var
|
|
35432
|
+
var NAME150 = "sole-export-matches-filename";
|
|
35072
35433
|
var EXCLUDED_STEMS = /* @__PURE__ */ new Set(["global", "index", "types"]);
|
|
35073
35434
|
function stem3(filename) {
|
|
35074
35435
|
const base = filename.replaceAll("\\", "/").split("/").at(-1) ?? "";
|
|
@@ -35082,7 +35443,7 @@ var sole_export_matches_filename_default = defineRule({
|
|
|
35082
35443
|
type: "suggestion",
|
|
35083
35444
|
docs: {
|
|
35084
35445
|
description: "Make a module filename reflect its sole named public runtime export.",
|
|
35085
|
-
url: docsUrl(
|
|
35446
|
+
url: docsUrl(NAME150)
|
|
35086
35447
|
},
|
|
35087
35448
|
schema: [],
|
|
35088
35449
|
messages: {
|
|
@@ -35825,7 +36186,7 @@ var stepdown_default = defineRule({
|
|
|
35825
36186
|
});
|
|
35826
36187
|
|
|
35827
36188
|
// src/rules/store-insert-requires-on-conflict.ts
|
|
35828
|
-
var
|
|
36189
|
+
var NAME151 = "store-insert-requires-on-conflict";
|
|
35829
36190
|
var INSERT_WRITE = /\bINSERT\s+(?:OR\s+\w+\s+)?INTO\s+[\w."'`?$:@-]+\s*(?:\([^)]*\)\s*)?(?:VALUES|SELECT|DEFAULT\s+VALUES)\b/i;
|
|
35830
36191
|
var CONFLICT_HANDLED = /\bON\s+CONFLICT\b|\bON\s+DUPLICATE\s+KEY\b|\bINSERT\s+OR\s+(?:IGNORE|REPLACE)\b|\bINSERT\b[\s\S]*?\bSELECT\b[\s\S]*?\bWHERE\s+NOT\s+EXISTS\b/i;
|
|
35831
36192
|
var REPLAY_CONTRACT_NAME = /(?:enqueue|ensure|migrate|recordOnce|schedule|seed|upsert|getOrCreate|createIfAbsent|insertIfAbsent)/i;
|
|
@@ -35854,7 +36215,7 @@ var store_insert_requires_on_conflict_default = defineRule({
|
|
|
35854
36215
|
type: "problem",
|
|
35855
36216
|
docs: {
|
|
35856
36217
|
description: "Review conflict handling for embedded inserts in replay-named callables.",
|
|
35857
|
-
url: docsUrl(
|
|
36218
|
+
url: docsUrl(NAME151)
|
|
35858
36219
|
},
|
|
35859
36220
|
schema: [],
|
|
35860
36221
|
messages: {
|
|
@@ -35879,7 +36240,7 @@ var store_insert_requires_on_conflict_default = defineRule({
|
|
|
35879
36240
|
});
|
|
35880
36241
|
|
|
35881
36242
|
// src/rules/test-loops-over-literal-cases.ts
|
|
35882
|
-
var
|
|
36243
|
+
var NAME152 = "test-loops-over-literal-cases";
|
|
35883
36244
|
var TEST_CALLERS3 = /* @__PURE__ */ new Set(["it", "test"]);
|
|
35884
36245
|
var TEST_MODIFIERS6 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
|
|
35885
36246
|
var ASSERTION_ROOTS = /* @__PURE__ */ new Set([
|
|
@@ -35975,7 +36336,7 @@ var test_loops_over_literal_cases_default = defineRule({
|
|
|
35975
36336
|
type: "suggestion",
|
|
35976
36337
|
docs: {
|
|
35977
36338
|
description: "Disallow assertions over an inline literal case loop in a test; parameterization reports and names every case independently.",
|
|
35978
|
-
url: docsUrl(
|
|
36339
|
+
url: docsUrl(NAME152)
|
|
35979
36340
|
},
|
|
35980
36341
|
schema: [],
|
|
35981
36342
|
messages: {
|
|
@@ -36039,7 +36400,7 @@ var test_loops_over_literal_cases_default = defineRule({
|
|
|
36039
36400
|
});
|
|
36040
36401
|
|
|
36041
36402
|
// src/rules/test-phase-label-comment.ts
|
|
36042
|
-
var
|
|
36403
|
+
var NAME153 = "test-phase-label-comment";
|
|
36043
36404
|
var PHASE_WORD = String.raw`arrange|act|assert(?:ion)?s?|given|when|then|exercise|execute|verif(?:y|ication)|cleanup|prepare|sanity(?:\s+check)?`;
|
|
36044
36405
|
var PHASE_RE = new RegExp(
|
|
36045
36406
|
String.raw`^[-=~*_#.\s]{0,40}(?:${PHASE_WORD})(?:\s*(?:[/&+,|]|->|and)\s*(?:${PHASE_WORD}))*[-=~*_#.\s:;!–—]{0,40}$`,
|
|
@@ -36067,7 +36428,7 @@ var test_phase_label_comment_default = defineRule({
|
|
|
36067
36428
|
fixable: "code",
|
|
36068
36429
|
docs: {
|
|
36069
36430
|
description: "Tests must not use bare Arrange, Act, Assert, Given, When, or Then phase comments.",
|
|
36070
|
-
url: docsUrl(
|
|
36431
|
+
url: docsUrl(NAME153)
|
|
36071
36432
|
},
|
|
36072
36433
|
schema: [],
|
|
36073
36434
|
messages: { removeLabel: "Bare test phase label \u2014 delete it and let the test names and helpers carry the structure." }
|
|
@@ -36120,6 +36481,7 @@ var RULES = {
|
|
|
36120
36481
|
"named-child-schema-type": named_child_schema_type_default,
|
|
36121
36482
|
"no-bare-return-from-test-catch": no_bare_return_from_test_catch_default,
|
|
36122
36483
|
"no-bespoke-api-case-conversion": no_bespoke_api_case_conversion_default,
|
|
36484
|
+
"no-blocked-input-paste": no_blocked_input_paste_default,
|
|
36123
36485
|
"no-boolean-selector-parameter": no_boolean_selector_parameter_default,
|
|
36124
36486
|
"no-broad-return-type": no_broad_return_type_default,
|
|
36125
36487
|
"no-client-side-data-fetching": no_client_side_data_fetching_default,
|
|
@@ -36153,6 +36515,7 @@ var RULES = {
|
|
|
36153
36515
|
"no-in-operator-on-built-in-collections": no_in_operator_on_built_in_collections_default,
|
|
36154
36516
|
"no-insecure-random-id": no_insecure_random_id_default,
|
|
36155
36517
|
"no-invalid-typed-mutation": no_invalid_typed_mutation_default,
|
|
36518
|
+
"no-invalid-web-resource-hints": no_invalid_web_resource_hints_default,
|
|
36156
36519
|
"no-invalid-zod-custom-parse": no_invalid_zod_custom_parse_default,
|
|
36157
36520
|
"no-json-stringify-error": no_json_stringify_error_default,
|
|
36158
36521
|
"no-json-stringify-object-equality": no_json_stringify_object_equality_default,
|
|
@@ -36160,6 +36523,7 @@ var RULES = {
|
|
|
36160
36523
|
"no-log-only-catch": no_log_only_catch_default,
|
|
36161
36524
|
"no-logical-or-fallback": no_logical_or_fallback_default,
|
|
36162
36525
|
"no-long-comment": no_long_comment_default,
|
|
36526
|
+
"no-message-origin-string-matching": no_message_origin_string_matching_default,
|
|
36163
36527
|
"no-mutating-container-transform": no_mutating_container_transform_default,
|
|
36164
36528
|
"no-mutating-input-with-result": no_mutating_input_with_result_default,
|
|
36165
36529
|
"no-negative-only-http-status-assertion": no_negative_only_http_status_assertion_default,
|
|
@@ -36167,6 +36531,7 @@ var RULES = {
|
|
|
36167
36531
|
"no-offset-pagination": no_offset_pagination_default,
|
|
36168
36532
|
"no-oxlint-directive": no_oxlint_directive_default,
|
|
36169
36533
|
"no-partial-type-predicate": no_partial_type_predicate_default,
|
|
36534
|
+
"no-password-get-form": no_password_get_form_default,
|
|
36170
36535
|
"no-positional-tuple-return": no_positional_tuple_return_default,
|
|
36171
36536
|
"no-production-browser-source-maps": no_production_browser_source_maps_default,
|
|
36172
36537
|
"no-raw-env": no_raw_env_default,
|
|
@@ -36254,6 +36619,7 @@ var RULES = {
|
|
|
36254
36619
|
"require-explicit-contract-implementation": require_explicit_contract_implementation_default,
|
|
36255
36620
|
"require-explicit-service-contract": require_explicit_service_contract_default,
|
|
36256
36621
|
"require-fetch-timeout": require_fetch_timeout_default,
|
|
36622
|
+
"require-ime-safe-enter-handler": require_ime_safe_enter_handler_default,
|
|
36257
36623
|
"require-interface-for-exported-class": require_interface_for_exported_class_default,
|
|
36258
36624
|
"require-jwt-lifetime": require_jwt_lifetime_default,
|
|
36259
36625
|
"require-pascal-case-zod-schema-name": require_pascal_case_zod_schema_name_default,
|
|
@@ -36266,7 +36632,7 @@ var RULES = {
|
|
|
36266
36632
|
"require-zod-form-validation": require_zod_form_validation_default,
|
|
36267
36633
|
"sole-export-matches-filename": sole_export_matches_filename_default,
|
|
36268
36634
|
"source-coupled-test": source_coupled_test_default,
|
|
36269
|
-
|
|
36635
|
+
stepdown: stepdown_default,
|
|
36270
36636
|
"store-insert-requires-on-conflict": store_insert_requires_on_conflict_default,
|
|
36271
36637
|
"test-loops-over-literal-cases": test_loops_over_literal_cases_default,
|
|
36272
36638
|
"test-phase-label-comment": test_phase_label_comment_default
|