@sarj/eslint-plugin 19.7.0 → 19.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.js +50 -1
- package/dist/{chunk-OX5DMK42.js → chunk-G5BIV4A4.js} +284 -112
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/catalog.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
publicDocumentation,
|
|
3
3
|
ruleSpec,
|
|
4
4
|
src_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-G5BIV4A4.js";
|
|
6
6
|
|
|
7
7
|
// src/docs/directive-disable-enable-pair.ts
|
|
8
8
|
var DIRECTIVE_DISABLE_ENABLE_PAIR_DOCUMENTATION = {
|
|
@@ -4440,6 +4440,54 @@ var PREFER_CODED_ERROR_RESULT_DOCUMENTATION = {
|
|
|
4440
4440
|
]
|
|
4441
4441
|
};
|
|
4442
4442
|
|
|
4443
|
+
// src/docs/prefer-configured-cloud-scope.ts
|
|
4444
|
+
var PREFER_CONFIGURED_CLOUD_SCOPE_DOCUMENTATION = {
|
|
4445
|
+
summary: "Prefer validated deployment configuration for account scope in outgoing cloud management requests.",
|
|
4446
|
+
rationale: "A source-literal cloud account scope pins operational requests to one deployment even when the credential or environment changes.",
|
|
4447
|
+
remediation: "Read the account ID from environment variables or injected configuration, validate it at startup, and pass the validated value to the request. Preserve independent security allowlists and fail closed when required configuration is missing.",
|
|
4448
|
+
category: "correctness",
|
|
4449
|
+
defaultLevel: "warning",
|
|
4450
|
+
autofix: "none",
|
|
4451
|
+
requiresTypeInformation: false,
|
|
4452
|
+
limitations: [
|
|
4453
|
+
"Initial coverage is canonical HTTPS Cloudflare v4 account-management URLs with a 32-character hexadecimal account segment sent to an unshadowed fetch, stable const alias, or fetch-default parameter. Other providers, SDKs, arbitrary endpoints, Worker names and resource IDs require separate evidence.",
|
|
4454
|
+
"Follows bounded same-file const aliases, concatenations and template strings; an unknown account, mutable binding, function return, object property, fallback expression, URL/Request object or cross-file value is not inferred. Direct writes to the ambient fetch or its global receivers veto findings; indirect runtime monkeypatches are not modeled.",
|
|
4455
|
+
"Analysis stops at 16 nested expressions or fetch aliases, 256 URL-expression visits per request, 128 string fragments or 8,192 UTF-16 code units of assembled URL text. These limits deliberately leave more complex expressions unreported.",
|
|
4456
|
+
"Scripts remain covered. Test/fixture and generated files are excluded. Comparisons, schemas, allowlists and unused URL strings do not produce findings. Each originating account literal is reported at most once per file.",
|
|
4457
|
+
"This is a warning without an automatic fix: the deployment configuration boundary and independent authorization policy require review. Application code should import validated configuration as required by no-raw-env; browser-exposed variables must never contain secrets."
|
|
4458
|
+
],
|
|
4459
|
+
references: [
|
|
4460
|
+
"https://developers.cloudflare.com/workers/wrangler/system-environment-variables/",
|
|
4461
|
+
"https://eslint.org/docs/latest/rules/no-restricted-syntax"
|
|
4462
|
+
],
|
|
4463
|
+
examples: [
|
|
4464
|
+
{
|
|
4465
|
+
id: "literal-account-scope",
|
|
4466
|
+
title: "Move outgoing account scope into deployment configuration",
|
|
4467
|
+
outcome: "match",
|
|
4468
|
+
files: [{
|
|
4469
|
+
path: ".github/scripts/publish.mjs",
|
|
4470
|
+
source: "const accountId = '0123456789abcdef0123456789abcdef';\nconst base = `https://api.cloudflare.com/client/v4/accounts/${accountId}`;\nexport async function publish(path, request = fetch) { return request(`${base}/${path}`); }"
|
|
4471
|
+
}],
|
|
4472
|
+
focusPath: ".github/scripts/publish.mjs",
|
|
4473
|
+
expectedCount: 1,
|
|
4474
|
+
public: true
|
|
4475
|
+
},
|
|
4476
|
+
{
|
|
4477
|
+
id: "validated-account-scope",
|
|
4478
|
+
title: "Pass validated deployment configuration to the request",
|
|
4479
|
+
outcome: "no-match",
|
|
4480
|
+
files: [{
|
|
4481
|
+
path: ".github/scripts/publish.mjs",
|
|
4482
|
+
source: "import { env } from './env.mjs';\nconst base = `https://api.cloudflare.com/client/v4/accounts/${env.CLOUDFLARE_ACCOUNT_ID}`;\nexport async function publish(path, request = fetch) { return request(`${base}/${path}`); }"
|
|
4483
|
+
}],
|
|
4484
|
+
focusPath: ".github/scripts/publish.mjs",
|
|
4485
|
+
expectedCount: 0,
|
|
4486
|
+
public: true
|
|
4487
|
+
}
|
|
4488
|
+
]
|
|
4489
|
+
};
|
|
4490
|
+
|
|
4443
4491
|
// src/docs/prefer-constant-time-secret-compare.ts
|
|
4444
4492
|
var PREFER_CONSTANT_TIME_SECRET_COMPARE_DOCUMENTATION = {
|
|
4445
4493
|
summary: "Prefer a supported constant-time comparison primitive for secret-like values.",
|
|
@@ -6842,6 +6890,7 @@ var RULE_DOCUMENTATION = {
|
|
|
6842
6890
|
"no-zod-parse-typed-object": NO_ZOD_PARSE_TYPED_OBJECT_DOCUMENTATION,
|
|
6843
6891
|
"prefer-await-in-async-return": PREFER_AWAIT_IN_ASYNC_RETURN_DOCUMENTATION,
|
|
6844
6892
|
"prefer-coded-error-result": PREFER_CODED_ERROR_RESULT_DOCUMENTATION,
|
|
6893
|
+
"prefer-configured-cloud-scope": PREFER_CONFIGURED_CLOUD_SCOPE_DOCUMENTATION,
|
|
6845
6894
|
"prefer-constant-time-secret-compare": PREFER_CONSTANT_TIME_SECRET_COMPARE_DOCUMENTATION,
|
|
6846
6895
|
"prefer-dependency-interface": PREFER_DEPENDENCY_INTERFACE_DOCUMENTATION,
|
|
6847
6896
|
"prefer-discriminated-union": PREFER_DISCRIMINATED_UNION_DOCUMENTATION,
|
|
@@ -22008,8 +22008,179 @@ var prefer_coded_error_result_default = defineRule({
|
|
|
22008
22008
|
}
|
|
22009
22009
|
});
|
|
22010
22010
|
|
|
22011
|
+
// src/rules/prefer-configured-cloud-scope.ts
|
|
22012
|
+
var NAME92 = "prefer-configured-cloud-scope";
|
|
22013
|
+
var ACCOUNT_PREFIX = "https://api.cloudflare.com/client/v4/accounts/";
|
|
22014
|
+
var ACCOUNT_URL = /^https:\/\/api\.cloudflare\.com\/client\/v4\/accounts\/[a-fA-F\d]{32}(?=\/|[?#]|$)/u;
|
|
22015
|
+
var GLOBAL_RECEIVERS5 = /* @__PURE__ */ new Set(["globalThis", "global", "self", "window"]);
|
|
22016
|
+
var UNKNOWN = [{ text: "\0", source: null }];
|
|
22017
|
+
function accountSource(parts) {
|
|
22018
|
+
if (!ACCOUNT_URL.test(parts.map((part) => part.text).join(""))) return null;
|
|
22019
|
+
let offset = 0;
|
|
22020
|
+
for (const part of parts) {
|
|
22021
|
+
if (offset + part.text.length > ACCOUNT_PREFIX.length) return part.source;
|
|
22022
|
+
offset += part.text.length;
|
|
22023
|
+
}
|
|
22024
|
+
return null;
|
|
22025
|
+
}
|
|
22026
|
+
function boundedParts(parts) {
|
|
22027
|
+
return parts.length <= 128 && parts.reduce((size, part) => size + part.text.length, 0) <= 8192 ? parts : UNKNOWN;
|
|
22028
|
+
}
|
|
22029
|
+
var prefer_configured_cloud_scope_default = defineRule({
|
|
22030
|
+
meta: {
|
|
22031
|
+
type: "suggestion",
|
|
22032
|
+
docs: {
|
|
22033
|
+
description: "Prefer validated deployment configuration for account scope in outgoing cloud management requests.",
|
|
22034
|
+
url: docsUrl(NAME92)
|
|
22035
|
+
},
|
|
22036
|
+
schema: [],
|
|
22037
|
+
messages: {
|
|
22038
|
+
configuredScope: "This outgoing Cloudflare management request uses a source-literal account scope. Read and validate the account ID from deployment configuration or environment variables at the boundary; keep independent security allowlists intact."
|
|
22039
|
+
}
|
|
22040
|
+
},
|
|
22041
|
+
createOnce(context) {
|
|
22042
|
+
let sourceCode2;
|
|
22043
|
+
const reported = /* @__PURE__ */ new Set();
|
|
22044
|
+
const requests = [];
|
|
22045
|
+
let fetchOverridden = false;
|
|
22046
|
+
let nodesRemaining = 0;
|
|
22047
|
+
function bindingOf(node) {
|
|
22048
|
+
return findVariable(sourceCode2.getScope(node), node.name);
|
|
22049
|
+
}
|
|
22050
|
+
function unshadowed(node) {
|
|
22051
|
+
const binding3 = bindingOf(node);
|
|
22052
|
+
return binding3 === null || binding3.defs.length === 0;
|
|
22053
|
+
}
|
|
22054
|
+
function globalReceiver2(node) {
|
|
22055
|
+
return node.type === "Identifier" && GLOBAL_RECEIVERS5.has(node.name) && unshadowed(node);
|
|
22056
|
+
}
|
|
22057
|
+
function outgoingFetch(node, seen = /* @__PURE__ */ new Set()) {
|
|
22058
|
+
const callee = unwrapExpression(node);
|
|
22059
|
+
if (callee.type === "MemberExpression") {
|
|
22060
|
+
return globalReceiver2(callee.object) && staticPropertyName(callee, sourceCode2) === "fetch";
|
|
22061
|
+
}
|
|
22062
|
+
if (callee.type !== "Identifier") return false;
|
|
22063
|
+
const binding3 = bindingOf(callee);
|
|
22064
|
+
if (binding3 === null || binding3.defs.length === 0) return callee.name === "fetch";
|
|
22065
|
+
if (seen.has(binding3) || seen.size >= 16 || binding3.defs.length !== 1 || binding3.references.some((ref) => ref.isWrite() && ref.init !== true)) return false;
|
|
22066
|
+
const next = /* @__PURE__ */ new Set([...seen, binding3]);
|
|
22067
|
+
const [definition] = binding3.defs;
|
|
22068
|
+
if (definition?.type === "Parameter") {
|
|
22069
|
+
const parameter = parentOf(definition.name);
|
|
22070
|
+
return parameter?.type === "AssignmentPattern" && parameter.left === definition.name && outgoingFetch(parameter.right, next);
|
|
22071
|
+
}
|
|
22072
|
+
if (definition?.type !== "Variable" || definition.parent?.type !== "VariableDeclaration" || definition.parent.kind !== "const") return false;
|
|
22073
|
+
const declarator = definition.node;
|
|
22074
|
+
return declarator.id.type === "Identifier" && declarator.init !== null && outgoingFetch(declarator.init, next);
|
|
22075
|
+
}
|
|
22076
|
+
function checkWrite(target, depth = 0) {
|
|
22077
|
+
if (depth >= 16) {
|
|
22078
|
+
fetchOverridden = true;
|
|
22079
|
+
return;
|
|
22080
|
+
}
|
|
22081
|
+
const value = unwrapExpression(target);
|
|
22082
|
+
switch (value.type) {
|
|
22083
|
+
case "Identifier":
|
|
22084
|
+
fetchOverridden ||= (value.name === "fetch" || GLOBAL_RECEIVERS5.has(value.name)) && unshadowed(value);
|
|
22085
|
+
return;
|
|
22086
|
+
case "MemberExpression":
|
|
22087
|
+
if (globalReceiver2(value.object)) {
|
|
22088
|
+
const name = staticPropertyName(value, sourceCode2);
|
|
22089
|
+
fetchOverridden ||= name === null || name === "fetch" || GLOBAL_RECEIVERS5.has(name);
|
|
22090
|
+
}
|
|
22091
|
+
return;
|
|
22092
|
+
case "ObjectPattern":
|
|
22093
|
+
for (const property of value.properties) checkWrite(property.type === "RestElement" ? property.argument : property.value, depth + 1);
|
|
22094
|
+
return;
|
|
22095
|
+
case "ArrayPattern":
|
|
22096
|
+
for (const element of value.elements) if (element !== null) checkWrite(element, depth + 1);
|
|
22097
|
+
return;
|
|
22098
|
+
case "AssignmentPattern":
|
|
22099
|
+
checkWrite(value.left, depth + 1);
|
|
22100
|
+
return;
|
|
22101
|
+
case "RestElement":
|
|
22102
|
+
checkWrite(value.argument, depth + 1);
|
|
22103
|
+
return;
|
|
22104
|
+
}
|
|
22105
|
+
}
|
|
22106
|
+
function urlParts(node, seen = /* @__PURE__ */ new Set(), depth = 0) {
|
|
22107
|
+
if (depth >= 16 || nodesRemaining-- <= 0) return UNKNOWN;
|
|
22108
|
+
const value = unwrapExpression(node);
|
|
22109
|
+
if (value.type === "Literal" && typeof value.value === "string") {
|
|
22110
|
+
return boundedParts([{ text: value.value, source: value }]);
|
|
22111
|
+
}
|
|
22112
|
+
if (value.type === "Identifier") {
|
|
22113
|
+
const binding3 = bindingOf(value);
|
|
22114
|
+
if (binding3 === null || seen.has(binding3) || binding3.defs.length !== 1 || binding3.references.some((ref) => ref.isWrite() && ref.init !== true)) return UNKNOWN;
|
|
22115
|
+
const [definition] = binding3.defs;
|
|
22116
|
+
if (definition?.type !== "Variable" || definition.parent?.type !== "VariableDeclaration" || definition.parent.kind !== "const") return UNKNOWN;
|
|
22117
|
+
const declarator = definition.node;
|
|
22118
|
+
if (declarator.id.type !== "Identifier" || declarator.init === null) return UNKNOWN;
|
|
22119
|
+
return urlParts(declarator.init, /* @__PURE__ */ new Set([...seen, binding3]), depth + 1);
|
|
22120
|
+
}
|
|
22121
|
+
if (value.type === "BinaryExpression" && value.operator === "+") {
|
|
22122
|
+
return boundedParts([...urlParts(value.left, seen, depth + 1), ...urlParts(value.right, seen, depth + 1)]);
|
|
22123
|
+
}
|
|
22124
|
+
if (value.type === "TemplateLiteral") return templateParts(value, seen, depth);
|
|
22125
|
+
return UNKNOWN;
|
|
22126
|
+
}
|
|
22127
|
+
function templateParts(value, seen, depth) {
|
|
22128
|
+
const parts = [];
|
|
22129
|
+
for (let index = 0; index < value.quasis.length; index++) {
|
|
22130
|
+
if (parts.length >= 128) return UNKNOWN;
|
|
22131
|
+
const quasi = value.quasis[index];
|
|
22132
|
+
if (quasi === void 0 || quasi.value.cooked === null) return UNKNOWN;
|
|
22133
|
+
parts.push({ text: quasi.value.cooked, source: quasi });
|
|
22134
|
+
const expression = value.expressions[index];
|
|
22135
|
+
if (expression !== void 0) parts.push(...urlParts(expression, seen, depth + 1));
|
|
22136
|
+
}
|
|
22137
|
+
return boundedParts(parts);
|
|
22138
|
+
}
|
|
22139
|
+
return {
|
|
22140
|
+
before() {
|
|
22141
|
+
sourceCode2 = context.sourceCode;
|
|
22142
|
+
reported.clear();
|
|
22143
|
+
requests.length = 0;
|
|
22144
|
+
fetchOverridden = false;
|
|
22145
|
+
const file = { filename: context.filename, cwd: context.cwd };
|
|
22146
|
+
return !isTestFile(file) && !isGeneratedFile(file, sourceCode2.text);
|
|
22147
|
+
},
|
|
22148
|
+
CallExpression(node) {
|
|
22149
|
+
if (outgoingFetch(node.callee)) requests.push(node);
|
|
22150
|
+
},
|
|
22151
|
+
AssignmentExpression(node) {
|
|
22152
|
+
checkWrite(node.left);
|
|
22153
|
+
},
|
|
22154
|
+
UpdateExpression(node) {
|
|
22155
|
+
checkWrite(node.argument);
|
|
22156
|
+
},
|
|
22157
|
+
UnaryExpression(node) {
|
|
22158
|
+
if (node.operator === "delete") checkWrite(node.argument);
|
|
22159
|
+
},
|
|
22160
|
+
ForInStatement(node) {
|
|
22161
|
+
if (node.left.type !== "VariableDeclaration") checkWrite(node.left);
|
|
22162
|
+
},
|
|
22163
|
+
ForOfStatement(node) {
|
|
22164
|
+
if (node.left.type !== "VariableDeclaration") checkWrite(node.left);
|
|
22165
|
+
},
|
|
22166
|
+
"Program:exit"() {
|
|
22167
|
+
if (fetchOverridden) return;
|
|
22168
|
+
for (const request of requests) {
|
|
22169
|
+
const [url] = request.arguments;
|
|
22170
|
+
if (url === void 0 || url.type === "SpreadElement") continue;
|
|
22171
|
+
nodesRemaining = 256;
|
|
22172
|
+
const literal2 = accountSource(urlParts(url));
|
|
22173
|
+
if (literal2 === null || reported.has(literal2)) continue;
|
|
22174
|
+
reported.add(literal2);
|
|
22175
|
+
context.report({ node: literal2, messageId: "configuredScope" });
|
|
22176
|
+
}
|
|
22177
|
+
}
|
|
22178
|
+
};
|
|
22179
|
+
}
|
|
22180
|
+
});
|
|
22181
|
+
|
|
22011
22182
|
// src/rules/prefer-constant-time-secret-compare.ts
|
|
22012
|
-
var
|
|
22183
|
+
var NAME93 = "prefer-constant-time-secret-compare";
|
|
22013
22184
|
var EQUALITY_OPERATORS3 = /* @__PURE__ */ new Set(["===", "!==", "==", "!="]);
|
|
22014
22185
|
var AUTH_TOKEN_QUALIFIERS = /* @__PURE__ */ new Set(["access", "refresh", "session", "admin", "csrf", "xsrf", "auth", "authentication", "signing", "api"]);
|
|
22015
22186
|
var SENTINEL_IDENTIFIERS = /* @__PURE__ */ new Set(["undefined", "NaN"]);
|
|
@@ -22073,7 +22244,7 @@ var prefer_constant_time_secret_compare_default = defineRule({
|
|
|
22073
22244
|
type: "problem",
|
|
22074
22245
|
docs: {
|
|
22075
22246
|
description: "Prefer a supported constant-time comparison primitive for secret-like values.",
|
|
22076
|
-
url: docsUrl(
|
|
22247
|
+
url: docsUrl(NAME93)
|
|
22077
22248
|
},
|
|
22078
22249
|
schema: [],
|
|
22079
22250
|
messages: {
|
|
@@ -22161,7 +22332,7 @@ function constInitializer4(definition) {
|
|
|
22161
22332
|
}
|
|
22162
22333
|
|
|
22163
22334
|
// src/rules/prefer-dependency-interface.ts
|
|
22164
|
-
var
|
|
22335
|
+
var NAME94 = "prefer-dependency-interface";
|
|
22165
22336
|
function readsInterfaceMember(use, members2) {
|
|
22166
22337
|
const parent = parentOf(use);
|
|
22167
22338
|
if (parent?.type !== "MemberExpression" || parent.object !== use || !members2.has(getPropertyName(parent) ?? "")) return false;
|
|
@@ -22191,7 +22362,7 @@ var prefer_dependency_interface_default = defineRule({
|
|
|
22191
22362
|
type: "suggestion",
|
|
22192
22363
|
docs: {
|
|
22193
22364
|
description: "Annotate retained collaborators with their existing interface when the consumer uses only that contract.",
|
|
22194
|
-
url: docsUrl(
|
|
22365
|
+
url: docsUrl(NAME94)
|
|
22195
22366
|
},
|
|
22196
22367
|
schema: [],
|
|
22197
22368
|
messages: { interface: "Use the existing `{{contract}}` interface for this dependency; its consumer uses only that contract." }
|
|
@@ -22548,14 +22719,14 @@ function literalTag(node) {
|
|
|
22548
22719
|
}
|
|
22549
22720
|
|
|
22550
22721
|
// src/rules/prefer-discriminated-union.ts
|
|
22551
|
-
var
|
|
22722
|
+
var NAME95 = "prefer-discriminated-union";
|
|
22552
22723
|
var prefer_discriminated_union_default = defineRule({
|
|
22553
22724
|
meta: {
|
|
22554
22725
|
type: "suggestion",
|
|
22555
22726
|
fixable: "code",
|
|
22556
22727
|
docs: {
|
|
22557
22728
|
description: "Preserve producer-proven tag/payload and Boolean state relationships in return types.",
|
|
22558
|
-
url: docsUrl(
|
|
22729
|
+
url: docsUrl(NAME95)
|
|
22559
22730
|
},
|
|
22560
22731
|
schema: [],
|
|
22561
22732
|
messages: {
|
|
@@ -22628,7 +22799,7 @@ function privateVariantType(properties2, result, sourceCode2) {
|
|
|
22628
22799
|
}
|
|
22629
22800
|
|
|
22630
22801
|
// src/rules/prefer-ecmascript-private-members.ts
|
|
22631
|
-
var
|
|
22802
|
+
var NAME96 = "prefer-ecmascript-private-members";
|
|
22632
22803
|
function isConvertible(member3) {
|
|
22633
22804
|
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);
|
|
22634
22805
|
}
|
|
@@ -22638,7 +22809,7 @@ var prefer_ecmascript_private_members_default = defineRule({
|
|
|
22638
22809
|
fixable: "code",
|
|
22639
22810
|
docs: {
|
|
22640
22811
|
description: "Prefer ECMAScript `#private` class members over TypeScript-only `private` members.",
|
|
22641
|
-
url: docsUrl(
|
|
22812
|
+
url: docsUrl(NAME96)
|
|
22642
22813
|
},
|
|
22643
22814
|
schema: [],
|
|
22644
22815
|
messages: {
|
|
@@ -22692,7 +22863,7 @@ var prefer_ecmascript_private_members_default = defineRule({
|
|
|
22692
22863
|
});
|
|
22693
22864
|
|
|
22694
22865
|
// src/rules/prefer-immutable-module-constant.ts
|
|
22695
|
-
var
|
|
22866
|
+
var NAME97 = "prefer-immutable-module-constant";
|
|
22696
22867
|
var CONSTANT_NAME = /^_?[A-Z][A-Z0-9_]*$/;
|
|
22697
22868
|
var JAVASCRIPT_FILE_RE = /\.[cm]?jsx?$/i;
|
|
22698
22869
|
var MUTATING_METHODS = /* @__PURE__ */ new Set([
|
|
@@ -22865,7 +23036,7 @@ var prefer_immutable_module_constant_default = defineRule({
|
|
|
22865
23036
|
fixable: "code",
|
|
22866
23037
|
docs: {
|
|
22867
23038
|
description: "Require module-level constant collections to expose readonly state.",
|
|
22868
|
-
url: docsUrl(
|
|
23039
|
+
url: docsUrl(NAME97)
|
|
22869
23040
|
},
|
|
22870
23041
|
schema: [],
|
|
22871
23042
|
defaultOptions: [],
|
|
@@ -22971,7 +23142,7 @@ function unwrapTransparentExport(node) {
|
|
|
22971
23142
|
}
|
|
22972
23143
|
|
|
22973
23144
|
// src/rules/prefer-input-group-search.ts
|
|
22974
|
-
var
|
|
23145
|
+
var NAME98 = "prefer-input-group-search";
|
|
22975
23146
|
var INPUT_MODULE = /(?:^|\/)components\/ui\/input$/u;
|
|
22976
23147
|
var INPUT_GROUP_MODULE = /(?:^|\/)components\/ui\/input-group$/u;
|
|
22977
23148
|
var MAX_JSX_DISTANCE = 2;
|
|
@@ -23042,7 +23213,7 @@ var prefer_input_group_search_default = defineRule({
|
|
|
23042
23213
|
type: "suggestion",
|
|
23043
23214
|
docs: {
|
|
23044
23215
|
description: "Require search icons and shared Input controls in the same visual wrapper to use InputGroup.",
|
|
23045
|
-
url: docsUrl(
|
|
23216
|
+
url: docsUrl(NAME98)
|
|
23046
23217
|
},
|
|
23047
23218
|
schema: [],
|
|
23048
23219
|
messages: {
|
|
@@ -23126,7 +23297,7 @@ var prefer_input_group_search_default = defineRule({
|
|
|
23126
23297
|
});
|
|
23127
23298
|
|
|
23128
23299
|
// src/rules/prefer-logical-tailwind-utilities.ts
|
|
23129
|
-
var
|
|
23300
|
+
var NAME99 = "prefer-logical-tailwind-utilities";
|
|
23130
23301
|
var PREFIXES = {
|
|
23131
23302
|
ml: "ms",
|
|
23132
23303
|
mr: "me",
|
|
@@ -23180,7 +23351,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
|
|
|
23180
23351
|
type: "suggestion",
|
|
23181
23352
|
docs: {
|
|
23182
23353
|
description: "Prefer logical Tailwind utilities in explicitly opted-in bidirectional interfaces.",
|
|
23183
|
-
url: docsUrl(
|
|
23354
|
+
url: docsUrl(NAME99)
|
|
23184
23355
|
},
|
|
23185
23356
|
schema: [
|
|
23186
23357
|
{
|
|
@@ -23247,7 +23418,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
|
|
|
23247
23418
|
});
|
|
23248
23419
|
|
|
23249
23420
|
// src/rules/prefer-millisecond-control-duration-schema.ts
|
|
23250
|
-
var
|
|
23421
|
+
var NAME100 = "prefer-millisecond-control-duration-schema";
|
|
23251
23422
|
var CONTROL_SECONDS_RE = /(?:^|_)(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)_seconds$/i;
|
|
23252
23423
|
var CONTROL_SECONDS_CAMEL_RE = /(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)Seconds$/i;
|
|
23253
23424
|
var NUMERIC_REFINEMENTS = /* @__PURE__ */ new Set(["int", "min", "max", "positive", "nonnegative", "finite", "multipleOf", "optional", "nullable", "nullish", "default", "describe", "brand", "readonly"]);
|
|
@@ -23259,7 +23430,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
|
|
|
23259
23430
|
type: "suggestion",
|
|
23260
23431
|
docs: {
|
|
23261
23432
|
description: "Require application-owned Zod control-duration fields to use millisecond granularity.",
|
|
23262
|
-
url: docsUrl(
|
|
23433
|
+
url: docsUrl(NAME100)
|
|
23263
23434
|
},
|
|
23264
23435
|
schema: [],
|
|
23265
23436
|
messages: {
|
|
@@ -23345,7 +23516,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
|
|
|
23345
23516
|
});
|
|
23346
23517
|
|
|
23347
23518
|
// src/rules/prefer-minimal-parameter-contract.ts
|
|
23348
|
-
var
|
|
23519
|
+
var NAME101 = "prefer-minimal-parameter-contract";
|
|
23349
23520
|
function inlineFields(ast, node, reads) {
|
|
23350
23521
|
const fields2 = /* @__PURE__ */ new Map();
|
|
23351
23522
|
for (const member3 of node.members) {
|
|
@@ -23364,7 +23535,7 @@ var prefer_minimal_parameter_contract_default = defineRule({
|
|
|
23364
23535
|
meta: {
|
|
23365
23536
|
type: "suggestion",
|
|
23366
23537
|
fixable: "code",
|
|
23367
|
-
docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(
|
|
23538
|
+
docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(NAME101) },
|
|
23368
23539
|
schema: [],
|
|
23369
23540
|
messages: {
|
|
23370
23541
|
minimal: "This private consumer reads only {{used}} but also requires {{unused}}. Review a smaller consumer contract; preserve the original runtime object and producer type."
|
|
@@ -23763,7 +23934,7 @@ var prefer_module_level_constant_default = defineRule({
|
|
|
23763
23934
|
});
|
|
23764
23935
|
|
|
23765
23936
|
// src/rules/prefer-module-level-schema.ts
|
|
23766
|
-
var
|
|
23937
|
+
var NAME102 = "prefer-module-level-schema";
|
|
23767
23938
|
var DEFAULT_FACTORIES = [
|
|
23768
23939
|
"discriminatedUnion",
|
|
23769
23940
|
"intersection",
|
|
@@ -23945,7 +24116,7 @@ var prefer_module_level_schema_default = defineRule({
|
|
|
23945
24116
|
type: "problem",
|
|
23946
24117
|
docs: {
|
|
23947
24118
|
description: "Declare a Zod schema at module scope when it closes over nothing in the enclosing function",
|
|
23948
|
-
url: docsUrl(
|
|
24119
|
+
url: docsUrl(NAME102)
|
|
23949
24120
|
},
|
|
23950
24121
|
schema: [
|
|
23951
24122
|
{
|
|
@@ -24095,7 +24266,7 @@ var prefer_module_level_schema_default = defineRule({
|
|
|
24095
24266
|
});
|
|
24096
24267
|
|
|
24097
24268
|
// src/rules/prefer-module-level-refined-schema.ts
|
|
24098
|
-
var
|
|
24269
|
+
var NAME103 = "prefer-module-level-refined-schema";
|
|
24099
24270
|
var BENCHMARK_PATH_RE = /(^|[/\\])(?:benchmarks?|bench)[/\\]/;
|
|
24100
24271
|
var FACTORIES = /* @__PURE__ */ new Set([
|
|
24101
24272
|
"array",
|
|
@@ -24245,7 +24416,7 @@ var prefer_module_level_refined_schema_default = defineRule({
|
|
|
24245
24416
|
type: "suggestion",
|
|
24246
24417
|
docs: {
|
|
24247
24418
|
description: "Declare closed Zod scalar, format, and wrapper schemas at module scope.",
|
|
24248
|
-
url: docsUrl(
|
|
24419
|
+
url: docsUrl(NAME103)
|
|
24249
24420
|
},
|
|
24250
24421
|
schema: [],
|
|
24251
24422
|
messages: {
|
|
@@ -24343,7 +24514,7 @@ var prefer_module_level_refined_schema_default = defineRule({
|
|
|
24343
24514
|
});
|
|
24344
24515
|
|
|
24345
24516
|
// src/rules/prefer-multi-value-zod-literal.ts
|
|
24346
|
-
var
|
|
24517
|
+
var NAME104 = "prefer-multi-value-zod-literal";
|
|
24347
24518
|
function isStaticPrimitive(node, sourceCode2) {
|
|
24348
24519
|
node = unwrapExpression(node);
|
|
24349
24520
|
if (node.type === "Literal") {
|
|
@@ -24370,7 +24541,7 @@ var prefer_multi_value_zod_literal_default = defineRule({
|
|
|
24370
24541
|
type: "suggestion",
|
|
24371
24542
|
docs: {
|
|
24372
24543
|
description: "Use the Zod 4 multi-value literal API instead of a union of literal schemas.",
|
|
24373
|
-
url: docsUrl(
|
|
24544
|
+
url: docsUrl(NAME104)
|
|
24374
24545
|
},
|
|
24375
24546
|
schema: [
|
|
24376
24547
|
{
|
|
@@ -24533,7 +24704,7 @@ function closedType(node) {
|
|
|
24533
24704
|
}
|
|
24534
24705
|
|
|
24535
24706
|
// src/rules/prefer-named-callback-domain.ts
|
|
24536
|
-
var
|
|
24707
|
+
var NAME105 = "prefer-named-callback-domain";
|
|
24537
24708
|
function isLiteralUnion(node) {
|
|
24538
24709
|
return node.type === "TSUnionType" && node.types.length >= 2 && node.types.every((part) => part.type === "TSLiteralType");
|
|
24539
24710
|
}
|
|
@@ -24553,7 +24724,7 @@ var prefer_named_callback_domain_default = defineRule({
|
|
|
24553
24724
|
fixable: "code",
|
|
24554
24725
|
docs: {
|
|
24555
24726
|
description: "Name literal-union domains used by callbacks in exported contracts.",
|
|
24556
|
-
url: docsUrl(
|
|
24727
|
+
url: docsUrl(NAME105)
|
|
24557
24728
|
},
|
|
24558
24729
|
schema: [],
|
|
24559
24730
|
messages: {
|
|
@@ -24592,7 +24763,7 @@ var prefer_named_callback_domain_default = defineRule({
|
|
|
24592
24763
|
});
|
|
24593
24764
|
|
|
24594
24765
|
// src/rules/prefer-named-complex-return-type.ts
|
|
24595
|
-
var
|
|
24766
|
+
var NAME106 = "prefer-named-complex-return-type";
|
|
24596
24767
|
function unwrap5(node) {
|
|
24597
24768
|
if (node.type === "TSTypeReference" && node.typeArguments?.params.length === 1) {
|
|
24598
24769
|
const [inner] = node.typeArguments.params;
|
|
@@ -24630,7 +24801,7 @@ var prefer_named_complex_return_type_default = defineRule({
|
|
|
24630
24801
|
fixable: "code",
|
|
24631
24802
|
docs: {
|
|
24632
24803
|
description: "Prefer a named contract for structurally complex function return types.",
|
|
24633
|
-
url: docsUrl(
|
|
24804
|
+
url: docsUrl(NAME106)
|
|
24634
24805
|
},
|
|
24635
24806
|
schema: [],
|
|
24636
24807
|
messages: {
|
|
@@ -24653,14 +24824,14 @@ var prefer_named_complex_return_type_default = defineRule({
|
|
|
24653
24824
|
});
|
|
24654
24825
|
|
|
24655
24826
|
// src/rules/prefer-native-fetch-in-server-actions.ts
|
|
24656
|
-
var
|
|
24827
|
+
var NAME107 = "prefer-native-fetch-in-server-actions";
|
|
24657
24828
|
var KY_MODULE = /^ky(?:\/.*)?$/u;
|
|
24658
24829
|
var prefer_native_fetch_in_server_actions_default = defineRule({
|
|
24659
24830
|
meta: {
|
|
24660
24831
|
type: "problem",
|
|
24661
24832
|
docs: {
|
|
24662
24833
|
description: "Server action modules should call native fetch instead of importing ky.",
|
|
24663
|
-
url: docsUrl(
|
|
24834
|
+
url: docsUrl(NAME107)
|
|
24664
24835
|
},
|
|
24665
24836
|
schema: [],
|
|
24666
24837
|
defaultOptions: [],
|
|
@@ -24696,7 +24867,7 @@ function isTypeOnly(node) {
|
|
|
24696
24867
|
}
|
|
24697
24868
|
|
|
24698
24869
|
// src/rules/prefer-native-random-uuid.ts
|
|
24699
|
-
var
|
|
24870
|
+
var NAME108 = "prefer-native-random-uuid";
|
|
24700
24871
|
function requireUuidCallee(node) {
|
|
24701
24872
|
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;
|
|
24702
24873
|
}
|
|
@@ -24709,7 +24880,7 @@ var prefer_native_random_uuid_default = defineRule({
|
|
|
24709
24880
|
type: "suggestion",
|
|
24710
24881
|
docs: {
|
|
24711
24882
|
description: "Prefer `globalThis.crypto.randomUUID()` over resolved zero-argument UUID v4 bindings from the `uuid` package.",
|
|
24712
|
-
url: docsUrl(
|
|
24883
|
+
url: docsUrl(NAME108)
|
|
24713
24884
|
},
|
|
24714
24885
|
hasSuggestions: true,
|
|
24715
24886
|
fixable: "code",
|
|
@@ -24797,7 +24968,7 @@ var prefer_native_random_uuid_default = defineRule({
|
|
|
24797
24968
|
});
|
|
24798
24969
|
|
|
24799
24970
|
// src/rules/prefer-node-crypto-hash.ts
|
|
24800
|
-
var
|
|
24971
|
+
var NAME109 = "prefer-node-crypto-hash";
|
|
24801
24972
|
var UNSAFE_NAMESPACE_METHODS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "valueOf"]);
|
|
24802
24973
|
var UNSAFE_AUTHORITY_IDENTIFIERS = [
|
|
24803
24974
|
"eval",
|
|
@@ -24901,7 +25072,7 @@ var prefer_node_crypto_hash_default = defineRule({
|
|
|
24901
25072
|
fixable: "code",
|
|
24902
25073
|
docs: {
|
|
24903
25074
|
description: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary.",
|
|
24904
|
-
url: docsUrl(
|
|
25075
|
+
url: docsUrl(NAME109)
|
|
24905
25076
|
},
|
|
24906
25077
|
schema: [],
|
|
24907
25078
|
messages: { preferNodeCryptoHash: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary." }
|
|
@@ -25131,7 +25302,7 @@ function hasRetainedFactoryCall(binding3, removed) {
|
|
|
25131
25302
|
}
|
|
25132
25303
|
|
|
25133
25304
|
// src/rules/prefer-node-fs-promises.ts
|
|
25134
|
-
var
|
|
25305
|
+
var NAME110 = "prefer-node-fs-promises";
|
|
25135
25306
|
function memberName3(node) {
|
|
25136
25307
|
if (!node.computed && node.property.type === "Identifier") return node.property.name;
|
|
25137
25308
|
if (node.computed && node.property.type === "Literal" && typeof node.property.value === "string") {
|
|
@@ -25164,7 +25335,7 @@ var prefer_node_fs_promises_default = defineRule({
|
|
|
25164
25335
|
type: "suggestion",
|
|
25165
25336
|
docs: {
|
|
25166
25337
|
description: "Prefer promise-based Node.js filesystem APIs over synchronous calls in production modules.",
|
|
25167
|
-
url: docsUrl(
|
|
25338
|
+
url: docsUrl(NAME110)
|
|
25168
25339
|
},
|
|
25169
25340
|
schema: [],
|
|
25170
25341
|
messages: {
|
|
@@ -25307,7 +25478,7 @@ function sameTypeBinding(sourceCode2, alias, annotation, parameter) {
|
|
|
25307
25478
|
}
|
|
25308
25479
|
|
|
25309
25480
|
// src/rules/prefer-nominal-id-types.ts
|
|
25310
|
-
var
|
|
25481
|
+
var NAME111 = "prefer-nominal-id-types";
|
|
25311
25482
|
var OPERATIONAL_ROLES = /* @__PURE__ */ new Set([
|
|
25312
25483
|
"request",
|
|
25313
25484
|
"trace",
|
|
@@ -25423,7 +25594,7 @@ var prefer_nominal_id_types_default = defineRule({
|
|
|
25423
25594
|
fixable: "code",
|
|
25424
25595
|
docs: {
|
|
25425
25596
|
description: "Distinguish identifier roles sharing primitive types at callable boundaries.",
|
|
25426
|
-
url: docsUrl(
|
|
25597
|
+
url: docsUrl(NAME111)
|
|
25427
25598
|
},
|
|
25428
25599
|
schema: [],
|
|
25429
25600
|
messages: {
|
|
@@ -25452,7 +25623,7 @@ var prefer_nominal_id_types_default = defineRule({
|
|
|
25452
25623
|
});
|
|
25453
25624
|
|
|
25454
25625
|
// src/rules/prefer-non-nullable-collection.ts
|
|
25455
|
-
var
|
|
25626
|
+
var NAME112 = "prefer-non-nullable-collection";
|
|
25456
25627
|
var ARRAY_TYPE_NAMES2 = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
|
|
25457
25628
|
var NULL_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "==="]);
|
|
25458
25629
|
var EMPTY_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "===", "<="]);
|
|
@@ -25807,7 +25978,7 @@ var prefer_non_nullable_collection_default = defineRule({
|
|
|
25807
25978
|
fixable: "code",
|
|
25808
25979
|
docs: {
|
|
25809
25980
|
description: "Suggest reviewing nullish arrays that use local empty-array defaults or a shared null-or-empty guard.",
|
|
25810
|
-
url: docsUrl(
|
|
25981
|
+
url: docsUrl(NAME112)
|
|
25811
25982
|
},
|
|
25812
25983
|
schema: [],
|
|
25813
25984
|
messages: {
|
|
@@ -25918,7 +26089,7 @@ var prefer_non_nullable_collection_default = defineRule({
|
|
|
25918
26089
|
});
|
|
25919
26090
|
|
|
25920
26091
|
// src/rules/prefer-nullish-filter-predicate.ts
|
|
25921
|
-
var
|
|
26092
|
+
var NAME113 = "prefer-nullish-filter-predicate";
|
|
25922
26093
|
var SUMMARY = "Prefer an explicit nullish predicate when `filter(Boolean)` removes only nullish values but does not narrow the result type.";
|
|
25923
26094
|
function isBuiltinArrayFilter(native, symbol) {
|
|
25924
26095
|
const kinds2 = native.ast.SyntaxKind;
|
|
@@ -25975,7 +26146,7 @@ function isLiteralValue(node) {
|
|
|
25975
26146
|
var prefer_nullish_filter_predicate_default = defineRule({
|
|
25976
26147
|
meta: {
|
|
25977
26148
|
type: "suggestion",
|
|
25978
|
-
docs: { description: SUMMARY, url: docsUrl(
|
|
26149
|
+
docs: { description: SUMMARY, url: docsUrl(NAME113) },
|
|
25979
26150
|
hasSuggestions: true,
|
|
25980
26151
|
fixable: "code",
|
|
25981
26152
|
schema: [],
|
|
@@ -26068,7 +26239,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
|
|
|
26068
26239
|
});
|
|
26069
26240
|
|
|
26070
26241
|
// src/rules/prefer-schema-for-api-payload.ts
|
|
26071
|
-
var
|
|
26242
|
+
var NAME114 = "prefer-schema-for-api-payload";
|
|
26072
26243
|
var unwrap6 = (node) => {
|
|
26073
26244
|
let current = node ?? null;
|
|
26074
26245
|
while (current !== null && (isErasedExpression(current) || current.type === "ChainExpression")) current = current.expression;
|
|
@@ -26351,7 +26522,7 @@ var prefer_schema_for_api_payload_default = defineRule({
|
|
|
26351
26522
|
type: "problem",
|
|
26352
26523
|
docs: {
|
|
26353
26524
|
description: "Require Zod (or similar) schema validation on `response.json()` / `JSON.parse()` results before property access.",
|
|
26354
|
-
url: docsUrl(
|
|
26525
|
+
url: docsUrl(NAME114)
|
|
26355
26526
|
},
|
|
26356
26527
|
schema: [],
|
|
26357
26528
|
messages: {
|
|
@@ -26534,7 +26705,7 @@ var prefer_schema_for_api_payload_default = defineRule({
|
|
|
26534
26705
|
// src/rules/prefer-semantic-colors.ts
|
|
26535
26706
|
import { existsSync as existsSync3, lstatSync, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "fs";
|
|
26536
26707
|
import { dirname as dirname3, join as join3, parse } from "path";
|
|
26537
|
-
var
|
|
26708
|
+
var NAME115 = "prefer-semantic-colors";
|
|
26538
26709
|
var COLOR_PREFIXES = "text|bg|border(?:-[trblxyse])?|ring(?:-offset)?|fill|stroke|from|via|to|divide|decoration|placeholder|accent|caret|shadow|outline";
|
|
26539
26710
|
var PALETTE = "red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone";
|
|
26540
26711
|
var COLOR_FN = "rgba?|hsla?|hwb|oklch|oklab|lab|lch|color";
|
|
@@ -26866,7 +27037,7 @@ var prefer_semantic_colors_default = defineRule({
|
|
|
26866
27037
|
type: "suggestion",
|
|
26867
27038
|
docs: {
|
|
26868
27039
|
description: "Enforce semantic color tokens over raw Tailwind palette classes, arbitrary color values, and inline color literals.",
|
|
26869
|
-
url: docsUrl(
|
|
27040
|
+
url: docsUrl(NAME115)
|
|
26870
27041
|
},
|
|
26871
27042
|
schema: [
|
|
26872
27043
|
{
|
|
@@ -27053,7 +27224,7 @@ function packageWorkspaceGlobs(parsed) {
|
|
|
27053
27224
|
}
|
|
27054
27225
|
|
|
27055
27226
|
// src/rules/prefer-server-actions.ts
|
|
27056
|
-
var
|
|
27227
|
+
var NAME116 = "prefer-server-actions";
|
|
27057
27228
|
var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "DELETE", "PATCH"]);
|
|
27058
27229
|
var AXIOS_MUTATION_METHODS = /* @__PURE__ */ new Set(["post", "put", "delete", "patch"]);
|
|
27059
27230
|
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\/)/;
|
|
@@ -27192,7 +27363,7 @@ var prefer_server_actions_default = defineRule({
|
|
|
27192
27363
|
type: "suggestion",
|
|
27193
27364
|
docs: {
|
|
27194
27365
|
description: "Prefer Next.js Server Actions over same-origin API mutations.",
|
|
27195
|
-
url: docsUrl(
|
|
27366
|
+
url: docsUrl(NAME116)
|
|
27196
27367
|
},
|
|
27197
27368
|
schema: [
|
|
27198
27369
|
{
|
|
@@ -27278,7 +27449,7 @@ var prefer_server_actions_default = defineRule({
|
|
|
27278
27449
|
});
|
|
27279
27450
|
|
|
27280
27451
|
// src/rules/prefer-server-data-preparation.ts
|
|
27281
|
-
var
|
|
27452
|
+
var NAME117 = "prefer-server-data-preparation";
|
|
27282
27453
|
var METHODS = /* @__PURE__ */ new Set(["map", "filter", "flatMap"]);
|
|
27283
27454
|
var DOM_EVENTS = /* @__PURE__ */ new Set(["onClick", "onChange", "onInput", "onSubmit"]);
|
|
27284
27455
|
var BINARY = /* @__PURE__ */ new Set(["===", "!==", "==", "!=", ">", ">=", "<", "<=", "+", "-", "*", "/", "%"]);
|
|
@@ -27410,7 +27581,7 @@ function typedProofs(native) {
|
|
|
27410
27581
|
var prefer_server_data_preparation_default = defineRule({
|
|
27411
27582
|
meta: {
|
|
27412
27583
|
type: "suggestion",
|
|
27413
|
-
docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(
|
|
27584
|
+
docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(NAME117) },
|
|
27414
27585
|
schema: [],
|
|
27415
27586
|
messages: {
|
|
27416
27587
|
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."
|
|
@@ -28328,7 +28499,7 @@ var ParseErrorCode;
|
|
|
28328
28499
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
28329
28500
|
|
|
28330
28501
|
// src/rules/prefer-shadcn-primitives.ts
|
|
28331
|
-
var
|
|
28502
|
+
var NAME118 = "prefer-shadcn-primitives";
|
|
28332
28503
|
var RAW_PRIMITIVES = {
|
|
28333
28504
|
button: { capability: "Button", replacement: "Button" },
|
|
28334
28505
|
dialog: { capability: "Dialog", replacement: "Dialog or AlertDialog family" },
|
|
@@ -28630,7 +28801,7 @@ var prefer_shadcn_primitives_default = defineRule({
|
|
|
28630
28801
|
type: "suggestion",
|
|
28631
28802
|
docs: {
|
|
28632
28803
|
description: "Require visible raw JSX controls to use the corresponding shared shadcn primitive.",
|
|
28633
|
-
url: docsUrl(
|
|
28804
|
+
url: docsUrl(NAME118)
|
|
28634
28805
|
},
|
|
28635
28806
|
schema: [
|
|
28636
28807
|
{
|
|
@@ -28737,7 +28908,7 @@ function matchingAliasTargets(paths, alias) {
|
|
|
28737
28908
|
}
|
|
28738
28909
|
|
|
28739
28910
|
// src/rules/prefer-shared-zod-enum.ts
|
|
28740
|
-
var
|
|
28911
|
+
var NAME119 = "prefer-shared-zod-enum";
|
|
28741
28912
|
function literalDomain(node) {
|
|
28742
28913
|
if (node.arguments.length !== 1) return null;
|
|
28743
28914
|
const first = node.arguments[0];
|
|
@@ -28776,7 +28947,7 @@ var prefer_shared_zod_enum_default = defineRule({
|
|
|
28776
28947
|
type: "suggestion",
|
|
28777
28948
|
docs: {
|
|
28778
28949
|
description: "Give repeated literal Zod enum domains one reusable module-level schema.",
|
|
28779
|
-
url: docsUrl(
|
|
28950
|
+
url: docsUrl(NAME119)
|
|
28780
28951
|
},
|
|
28781
28952
|
schema: [],
|
|
28782
28953
|
messages: {
|
|
@@ -28833,7 +29004,7 @@ var prefer_shared_zod_enum_default = defineRule({
|
|
|
28833
29004
|
});
|
|
28834
29005
|
|
|
28835
29006
|
// src/rules/prefer-switch-for-repeated-equality.ts
|
|
28836
|
-
var
|
|
29007
|
+
var NAME120 = "prefer-switch-for-repeated-equality";
|
|
28837
29008
|
function discriminantName(test) {
|
|
28838
29009
|
if (test.type !== "BinaryExpression" || test.operator !== "===") return null;
|
|
28839
29010
|
const leftIsCase = isCaseValue(test.left);
|
|
@@ -28910,7 +29081,7 @@ var prefer_switch_for_repeated_equality_default = defineRule({
|
|
|
28910
29081
|
fixable: "code",
|
|
28911
29082
|
docs: {
|
|
28912
29083
|
description: "Prefer switch over long if/else-if chains that compare one value for strict equality.",
|
|
28913
|
-
url: docsUrl(
|
|
29084
|
+
url: docsUrl(NAME120)
|
|
28914
29085
|
},
|
|
28915
29086
|
schema: [],
|
|
28916
29087
|
messages: {
|
|
@@ -28960,7 +29131,7 @@ var prefer_switch_for_repeated_equality_default = defineRule({
|
|
|
28960
29131
|
});
|
|
28961
29132
|
|
|
28962
29133
|
// src/rules/prefer-test-fixture-reuse.ts
|
|
28963
|
-
var
|
|
29134
|
+
var NAME121 = "prefer-test-fixture-reuse";
|
|
28964
29135
|
var MAX_DEPTH2 = 8;
|
|
28965
29136
|
var FRAMEWORKS = /* @__PURE__ */ new Set(["vitest", "@playwright/test"]);
|
|
28966
29137
|
var TEST_MODIFIERS4 = /* @__PURE__ */ new Set(["only", "skip", "concurrent", "sequential"]);
|
|
@@ -29089,7 +29260,7 @@ var prefer_test_fixture_reuse_default = defineRule({
|
|
|
29089
29260
|
type: "suggestion",
|
|
29090
29261
|
docs: {
|
|
29091
29262
|
description: "Reuse a requested test fixture instead of constructing another instance of its class.",
|
|
29092
|
-
url: docsUrl(
|
|
29263
|
+
url: docsUrl(NAME121)
|
|
29093
29264
|
},
|
|
29094
29265
|
schema: [],
|
|
29095
29266
|
messages: { reuseFixture: "This class is already supplied by the requested `{{fixture}}` fixture; reuse it or request a typed factory for independent instances." }
|
|
@@ -29123,7 +29294,7 @@ var prefer_test_fixture_reuse_default = defineRule({
|
|
|
29123
29294
|
});
|
|
29124
29295
|
|
|
29125
29296
|
// src/rules/prefer-typed-reflection.ts
|
|
29126
|
-
var
|
|
29297
|
+
var NAME122 = "prefer-typed-reflection";
|
|
29127
29298
|
function knownType(native, type) {
|
|
29128
29299
|
if (type.isUnionType()) return type.getTypes().every((part) => knownType(native, part));
|
|
29129
29300
|
const flags = native.sync.TypeFlags;
|
|
@@ -29153,7 +29324,7 @@ var prefer_typed_reflection_default = defineRule({
|
|
|
29153
29324
|
fixable: "code",
|
|
29154
29325
|
docs: {
|
|
29155
29326
|
description: "Prefer typed access when Reflect.get or Reflect.apply discards a known contract.",
|
|
29156
|
-
url: docsUrl(
|
|
29327
|
+
url: docsUrl(NAME122)
|
|
29157
29328
|
},
|
|
29158
29329
|
schema: [],
|
|
29159
29330
|
messages: {
|
|
@@ -29319,7 +29490,7 @@ var prefer_typed_reflection_default = defineRule({
|
|
|
29319
29490
|
});
|
|
29320
29491
|
|
|
29321
29492
|
// src/rules/prefer-whole-object-assertion.ts
|
|
29322
|
-
var
|
|
29493
|
+
var NAME123 = "prefer-whole-object-assertion";
|
|
29323
29494
|
var MERGEABLE_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
|
|
29324
29495
|
var SYNTHETIC_LITERAL_MATCHERS = /* @__PURE__ */ new Map([
|
|
29325
29496
|
["toBeNull", "null"]
|
|
@@ -29409,7 +29580,7 @@ var prefer_whole_object_assertion_default = defineRule({
|
|
|
29409
29580
|
type: "suggestion",
|
|
29410
29581
|
docs: {
|
|
29411
29582
|
description: "Collapse consecutive assertions on one object into a whole-object assertion so related mismatches are reported together.",
|
|
29412
|
-
url: docsUrl(
|
|
29583
|
+
url: docsUrl(NAME123)
|
|
29413
29584
|
},
|
|
29414
29585
|
messages: {
|
|
29415
29586
|
combineAssertions: "Consider combining these {{count}} assertions on `{{receiver}}` with `toMatchObject` when structural matching preserves property presence and getter or proxy behavior.",
|
|
@@ -29556,7 +29727,7 @@ var prefer_whole_object_assertion_default = defineRule({
|
|
|
29556
29727
|
});
|
|
29557
29728
|
|
|
29558
29729
|
// src/rules/prefer-zod-enum-validator.ts
|
|
29559
|
-
var
|
|
29730
|
+
var NAME124 = "prefer-zod-enum-validator";
|
|
29560
29731
|
function isInput(node, name) {
|
|
29561
29732
|
if (node == null) return false;
|
|
29562
29733
|
const value = unwrapExpression(node);
|
|
@@ -29647,7 +29818,7 @@ var prefer_zod_enum_validator_default = defineRule({
|
|
|
29647
29818
|
type: "suggestion",
|
|
29648
29819
|
docs: {
|
|
29649
29820
|
description: "Express closed string validators with a reusable Zod enum schema.",
|
|
29650
|
-
url: docsUrl(
|
|
29821
|
+
url: docsUrl(NAME124)
|
|
29651
29822
|
},
|
|
29652
29823
|
schema: [],
|
|
29653
29824
|
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." }
|
|
@@ -29675,7 +29846,7 @@ var prefer_zod_enum_validator_default = defineRule({
|
|
|
29675
29846
|
});
|
|
29676
29847
|
|
|
29677
29848
|
// src/rules/prefer-zod-infer.ts
|
|
29678
|
-
var
|
|
29849
|
+
var NAME125 = "prefer-zod-infer";
|
|
29679
29850
|
function absent(value) {
|
|
29680
29851
|
return value === void 0 || value === null;
|
|
29681
29852
|
}
|
|
@@ -30051,7 +30222,7 @@ var prefer_zod_infer_default = defineRule({
|
|
|
30051
30222
|
fixable: "code",
|
|
30052
30223
|
docs: {
|
|
30053
30224
|
description: "Derive a type from its Zod schema with `z.infer` instead of hand-writing a twin declaration beside it.",
|
|
30054
|
-
url: docsUrl(
|
|
30225
|
+
url: docsUrl(NAME125)
|
|
30055
30226
|
},
|
|
30056
30227
|
schema: [
|
|
30057
30228
|
{
|
|
@@ -30501,7 +30672,7 @@ function returnsContract(authority, returned2) {
|
|
|
30501
30672
|
}
|
|
30502
30673
|
|
|
30503
30674
|
// src/rules/prefer-zod-parse-output-type.ts
|
|
30504
|
-
var
|
|
30675
|
+
var NAME126 = "prefer-zod-parse-output-type";
|
|
30505
30676
|
function isLocalZodObjectSchema(node, namespaces) {
|
|
30506
30677
|
let current = node;
|
|
30507
30678
|
while (current.type === "CallExpression") {
|
|
@@ -30647,7 +30818,7 @@ var prefer_zod_parse_output_type_default = defineRule({
|
|
|
30647
30818
|
fixable: "code",
|
|
30648
30819
|
docs: {
|
|
30649
30820
|
description: "Consider deriving validated return contracts from the Zod schema when the schema owns the contract.",
|
|
30650
|
-
url: docsUrl(
|
|
30821
|
+
url: docsUrl(NAME126)
|
|
30651
30822
|
},
|
|
30652
30823
|
schema: [],
|
|
30653
30824
|
messages: {
|
|
@@ -30935,7 +31106,7 @@ var production_derived_test_cases_default = defineRule({
|
|
|
30935
31106
|
});
|
|
30936
31107
|
|
|
30937
31108
|
// src/rules/repeated-static-call-cases.ts
|
|
30938
|
-
var
|
|
31109
|
+
var NAME127 = "repeated-static-call-cases";
|
|
30939
31110
|
var TEST_MODULES2 = /* @__PURE__ */ new Set(["@jest/globals", "@playwright/test", "bun:test", "node:test", "vitest"]);
|
|
30940
31111
|
var TEST_NAMES3 = /* @__PURE__ */ new Set(["it", "test"]);
|
|
30941
31112
|
var TEST_MODIFIERS5 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
|
|
@@ -31059,7 +31230,7 @@ var repeated_static_call_cases_default = defineRule({
|
|
|
31059
31230
|
type: "suggestion",
|
|
31060
31231
|
docs: {
|
|
31061
31232
|
description: "Review three or more consecutive static-input call assertions as potential named cases.",
|
|
31062
|
-
url: docsUrl(
|
|
31233
|
+
url: docsUrl(NAME127)
|
|
31063
31234
|
},
|
|
31064
31235
|
schema: [],
|
|
31065
31236
|
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." }
|
|
@@ -31201,7 +31372,7 @@ function isPrimitiveReturn(node, annotation) {
|
|
|
31201
31372
|
}
|
|
31202
31373
|
|
|
31203
31374
|
// src/rules/require-assert-never.ts
|
|
31204
|
-
var
|
|
31375
|
+
var NAME128 = "require-assert-never";
|
|
31205
31376
|
function isRuntimeHandlingStatement(statement) {
|
|
31206
31377
|
if (statement.type === "EmptyStatement") return false;
|
|
31207
31378
|
if (statement.type === "BreakStatement") return statement.label !== null;
|
|
@@ -31261,7 +31432,7 @@ var require_assert_never_default = defineRule({
|
|
|
31261
31432
|
fixable: "code",
|
|
31262
31433
|
docs: {
|
|
31263
31434
|
description: "Require an empty switch default to call `assertNever` so discriminated unions remain exhaustive at compile time.",
|
|
31264
|
-
url: docsUrl(
|
|
31435
|
+
url: docsUrl(NAME128)
|
|
31265
31436
|
},
|
|
31266
31437
|
schema: [],
|
|
31267
31438
|
messages: {
|
|
@@ -31305,7 +31476,7 @@ var require_assert_never_default = defineRule({
|
|
|
31305
31476
|
});
|
|
31306
31477
|
|
|
31307
31478
|
// src/rules/require-button-accessible-name.ts
|
|
31308
|
-
var
|
|
31479
|
+
var NAME129 = "require-button-accessible-name";
|
|
31309
31480
|
var DELEGATING_PROPS = /* @__PURE__ */ new Set(["render", "asChild"]);
|
|
31310
31481
|
function delegatesRendering(opening) {
|
|
31311
31482
|
return opening.attributes.some(
|
|
@@ -31318,7 +31489,7 @@ var require_button_accessible_name_default = defineRule({
|
|
|
31318
31489
|
type: "problem",
|
|
31319
31490
|
docs: {
|
|
31320
31491
|
description: "Require an accessible name on statically unnamed native or configured JSX buttons.",
|
|
31321
|
-
url: docsUrl(
|
|
31492
|
+
url: docsUrl(NAME129)
|
|
31322
31493
|
},
|
|
31323
31494
|
schema: [
|
|
31324
31495
|
{
|
|
@@ -31372,7 +31543,7 @@ var require_button_accessible_name_default = defineRule({
|
|
|
31372
31543
|
});
|
|
31373
31544
|
|
|
31374
31545
|
// src/rules/require-camelcase-properties.ts
|
|
31375
|
-
var
|
|
31546
|
+
var NAME130 = "require-camelcase-properties";
|
|
31376
31547
|
var SNAKE_CASE_RE2 = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)+$/u;
|
|
31377
31548
|
function blocksRename(member3, name) {
|
|
31378
31549
|
if (member3.type === "TSIndexSignature" || "computed" in member3 && member3.computed) return true;
|
|
@@ -31386,7 +31557,7 @@ var require_camelcase_properties_default = defineRule({
|
|
|
31386
31557
|
fixable: "code",
|
|
31387
31558
|
docs: {
|
|
31388
31559
|
description: "Require unquoted lower snake_case TypeScript properties and dot access to use camelCase.",
|
|
31389
|
-
url: docsUrl(
|
|
31560
|
+
url: docsUrl(NAME130)
|
|
31390
31561
|
},
|
|
31391
31562
|
schema: [],
|
|
31392
31563
|
defaultOptions: [],
|
|
@@ -31450,7 +31621,7 @@ var require_camelcase_properties_default = defineRule({
|
|
|
31450
31621
|
});
|
|
31451
31622
|
|
|
31452
31623
|
// src/rules/require-constrained-schema-integer.ts
|
|
31453
|
-
var
|
|
31624
|
+
var NAME131 = "require-constrained-schema-integer";
|
|
31454
31625
|
var FIELD_MINIMUMS = /* @__PURE__ */ new Map([["limit", 1], ["version", 0]]);
|
|
31455
31626
|
var NUMBER_FACTORIES = /* @__PURE__ */ new Set(["number", "int", "int32", "uint32"]);
|
|
31456
31627
|
var OBJECT_FACTORIES = /* @__PURE__ */ new Set(["object", "strictObject", "looseObject"]);
|
|
@@ -31492,7 +31663,7 @@ var require_constrained_schema_integer_default = defineRule({
|
|
|
31492
31663
|
type: "suggestion",
|
|
31493
31664
|
docs: {
|
|
31494
31665
|
description: "Declare integer and lower-bound validation for numeric limit and version schema fields.",
|
|
31495
|
-
url: docsUrl(
|
|
31666
|
+
url: docsUrl(NAME131)
|
|
31496
31667
|
},
|
|
31497
31668
|
schema: [],
|
|
31498
31669
|
messages: { constrainInteger: "Declare `{{field}}` as an integer with a lower bound of {{minimum}} or greater, or reuse its named domain schema." }
|
|
@@ -31971,14 +32142,14 @@ function closedNominalInheritanceFix(sourceCode2, file, call, consumer, implemen
|
|
|
31971
32142
|
}
|
|
31972
32143
|
|
|
31973
32144
|
// src/rules/require-explicit-contract-implementation.ts
|
|
31974
|
-
var
|
|
32145
|
+
var NAME132 = "require-explicit-contract-implementation";
|
|
31975
32146
|
var require_explicit_contract_implementation_default = defineRule({
|
|
31976
32147
|
meta: {
|
|
31977
32148
|
type: "problem",
|
|
31978
32149
|
fixable: "code",
|
|
31979
32150
|
docs: {
|
|
31980
32151
|
description: "Require nominal inheritance when an injected abstract class is rejected by an instanceof guard.",
|
|
31981
|
-
url: docsUrl(
|
|
32152
|
+
url: docsUrl(NAME132)
|
|
31982
32153
|
},
|
|
31983
32154
|
schema: [],
|
|
31984
32155
|
messages: {
|
|
@@ -32669,7 +32840,7 @@ function abstractContractOperations(node, functionAliases) {
|
|
|
32669
32840
|
}
|
|
32670
32841
|
|
|
32671
32842
|
// src/rules/require-explicit-service-contract.ts
|
|
32672
|
-
var
|
|
32843
|
+
var NAME133 = "require-explicit-service-contract";
|
|
32673
32844
|
var JAVASCRIPT_FILE_RE2 = /\.(?:js|jsx|mjs|cjs)$/iu;
|
|
32674
32845
|
var BOUNDARY_SUFFIX = /(?:Service|ServiceImpl|Store|Repository|Provider|Executor|Enqueuer|Runner|Platform|Manager|ManagerImpl|Detector|Control|Refresher|Reader|Settlement|Retry|Stop|Catalog|DAO)$/u;
|
|
32675
32846
|
var NON_SERVICE_SUFFIX = /(?:Router|Middleware|Builder)$/u;
|
|
@@ -32685,7 +32856,7 @@ var require_explicit_service_contract_default = defineRule({
|
|
|
32685
32856
|
type: "problem",
|
|
32686
32857
|
docs: {
|
|
32687
32858
|
description: "Require explicit contracts for classes that invoke retained collaborators.",
|
|
32688
|
-
url: docsUrl(
|
|
32859
|
+
url: docsUrl(NAME133)
|
|
32689
32860
|
},
|
|
32690
32861
|
schema: [],
|
|
32691
32862
|
fixable: "code",
|
|
@@ -32721,7 +32892,7 @@ var require_explicit_service_contract_default = defineRule({
|
|
|
32721
32892
|
});
|
|
32722
32893
|
|
|
32723
32894
|
// src/rules/require-fetch-timeout.ts
|
|
32724
|
-
var
|
|
32895
|
+
var NAME134 = "require-fetch-timeout";
|
|
32725
32896
|
function emptySignal(expression, resolvesToGlobal) {
|
|
32726
32897
|
const value = unwrapExpression(expression);
|
|
32727
32898
|
if (value.type === "Literal" && value.value === null)
|
|
@@ -32783,7 +32954,7 @@ var require_fetch_timeout_default = defineRule({
|
|
|
32783
32954
|
type: "problem",
|
|
32784
32955
|
docs: {
|
|
32785
32956
|
description: "Require an explicit abort signal on locally analyzable global fetch calls.",
|
|
32786
|
-
url: docsUrl(
|
|
32957
|
+
url: docsUrl(NAME134)
|
|
32787
32958
|
},
|
|
32788
32959
|
schema: [
|
|
32789
32960
|
{
|
|
@@ -32875,7 +33046,7 @@ var require_fetch_timeout_default = defineRule({
|
|
|
32875
33046
|
});
|
|
32876
33047
|
|
|
32877
33048
|
// src/rules/require-interface-for-exported-class.ts
|
|
32878
|
-
var
|
|
33049
|
+
var NAME135 = "require-interface-for-exported-class";
|
|
32879
33050
|
var JAVASCRIPT_FILE_RE3 = /\.(?:js|jsx|mjs|cjs)$/iu;
|
|
32880
33051
|
function isPublicInstanceMember2(member3) {
|
|
32881
33052
|
return !member3.static && member3.accessibility !== "private" && member3.accessibility !== "protected" && member3.key.type !== "PrivateIdentifier";
|
|
@@ -32936,7 +33107,7 @@ var require_interface_for_exported_class_default = defineRule({
|
|
|
32936
33107
|
type: "suggestion",
|
|
32937
33108
|
docs: {
|
|
32938
33109
|
description: "Require exported concrete classes with public behavior to declare a contract.",
|
|
32939
|
-
url: docsUrl(
|
|
33110
|
+
url: docsUrl(NAME135)
|
|
32940
33111
|
},
|
|
32941
33112
|
schema: [],
|
|
32942
33113
|
fixable: "code",
|
|
@@ -32978,7 +33149,7 @@ var require_interface_for_exported_class_default = defineRule({
|
|
|
32978
33149
|
});
|
|
32979
33150
|
|
|
32980
33151
|
// src/rules/require-jwt-lifetime.ts
|
|
32981
|
-
var
|
|
33152
|
+
var NAME136 = "require-jwt-lifetime";
|
|
32982
33153
|
function isJoseValueImport(declaration) {
|
|
32983
33154
|
return declaration.type === "ImportDeclaration" && declaration.importKind !== "type" && declaration.source.value === "jose";
|
|
32984
33155
|
}
|
|
@@ -32987,7 +33158,7 @@ var require_jwt_lifetime_default = defineRule({
|
|
|
32987
33158
|
type: "problem",
|
|
32988
33159
|
docs: {
|
|
32989
33160
|
description: "Require an expiration claim or a maximum token age when returning a verified JWT.",
|
|
32990
|
-
url: docsUrl(
|
|
33161
|
+
url: docsUrl(NAME136)
|
|
32991
33162
|
},
|
|
32992
33163
|
schema: [],
|
|
32993
33164
|
messages: { lifetime: "Require the JWT exp claim or set maxTokenAge before returning this verification result." }
|
|
@@ -33046,7 +33217,7 @@ var require_jwt_lifetime_default = defineRule({
|
|
|
33046
33217
|
});
|
|
33047
33218
|
|
|
33048
33219
|
// src/rules/require-pascal-case-zod-schema-name.ts
|
|
33049
|
-
var
|
|
33220
|
+
var NAME137 = "require-pascal-case-zod-schema-name";
|
|
33050
33221
|
var PASCAL_SCHEMA_NAME_RE = /^[A-Z][A-Za-z0-9]*Schema$/;
|
|
33051
33222
|
var BENCHMARK_PATH_RE2 = /(^|[\\/])(?:benchmarks?|bench)[\\/]/;
|
|
33052
33223
|
var NON_SCHEMA_TERMINALS2 = /* @__PURE__ */ new Set([
|
|
@@ -33217,7 +33388,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
|
|
|
33217
33388
|
fixable: "code",
|
|
33218
33389
|
docs: {
|
|
33219
33390
|
description: "Require confirmed module-level Zod schema contracts to use PascalCase with a `Schema` suffix.",
|
|
33220
|
-
url: docsUrl(
|
|
33391
|
+
url: docsUrl(NAME137)
|
|
33221
33392
|
},
|
|
33222
33393
|
schema: [],
|
|
33223
33394
|
defaultOptions: [],
|
|
@@ -33327,7 +33498,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
|
|
|
33327
33498
|
});
|
|
33328
33499
|
|
|
33329
33500
|
// src/rules/require-port-for-service.ts
|
|
33330
|
-
var
|
|
33501
|
+
var NAME138 = "require-port-for-service";
|
|
33331
33502
|
var HTTP_TRANSPORT_TYPE_RE = /^(?:KyInstance|AxiosInstance|Session)$/;
|
|
33332
33503
|
var TRANSPORT_WRAPPER_NAME_RE = /(?:Client$|^Http[A-Z])/;
|
|
33333
33504
|
var ERROR_VALUE_NAME_RE = /Error$/;
|
|
@@ -33461,7 +33632,7 @@ var require_port_for_service_default = defineRule({
|
|
|
33461
33632
|
type: "suggestion",
|
|
33462
33633
|
docs: {
|
|
33463
33634
|
description: "Advise when an exported service with injected collaborators has public methods not covered by its declared ports.",
|
|
33464
|
-
url: docsUrl(
|
|
33635
|
+
url: docsUrl(NAME138)
|
|
33465
33636
|
},
|
|
33466
33637
|
schema: [],
|
|
33467
33638
|
fixable: "code",
|
|
@@ -33501,7 +33672,7 @@ var require_port_for_service_default = defineRule({
|
|
|
33501
33672
|
});
|
|
33502
33673
|
|
|
33503
33674
|
// src/rules/require-sql-access-class.ts
|
|
33504
|
-
var
|
|
33675
|
+
var NAME139 = "require-sql-access-class";
|
|
33505
33676
|
var DIRECT_EXECUTION_METHODS = /* @__PURE__ */ new Set([
|
|
33506
33677
|
"all",
|
|
33507
33678
|
"batch",
|
|
@@ -33699,7 +33870,7 @@ var require_sql_access_class_default = defineRule({
|
|
|
33699
33870
|
type: "suggestion",
|
|
33700
33871
|
docs: {
|
|
33701
33872
|
description: "Keep SQL reads and writes inside a class that receives its database dependency.",
|
|
33702
|
-
url: docsUrl(
|
|
33873
|
+
url: docsUrl(NAME139)
|
|
33703
33874
|
},
|
|
33704
33875
|
schema: [],
|
|
33705
33876
|
messages: {
|
|
@@ -33771,7 +33942,7 @@ function staticMatcherFix(sourceCode2, property) {
|
|
|
33771
33942
|
}
|
|
33772
33943
|
|
|
33773
33944
|
// src/rules/require-static-next-matcher.ts
|
|
33774
|
-
var
|
|
33945
|
+
var NAME140 = "require-static-next-matcher";
|
|
33775
33946
|
var NEXT_ENTRY_FILE = /(?:^|[/\\])(?:middleware|proxy)\.[cm]?[jt]sx?$/u;
|
|
33776
33947
|
function isStaticValue(node) {
|
|
33777
33948
|
const value = unwrapExpression(node);
|
|
@@ -33803,7 +33974,7 @@ var require_static_next_matcher_default = defineRule({
|
|
|
33803
33974
|
fixable: "code",
|
|
33804
33975
|
docs: {
|
|
33805
33976
|
description: "Require Next.js middleware and proxy matcher configuration to contain only build-time literals.",
|
|
33806
|
-
url: docsUrl(
|
|
33977
|
+
url: docsUrl(NAME140)
|
|
33807
33978
|
},
|
|
33808
33979
|
schema: [],
|
|
33809
33980
|
messages: {
|
|
@@ -33847,7 +34018,7 @@ var require_static_next_matcher_default = defineRule({
|
|
|
33847
34018
|
});
|
|
33848
34019
|
|
|
33849
34020
|
// src/rules/require-svg-accessible-name.ts
|
|
33850
|
-
var
|
|
34021
|
+
var NAME141 = "require-svg-accessible-name";
|
|
33851
34022
|
var DECORATIVE_ROLES = /* @__PURE__ */ new Set(["none", "presentation"]);
|
|
33852
34023
|
var NAME_ATTRIBUTES = ["aria-label", "aria-labelledby"];
|
|
33853
34024
|
var NO_ICON_MODULES = [];
|
|
@@ -33856,7 +34027,7 @@ var require_svg_accessible_name_default = defineRule({
|
|
|
33856
34027
|
type: "problem",
|
|
33857
34028
|
docs: {
|
|
33858
34029
|
description: "Require a name or explicit decorative semantics on inline SVG elements.",
|
|
33859
|
-
url: docsUrl(
|
|
34030
|
+
url: docsUrl(NAME141)
|
|
33860
34031
|
},
|
|
33861
34032
|
schema: [],
|
|
33862
34033
|
messages: {
|
|
@@ -33888,7 +34059,7 @@ var require_svg_accessible_name_default = defineRule({
|
|
|
33888
34059
|
});
|
|
33889
34060
|
|
|
33890
34061
|
// src/rules/require-use-form-default-values.ts
|
|
33891
|
-
var
|
|
34062
|
+
var NAME142 = "require-use-form-default-values";
|
|
33892
34063
|
var UNSAFE_FORM_MEMBERS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "__proto__", "valueOf"]);
|
|
33893
34064
|
function staticPropertyName2(property) {
|
|
33894
34065
|
return property.computed ? null : getPropertyName(property);
|
|
@@ -33931,7 +34102,7 @@ var require_use_form_default_values_default = defineRule({
|
|
|
33931
34102
|
type: "problem",
|
|
33932
34103
|
docs: {
|
|
33933
34104
|
description: "Require explicit form-level initialization or a field default for directly bound Controller fields.",
|
|
33934
|
-
url: docsUrl(
|
|
34105
|
+
url: docsUrl(NAME142)
|
|
33935
34106
|
},
|
|
33936
34107
|
schema: [],
|
|
33937
34108
|
messages: { requireUseFormDefaultValues: "Add non-undefined defaultValues/values to the associated useForm call or non-undefined defaultValue to this field." }
|
|
@@ -34070,7 +34241,7 @@ var require_use_form_default_values_default = defineRule({
|
|
|
34070
34241
|
});
|
|
34071
34242
|
|
|
34072
34243
|
// src/rules/require-use-server-in-actions-file.ts
|
|
34073
|
-
var
|
|
34244
|
+
var NAME143 = "require-use-server-in-actions-file";
|
|
34074
34245
|
var ACTION_MODULE_RE = /(?:^|\/)app\/.*\/(?:actions|[^/]+-actions)\.[cm]?[jt]s$/u;
|
|
34075
34246
|
function isUseServerDirective2(statement) {
|
|
34076
34247
|
return statement.type === "ExpressionStatement" && statement.directive === "use server";
|
|
@@ -34091,7 +34262,7 @@ var require_use_server_in_actions_file_default = defineRule({
|
|
|
34091
34262
|
type: "problem",
|
|
34092
34263
|
docs: {
|
|
34093
34264
|
description: "route action module missing the use server directive",
|
|
34094
|
-
url: docsUrl(
|
|
34265
|
+
url: docsUrl(NAME143)
|
|
34095
34266
|
},
|
|
34096
34267
|
schema: [],
|
|
34097
34268
|
messages: {
|
|
@@ -34117,7 +34288,7 @@ var require_use_server_in_actions_file_default = defineRule({
|
|
|
34117
34288
|
});
|
|
34118
34289
|
|
|
34119
34290
|
// src/rules/require-zod-form-validation.ts
|
|
34120
|
-
var
|
|
34291
|
+
var NAME144 = "require-zod-form-validation";
|
|
34121
34292
|
var ZOD_PARSE_METHODS = /* @__PURE__ */ new Set([
|
|
34122
34293
|
"parse",
|
|
34123
34294
|
"safeParse",
|
|
@@ -34176,7 +34347,7 @@ var require_zod_form_validation_default = defineRule({
|
|
|
34176
34347
|
type: "problem",
|
|
34177
34348
|
docs: {
|
|
34178
34349
|
description: "Require Zod validation (`Schema.parse(...)` / `Schema.safeParse(...)`) when reading values out of a `FormData` object.",
|
|
34179
|
-
url: docsUrl(
|
|
34350
|
+
url: docsUrl(NAME144)
|
|
34180
34351
|
},
|
|
34181
34352
|
schema: [],
|
|
34182
34353
|
messages: {
|
|
@@ -34464,7 +34635,7 @@ function declaresFramework(metadata, name) {
|
|
|
34464
34635
|
}
|
|
34465
34636
|
|
|
34466
34637
|
// src/rules/sole-export-matches-filename.ts
|
|
34467
|
-
var
|
|
34638
|
+
var NAME145 = "sole-export-matches-filename";
|
|
34468
34639
|
var EXCLUDED_STEMS = /* @__PURE__ */ new Set(["global", "index", "types"]);
|
|
34469
34640
|
function stem3(filename) {
|
|
34470
34641
|
const base = filename.replaceAll("\\", "/").split("/").at(-1) ?? "";
|
|
@@ -34478,7 +34649,7 @@ var sole_export_matches_filename_default = defineRule({
|
|
|
34478
34649
|
type: "suggestion",
|
|
34479
34650
|
docs: {
|
|
34480
34651
|
description: "Make a module filename reflect its sole named public runtime export.",
|
|
34481
|
-
url: docsUrl(
|
|
34652
|
+
url: docsUrl(NAME145)
|
|
34482
34653
|
},
|
|
34483
34654
|
schema: [],
|
|
34484
34655
|
messages: {
|
|
@@ -35221,7 +35392,7 @@ var stepdown_default = defineRule({
|
|
|
35221
35392
|
});
|
|
35222
35393
|
|
|
35223
35394
|
// src/rules/store-insert-requires-on-conflict.ts
|
|
35224
|
-
var
|
|
35395
|
+
var NAME146 = "store-insert-requires-on-conflict";
|
|
35225
35396
|
var INSERT_WRITE = /\bINSERT\s+(?:OR\s+\w+\s+)?INTO\s+[\w."'`?$:@-]+\s*(?:\([^)]*\)\s*)?(?:VALUES|SELECT|DEFAULT\s+VALUES)\b/i;
|
|
35226
35397
|
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;
|
|
35227
35398
|
var REPLAY_CONTRACT_NAME = /(?:enqueue|ensure|migrate|recordOnce|schedule|seed|upsert|getOrCreate|createIfAbsent|insertIfAbsent)/i;
|
|
@@ -35250,7 +35421,7 @@ var store_insert_requires_on_conflict_default = defineRule({
|
|
|
35250
35421
|
type: "problem",
|
|
35251
35422
|
docs: {
|
|
35252
35423
|
description: "Review conflict handling for embedded inserts in replay-named callables.",
|
|
35253
|
-
url: docsUrl(
|
|
35424
|
+
url: docsUrl(NAME146)
|
|
35254
35425
|
},
|
|
35255
35426
|
schema: [],
|
|
35256
35427
|
messages: {
|
|
@@ -35275,7 +35446,7 @@ var store_insert_requires_on_conflict_default = defineRule({
|
|
|
35275
35446
|
});
|
|
35276
35447
|
|
|
35277
35448
|
// src/rules/test-loops-over-literal-cases.ts
|
|
35278
|
-
var
|
|
35449
|
+
var NAME147 = "test-loops-over-literal-cases";
|
|
35279
35450
|
var TEST_CALLERS3 = /* @__PURE__ */ new Set(["it", "test"]);
|
|
35280
35451
|
var TEST_MODIFIERS6 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
|
|
35281
35452
|
var ASSERTION_ROOTS = /* @__PURE__ */ new Set([
|
|
@@ -35371,7 +35542,7 @@ var test_loops_over_literal_cases_default = defineRule({
|
|
|
35371
35542
|
type: "suggestion",
|
|
35372
35543
|
docs: {
|
|
35373
35544
|
description: "Disallow assertions over an inline literal case loop in a test; parameterization reports and names every case independently.",
|
|
35374
|
-
url: docsUrl(
|
|
35545
|
+
url: docsUrl(NAME147)
|
|
35375
35546
|
},
|
|
35376
35547
|
schema: [],
|
|
35377
35548
|
messages: {
|
|
@@ -35435,7 +35606,7 @@ var test_loops_over_literal_cases_default = defineRule({
|
|
|
35435
35606
|
});
|
|
35436
35607
|
|
|
35437
35608
|
// src/rules/test-phase-label-comment.ts
|
|
35438
|
-
var
|
|
35609
|
+
var NAME148 = "test-phase-label-comment";
|
|
35439
35610
|
var PHASE_WORD = String.raw`arrange|act|assert(?:ion)?s?|given|when|then|exercise|execute|verif(?:y|ication)|cleanup|prepare|sanity(?:\s+check)?`;
|
|
35440
35611
|
var PHASE_RE = new RegExp(
|
|
35441
35612
|
String.raw`^[-=~*_#.\s]{0,40}(?:${PHASE_WORD})(?:\s*(?:[/&+,|]|->|and)\s*(?:${PHASE_WORD}))*[-=~*_#.\s:;!–—]{0,40}$`,
|
|
@@ -35463,7 +35634,7 @@ var test_phase_label_comment_default = defineRule({
|
|
|
35463
35634
|
fixable: "code",
|
|
35464
35635
|
docs: {
|
|
35465
35636
|
description: "Tests must not use bare Arrange, Act, Assert, Given, When, or Then phase comments.",
|
|
35466
|
-
url: docsUrl(
|
|
35637
|
+
url: docsUrl(NAME148)
|
|
35467
35638
|
},
|
|
35468
35639
|
schema: [],
|
|
35469
35640
|
messages: { removeLabel: "Bare test phase label \u2014 delete it and let the test names and helpers carry the structure." }
|
|
@@ -35605,6 +35776,7 @@ var RULES = {
|
|
|
35605
35776
|
"no-zod-parse-typed-object": no_zod_parse_typed_object_default,
|
|
35606
35777
|
"prefer-await-in-async-return": prefer_await_in_async_return_default,
|
|
35607
35778
|
"prefer-coded-error-result": prefer_coded_error_result_default,
|
|
35779
|
+
"prefer-configured-cloud-scope": prefer_configured_cloud_scope_default,
|
|
35608
35780
|
"prefer-constant-time-secret-compare": prefer_constant_time_secret_compare_default,
|
|
35609
35781
|
"prefer-dependency-interface": prefer_dependency_interface_default,
|
|
35610
35782
|
"prefer-discriminated-union": prefer_discriminated_union_default,
|
package/dist/index.js
CHANGED