@sarj/eslint-plugin 19.0.2 → 19.2.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.
@@ -4196,8 +4196,8 @@ function typeFacts(file, flags, roots, withMembers) {
4196
4196
  const indexes = facts.indexValueFlags.get(type) ?? [];
4197
4197
  return withMembers && (type.flags & flags.Object) !== 0 || indexes.length > 0 && indexes.every((index) => (index & flags.Unknown) !== 0);
4198
4198
  });
4199
- const properties = file.batch(counted.map((type) => checker.getPropertiesOfType.gen(type)));
4200
- counted.forEach((type, i) => facts.propertyCount.set(type, properties[i]?.length ?? 0));
4199
+ const properties2 = file.batch(counted.map((type) => checker.getPropertiesOfType.gen(type)));
4200
+ counted.forEach((type, i) => facts.propertyCount.set(type, properties2[i]?.length ?? 0));
4201
4201
  return facts;
4202
4202
  }
4203
4203
  var no_broad_return_type_default = defineRule({
@@ -4238,7 +4238,7 @@ var no_broad_return_type_default = defineRule({
4238
4238
  ...canFix && { fix: (fixer) => fixer.replaceText(annotation, sourceCode2.getText(annotation).replace(/[^\r\n]/gu, "")) }
4239
4239
  });
4240
4240
  }
4241
- function resolve3(file) {
4241
+ function resolve4(file) {
4242
4242
  const flags = file.flags;
4243
4243
  const annotationTypes = valueTypes(file, flags, annotated.map((frame) => frame.annotation.typeAnnotation));
4244
4244
  const present = annotationTypes.filter((type) => type !== void 0);
@@ -4285,7 +4285,7 @@ var no_broad_return_type_default = defineRule({
4285
4285
  },
4286
4286
  "Program:exit"() {
4287
4287
  if (annotated.length === 0 || tsrs === null) return;
4288
- const reported = tsrs.run(resolve3);
4288
+ const reported = tsrs.run(resolve4);
4289
4289
  if (reported === null) return;
4290
4290
  reported.forEach(report2);
4291
4291
  }
@@ -5166,10 +5166,10 @@ function overloadProof(file) {
5166
5166
  const node = unparen(expression);
5167
5167
  const literal2 = primitiveLiteral3(node);
5168
5168
  if (literal2 !== void 0) return { kind: "literal", node, value: literal2 };
5169
- const properties = node["properties"] ?? [];
5170
- if (!a.isObjectLiteralExpression(node) || properties.length > LIMIT) return void 0;
5169
+ const properties2 = node["properties"] ?? [];
5170
+ if (!a.isObjectLiteralExpression(node) || properties2.length > LIMIT) return void 0;
5171
5171
  const values = /* @__PURE__ */ new Map();
5172
- for (const property of properties) {
5172
+ for (const property of properties2) {
5173
5173
  if (!a.isPropertyAssignment(property)) return void 0;
5174
5174
  const name = propertyKey(property["name"]);
5175
5175
  const value = primitiveLiteral3(property["initializer"]);
@@ -5848,10 +5848,10 @@ var no_cors_wildcard_with_credentials_default = defineRule({
5848
5848
  },
5849
5849
  ObjectExpression(node) {
5850
5850
  if (spreadOnly(node)) return;
5851
- const properties = effectiveProperties(node);
5852
- if (properties === null) return;
5851
+ const properties2 = effectiveProperties(node);
5852
+ if (properties2 === null) return;
5853
5853
  const headers = /* @__PURE__ */ new Map();
5854
- for (const [key, property] of properties) {
5854
+ for (const [key, property] of properties2) {
5855
5855
  const value = headerValue(property.value);
5856
5856
  if (value === null) return;
5857
5857
  const name = key.toLowerCase();
@@ -5910,9 +5910,9 @@ function headerWrite(node) {
5910
5910
  function wildcardCredentialedOptions(argument) {
5911
5911
  if (argument === void 0) return false;
5912
5912
  const options = unwrapExpression(argument);
5913
- const properties = options.type === "ObjectExpression" ? effectiveProperties(options) : null;
5914
- const origin = properties?.get("origin");
5915
- const credentials = properties?.get("credentials");
5913
+ const properties2 = options.type === "ObjectExpression" ? effectiveProperties(options) : null;
5914
+ const origin = properties2?.get("origin");
5915
+ const credentials = properties2?.get("credentials");
5916
5916
  if (origin === void 0 || credentials === void 0) return false;
5917
5917
  const value = unwrapExpression(credentials.value);
5918
5918
  return staticString(origin.value) === "*" && value.type === "Literal" && value.value === true;
@@ -5930,13 +5930,13 @@ function scalarLiteralText(node) {
5930
5930
  return value?.type === "Literal" && SCALAR_HEADER_VALUE_TYPES.has(typeof value.value) ? String(value.value) : null;
5931
5931
  }
5932
5932
  function effectiveProperties(node) {
5933
- const properties = /* @__PURE__ */ new Map();
5933
+ const properties2 = /* @__PURE__ */ new Map();
5934
5934
  for (const entry of node.properties) {
5935
5935
  const entries = propertyEntries(entry);
5936
5936
  if (entries === null) return null;
5937
- for (const [key, property] of entries) properties.set(key, property);
5937
+ for (const [key, property] of entries) properties2.set(key, property);
5938
5938
  }
5939
- return properties;
5939
+ return properties2;
5940
5940
  }
5941
5941
  function propertyEntries(entry) {
5942
5942
  if (entry.type === "SpreadElement") {
@@ -6202,7 +6202,7 @@ function cookieName(value) {
6202
6202
 
6203
6203
  // src/utils/exported-next-config-property.ts
6204
6204
  function exportedNextConfigProperty(sourceCode2, path) {
6205
- const resolve3 = (input, seen = /* @__PURE__ */ new Set()) => {
6205
+ const resolve4 = (input, seen = /* @__PURE__ */ new Set()) => {
6206
6206
  const node = unwrapExpression(input);
6207
6207
  if (node.type !== "Identifier") return node;
6208
6208
  if (seen.has(node)) return null;
@@ -6213,17 +6213,17 @@ function exportedNextConfigProperty(sourceCode2, path) {
6213
6213
  const declaration = definition.parent;
6214
6214
  const declarator = definition.node;
6215
6215
  if (declaration?.kind !== "const" || declarator.init === null || binding3?.references.some((reference) => reference.identifier !== node && reference.init !== true)) return null;
6216
- return resolve3(declarator.init, seen);
6216
+ return resolve4(declarator.init, seen);
6217
6217
  };
6218
6218
  const exported = exportedConfig(sourceCode2);
6219
6219
  if (exported === null) return null;
6220
- let current = resolve3(exported);
6220
+ let current = resolve4(exported);
6221
6221
  let selected = null;
6222
6222
  for (const name of path) {
6223
6223
  if (current?.type !== "ObjectExpression" || current.properties.some((property) => property.type !== "Property" || getPropertyName(property) === null || property.kind !== "init")) return null;
6224
6224
  selected = objectProperty(current, name);
6225
6225
  if (selected === null) return null;
6226
- current = resolve3(selected.value);
6226
+ current = resolve4(selected.value);
6227
6227
  }
6228
6228
  return selected;
6229
6229
  }
@@ -8299,8 +8299,8 @@ var ActionResults = class {
8299
8299
  return error !== null && this.#closedError(error, owner);
8300
8300
  }
8301
8301
  case "ObjectExpression": {
8302
- const properties = this.#properties(value);
8303
- return properties !== null && [...properties.values()].some((field) => this.payload(field, owner, seen));
8302
+ const properties2 = this.#properties(value);
8303
+ return properties2 !== null && [...properties2.values()].some((field) => this.payload(field, owner, seen));
8304
8304
  }
8305
8305
  case "ArrayExpression":
8306
8306
  return !value.elements.some((element) => element?.type === "SpreadElement") && value.elements.some((element) => element !== null && this.payload(element, owner, seen));
@@ -8606,7 +8606,7 @@ var no_exception_text_in_5xx_response_default = defineRule({
8606
8606
  if (definition === void 0) return value.name === "Response" && stable2(variable);
8607
8607
  return variable.defs.length === 1 && isNextResponseImport(definition) && stable2(variable);
8608
8608
  }
8609
- function properties(node) {
8609
+ function properties2(node) {
8610
8610
  const value = unwrapExpression(node);
8611
8611
  if (value.type !== "ObjectExpression") return null;
8612
8612
  const fields2 = /* @__PURE__ */ new Map();
@@ -8619,7 +8619,7 @@ var no_exception_text_in_5xx_response_default = defineRule({
8619
8619
  return fields2;
8620
8620
  }
8621
8621
  function serverError(node) {
8622
- const field = properties(node)?.get("status");
8622
+ const field = properties2(node)?.get("status");
8623
8623
  const status = field === void 0 ? void 0 : unwrapExpression(field);
8624
8624
  return status?.type === "Literal" && typeof status.value === "number" && Number.isInteger(status.value) && status.value >= 500 && status.value <= 599;
8625
8625
  }
@@ -8631,7 +8631,7 @@ var no_exception_text_in_5xx_response_default = defineRule({
8631
8631
  case "MemberExpression":
8632
8632
  return exceptionTextErrors(value);
8633
8633
  case "ObjectExpression":
8634
- return [...properties(value)?.values() ?? []].flatMap(payloadErrors);
8634
+ return [...properties2(value)?.values() ?? []].flatMap(payloadErrors);
8635
8635
  case "ArrayExpression":
8636
8636
  return arrayErrors(value);
8637
8637
  case "TemplateLiteral":
@@ -9248,8 +9248,8 @@ function parameterReads(native, parameter, body3, jsx, calls = false, auxiliarie
9248
9248
  const aliases = parameterAliases(native, parameter.name, reads);
9249
9249
  if (!aliases) return null;
9250
9250
  const expression = returnedExpression2(ast, body3);
9251
- const view = { native, props: checker.getTypeAtLocation(parameter), root, aliases, reads, calls, auxiliaries };
9252
- return expression && scalarView(expression, view, jsx) ? reads : null;
9251
+ const view2 = { native, props: checker.getTypeAtLocation(parameter), root, aliases, reads, calls, auxiliaries };
9252
+ return expression && scalarView(expression, view2, jsx) ? reads : null;
9253
9253
  }
9254
9254
  function scalarType(native, type, allowUndefined = true) {
9255
9255
  if (type.isUnionType()) return type.getTypes().every((part) => scalarType(native, part, allowUndefined));
@@ -9277,86 +9277,86 @@ function returnedExpression2(ast, body3) {
9277
9277
  const statement = body3.statements.length === 1 ? body3.statements[0] : void 0;
9278
9278
  return statement && ast.isReturnStatement(statement) ? statement.expression : void 0;
9279
9279
  }
9280
- function scalarView(node, view, jsx = false) {
9281
- const { ast, checker } = view.native;
9280
+ function scalarView(node, view2, jsx = false) {
9281
+ const { ast, checker } = view2.native;
9282
9282
  if (scalarLiteral(ast, node)) return true;
9283
- if (ast.isCallExpression(node)) return !jsx && scalarCall(node, view);
9284
- if (ast.isJsxExpression(node)) return !node.dotDotDotToken && (!node.expression || scalarView(node.expression, view, jsx));
9283
+ if (ast.isCallExpression(node)) return !jsx && scalarCall(node, view2);
9284
+ if (ast.isJsxExpression(node)) return !node.dotDotDotToken && (!node.expression || scalarView(node.expression, view2, jsx));
9285
9285
  if (ast.isIdentifier(node)) {
9286
9286
  const binding3 = checker.getSymbolAtLocation(node);
9287
- if (binding3 && view.auxiliaries?.has(binding3.id)) return scalarType(view.native, checker.getTypeAtLocation(node));
9288
- const key = binding3 && view.aliases.get(binding3.id);
9289
- return key !== void 0 && readField(node, key, view);
9287
+ if (binding3 && view2.auxiliaries?.has(binding3.id)) return scalarType(view2.native, checker.getTypeAtLocation(node));
9288
+ const key = binding3 && view2.aliases.get(binding3.id);
9289
+ return key !== void 0 && readField(node, key, view2);
9290
9290
  }
9291
- if (ast.isPropertyAccessExpression(node) || ast.isElementAccessExpression(node)) return memberRead(node, view);
9292
- return scalarOperation(node, view, jsx);
9291
+ if (ast.isPropertyAccessExpression(node) || ast.isElementAccessExpression(node)) return memberRead(node, view2);
9292
+ return scalarOperation(node, view2, jsx);
9293
9293
  }
9294
- function scalarOperation(node, view, jsx) {
9295
- const { ast } = view.native;
9296
- if (ast.isParenthesizedExpression(node) || ast.isNonNullExpression(node)) return scalarView(node.expression, view, jsx);
9297
- if (ast.isTypeOfExpression(node)) return scalarView(node.expression, view);
9294
+ function scalarOperation(node, view2, jsx) {
9295
+ const { ast } = view2.native;
9296
+ if (ast.isParenthesizedExpression(node) || ast.isNonNullExpression(node)) return scalarView(node.expression, view2, jsx);
9297
+ if (ast.isTypeOfExpression(node)) return scalarView(node.expression, view2);
9298
9298
  if (ast.isConditionalExpression(node)) {
9299
- return scalarView(node.condition, view) && scalarView(node.whenTrue, view, jsx) && scalarView(node.whenFalse, view, jsx);
9299
+ return scalarView(node.condition, view2) && scalarView(node.whenTrue, view2, jsx) && scalarView(node.whenFalse, view2, jsx);
9300
9300
  }
9301
- if (ast.isBinaryExpression(node)) return binaryView(node, view, jsx);
9302
- if (ast.isPrefixUnaryExpression(node)) return operatorKinds(ast).scalarPrefixes.has(node.operator) && scalarView(node.operand, view);
9303
- if (ast.isTemplateExpression(node)) return node.templateSpans.every((span) => scalarView(span.expression, view));
9304
- return jsx && jsxView(node, view);
9301
+ if (ast.isBinaryExpression(node)) return binaryView(node, view2, jsx);
9302
+ if (ast.isPrefixUnaryExpression(node)) return operatorKinds(ast).scalarPrefixes.has(node.operator) && scalarView(node.operand, view2);
9303
+ if (ast.isTemplateExpression(node)) return node.templateSpans.every((span) => scalarView(span.expression, view2));
9304
+ return jsx && jsxView(node, view2);
9305
9305
  }
9306
- function scalarCall(node, view) {
9307
- const { ast, checker } = view.native;
9306
+ function scalarCall(node, view2) {
9307
+ const { ast, checker } = view2.native;
9308
9308
  if (!ast.isCallExpression(node)) return false;
9309
- if (!view.calls || node.questionDotToken || node.typeArguments?.length || !ast.isIdentifier(node.expression) || !node.arguments.length || node.arguments.some((argument) => ast.isSpreadElement(argument))) return false;
9309
+ if (!view2.calls || node.questionDotToken || node.typeArguments?.length || !ast.isIdentifier(node.expression) || !node.arguments.length || node.arguments.some((argument) => ast.isSpreadElement(argument))) return false;
9310
9310
  const declarations = checker.getSymbolAtLocation(node.expression)?.declarations;
9311
9311
  const handle = declarations?.length === 1 ? declarations[0] : void 0;
9312
- const declaration = handle && handle.path === node.getSourceFile().path ? declarationNode(view.native, handle) : void 0;
9312
+ const declaration = handle && handle.path === node.getSourceFile().path ? declarationNode(view2.native, handle) : void 0;
9313
9313
  const helper = declaration && localHelper(ast, declaration);
9314
- if (!helper || helper.getSourceFile() !== node.getSourceFile() || helper.typeParameters?.length || !helper.type || !node.arguments.every((argument) => scalarView(argument, view))) return false;
9315
- if (!checkedNativeSource(view.native, node.getSourceFile())) return false;
9314
+ if (!helper || helper.getSourceFile() !== node.getSourceFile() || helper.typeParameters?.length || !helper.type || !node.arguments.every((argument) => scalarView(argument, view2))) return false;
9315
+ if (!checkedNativeSource(view2.native, node.getSourceFile())) return false;
9316
9316
  const signature = checker.getResolvedSignature(node);
9317
- const resolved = signature.declaration === void 0 ? void 0 : declarationNode(view.native, signature.declaration);
9318
- return resolved === helper && !checker.getTypePredicateOfSignature(signature) && scalarType(view.native, checker.getTypeAtLocation(node));
9317
+ const resolved = signature.declaration === void 0 ? void 0 : declarationNode(view2.native, signature.declaration);
9318
+ return resolved === helper && !checker.getTypePredicateOfSignature(signature) && scalarType(view2.native, checker.getTypeAtLocation(node));
9319
9319
  }
9320
9320
  function localHelper(ast, node) {
9321
9321
  if (ast.isFunctionDeclaration(node)) return node.body && ast.isSourceFile(node.parent) ? node : void 0;
9322
9322
  if (!ast.isVariableDeclaration(node) || node.type || !node.initializer || constInitializer2(ast, node) !== node.initializer || !ast.isArrowFunction(node.initializer) || !ast.isVariableStatement(node.parent.parent) || !ast.isSourceFile(node.parent.parent.parent)) return void 0;
9323
9323
  return node.initializer;
9324
9324
  }
9325
- function binaryView(node, view, jsx) {
9326
- const { ast } = view.native;
9325
+ function binaryView(node, view2, jsx) {
9326
+ const { ast } = view2.native;
9327
9327
  if (!ast.isBinaryExpression(node)) return false;
9328
9328
  const { scalarOperators, returnedOperands: returned2 } = operatorKinds(ast);
9329
9329
  const operands = jsx && returned2.has(node.operatorToken.kind);
9330
- return scalarOperators.has(node.operatorToken.kind) && scalarView(node.left, view, operands) && scalarView(node.right, view, operands);
9330
+ return scalarOperators.has(node.operatorToken.kind) && scalarView(node.left, view2, operands) && scalarView(node.right, view2, operands);
9331
9331
  }
9332
9332
  function scalarLiteral(ast, node) {
9333
9333
  const k = ast.SyntaxKind;
9334
9334
  return ast.isStringLiteralLikeNode(node) || ast.isNumericLiteral(node) || ast.isBigIntLiteral(node) || ast.isJsxText(node) || node.kind === k.TrueKeyword || node.kind === k.FalseKeyword || node.kind === k.NullKeyword;
9335
9335
  }
9336
- function memberRead(node, view) {
9337
- const { ast, checker } = view.native;
9336
+ function memberRead(node, view2) {
9337
+ const { ast, checker } = view2.native;
9338
9338
  if (!ast.isPropertyAccessExpression(node) && !ast.isElementAccessExpression(node)) return false;
9339
- if (!view.root || !ast.isIdentifier(node.expression) || checker.getSymbolAtLocation(node.expression)?.id !== view.root.id) return false;
9339
+ if (!view2.root || !ast.isIdentifier(node.expression) || checker.getSymbolAtLocation(node.expression)?.id !== view2.root.id) return false;
9340
9340
  const key = ast.isPropertyAccessExpression(node) ? ast.isIdentifier(node.name) ? node.name.text : void 0 : node.argumentExpression && (ast.isStringLiteralLikeNode(node.argumentExpression) || ast.isNumericLiteral(node.argumentExpression)) ? node.argumentExpression.text : void 0;
9341
- return key !== void 0 && readField(node, key, view);
9341
+ return key !== void 0 && readField(node, key, view2);
9342
9342
  }
9343
- function readField(node, key, view) {
9344
- const { checker } = view.native;
9345
- if (!checker.getPropertyOfType(view.props, key) || !scalarType(view.native, checker.getTypeAtLocation(node))) return false;
9346
- view.reads.add(key);
9343
+ function readField(node, key, view2) {
9344
+ const { checker } = view2.native;
9345
+ if (!checker.getPropertyOfType(view2.props, key) || !scalarType(view2.native, checker.getTypeAtLocation(node))) return false;
9346
+ view2.reads.add(key);
9347
9347
  return true;
9348
9348
  }
9349
- function jsxView(node, view) {
9350
- const { ast } = view.native;
9351
- if (ast.isJsxFragment(node)) return node.children.every((child) => scalarView(child, view, true));
9352
- if (ast.isJsxElement(node)) return jsxView(node.openingElement, view) && node.children.every((child) => scalarView(child, view, true));
9349
+ function jsxView(node, view2) {
9350
+ const { ast } = view2.native;
9351
+ if (ast.isJsxFragment(node)) return node.children.every((child) => scalarView(child, view2, true));
9352
+ if (ast.isJsxElement(node)) return jsxView(node.openingElement, view2) && node.children.every((child) => scalarView(child, view2, true));
9353
9353
  if (!ast.isJsxOpeningElement(node) && !ast.isJsxSelfClosingElement(node)) return false;
9354
9354
  if (!ast.isIdentifier(node.tagName) || !/^[a-z][A-Za-z0-9]*$/u.test(node.tagName.text)) return false;
9355
- return node.attributes.properties.every((attribute) => intrinsicAttribute(attribute, view));
9355
+ return node.attributes.properties.every((attribute) => intrinsicAttribute(attribute, view2));
9356
9356
  }
9357
- function intrinsicAttribute(attribute, view) {
9358
- const { ast } = view.native;
9359
- return ast.isJsxAttribute(attribute) && ast.isIdentifier(attribute.name) && attribute.name.text !== "is" && (!attribute.initializer || scalarView(attribute.initializer, view));
9357
+ function intrinsicAttribute(attribute, view2) {
9358
+ const { ast } = view2.native;
9359
+ return ast.isJsxAttribute(attribute) && ast.isIdentifier(attribute.name) && attribute.name.text !== "is" && (!attribute.initializer || scalarView(attribute.initializer, view2));
9360
9360
  }
9361
9361
 
9362
9362
  // src/utils/private-scalar-consumer.ts
@@ -11617,8 +11617,8 @@ var no_hand_rolled_spinner_default = defineRule({
11617
11617
  base: tailwindBase(token),
11618
11618
  variant: tailwindVariantPrefix(token)
11619
11619
  }));
11620
- const variants = new Set(classes.map((entry) => entry.variant));
11621
- if ([...variants].some((variant) => hasSpinnerInVariant(classes, variant))) {
11620
+ const variants2 = new Set(classes.map((entry) => entry.variant));
11621
+ if ([...variants2].some((variant) => hasSpinnerInVariant(classes, variant))) {
11622
11622
  context.report({ node, messageId: "handRolledSpinner" });
11623
11623
  }
11624
11624
  }
@@ -12295,9 +12295,9 @@ function localDataTarget(target, sourceCode2) {
12295
12295
  if (binding3 === null) return void 0;
12296
12296
  const value = annotatedLocalObject(binding3);
12297
12297
  if (value === void 0) return void 0;
12298
- const properties = plainProperties(value);
12299
- if (properties === void 0 || !onlyOwnerUses(binding3, value, sourceCode2)) return void 0;
12300
- return new Set(properties.map((property) => property.key));
12298
+ const properties2 = plainProperties(value);
12299
+ if (properties2 === void 0 || !onlyOwnerUses(binding3, value, sourceCode2)) return void 0;
12300
+ return new Set(properties2.map((property) => property.key));
12301
12301
  }
12302
12302
  function annotatedLocalObject(binding3) {
12303
12303
  const definition = binding3.defs.length === 1 ? binding3.defs[0] : void 0;
@@ -12335,8 +12335,8 @@ function keepsMutableDescriptor(call, method) {
12335
12335
  if (method !== "defineProperty") return true;
12336
12336
  const descriptor = call.arguments[2];
12337
12337
  if (descriptor?.type !== "ObjectExpression") return false;
12338
- const properties = plainProperties(descriptor);
12339
- return properties !== void 0 && properties.every((property) => {
12338
+ const properties2 = plainProperties(descriptor);
12339
+ return properties2 !== void 0 && properties2.every((property) => {
12340
12340
  if (property.key !== "writable" && property.key !== "configurable") return true;
12341
12341
  const value = unwrapExpression(property.value);
12342
12342
  return value.type === "Literal" && value.value === true;
@@ -12395,9 +12395,9 @@ function mutationWrites(node, namespace, method) {
12395
12395
  }
12396
12396
  function dataDescriptorValue(descriptor) {
12397
12397
  if (descriptor.type !== "ObjectExpression") return void 0;
12398
- const properties = plainProperties(descriptor);
12399
- if (properties === void 0 || properties.some((property) => !DATA_DESCRIPTOR_KEYS.has(property.key))) return void 0;
12400
- return properties.find((property) => property.key === "value")?.value;
12398
+ const properties2 = plainProperties(descriptor);
12399
+ if (properties2 === void 0 || properties2.some((property) => !DATA_DESCRIPTOR_KEYS.has(property.key))) return void 0;
12400
+ return properties2.find((property) => property.key === "value")?.value;
12401
12401
  }
12402
12402
  function plainProperties(node) {
12403
12403
  const writes2 = [];
@@ -12583,16 +12583,16 @@ function primitiveLiteral2(node) {
12583
12583
  if (typeof operand.value === "number") return value.operator === "-" ? -operand.value : operand.value;
12584
12584
  return typeof operand.value === "bigint" && value.operator === "-" ? -operand.value : void 0;
12585
12585
  }
12586
- function primitiveDomain(view, flags) {
12587
- if (view.members !== void 0) return view.members.every((member3) => primitiveDomain({ type: member3, members: void 0 }, flags));
12588
- const type = view.type;
12586
+ function primitiveDomain(view2, flags) {
12587
+ if (view2.members !== void 0) return view2.members.every((member3) => primitiveDomain({ type: member3, members: void 0 }, flags));
12588
+ const type = view2.type;
12589
12589
  if ((type.flags & (flags.Enum | flags.EnumLiteral)) !== 0) return false;
12590
12590
  const domain = flags.String | flags.Number | flags.BigInt | flags.BooleanLiteral | flags.StringLiteral | flags.NumberLiteral | flags.BigIntLiteral | flags.Null | flags.Undefined | flags.Never;
12591
12591
  return (type.flags & domain) !== 0;
12592
12592
  }
12593
- function acceptsPrimitive(view, value, flags) {
12594
- if (view.members !== void 0) return view.members.some((member3) => acceptsPrimitive({ type: member3, members: void 0 }, value, flags));
12595
- const type = view.type;
12593
+ function acceptsPrimitive(view2, value, flags) {
12594
+ if (view2.members !== void 0) return view2.members.some((member3) => acceptsPrimitive({ type: member3, members: void 0 }, value, flags));
12595
+ const type = view2.type;
12596
12596
  if (value === null) return (type.flags & flags.Null) !== 0;
12597
12597
  if (typeof value === "string") return (type.flags & flags.String) !== 0 || (type.flags & flags.StringLiteral) !== 0 && type.value === value;
12598
12598
  if (typeof value === "number") return (type.flags & flags.Number) !== 0 || (type.flags & flags.NumberLiteral) !== 0 && type.value === value;
@@ -12615,7 +12615,7 @@ var no_invalid_zod_custom_parse_default = defineRule({
12615
12615
  let tsrs = null;
12616
12616
  let strictNullChecks = false;
12617
12617
  let candidates2 = [];
12618
- function resolve3(file) {
12618
+ function resolve4(file) {
12619
12619
  const flags = file.flags;
12620
12620
  const checker = file.checker;
12621
12621
  const pairs = candidates2.map((candidate2) => [file.tsNode(candidate2.custom), file.tsNode(candidate2.node)]);
@@ -12636,8 +12636,8 @@ var no_invalid_zod_custom_parse_default = defineRule({
12636
12636
  const reported = kept.flatMap((candidate2, i) => {
12637
12637
  const type = types[i];
12638
12638
  if (type === void 0) return [];
12639
- const view = { type, members: membersOf2.get(type) };
12640
- return !primitiveDomain(view, flags) || acceptsPrimitive(view, candidate2.value, flags) ? [] : [{ node: candidate2.node, type }];
12639
+ const view2 = { type, members: membersOf2.get(type) };
12640
+ return !primitiveDomain(view2, flags) || acceptsPrimitive(view2, candidate2.value, flags) ? [] : [{ node: candidate2.node, type }];
12641
12641
  });
12642
12642
  const names = file.batch(reported.map((entry) => file.checker.typeToString.gen(entry.type)));
12643
12643
  return reported.map((entry, i) => ({ node: entry.node, target: names[i] ?? "" }));
@@ -12663,7 +12663,7 @@ var no_invalid_zod_custom_parse_default = defineRule({
12663
12663
  },
12664
12664
  "Program:exit"() {
12665
12665
  if (candidates2.length === 0 || tsrs === null) return;
12666
- const reports = tsrs.run(resolve3);
12666
+ const reports = tsrs.run(resolve4);
12667
12667
  if (reports === null) return;
12668
12668
  for (const { node, target } of reports) context.report({ node, messageId: "incompatibleCustomParse", data: { target } });
12669
12669
  }
@@ -13938,7 +13938,7 @@ function tsrsMembers(file, nodes) {
13938
13938
  if ((type.flags & table2.bigIntLiteral) !== 0) return BigInt(type.value) !== 0n;
13939
13939
  return void 0;
13940
13940
  }
13941
- return views.map((view) => view?.map((type) => ({ ...leaf(type), parts: partsOf2.get(type)?.map(leaf) })));
13941
+ return views.map((view2) => view2?.map((type) => ({ ...leaf(type), parts: partsOf2.get(type)?.map(leaf) })));
13942
13942
  }
13943
13943
  function tsrsTable(flags) {
13944
13944
  return {
@@ -14003,20 +14003,20 @@ var no_logical_or_fallback_default = defineRule({
14003
14003
  function shadowed(node) {
14004
14004
  return (findVariable(context.sourceCode.getScope(node), node.name)?.defs.length ?? 0) !== 0;
14005
14005
  }
14006
- function resolve3(file) {
14006
+ function resolve4(file) {
14007
14007
  const members2 = tsrsMembers(file, candidates2.map((candidate2) => candidate2.node.left));
14008
- const typed = members2.map((view) => view !== void 0 && fallbackType(view));
14008
+ const typed = members2.map((view2) => view2 !== void 0 && fallbackType(view2));
14009
14009
  const pending = candidates2.flatMap((candidate2, i) => typed[i] === true && candidate2.callee !== null ? [i] : []);
14010
14010
  const identifiers = pending.flatMap((i) => candidates2[i].callee.identifier ?? []);
14011
14011
  const receivers = pending.flatMap((i) => candidates2[i].callee.receiver ?? []);
14012
14012
  const identifierSymbols = file.symbolsOf(identifiers);
14013
14013
  const receiverTypes = file.typesOf(receivers);
14014
14014
  const present = receiverTypes.filter((type) => type !== void 0);
14015
- const properties = file.batch(present.map((type) => type.getProperty.gen("Boolean")));
14015
+ const properties2 = file.batch(present.map((type) => type.getProperty.gen("Boolean")));
14016
14016
  const symbolOf = /* @__PURE__ */ new Map();
14017
14017
  identifiers.forEach((node, i) => symbolOf.set(node, identifierSymbols[i]));
14018
14018
  let next = 0;
14019
- receivers.forEach((node, i) => symbolOf.set(node, receiverTypes[i] === void 0 ? void 0 : properties[next++]));
14019
+ receivers.forEach((node, i) => symbolOf.set(node, receiverTypes[i] === void 0 ? void 0 : properties2[next++]));
14020
14020
  for (const i of pending) {
14021
14021
  const callee = candidates2[i].callee;
14022
14022
  if (file.isDefaultLibrarySymbol(symbolOf.get(callee.identifier ?? callee.receiver))) typed[i] = false;
@@ -14039,7 +14039,7 @@ var no_logical_or_fallback_default = defineRule({
14039
14039
  },
14040
14040
  "Program:exit"() {
14041
14041
  if (tsrs === null || candidates2.length === 0) return;
14042
- const found = tsrs.run(resolve3);
14042
+ const found = tsrs.run(resolve4);
14043
14043
  if (found === null) return;
14044
14044
  candidates2.forEach((candidate2, i) => {
14045
14045
  if (found[i] === true) context.report({ node: candidate2.node, messageId: "logicalOrFallback" });
@@ -15053,18 +15053,18 @@ function labeledTupleObjectFix(sourceCode2, annotation) {
15053
15053
  return null;
15054
15054
  const pattern = callerPattern(sourceCode2, caller, helper, fields2);
15055
15055
  if (pattern === null) return null;
15056
- const properties = [];
15056
+ const properties2 = [];
15057
15057
  for (const [index, label] of fields2.labels.entries()) {
15058
15058
  const value = fields2.values[index];
15059
15059
  if (value === void 0) return null;
15060
- properties.push(
15060
+ properties2.push(
15061
15061
  `${sourceCode2.getText(label)}: ${sourceCode2.getText(value)}`
15062
15062
  );
15063
15063
  }
15064
15064
  const bindings = fields2.labels.map((label) => sourceCode2.getText(label));
15065
15065
  return (fixer) => [
15066
15066
  fixer.replaceText(annotation, sourceCode2.getText(object)),
15067
- fixer.replaceText(fields2.returned, `{ ${properties.join(", ")} }`),
15067
+ fixer.replaceText(fields2.returned, `{ ${properties2.join(", ")} }`),
15068
15068
  fixer.replaceText(pattern, `{ ${bindings.join(", ")} }`)
15069
15069
  ];
15070
15070
  }
@@ -15925,12 +15925,12 @@ function renderFunction(node) {
15925
15925
  while (parent !== null) {
15926
15926
  const owner = functionNode2(parent);
15927
15927
  if (owner !== null) {
15928
- let view = VIEWS.get(owner);
15929
- if (view === void 0) {
15930
- view = owner.body !== null && containsView(owner.body);
15931
- VIEWS.set(owner, view);
15928
+ let view2 = VIEWS.get(owner);
15929
+ if (view2 === void 0) {
15930
+ view2 = owner.body !== null && containsView(owner.body);
15931
+ VIEWS.set(owner, view2);
15932
15932
  }
15933
- return view ? owner : null;
15933
+ return view2 ? owner : null;
15934
15934
  }
15935
15935
  parent = parentOf(parent);
15936
15936
  }
@@ -18894,10 +18894,10 @@ function isNonzeroNumericLiteral(node) {
18894
18894
  function isPromiseSleep(node) {
18895
18895
  const executor = promiseExecutor(node);
18896
18896
  const body3 = executor?.body ?? null;
18897
- const resolve3 = executor?.params[0];
18898
- if (body3 === null || executor?.params.length !== 1 || resolve3?.type !== "Identifier" || resolve3.name === "setTimeout") return false;
18897
+ const resolve4 = executor?.params[0];
18898
+ if (body3 === null || executor?.params.length !== 1 || resolve4?.type !== "Identifier" || resolve4.name === "setTimeout") return false;
18899
18899
  const timer = executorTimer(body3);
18900
- return timer?.type === "CallExpression" && isTimedSetTimeout(timer) && timer.arguments[0]?.type === "Identifier" && timer.arguments[0].name === resolve3.name;
18900
+ return timer?.type === "CallExpression" && isTimedSetTimeout(timer) && timer.arguments[0]?.type === "Identifier" && timer.arguments[0].name === resolve4.name;
18901
18901
  }
18902
18902
  function promiseExecutor(node) {
18903
18903
  const callee = unwrapExpression(node.callee);
@@ -20873,11 +20873,11 @@ var no_unsafe_mock_casting_default = defineRule({
20873
20873
  createOnce(context) {
20874
20874
  const directBindings = /* @__PURE__ */ new Set();
20875
20875
  const namespaceBindings = /* @__PURE__ */ new Set();
20876
- function resolve3(identifier) {
20876
+ function resolve4(identifier) {
20877
20877
  return typeBinding(context.sourceCode, identifier);
20878
20878
  }
20879
20879
  function record(identifier, destination) {
20880
- const binding3 = resolve3(identifier);
20880
+ const binding3 = resolve4(identifier);
20881
20881
  if (binding3 !== null) destination.add(binding3);
20882
20882
  }
20883
20883
  function checkAssertion(node) {
@@ -20891,11 +20891,11 @@ var no_unsafe_mock_casting_default = defineRule({
20891
20891
  if (node.type !== "TSTypeReference") return false;
20892
20892
  const typeName = node.typeName;
20893
20893
  if (typeName.type === "Identifier") {
20894
- const binding3 = resolve3(typeName);
20894
+ const binding3 = resolve4(typeName);
20895
20895
  return binding3 !== null && directBindings.has(binding3);
20896
20896
  }
20897
20897
  if (typeName.type === "TSQualifiedName" && typeName.left.type === "Identifier" && MOCK_TYPE_NAMES.has(typeName.right.name)) {
20898
- const binding3 = resolve3(typeName.left);
20898
+ const binding3 = resolve4(typeName.left);
20899
20899
  return binding3 !== null && namespaceBindings.has(binding3);
20900
20900
  }
20901
20901
  return false;
@@ -21178,7 +21178,7 @@ function knownValue(env, type, location, seen) {
21178
21178
  if ((type.flags & flags.Object) === 0) return true;
21179
21179
  if (seen.has(type.id)) return true;
21180
21180
  if (seen.size >= 128) return false;
21181
- const [calls, constructs, array, properties, indexes] = ask(file, sync.all(
21181
+ const [calls, constructs, array, properties2, indexes] = ask(file, sync.all(
21182
21182
  type.getCallSignatures.gen(),
21183
21183
  type.getConstructSignatures.gen(),
21184
21184
  checker.isArrayType.gen(type),
@@ -21195,8 +21195,8 @@ function knownValue(env, type, location, seen) {
21195
21195
  const element = type.getNumberIndexType();
21196
21196
  return element !== void 0 && knownValue(env, element, location, seen);
21197
21197
  }
21198
- if (properties.length + indexes.length === 0 || properties.length > 128) return false;
21199
- const types = file.batch(properties.map((property) => checker.getTypeOfSymbolAtLocation.gen(property, location)));
21198
+ if (properties2.length + indexes.length === 0 || properties2.length > 128) return false;
21199
+ const types = file.batch(properties2.map((property) => checker.getTypeOfSymbolAtLocation.gen(property, location)));
21200
21200
  return types.every((member3) => knownValue(env, member3, location, seen)) && indexes.every((index) => knownValue(env, index.valueType, location, seen));
21201
21201
  }
21202
21202
  function ask(file, request) {
@@ -21249,7 +21249,7 @@ function sameShape(env, input, output, location) {
21249
21249
  return (member3.flags & (flags.Object | opaque)) === 0 && others.some((other) => other.id === member3.id);
21250
21250
  }
21251
21251
  function sameObjectShape(left, right) {
21252
- const [leftTuple, rightTuple, leftArray, rightArray, properties, rightProperties] = ask(file, sync.all(
21252
+ const [leftTuple, rightTuple, leftArray, rightArray, properties2, rightProperties] = ask(file, sync.all(
21253
21253
  checker.isTupleType.gen(left),
21254
21254
  checker.isTupleType.gen(right),
21255
21255
  checker.isArrayType.gen(left),
@@ -21259,17 +21259,17 @@ function sameShape(env, input, output, location) {
21259
21259
  ));
21260
21260
  if (leftTuple || rightTuple) return leftTuple && rightTuple && sameTuplePositions(left, right);
21261
21261
  if (leftArray) return rightArray && sameArrayElements(left, right);
21262
- return properties.length === rightProperties.length && properties.length <= 128 && sameProperties(right, properties) && sameIndexInfos(left, right);
21262
+ return properties2.length === rightProperties.length && properties2.length <= 128 && sameProperties(right, properties2) && sameIndexInfos(left, right);
21263
21263
  }
21264
21264
  function sameArrayElements(left, right) {
21265
21265
  const a = left.getNumberIndexType();
21266
21266
  const b = right.getNumberIndexType();
21267
21267
  return a !== void 0 && b !== void 0 && compare(a, b);
21268
21268
  }
21269
- function sameProperties(right, properties) {
21270
- const others = file.batch(properties.map((property) => right.getProperty.gen(property.name)));
21269
+ function sameProperties(right, properties2) {
21270
+ const others = file.batch(properties2.map((property) => right.getProperty.gen(property.name)));
21271
21271
  const matched = [];
21272
- for (const [i, property] of properties.entries()) {
21272
+ for (const [i, property] of properties2.entries()) {
21273
21273
  const other = others[i];
21274
21274
  if (other === void 0) break;
21275
21275
  matched.push([property, other]);
@@ -21280,7 +21280,7 @@ function sameShape(env, input, output, location) {
21280
21280
  const b = types[2 * i + 1];
21281
21281
  if (a === void 0 || b === void 0 || !compare(a, b)) return false;
21282
21282
  }
21283
- return matched.length === properties.length;
21283
+ return matched.length === properties2.length;
21284
21284
  }
21285
21285
  function sameIndexInfos(left, right) {
21286
21286
  const a = checker.getIndexInfosOfType(left);
@@ -21315,7 +21315,7 @@ var no_zod_parse_typed_object_default = defineRule({
21315
21315
  createOnce(context) {
21316
21316
  let tsrs = null;
21317
21317
  let candidates2 = [];
21318
- function resolve3(native) {
21318
+ function resolve4(native) {
21319
21319
  const flags = native.sync.TypeFlags;
21320
21320
  const env = {
21321
21321
  native,
@@ -21355,7 +21355,7 @@ var no_zod_parse_typed_object_default = defineRule({
21355
21355
  },
21356
21356
  "Program:exit"() {
21357
21357
  if (candidates2.length === 0 || tsrs === null) return;
21358
- const found = tsrs.run((file) => resolve3(nativeTypes(file)));
21358
+ const found = tsrs.run((file) => resolve4(nativeTypes(file)));
21359
21359
  if (found === null) return;
21360
21360
  candidates2.forEach((candidate2, i) => {
21361
21361
  if (found[i] === true) context.report({ node: candidate2.node, messageId: "typedObject" });
@@ -21499,8 +21499,334 @@ var prefer_await_in_async_return_default = defineRule({
21499
21499
  }
21500
21500
  });
21501
21501
 
21502
+ // src/rules/prefer-coded-error-result.ts
21503
+ var NAME91 = "prefer-coded-error-result";
21504
+ var MAX_DEPTH = 16;
21505
+ var MAX_VARIANTS = 64;
21506
+ var MAX_TYPE_STEPS = 256;
21507
+ var STATUS_NAMES = ["ok", "success"];
21508
+ var CODE_NAMES = ["code", "kind", "type", "tag"];
21509
+ function view(node) {
21510
+ return { node, origin: node, bindings: /* @__PURE__ */ new Map() };
21511
+ }
21512
+ function resolve2(value, source, depth = 0) {
21513
+ if (depth >= MAX_DEPTH) return null;
21514
+ const node = value.node;
21515
+ if (node.type !== "TSTypeReference") return value;
21516
+ if (node.typeName.type !== "Identifier") return null;
21517
+ const variable = typeBinding(source, node.typeName);
21518
+ if (variable === null) return null;
21519
+ const bound = value.bindings.get(variable);
21520
+ if (bound !== void 0) return resolve2(bound, source, depth + 1);
21521
+ const declaration = variable.defs.length === 1 ? variable.defs[0]?.node : void 0;
21522
+ if (declaration?.type !== "TSTypeAliasDeclaration" && declaration?.type !== "TSInterfaceDeclaration")
21523
+ return null;
21524
+ if (declaration.type === "TSInterfaceDeclaration" && declaration.extends.length !== 0)
21525
+ return null;
21526
+ const bindings = bindArguments(declaration, node, value, source);
21527
+ if (bindings === null) return null;
21528
+ return resolve2(
21529
+ {
21530
+ node: declaration.type === "TSTypeAliasDeclaration" ? declaration.typeAnnotation : declaration.body,
21531
+ origin: value.origin,
21532
+ bindings
21533
+ },
21534
+ source,
21535
+ depth + 1
21536
+ );
21537
+ }
21538
+ function bindArguments(declaration, reference, outer, source) {
21539
+ const parameters = declaration.typeParameters?.params ?? [];
21540
+ const arguments_ = reference.typeArguments?.params ?? [];
21541
+ if (arguments_.length > parameters.length) return null;
21542
+ const bindings = /* @__PURE__ */ new Map();
21543
+ for (const [index, parameter] of parameters.entries()) {
21544
+ const variable = typeBinding(source, parameter.name);
21545
+ if (variable === null) return null;
21546
+ const argument = arguments_[index];
21547
+ if (argument !== void 0)
21548
+ bindings.set(variable, {
21549
+ node: argument,
21550
+ origin: argument,
21551
+ bindings: outer.bindings
21552
+ });
21553
+ else if (parameter.default !== null)
21554
+ bindings.set(variable, {
21555
+ node: parameter.default,
21556
+ origin: reference,
21557
+ bindings
21558
+ });
21559
+ }
21560
+ return bindings;
21561
+ }
21562
+ function properties(value) {
21563
+ const node = value.node;
21564
+ const members2 = node.type === "TSTypeLiteral" ? node.members : node.type === "TSInterfaceBody" ? node.body : null;
21565
+ if (members2 === null) return null;
21566
+ const result = /* @__PURE__ */ new Map();
21567
+ for (const member3 of members2) {
21568
+ if (member3.type !== "TSPropertySignature" || member3.computed || member3.typeAnnotation === null)
21569
+ return null;
21570
+ const name = member3.key.type === "Identifier" ? member3.key.name : member3.key.type === "Literal" && typeof member3.key.value === "string" ? member3.key.value : null;
21571
+ if (name === null || result.has(name)) return null;
21572
+ result.set(name, member3);
21573
+ }
21574
+ return result;
21575
+ }
21576
+ function propertyView(property, owner) {
21577
+ const node = property.typeAnnotation?.typeAnnotation;
21578
+ return node === void 0 ? null : { node, origin: node, bindings: owner.bindings };
21579
+ }
21580
+ function booleanTag(property, owner, source) {
21581
+ if (property === void 0 || property.optional) return null;
21582
+ const type = propertyView(property, owner);
21583
+ const resolved = type === null ? null : resolve2(type, source);
21584
+ const node = resolved?.node;
21585
+ return node?.type === "TSLiteralType" && node.literal.type === "Literal" && typeof node.literal.value === "boolean" ? node.literal.value : null;
21586
+ }
21587
+ function hasCode(fields2, owner, source) {
21588
+ return CODE_NAMES.some((name) => {
21589
+ const property = fields2.get(name);
21590
+ if (property === void 0 || property.optional) return false;
21591
+ const type = propertyView(property, owner);
21592
+ return type !== null && openString(type, source) === null;
21593
+ });
21594
+ }
21595
+ function openString(value, source, depth = 0, budget = { remaining: MAX_TYPE_STEPS }) {
21596
+ if (depth >= MAX_DEPTH || --budget.remaining < 0) return null;
21597
+ const resolved = resolve2(value, source);
21598
+ if (resolved === null) return null;
21599
+ if (resolved.node.type === "TSStringKeyword") return resolved.origin;
21600
+ if (resolved.node.type !== "TSUnionType" || resolved.node.types.length > MAX_VARIANTS)
21601
+ return null;
21602
+ for (const member3 of resolved.node.types) {
21603
+ const broad = openString(
21604
+ { ...resolved, node: member3 },
21605
+ source,
21606
+ depth + 1,
21607
+ budget
21608
+ );
21609
+ if (broad !== null) return broad;
21610
+ }
21611
+ return null;
21612
+ }
21613
+ function weakError(value, source, depth = 0, budget = { remaining: MAX_TYPE_STEPS }) {
21614
+ if (depth >= MAX_DEPTH || --budget.remaining < 0) return null;
21615
+ const resolved = resolve2(value, source);
21616
+ if (resolved === null) return null;
21617
+ if (resolved.node.type === "TSStringKeyword") return resolved.origin;
21618
+ if (resolved.node.type === "TSUnionType") {
21619
+ if (resolved.node.types.length > MAX_VARIANTS) return null;
21620
+ for (const member3 of resolved.node.types) {
21621
+ const error = weakError(
21622
+ { ...resolved, node: member3 },
21623
+ source,
21624
+ depth + 1,
21625
+ budget
21626
+ );
21627
+ if (error !== null) return error;
21628
+ }
21629
+ return null;
21630
+ }
21631
+ const fields2 = properties(resolved);
21632
+ if (fields2 === null || hasCode(fields2, resolved, source)) return null;
21633
+ return weakObject(fields2, resolved, source, depth, budget);
21634
+ }
21635
+ function weakObject(fields2, owner, source, depth, budget) {
21636
+ const code = openStringField(fields2, owner, source, CODE_NAMES, budget);
21637
+ if (code !== null) return code;
21638
+ const error = fields2.get("error");
21639
+ if (error !== void 0) {
21640
+ const inner = propertyView(error, owner);
21641
+ return inner === null || error.optional ? null : weakError(inner, source, depth + 1, budget);
21642
+ }
21643
+ return openStringField(fields2, owner, source, ["message", "reason"], budget);
21644
+ }
21645
+ function openStringField(fields2, owner, source, names, budget) {
21646
+ for (const name of names) {
21647
+ const property = fields2.get(name);
21648
+ if (property === void 0 || property.optional) continue;
21649
+ const inner = propertyView(property, owner);
21650
+ const broad = inner === null ? null : openString(inner, source, 0, budget);
21651
+ if (broad !== null) return broad;
21652
+ }
21653
+ return null;
21654
+ }
21655
+ function failureMessages(value, source) {
21656
+ const members2 = variants(value, source);
21657
+ if (members2 === null || members2.length < 2) return [];
21658
+ const objects = members2.map((member3) => ({
21659
+ member: member3,
21660
+ fields: properties(member3)
21661
+ }));
21662
+ if (objects.some((object) => object.fields === null)) return [];
21663
+ for (const status of STATUS_NAMES) {
21664
+ const tags = objects.map(
21665
+ (object) => booleanTag(object.fields?.get(status), object.member, source)
21666
+ );
21667
+ if (tags.some((tag) => tag === null) || !tags.includes(true) || !tags.includes(false))
21668
+ continue;
21669
+ if (objects.some(
21670
+ (object, index) => tags[index] === true && ["error", "errors"].some((name) => object.fields?.has(name))
21671
+ ))
21672
+ continue;
21673
+ return objects.flatMap((object, index) => {
21674
+ if (tags[index] !== false || object.fields === null || hasCode(object.fields, object.member, source))
21675
+ return [];
21676
+ if (["data", "value", "result"].some((name) => object.fields?.has(name)))
21677
+ return [];
21678
+ const error = weakError(object.member, source);
21679
+ return error === null ? [] : [error];
21680
+ });
21681
+ }
21682
+ return [];
21683
+ }
21684
+ function variants(value, source, depth = 0, budget = { remaining: MAX_TYPE_STEPS }) {
21685
+ if (--budget.remaining < 0) return null;
21686
+ const resolved = resolve2(value, source);
21687
+ if (resolved === null || depth >= MAX_DEPTH) return null;
21688
+ if (resolved.node.type !== "TSUnionType") return [resolved];
21689
+ const result = [];
21690
+ for (const member3 of resolved.node.types) {
21691
+ const nested = variants(
21692
+ { ...resolved, node: member3, origin: member3 },
21693
+ source,
21694
+ depth + 1,
21695
+ budget
21696
+ );
21697
+ if (nested === null || result.length + nested.length > MAX_VARIANTS)
21698
+ return null;
21699
+ result.push(...nested);
21700
+ }
21701
+ return result;
21702
+ }
21703
+ function libraryError(reference, source) {
21704
+ if (reference.typeName.type !== "Identifier" || reference.typeArguments?.params.length !== 2)
21705
+ return null;
21706
+ const variable = typeBinding(source, reference.typeName);
21707
+ const definition = variable?.defs.length === 1 ? variable.defs[0]?.node : void 0;
21708
+ if (definition?.type !== "ImportSpecifier") return null;
21709
+ const declaration = parentOf(definition);
21710
+ if (declaration?.type !== "ImportDeclaration" || declaration.source.value !== "neverthrow")
21711
+ return null;
21712
+ if (!["Result", "ResultAsync"].includes(importSpecifierName(definition) ?? ""))
21713
+ return null;
21714
+ const error = reference.typeArguments.params[1];
21715
+ return error === void 0 ? null : weakError(view(error), source);
21716
+ }
21717
+ function weakAnnotation(node, source, depth = 0, budget = { remaining: MAX_TYPE_STEPS }) {
21718
+ if (depth >= MAX_DEPTH || --budget.remaining < 0) return false;
21719
+ if (failureMessages(view(node), source).length !== 0) return true;
21720
+ if (node.type !== "TSTypeReference") return false;
21721
+ if (libraryError(node, source) !== null) return true;
21722
+ if (node.typeName.type !== "Identifier" || !["Promise", "PromiseLike"].includes(node.typeName.name) || typeBinding(source, node.typeName) !== null || node.typeArguments?.params.length !== 1)
21723
+ return false;
21724
+ const argument = node.typeArguments.params[0];
21725
+ return argument !== void 0 && weakAnnotation(argument, source, depth + 1, budget);
21726
+ }
21727
+ function renderedFailure(node) {
21728
+ const outer = objectFields(unwrapExpression(node));
21729
+ if (outer === null || !STATUS_NAMES.some((name) => {
21730
+ const status = outer.get(name);
21731
+ return status?.type === "Literal" && status.value === false;
21732
+ }))
21733
+ return null;
21734
+ const error = outer.get("error");
21735
+ const fields2 = error === void 0 ? outer : objectFields(unwrapExpression(error));
21736
+ if (fields2 === null || !CODE_NAMES.some((name) => {
21737
+ const code = fields2.get(name);
21738
+ return code?.type === "Literal" && typeof code.value === "string";
21739
+ }))
21740
+ return null;
21741
+ for (const name of ["message", "reason"]) {
21742
+ const value = fields2.get(name);
21743
+ if (value !== void 0 && renderedString(value)) return value;
21744
+ }
21745
+ return null;
21746
+ }
21747
+ function objectFields(node) {
21748
+ if (node.type !== "ObjectExpression") return null;
21749
+ const fields2 = /* @__PURE__ */ new Map();
21750
+ for (const property of node.properties) {
21751
+ if (property.type !== "Property" || property.computed || property.kind !== "init" || property.method)
21752
+ return null;
21753
+ const key = property.key.type === "Identifier" ? property.key.name : property.key.type === "Literal" && typeof property.key.value === "string" ? property.key.value : null;
21754
+ if (key === null || fields2.has(key)) return null;
21755
+ fields2.set(key, property.value);
21756
+ }
21757
+ return fields2;
21758
+ }
21759
+ function renderedString(node, depth = 0) {
21760
+ const value = unwrapExpression(node);
21761
+ if (depth >= MAX_DEPTH) return false;
21762
+ if (value.type === "TemplateLiteral") return value.expressions.length > 0;
21763
+ if (value.type !== "BinaryExpression" || value.operator !== "+") return false;
21764
+ return [value.left, value.right].some(
21765
+ (part) => part.type === "Literal" && typeof part.value === "string" || renderedString(part, depth + 1)
21766
+ );
21767
+ }
21768
+ var prefer_coded_error_result_default = defineRule({
21769
+ meta: {
21770
+ type: "suggestion",
21771
+ docs: {
21772
+ description: "Return a stable error code and typed context instead of only a rendered failure message.",
21773
+ url: docsUrl(NAME91)
21774
+ },
21775
+ schema: [],
21776
+ messages: {
21777
+ preferCodedErrorResult: "This Result failure carries only a rendered string or an open string code. Return a finite error code with the typed context needed by the caller, and format the message at the consumer. Keep an intentional presentation boundary explicit.",
21778
+ formatAtConsumer: "This coded failure formats context into a message at the producer. Return the code and typed context, and let the consumer format the message. Preserve an intentional presentation boundary explicitly."
21779
+ }
21780
+ },
21781
+ createOnce(context) {
21782
+ const reported = /* @__PURE__ */ new Set();
21783
+ function check(node) {
21784
+ const candidates2 = failureMessages(view(node), context.sourceCode);
21785
+ const library = node.type === "TSTypeReference" ? libraryError(node, context.sourceCode) : null;
21786
+ for (const candidate2 of library === null ? candidates2 : [...candidates2, library]) {
21787
+ if (reported.has(candidate2)) continue;
21788
+ reported.add(candidate2);
21789
+ context.report({
21790
+ node: candidate2,
21791
+ messageId: "preferCodedErrorResult"
21792
+ });
21793
+ }
21794
+ }
21795
+ function checkProducer(owner, value) {
21796
+ if (owner === null) return;
21797
+ const rendered = renderedFailure(value);
21798
+ if (rendered === null || reported.has(rendered)) return;
21799
+ const contract = owner.returnType?.typeAnnotation;
21800
+ if (contract !== void 0 && weakAnnotation(contract, context.sourceCode))
21801
+ return;
21802
+ reported.add(rendered);
21803
+ context.report({ node: rendered, messageId: "formatAtConsumer" });
21804
+ }
21805
+ return {
21806
+ before() {
21807
+ reported.clear();
21808
+ if (isGeneratedFile(
21809
+ { filename: context.filename, cwd: context.cwd },
21810
+ context.sourceCode.text
21811
+ ))
21812
+ return false;
21813
+ return void 0;
21814
+ },
21815
+ TSUnionType: check,
21816
+ TSTypeReference: check,
21817
+ ReturnStatement(node) {
21818
+ if (node.argument !== null)
21819
+ checkProducer(enclosingFunction(node), node.argument);
21820
+ },
21821
+ ArrowFunctionExpression(node) {
21822
+ if (node.body.type !== "BlockStatement") checkProducer(node, node.body);
21823
+ }
21824
+ };
21825
+ }
21826
+ });
21827
+
21502
21828
  // src/rules/prefer-constant-time-secret-compare.ts
21503
- var NAME91 = "prefer-constant-time-secret-compare";
21829
+ var NAME92 = "prefer-constant-time-secret-compare";
21504
21830
  var EQUALITY_OPERATORS3 = /* @__PURE__ */ new Set(["===", "!==", "==", "!="]);
21505
21831
  var AUTH_TOKEN_QUALIFIERS = /* @__PURE__ */ new Set(["access", "refresh", "session", "admin", "csrf", "xsrf", "auth", "authentication", "signing", "api"]);
21506
21832
  var SENTINEL_IDENTIFIERS = /* @__PURE__ */ new Set(["undefined", "NaN"]);
@@ -21564,7 +21890,7 @@ var prefer_constant_time_secret_compare_default = defineRule({
21564
21890
  type: "problem",
21565
21891
  docs: {
21566
21892
  description: "Prefer a supported constant-time comparison primitive for secret-like values.",
21567
- url: docsUrl(NAME91)
21893
+ url: docsUrl(NAME92)
21568
21894
  },
21569
21895
  schema: [],
21570
21896
  messages: {
@@ -21652,7 +21978,7 @@ function constInitializer4(definition) {
21652
21978
  }
21653
21979
 
21654
21980
  // src/rules/prefer-dependency-interface.ts
21655
- var NAME92 = "prefer-dependency-interface";
21981
+ var NAME93 = "prefer-dependency-interface";
21656
21982
  function readsInterfaceMember(use, members2) {
21657
21983
  const parent = parentOf(use);
21658
21984
  if (parent?.type !== "MemberExpression" || parent.object !== use || !members2.has(getPropertyName(parent) ?? "")) return false;
@@ -21682,7 +22008,7 @@ var prefer_dependency_interface_default = defineRule({
21682
22008
  type: "suggestion",
21683
22009
  docs: {
21684
22010
  description: "Annotate retained collaborators with their existing interface when the consumer uses only that contract.",
21685
- url: docsUrl(NAME92)
22011
+ url: docsUrl(NAME93)
21686
22012
  },
21687
22013
  schema: [],
21688
22014
  messages: { interface: "Use the existing `{{contract}}` interface for this dependency; its consumer uses only that contract." }
@@ -21827,28 +22153,28 @@ function objectContract(elements) {
21827
22153
  function returnedProperties(objects, contract) {
21828
22154
  const returned2 = [];
21829
22155
  for (const object of objects) {
21830
- const properties = objectProperties(object);
21831
- if (properties === void 0) return void 0;
21832
- if ([...properties.keys()].some((name) => !contract.members.has(name))) return void 0;
21833
- if ([...contract.members].some(([name, member3]) => !member3.optional && !properties.has(name))) return void 0;
21834
- if (hasEmptyPayload(properties, contract.optional)) return void 0;
21835
- returned2.push(properties);
22156
+ const properties2 = objectProperties(object);
22157
+ if (properties2 === void 0) return void 0;
22158
+ if ([...properties2.keys()].some((name) => !contract.members.has(name))) return void 0;
22159
+ if ([...contract.members].some(([name, member3]) => !member3.optional && !properties2.has(name))) return void 0;
22160
+ if (hasEmptyPayload(properties2, contract.optional)) return void 0;
22161
+ returned2.push(properties2);
21836
22162
  }
21837
22163
  return returned2;
21838
22164
  }
21839
22165
  function objectProperties(object) {
21840
- const properties = /* @__PURE__ */ new Map();
22166
+ const properties2 = /* @__PURE__ */ new Map();
21841
22167
  for (const property of object.properties) {
21842
22168
  if (property.type !== "Property" || property.kind !== "init" || property.method) return void 0;
21843
22169
  const name = propertyName(property);
21844
- if (name === void 0 || name === "__proto__" || properties.has(name) || property.value.type === "AssignmentPattern") return void 0;
21845
- properties.set(name, property.value);
22170
+ if (name === void 0 || name === "__proto__" || properties2.has(name) || property.value.type === "AssignmentPattern") return void 0;
22171
+ properties2.set(name, property.value);
21846
22172
  }
21847
- return properties;
22173
+ return properties2;
21848
22174
  }
21849
- function hasEmptyPayload(properties, optional) {
22175
+ function hasEmptyPayload(properties2, optional) {
21850
22176
  for (const name of optional) {
21851
- const value = properties.get(name);
22177
+ const value = properties2.get(name);
21852
22178
  if (value === void 0) continue;
21853
22179
  if (value.type === "Literal" && value.value === null) return true;
21854
22180
  if (value.type === "Identifier" && value.name === "undefined") return true;
@@ -21869,19 +22195,19 @@ function tagDomain(node) {
21869
22195
  return values.size > 1 ? values : void 0;
21870
22196
  }
21871
22197
  function hasTagSpecificPayload(tag, domain, optional, returned2) {
21872
- const variants = /* @__PURE__ */ new Map();
21873
- for (const properties of returned2) {
21874
- const value = properties.get(tag);
22198
+ const variants2 = /* @__PURE__ */ new Map();
22199
+ for (const properties2 of returned2) {
22200
+ const value = properties2.get(tag);
21875
22201
  const literal2 = value === void 0 ? void 0 : literalTag(value);
21876
22202
  if (literal2 === void 0 || !domain.has(literal2)) return false;
21877
- const payload = new Set([...optional].filter((name) => properties.has(name)));
21878
- const previous = variants.get(literal2);
22203
+ const payload = new Set([...optional].filter((name) => properties2.has(name)));
22204
+ const previous = variants2.get(literal2);
21879
22205
  if (previous !== void 0 && (previous.size !== payload.size || [...previous].some((name) => !payload.has(name)))) return false;
21880
- variants.set(literal2, payload);
22206
+ variants2.set(literal2, payload);
21881
22207
  }
21882
- if (variants.size !== domain.size) return false;
22208
+ if (variants2.size !== domain.size) return false;
21883
22209
  return [...optional].some((name) => {
21884
- const presence = [...variants.values()].map((payload) => payload.has(name));
22210
+ const presence = [...variants2.values()].map((payload) => payload.has(name));
21885
22211
  return presence.includes(true) && presence.includes(false);
21886
22212
  });
21887
22213
  }
@@ -22007,7 +22333,7 @@ function literalTag(node) {
22007
22333
  }
22008
22334
 
22009
22335
  // src/rules/prefer-discriminated-union.ts
22010
- var NAME93 = "prefer-discriminated-union";
22336
+ var NAME94 = "prefer-discriminated-union";
22011
22337
  var STATUS_MEMBER_NAMES = /* @__PURE__ */ new Set([
22012
22338
  "success",
22013
22339
  "ok"
@@ -22098,7 +22424,7 @@ var prefer_discriminated_union_default = defineRule({
22098
22424
  fixable: "code",
22099
22425
  docs: {
22100
22426
  description: "Prefer discriminated unions for result contracts and locally proven tag-specific return payloads.",
22101
- url: docsUrl(NAME93)
22427
+ url: docsUrl(NAME94)
22102
22428
  },
22103
22429
  schema: [],
22104
22430
  messages: {
@@ -22172,9 +22498,9 @@ var prefer_discriminated_union_default = defineRule({
22172
22498
  function privateVariantReturn(sourceCode2, filename, owner, result) {
22173
22499
  const annotation = owner.returnType?.typeAnnotation;
22174
22500
  if (owner.type !== "FunctionDeclaration" || owner.id === null || !returnsOnlyConditionalObject(owner) || annotation?.type !== "TSTypeLiteral" || result.reportNode !== owner.returnType || result.returned.length !== 2 || sourceCode2.getCommentsInside(owner).length > 0 || !isUnusedPrivateBinding(sourceCode2, owner, owner.id, filename) || !retainsNamedTypeUses(sourceCode2, annotation)) return null;
22175
- const variants = result.returned.map((properties) => privateVariantType(properties, result, sourceCode2));
22176
- if (variants.some((variant) => variant === null)) return null;
22177
- const text = `${variants.join(" | ")}${sourceCode2.getText(annotation).replace(/[^\r\n]/gu, "")}`;
22501
+ const variants2 = result.returned.map((properties2) => privateVariantType(properties2, result, sourceCode2));
22502
+ if (variants2.some((variant) => variant === null)) return null;
22503
+ const text = `${variants2.join(" | ")}${sourceCode2.getText(annotation).replace(/[^\r\n]/gu, "")}`;
22178
22504
  return (fixer) => fixer.replaceText(annotation, text);
22179
22505
  }
22180
22506
  function returnsOnlyConditionalObject(fn) {
@@ -22183,11 +22509,11 @@ function returnsOnlyConditionalObject(fn) {
22183
22509
  const [returned2] = statements;
22184
22510
  return statements.length === 1 && returned2?.type === "ReturnStatement" && returned2.argument?.type === "ConditionalExpression" && returned2.argument.consequent.type === "ObjectExpression" && returned2.argument.alternate.type === "ObjectExpression";
22185
22511
  }
22186
- function privateVariantType(properties, result, sourceCode2) {
22187
- if ([...properties.values()].some((value) => value.type !== "Literal" || typeof value.value === "object" && value.value !== null || typeof value.value === "number" && !Number.isFinite(value.value))) return null;
22512
+ function privateVariantType(properties2, result, sourceCode2) {
22513
+ if ([...properties2.values()].some((value) => value.type !== "Literal" || typeof value.value === "object" && value.value !== null || typeof value.value === "number" && !Number.isFinite(value.value))) return null;
22188
22514
  const fields2 = [];
22189
22515
  for (const [name, member3] of result.members) {
22190
- const value = properties.get(name);
22516
+ const value = properties2.get(name);
22191
22517
  if (value === void 0) continue;
22192
22518
  const annotation = member3.typeAnnotation?.typeAnnotation;
22193
22519
  if (annotation === void 0) return null;
@@ -22198,7 +22524,7 @@ function privateVariantType(properties, result, sourceCode2) {
22198
22524
  }
22199
22525
 
22200
22526
  // src/rules/prefer-ecmascript-private-members.ts
22201
- var NAME94 = "prefer-ecmascript-private-members";
22527
+ var NAME95 = "prefer-ecmascript-private-members";
22202
22528
  function isConvertible(member3) {
22203
22529
  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);
22204
22530
  }
@@ -22208,7 +22534,7 @@ var prefer_ecmascript_private_members_default = defineRule({
22208
22534
  fixable: "code",
22209
22535
  docs: {
22210
22536
  description: "Prefer ECMAScript `#private` class members over TypeScript-only `private` members.",
22211
- url: docsUrl(NAME94)
22537
+ url: docsUrl(NAME95)
22212
22538
  },
22213
22539
  schema: [],
22214
22540
  messages: {
@@ -22262,7 +22588,7 @@ var prefer_ecmascript_private_members_default = defineRule({
22262
22588
  });
22263
22589
 
22264
22590
  // src/rules/prefer-immutable-module-constant.ts
22265
- var NAME95 = "prefer-immutable-module-constant";
22591
+ var NAME96 = "prefer-immutable-module-constant";
22266
22592
  var CONSTANT_NAME = /^_?[A-Z][A-Z0-9_]*$/;
22267
22593
  var JAVASCRIPT_FILE_RE = /\.[cm]?jsx?$/i;
22268
22594
  var MUTATING_METHODS = /* @__PURE__ */ new Set([
@@ -22435,7 +22761,7 @@ var prefer_immutable_module_constant_default = defineRule({
22435
22761
  fixable: "code",
22436
22762
  docs: {
22437
22763
  description: "Require module-level constant collections to expose readonly state.",
22438
- url: docsUrl(NAME95)
22764
+ url: docsUrl(NAME96)
22439
22765
  },
22440
22766
  schema: [],
22441
22767
  defaultOptions: [],
@@ -22541,7 +22867,7 @@ function unwrapTransparentExport(node) {
22541
22867
  }
22542
22868
 
22543
22869
  // src/rules/prefer-input-group-search.ts
22544
- var NAME96 = "prefer-input-group-search";
22870
+ var NAME97 = "prefer-input-group-search";
22545
22871
  var INPUT_MODULE = /(?:^|\/)components\/ui\/input$/u;
22546
22872
  var INPUT_GROUP_MODULE = /(?:^|\/)components\/ui\/input-group$/u;
22547
22873
  var MAX_JSX_DISTANCE = 2;
@@ -22612,7 +22938,7 @@ var prefer_input_group_search_default = defineRule({
22612
22938
  type: "suggestion",
22613
22939
  docs: {
22614
22940
  description: "Require search icons and shared Input controls in the same visual wrapper to use InputGroup.",
22615
- url: docsUrl(NAME96)
22941
+ url: docsUrl(NAME97)
22616
22942
  },
22617
22943
  schema: [],
22618
22944
  messages: {
@@ -22696,7 +23022,7 @@ var prefer_input_group_search_default = defineRule({
22696
23022
  });
22697
23023
 
22698
23024
  // src/rules/prefer-logical-tailwind-utilities.ts
22699
- var NAME97 = "prefer-logical-tailwind-utilities";
23025
+ var NAME98 = "prefer-logical-tailwind-utilities";
22700
23026
  var PREFIXES = {
22701
23027
  ml: "ms",
22702
23028
  mr: "me",
@@ -22750,7 +23076,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
22750
23076
  type: "suggestion",
22751
23077
  docs: {
22752
23078
  description: "Prefer logical Tailwind utilities in explicitly opted-in bidirectional interfaces.",
22753
- url: docsUrl(NAME97)
23079
+ url: docsUrl(NAME98)
22754
23080
  },
22755
23081
  schema: [
22756
23082
  {
@@ -22817,7 +23143,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
22817
23143
  });
22818
23144
 
22819
23145
  // src/rules/prefer-millisecond-control-duration-schema.ts
22820
- var NAME98 = "prefer-millisecond-control-duration-schema";
23146
+ var NAME99 = "prefer-millisecond-control-duration-schema";
22821
23147
  var CONTROL_SECONDS_RE = /(?:^|_)(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)_seconds$/i;
22822
23148
  var CONTROL_SECONDS_CAMEL_RE = /(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)Seconds$/i;
22823
23149
  var NUMERIC_REFINEMENTS = /* @__PURE__ */ new Set(["int", "min", "max", "positive", "nonnegative", "finite", "multipleOf", "optional", "nullable", "nullish", "default", "describe", "brand", "readonly"]);
@@ -22829,7 +23155,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
22829
23155
  type: "suggestion",
22830
23156
  docs: {
22831
23157
  description: "Require application-owned Zod control-duration fields to use millisecond granularity.",
22832
- url: docsUrl(NAME98)
23158
+ url: docsUrl(NAME99)
22833
23159
  },
22834
23160
  schema: [],
22835
23161
  messages: {
@@ -22915,7 +23241,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
22915
23241
  });
22916
23242
 
22917
23243
  // src/rules/prefer-minimal-parameter-contract.ts
22918
- var NAME99 = "prefer-minimal-parameter-contract";
23244
+ var NAME100 = "prefer-minimal-parameter-contract";
22919
23245
  function inlineFields(ast, node, reads) {
22920
23246
  const fields2 = /* @__PURE__ */ new Map();
22921
23247
  for (const member3 of node.members) {
@@ -22934,7 +23260,7 @@ var prefer_minimal_parameter_contract_default = defineRule({
22934
23260
  meta: {
22935
23261
  type: "suggestion",
22936
23262
  fixable: "code",
22937
- docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(NAME99) },
23263
+ docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(NAME100) },
22938
23264
  schema: [],
22939
23265
  messages: {
22940
23266
  minimal: "This private consumer reads only {{used}} but also requires {{unused}}. Review a smaller consumer contract; preserve the original runtime object and producer type."
@@ -23333,7 +23659,7 @@ var prefer_module_level_constant_default = defineRule({
23333
23659
  });
23334
23660
 
23335
23661
  // src/rules/prefer-module-level-schema.ts
23336
- var NAME100 = "prefer-module-level-schema";
23662
+ var NAME101 = "prefer-module-level-schema";
23337
23663
  var DEFAULT_FACTORIES = [
23338
23664
  "discriminatedUnion",
23339
23665
  "intersection",
@@ -23515,7 +23841,7 @@ var prefer_module_level_schema_default = defineRule({
23515
23841
  type: "problem",
23516
23842
  docs: {
23517
23843
  description: "Declare a Zod schema at module scope when it closes over nothing in the enclosing function",
23518
- url: docsUrl(NAME100)
23844
+ url: docsUrl(NAME101)
23519
23845
  },
23520
23846
  schema: [
23521
23847
  {
@@ -23665,7 +23991,7 @@ var prefer_module_level_schema_default = defineRule({
23665
23991
  });
23666
23992
 
23667
23993
  // src/rules/prefer-module-level-refined-schema.ts
23668
- var NAME101 = "prefer-module-level-refined-schema";
23994
+ var NAME102 = "prefer-module-level-refined-schema";
23669
23995
  var BENCHMARK_PATH_RE = /(^|[/\\])(?:benchmarks?|bench)[/\\]/;
23670
23996
  var FACTORIES = /* @__PURE__ */ new Set([
23671
23997
  "array",
@@ -23815,7 +24141,7 @@ var prefer_module_level_refined_schema_default = defineRule({
23815
24141
  type: "suggestion",
23816
24142
  docs: {
23817
24143
  description: "Declare closed Zod scalar, format, and wrapper schemas at module scope.",
23818
- url: docsUrl(NAME101)
24144
+ url: docsUrl(NAME102)
23819
24145
  },
23820
24146
  schema: [],
23821
24147
  messages: {
@@ -23913,7 +24239,7 @@ var prefer_module_level_refined_schema_default = defineRule({
23913
24239
  });
23914
24240
 
23915
24241
  // src/rules/prefer-multi-value-zod-literal.ts
23916
- var NAME102 = "prefer-multi-value-zod-literal";
24242
+ var NAME103 = "prefer-multi-value-zod-literal";
23917
24243
  function isStaticPrimitive(node, sourceCode2) {
23918
24244
  node = unwrapExpression(node);
23919
24245
  if (node.type === "Literal") {
@@ -23940,7 +24266,7 @@ var prefer_multi_value_zod_literal_default = defineRule({
23940
24266
  type: "suggestion",
23941
24267
  docs: {
23942
24268
  description: "Use the Zod 4 multi-value literal API instead of a union of literal schemas.",
23943
- url: docsUrl(NAME102)
24269
+ url: docsUrl(NAME103)
23944
24270
  },
23945
24271
  schema: [
23946
24272
  {
@@ -24103,7 +24429,7 @@ function closedType(node) {
24103
24429
  }
24104
24430
 
24105
24431
  // src/rules/prefer-named-callback-domain.ts
24106
- var NAME103 = "prefer-named-callback-domain";
24432
+ var NAME104 = "prefer-named-callback-domain";
24107
24433
  function isLiteralUnion(node) {
24108
24434
  return node.type === "TSUnionType" && node.types.length >= 2 && node.types.every((part) => part.type === "TSLiteralType");
24109
24435
  }
@@ -24123,7 +24449,7 @@ var prefer_named_callback_domain_default = defineRule({
24123
24449
  fixable: "code",
24124
24450
  docs: {
24125
24451
  description: "Name literal-union domains used by callbacks in exported contracts.",
24126
- url: docsUrl(NAME103)
24452
+ url: docsUrl(NAME104)
24127
24453
  },
24128
24454
  schema: [],
24129
24455
  messages: {
@@ -24162,7 +24488,7 @@ var prefer_named_callback_domain_default = defineRule({
24162
24488
  });
24163
24489
 
24164
24490
  // src/rules/prefer-named-complex-return-type.ts
24165
- var NAME104 = "prefer-named-complex-return-type";
24491
+ var NAME105 = "prefer-named-complex-return-type";
24166
24492
  function unwrap5(node) {
24167
24493
  if (node.type === "TSTypeReference" && node.typeArguments?.params.length === 1) {
24168
24494
  const [inner] = node.typeArguments.params;
@@ -24200,7 +24526,7 @@ var prefer_named_complex_return_type_default = defineRule({
24200
24526
  fixable: "code",
24201
24527
  docs: {
24202
24528
  description: "Prefer a named contract for structurally complex function return types.",
24203
- url: docsUrl(NAME104)
24529
+ url: docsUrl(NAME105)
24204
24530
  },
24205
24531
  schema: [],
24206
24532
  messages: {
@@ -24223,14 +24549,14 @@ var prefer_named_complex_return_type_default = defineRule({
24223
24549
  });
24224
24550
 
24225
24551
  // src/rules/prefer-native-fetch-in-server-actions.ts
24226
- var NAME105 = "prefer-native-fetch-in-server-actions";
24552
+ var NAME106 = "prefer-native-fetch-in-server-actions";
24227
24553
  var KY_MODULE = /^ky(?:\/.*)?$/u;
24228
24554
  var prefer_native_fetch_in_server_actions_default = defineRule({
24229
24555
  meta: {
24230
24556
  type: "problem",
24231
24557
  docs: {
24232
24558
  description: "Server action modules should call native fetch instead of importing ky.",
24233
- url: docsUrl(NAME105)
24559
+ url: docsUrl(NAME106)
24234
24560
  },
24235
24561
  schema: [],
24236
24562
  defaultOptions: [],
@@ -24266,7 +24592,7 @@ function isTypeOnly(node) {
24266
24592
  }
24267
24593
 
24268
24594
  // src/rules/prefer-native-random-uuid.ts
24269
- var NAME106 = "prefer-native-random-uuid";
24595
+ var NAME107 = "prefer-native-random-uuid";
24270
24596
  function requireUuidCallee(node) {
24271
24597
  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;
24272
24598
  }
@@ -24279,7 +24605,7 @@ var prefer_native_random_uuid_default = defineRule({
24279
24605
  type: "suggestion",
24280
24606
  docs: {
24281
24607
  description: "Prefer `globalThis.crypto.randomUUID()` over resolved zero-argument UUID v4 bindings from the `uuid` package.",
24282
- url: docsUrl(NAME106)
24608
+ url: docsUrl(NAME107)
24283
24609
  },
24284
24610
  hasSuggestions: true,
24285
24611
  fixable: "code",
@@ -24293,11 +24619,11 @@ var prefer_native_random_uuid_default = defineRule({
24293
24619
  let sourceCode2;
24294
24620
  let directBindings = /* @__PURE__ */ new Set();
24295
24621
  let namespaceBindings = /* @__PURE__ */ new Set();
24296
- function resolve3(identifier) {
24622
+ function resolve4(identifier) {
24297
24623
  return findVariable(sourceCode2.getScope(identifier), identifier.name);
24298
24624
  }
24299
24625
  function record(identifier, destination) {
24300
- const variable = resolve3(identifier);
24626
+ const variable = resolve4(identifier);
24301
24627
  if (variable !== null) destination.add(variable);
24302
24628
  }
24303
24629
  function report2(node) {
@@ -24336,7 +24662,7 @@ var prefer_native_random_uuid_default = defineRule({
24336
24662
  const declaration = node.parent;
24337
24663
  if (declaration.kind !== "const") return;
24338
24664
  const require2 = requireUuidCallee(node.init);
24339
- if (require2 === null || (resolve3(require2)?.defs.length ?? 0) > 0) return;
24665
+ if (require2 === null || (resolve4(require2)?.defs.length ?? 0) > 0) return;
24340
24666
  if (node.id.type === "Identifier") {
24341
24667
  record(node.id, namespaceBindings);
24342
24668
  return;
@@ -24352,14 +24678,14 @@ var prefer_native_random_uuid_default = defineRule({
24352
24678
  if (node.arguments.length !== 0 || directBindings.size === 0 && namespaceBindings.size === 0) return;
24353
24679
  const callee = unwrapExpression(node.callee);
24354
24680
  if (callee.type === "Identifier") {
24355
- const variable2 = resolve3(callee);
24681
+ const variable2 = resolve4(callee);
24356
24682
  if (variable2 !== null && directBindings.has(variable2)) report2(node);
24357
24683
  return;
24358
24684
  }
24359
24685
  if (callee.type !== "MemberExpression" || callee.computed || callee.object.type !== "Identifier" || callee.property.type !== "Identifier" || callee.property.name !== "v4") {
24360
24686
  return;
24361
24687
  }
24362
- const variable = resolve3(callee.object);
24688
+ const variable = resolve4(callee.object);
24363
24689
  if (variable !== null && namespaceBindings.has(variable)) report2(node);
24364
24690
  }
24365
24691
  };
@@ -24367,7 +24693,7 @@ var prefer_native_random_uuid_default = defineRule({
24367
24693
  });
24368
24694
 
24369
24695
  // src/rules/prefer-node-crypto-hash.ts
24370
- var NAME107 = "prefer-node-crypto-hash";
24696
+ var NAME108 = "prefer-node-crypto-hash";
24371
24697
  var UNSAFE_NAMESPACE_METHODS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "valueOf"]);
24372
24698
  var UNSAFE_AUTHORITY_IDENTIFIERS = [
24373
24699
  "eval",
@@ -24416,13 +24742,13 @@ function readonlyNamespaceUse(receiver) {
24416
24742
  const parent = parentOf(use);
24417
24743
  return name !== null && !UNSAFE_NAMESPACE_METHODS.has(name) && parent?.type === "CallExpression" && parent.callee === use;
24418
24744
  }
24419
- function readonlyLoaderUse(node, resolve3, stable2) {
24745
+ function readonlyLoaderUse(node, resolve4, stable2) {
24420
24746
  const receiver = outerExpression(node);
24421
24747
  const parent = parentOf(receiver);
24422
24748
  if (parent?.type === "VariableDeclarator" && parent.init === receiver) {
24423
24749
  if (parent.id.type === "ObjectPattern") return true;
24424
24750
  if (parent.id.type !== "Identifier") return false;
24425
- const variable = resolve3(parent.id);
24751
+ const variable = resolve4(parent.id);
24426
24752
  return variable !== null && stable2(variable);
24427
24753
  }
24428
24754
  return parent?.type === "ExpressionStatement" || readonlyNamespaceUse(receiver);
@@ -24439,7 +24765,7 @@ function namespaceDefaultMayEscape(variable) {
24439
24765
  return (name === null || name === "default") && !readonlyNamespaceUse(outerExpression(member3));
24440
24766
  });
24441
24767
  }
24442
- function isBuiltinLoader(node, resolve3, builtin = "crypto") {
24768
+ function isBuiltinLoader(node, resolve4, builtin = "crypto") {
24443
24769
  if (node.type !== "CallExpression" || node.arguments.length !== 1) return false;
24444
24770
  const [argument] = node.arguments;
24445
24771
  if (argument === void 0 || argument.type === "SpreadElement" || !isBuiltinSpecifier(argument, builtin)) {
@@ -24447,15 +24773,15 @@ function isBuiltinLoader(node, resolve3, builtin = "crypto") {
24447
24773
  }
24448
24774
  const unwrappedNodeCallee = unwrapExpression(node.callee);
24449
24775
  if (unwrappedNodeCallee.type === "Identifier") {
24450
- return unwrappedNodeCallee.name === "require" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee, resolve3);
24776
+ return unwrappedNodeCallee.name === "require" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee, resolve4);
24451
24777
  }
24452
- return unwrappedNodeCallee.type === "MemberExpression" && unwrappedNodeCallee.object.type === "Identifier" && unwrappedNodeCallee.object.name === "process" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee.object, resolve3) && getPropertyName(unwrappedNodeCallee) === "getBuiltinModule";
24778
+ return unwrappedNodeCallee.type === "MemberExpression" && unwrappedNodeCallee.object.type === "Identifier" && unwrappedNodeCallee.object.name === "process" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee.object, resolve4) && getPropertyName(unwrappedNodeCallee) === "getBuiltinModule";
24453
24779
  }
24454
24780
  function isBuiltinSpecifier(node, builtin) {
24455
24781
  return node.type === "Literal" && (node.value === builtin || node.value === `node:${builtin}`);
24456
24782
  }
24457
- function isUnshadowedBuiltinIdentifier(identifier, resolve3) {
24458
- const variable = resolve3(identifier);
24783
+ function isUnshadowedBuiltinIdentifier(identifier, resolve4) {
24784
+ const variable = resolve4(identifier);
24459
24785
  return variable === null || variable.defs.length === 0;
24460
24786
  }
24461
24787
  function propertyName2(node) {
@@ -24471,7 +24797,7 @@ var prefer_node_crypto_hash_default = defineRule({
24471
24797
  fixable: "code",
24472
24798
  docs: {
24473
24799
  description: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary.",
24474
- url: docsUrl(NAME107)
24800
+ url: docsUrl(NAME108)
24475
24801
  },
24476
24802
  schema: [],
24477
24803
  messages: { preferNodeCryptoHash: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary." }
@@ -24496,11 +24822,11 @@ var prefer_node_crypto_hash_default = defineRule({
24496
24822
  namespaceStability.set(variable, stable2);
24497
24823
  return stable2;
24498
24824
  }
24499
- function resolve3(identifier) {
24825
+ function resolve4(identifier) {
24500
24826
  return findVariable(context.sourceCode.getScope(identifier), identifier.name);
24501
24827
  }
24502
24828
  function record(identifier, destination, shared = false) {
24503
- const variable = resolve3(identifier);
24829
+ const variable = resolve4(identifier);
24504
24830
  if (variable === null) return;
24505
24831
  const stable2 = destination === namespaceBindings ? namespaceStable(variable) : stableValueBinding(variable);
24506
24832
  if (shared && destination === namespaceBindings && !stable2) sharedNamespaceUnsafe = true;
@@ -24520,7 +24846,7 @@ var prefer_node_crypto_hash_default = defineRule({
24520
24846
  if (node.source.value !== "node:crypto" || node.importKind === "type") return;
24521
24847
  for (const specifier of node.specifiers) {
24522
24848
  if (specifier.type !== "ImportSpecifier" || specifier.importKind === "type") continue;
24523
- const binding3 = resolve3(specifier.local);
24849
+ const binding3 = resolve4(specifier.local);
24524
24850
  if (binding3 === null) continue;
24525
24851
  const name = importSpecifierName(specifier);
24526
24852
  if (name === "hash") hashBindings.set(binding3, specifier.local);
@@ -24532,7 +24858,7 @@ var prefer_node_crypto_hash_default = defineRule({
24532
24858
  const { sourceCode: sourceCode2 } = context;
24533
24859
  const constructor = unwrapExpression(create.callee);
24534
24860
  if (sourceCode2.getCommentsInside(node).length > 0 || constructor.type !== "Identifier" || !hasLiteralSha256HexArguments(node, update, create) || ![create, update, node].every(isPlainCall) || hashMayBeRebound()) return null;
24535
- const creator = resolve3(constructor);
24861
+ const creator = resolve4(constructor);
24536
24862
  if (creator === null || !canonicalCreators.has(creator) || !hasOnlyDirectFactoryUses(creator) || !hasRetainedFactoryCall(creator, candidates2.map((candidate2) => candidate2.node))) return null;
24537
24863
  const hash = visibleHashImport(node);
24538
24864
  if (hash === void 0) return null;
@@ -24582,7 +24908,7 @@ var prefer_node_crypto_hash_default = defineRule({
24582
24908
  const shared = specifier.type === "ImportDefaultSpecifier" || specifier.type === "ImportSpecifier" && importSpecifierName(specifier) === "default";
24583
24909
  if (specifier.type === "ImportNamespaceSpecifier" || shared) {
24584
24910
  record(specifier.local, namespaceBindings, shared);
24585
- const variable = resolve3(specifier.local);
24911
+ const variable = resolve4(specifier.local);
24586
24912
  if (!shared && variable !== null && namespaceDefaultMayEscape(variable)) sharedNamespaceUnsafe = true;
24587
24913
  } else if (specifier.type === "ImportSpecifier" && importSpecifierName(specifier) === "createHash") {
24588
24914
  record(specifier.local, directBindings);
@@ -24591,8 +24917,8 @@ var prefer_node_crypto_hash_default = defineRule({
24591
24917
  },
24592
24918
  VariableDeclarator(node) {
24593
24919
  if (parentOf(node).kind !== "const" || node.init === null) return;
24594
- const crypto = isBuiltinLoader(node.init, resolve3);
24595
- if (!crypto && !isBuiltinLoader(node.init, resolve3, "module")) return;
24920
+ const crypto = isBuiltinLoader(node.init, resolve4);
24921
+ if (!crypto && !isBuiltinLoader(node.init, resolve4, "module")) return;
24596
24922
  if (node.id.type === "Identifier") {
24597
24923
  record(node.id, crypto ? namespaceBindings : moduleBindings, crypto);
24598
24924
  return;
@@ -24605,16 +24931,16 @@ var prefer_node_crypto_hash_default = defineRule({
24605
24931
  }
24606
24932
  },
24607
24933
  CallExpression(node) {
24608
- if (isBuiltinLoader(node, resolve3) && !readonlyLoaderUse(node, resolve3, namespaceStable)) sharedNamespaceUnsafe = true;
24934
+ if (isBuiltinLoader(node, resolve4) && !readonlyLoaderUse(node, resolve4, namespaceStable)) sharedNamespaceUnsafe = true;
24609
24935
  const callee = unwrapExpression(node.callee);
24610
24936
  if (callee.type === "Identifier" || callee.type === "MemberExpression" && getPropertyName(callee) === "syncBuiltinESMExports") possibleSynchronizations.push(node);
24611
24937
  const chain = digestChain(node);
24612
24938
  if (chain === null) return;
24613
- const provider = builtinCallProvider(chain.create, directBindings, namespaceBindings, sharedBindings, resolve3);
24939
+ const provider = builtinCallProvider(chain.create, directBindings, namespaceBindings, sharedBindings, resolve4);
24614
24940
  if (provider !== null) candidates2.push({ node, ...chain, shared: provider === "shared" });
24615
24941
  },
24616
24942
  "Program:exit"() {
24617
- const exportsMaySynchronize = sharedNamespaceUnsafe && possibleSynchronizations.some((node) => builtinCallProvider(node, syncBindings, moduleBindings, sharedBindings, resolve3, "module") !== null);
24943
+ const exportsMaySynchronize = sharedNamespaceUnsafe && possibleSynchronizations.some((node) => builtinCallProvider(node, syncBindings, moduleBindings, sharedBindings, resolve4, "module") !== null);
24618
24944
  for (const candidate2 of candidates2) {
24619
24945
  if (!sharedNamespaceUnsafe || !candidate2.shared && !exportsMaySynchronize) {
24620
24946
  const fix = existingHashFix(candidate2);
@@ -24647,19 +24973,19 @@ function isPlainCall(call) {
24647
24973
  const callee = unwrapExpression(call.callee);
24648
24974
  return !call.optional && !isPresent(call.typeArguments) && (callee.type !== "MemberExpression" || !callee.optional);
24649
24975
  }
24650
- function builtinCallProvider(node, directBindings, namespaceBindings, sharedBindings, resolve3, builtin = "crypto") {
24976
+ function builtinCallProvider(node, directBindings, namespaceBindings, sharedBindings, resolve4, builtin = "crypto") {
24651
24977
  const unwrappedNodeCallee = unwrapExpression(node.callee);
24652
24978
  if (unwrappedNodeCallee.type === "Identifier") {
24653
- const variable2 = resolve3(unwrappedNodeCallee);
24979
+ const variable2 = resolve4(unwrappedNodeCallee);
24654
24980
  if (variable2 === null || !directBindings.has(variable2)) return null;
24655
24981
  return sharedBindings.has(variable2) ? "shared" : "snapshot";
24656
24982
  }
24657
24983
  if (unwrappedNodeCallee.type !== "MemberExpression" || getPropertyName(unwrappedNodeCallee) !== (builtin === "crypto" ? "createHash" : "syncBuiltinESMExports")) {
24658
24984
  return null;
24659
24985
  }
24660
- if (isBuiltinLoader(unwrappedNodeCallee.object, resolve3, builtin)) return "shared";
24986
+ if (isBuiltinLoader(unwrappedNodeCallee.object, resolve4, builtin)) return "shared";
24661
24987
  if (unwrappedNodeCallee.object.type !== "Identifier") return null;
24662
- const variable = resolve3(unwrappedNodeCallee.object);
24988
+ const variable = resolve4(unwrappedNodeCallee.object);
24663
24989
  if (variable === null || !namespaceBindings.has(variable)) return null;
24664
24990
  return sharedBindings.has(variable) ? "shared" : "snapshot";
24665
24991
  }
@@ -24701,7 +25027,7 @@ function hasRetainedFactoryCall(binding3, removed) {
24701
25027
  }
24702
25028
 
24703
25029
  // src/rules/prefer-node-fs-promises.ts
24704
- var NAME108 = "prefer-node-fs-promises";
25030
+ var NAME109 = "prefer-node-fs-promises";
24705
25031
  function memberName3(node) {
24706
25032
  if (!node.computed && node.property.type === "Identifier") return node.property.name;
24707
25033
  if (node.computed && node.property.type === "Literal" && typeof node.property.value === "string") {
@@ -24734,7 +25060,7 @@ var prefer_node_fs_promises_default = defineRule({
24734
25060
  type: "suggestion",
24735
25061
  docs: {
24736
25062
  description: "Prefer promise-based Node.js filesystem APIs over synchronous calls in production modules.",
24737
- url: docsUrl(NAME108)
25063
+ url: docsUrl(NAME109)
24738
25064
  },
24739
25065
  schema: [],
24740
25066
  messages: {
@@ -24877,7 +25203,7 @@ function sameTypeBinding(sourceCode2, alias, annotation, parameter) {
24877
25203
  }
24878
25204
 
24879
25205
  // src/rules/prefer-nominal-id-types.ts
24880
- var NAME109 = "prefer-nominal-id-types";
25206
+ var NAME110 = "prefer-nominal-id-types";
24881
25207
  var OPERATIONAL_ROLES = /* @__PURE__ */ new Set([
24882
25208
  "request",
24883
25209
  "trace",
@@ -24993,7 +25319,7 @@ var prefer_nominal_id_types_default = defineRule({
24993
25319
  fixable: "code",
24994
25320
  docs: {
24995
25321
  description: "Distinguish identifier roles sharing primitive types at callable boundaries.",
24996
- url: docsUrl(NAME109)
25322
+ url: docsUrl(NAME110)
24997
25323
  },
24998
25324
  schema: [],
24999
25325
  messages: {
@@ -25022,7 +25348,7 @@ var prefer_nominal_id_types_default = defineRule({
25022
25348
  });
25023
25349
 
25024
25350
  // src/rules/prefer-non-nullable-collection.ts
25025
- var NAME110 = "prefer-non-nullable-collection";
25351
+ var NAME111 = "prefer-non-nullable-collection";
25026
25352
  var ARRAY_TYPE_NAMES2 = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
25027
25353
  var NULL_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "==="]);
25028
25354
  var EMPTY_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "===", "<="]);
@@ -25377,7 +25703,7 @@ var prefer_non_nullable_collection_default = defineRule({
25377
25703
  fixable: "code",
25378
25704
  docs: {
25379
25705
  description: "Suggest reviewing nullish arrays that use local empty-array defaults or a shared null-or-empty guard.",
25380
- url: docsUrl(NAME110)
25706
+ url: docsUrl(NAME111)
25381
25707
  },
25382
25708
  schema: [],
25383
25709
  messages: {
@@ -25413,13 +25739,13 @@ var prefer_non_nullable_collection_default = defineRule({
25413
25739
  function checkParameter(rawParameter) {
25414
25740
  const parameter = rawParameter.type === "AssignmentPattern" ? rawParameter.left : rawParameter;
25415
25741
  if (parameter.type === "ObjectPattern") {
25416
- const properties2 = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25417
- checkDestructuredProperties(parameter, properties2);
25742
+ const properties3 = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25743
+ checkDestructuredProperties(parameter, properties3);
25418
25744
  return;
25419
25745
  }
25420
25746
  if (parameter.type !== "Identifier") return;
25421
- const properties = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25422
- for (const property of properties) {
25747
+ const properties2 = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25748
+ for (const property of properties2) {
25423
25749
  const access = { kind: "member", object: parameter.name, property: property.name };
25424
25750
  record(
25425
25751
  property,
@@ -25427,8 +25753,8 @@ var prefer_non_nullable_collection_default = defineRule({
25427
25753
  );
25428
25754
  }
25429
25755
  }
25430
- function checkDestructuredProperties(parameter, properties) {
25431
- for (const property of properties) {
25756
+ function checkDestructuredProperties(parameter, properties2) {
25757
+ for (const property of properties2) {
25432
25758
  const bindingProperty = parameter.properties.find(
25433
25759
  (entry) => entry.type === "Property" && !entry.computed && getPropertyName(entry) === property.name
25434
25760
  );
@@ -25488,7 +25814,7 @@ var prefer_non_nullable_collection_default = defineRule({
25488
25814
  });
25489
25815
 
25490
25816
  // src/rules/prefer-nullish-filter-predicate.ts
25491
- var NAME111 = "prefer-nullish-filter-predicate";
25817
+ var NAME112 = "prefer-nullish-filter-predicate";
25492
25818
  var SUMMARY = "Prefer an explicit nullish predicate when `filter(Boolean)` removes only nullish values but does not narrow the result type.";
25493
25819
  function isBuiltinArrayFilter(native, symbol) {
25494
25820
  const kinds2 = native.ast.SyntaxKind;
@@ -25545,7 +25871,7 @@ function isLiteralValue(node) {
25545
25871
  var prefer_nullish_filter_predicate_default = defineRule({
25546
25872
  meta: {
25547
25873
  type: "suggestion",
25548
- docs: { description: SUMMARY, url: docsUrl(NAME111) },
25874
+ docs: { description: SUMMARY, url: docsUrl(NAME112) },
25549
25875
  hasSuggestions: true,
25550
25876
  fixable: "code",
25551
25877
  schema: [],
@@ -25590,7 +25916,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
25590
25916
  while (findVariable(scope, `value${String(suffix)}`) !== null) suffix += 1;
25591
25917
  return `value${String(suffix)}`;
25592
25918
  }
25593
- function resolve3(native) {
25919
+ function resolve4(native) {
25594
25920
  const { checker, file } = native;
25595
25921
  const symbols = file.symbolsOf(candidates2.map((candidate2) => candidate2.callee.property));
25596
25922
  const receivers = file.typesOf(candidates2.map((candidate2) => candidate2.callee.object));
@@ -25627,7 +25953,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
25627
25953
  },
25628
25954
  "Program:exit"() {
25629
25955
  if (candidates2.length === 0 || tsrs === null) return;
25630
- const found = tsrs.run((file) => resolve3(nativeTypes(file)));
25956
+ const found = tsrs.run((file) => resolve4(nativeTypes(file)));
25631
25957
  if (found === null) return;
25632
25958
  candidates2.forEach((candidate2, i) => {
25633
25959
  if (found[i] === true) report2(candidate2);
@@ -25638,7 +25964,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
25638
25964
  });
25639
25965
 
25640
25966
  // src/rules/prefer-schema-for-api-payload.ts
25641
- var NAME112 = "prefer-schema-for-api-payload";
25967
+ var NAME113 = "prefer-schema-for-api-payload";
25642
25968
  var unwrap6 = (node) => {
25643
25969
  let current = node ?? null;
25644
25970
  while (current !== null && (isErasedExpression(current) || current.type === "ChainExpression")) current = current.expression;
@@ -25921,7 +26247,7 @@ var prefer_schema_for_api_payload_default = defineRule({
25921
26247
  type: "problem",
25922
26248
  docs: {
25923
26249
  description: "Require Zod (or similar) schema validation on `response.json()` / `JSON.parse()` results before property access.",
25924
- url: docsUrl(NAME112)
26250
+ url: docsUrl(NAME113)
25925
26251
  },
25926
26252
  schema: [],
25927
26253
  messages: {
@@ -26104,7 +26430,7 @@ var prefer_schema_for_api_payload_default = defineRule({
26104
26430
  // src/rules/prefer-semantic-colors.ts
26105
26431
  import { existsSync as existsSync3, lstatSync, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "fs";
26106
26432
  import { dirname as dirname3, join as join3, parse } from "path";
26107
- var NAME113 = "prefer-semantic-colors";
26433
+ var NAME114 = "prefer-semantic-colors";
26108
26434
  var COLOR_PREFIXES = "text|bg|border(?:-[trblxyse])?|ring(?:-offset)?|fill|stroke|from|via|to|divide|decoration|placeholder|accent|caret|shadow|outline";
26109
26435
  var PALETTE = "red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone";
26110
26436
  var COLOR_FN = "rgba?|hsla?|hwb|oklch|oklab|lab|lch|color";
@@ -26436,7 +26762,7 @@ var prefer_semantic_colors_default = defineRule({
26436
26762
  type: "suggestion",
26437
26763
  docs: {
26438
26764
  description: "Enforce semantic color tokens over raw Tailwind palette classes, arbitrary color values, and inline color literals.",
26439
- url: docsUrl(NAME113)
26765
+ url: docsUrl(NAME114)
26440
26766
  },
26441
26767
  schema: [
26442
26768
  {
@@ -26623,7 +26949,7 @@ function packageWorkspaceGlobs(parsed) {
26623
26949
  }
26624
26950
 
26625
26951
  // src/rules/prefer-server-actions.ts
26626
- var NAME114 = "prefer-server-actions";
26952
+ var NAME115 = "prefer-server-actions";
26627
26953
  var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "DELETE", "PATCH"]);
26628
26954
  var AXIOS_MUTATION_METHODS = /* @__PURE__ */ new Set(["post", "put", "delete", "patch"]);
26629
26955
  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\/)/;
@@ -26762,7 +27088,7 @@ var prefer_server_actions_default = defineRule({
26762
27088
  type: "suggestion",
26763
27089
  docs: {
26764
27090
  description: "Prefer Next.js Server Actions over same-origin API mutations.",
26765
- url: docsUrl(NAME114)
27091
+ url: docsUrl(NAME115)
26766
27092
  },
26767
27093
  schema: [
26768
27094
  {
@@ -26848,7 +27174,7 @@ var prefer_server_actions_default = defineRule({
26848
27174
  });
26849
27175
 
26850
27176
  // src/rules/prefer-server-data-preparation.ts
26851
- var NAME115 = "prefer-server-data-preparation";
27177
+ var NAME116 = "prefer-server-data-preparation";
26852
27178
  var METHODS = /* @__PURE__ */ new Set(["map", "filter", "flatMap"]);
26853
27179
  var DOM_EVENTS = /* @__PURE__ */ new Set(["onClick", "onChange", "onInput", "onSubmit"]);
26854
27180
  var BINARY = /* @__PURE__ */ new Set(["===", "!==", "==", "!=", ">", ">=", "<", "<=", "+", "-", "*", "/", "%"]);
@@ -26980,7 +27306,7 @@ function typedProofs(native) {
26980
27306
  var prefer_server_data_preparation_default = defineRule({
26981
27307
  meta: {
26982
27308
  type: "suggestion",
26983
- docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(NAME115) },
27309
+ docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(NAME116) },
26984
27310
  schema: [],
26985
27311
  messages: {
26986
27312
  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."
@@ -27036,7 +27362,7 @@ var prefer_server_data_preparation_default = defineRule({
27036
27362
  // src/rules/prefer-shadcn-primitives.ts
27037
27363
  import { existsSync as existsSync4, lstatSync as lstatSync2, readFileSync as readFileSync3, realpathSync } from "fs";
27038
27364
  import { createRequire as createRequire2 } from "module";
27039
- import { dirname as dirname4, isAbsolute, join as join4, parse as parsePath, relative, resolve as resolve2, sep } from "path";
27365
+ import { dirname as dirname4, isAbsolute, join as join4, parse as parsePath, relative, resolve as resolve3, sep } from "path";
27040
27366
 
27041
27367
  // node_modules/jsonc-parser/lib/esm/impl/scanner.js
27042
27368
  function createScanner(text, ignoreTrivia = false) {
@@ -27898,7 +28224,7 @@ var ParseErrorCode;
27898
28224
  })(ParseErrorCode || (ParseErrorCode = {}));
27899
28225
 
27900
28226
  // src/rules/prefer-shadcn-primitives.ts
27901
- var NAME116 = "prefer-shadcn-primitives";
28227
+ var NAME117 = "prefer-shadcn-primitives";
27902
28228
  var RAW_PRIMITIVES = {
27903
28229
  button: { capability: "Button", replacement: "Button" },
27904
28230
  dialog: { capability: "Dialog", replacement: "Dialog or AlertDialog family" },
@@ -28047,7 +28373,7 @@ function stringProperty(value, ...keys) {
28047
28373
  }
28048
28374
  function resolveAlias(packageRoot, alias) {
28049
28375
  if (isAbsolute(alias)) return null;
28050
- if (alias.startsWith(".")) return resolve2(packageRoot, alias);
28376
+ if (alias.startsWith(".")) return resolve3(packageRoot, alias);
28051
28377
  const configPath = ["tsconfig.json", "jsconfig.json"].map((name) => join4(packageRoot, name)).find(existsSync4);
28052
28378
  if (configPath === void 0) return null;
28053
28379
  const config = readJsonc(configPath);
@@ -28061,7 +28387,7 @@ function resolveAlias(packageRoot, alias) {
28061
28387
  const matches = matchingAliasTargets(paths, alias);
28062
28388
  const [match] = matches;
28063
28389
  if (matches.length !== 1 || match === void 0) return null;
28064
- return resolve2(packageRoot, baseUrl, match);
28390
+ return resolve3(packageRoot, baseUrl, match);
28065
28391
  }
28066
28392
  var parseModule;
28067
28393
  function exportsPrimitive(path, exportName) {
@@ -28200,7 +28526,7 @@ var prefer_shadcn_primitives_default = defineRule({
28200
28526
  type: "suggestion",
28201
28527
  docs: {
28202
28528
  description: "Require visible raw JSX controls to use the corresponding shared shadcn primitive.",
28203
- url: docsUrl(NAME116)
28529
+ url: docsUrl(NAME117)
28204
28530
  },
28205
28531
  schema: [
28206
28532
  {
@@ -28307,7 +28633,7 @@ function matchingAliasTargets(paths, alias) {
28307
28633
  }
28308
28634
 
28309
28635
  // src/rules/prefer-shared-zod-enum.ts
28310
- var NAME117 = "prefer-shared-zod-enum";
28636
+ var NAME118 = "prefer-shared-zod-enum";
28311
28637
  function literalDomain(node) {
28312
28638
  if (node.arguments.length !== 1) return null;
28313
28639
  const first = node.arguments[0];
@@ -28346,7 +28672,7 @@ var prefer_shared_zod_enum_default = defineRule({
28346
28672
  type: "suggestion",
28347
28673
  docs: {
28348
28674
  description: "Give repeated literal Zod enum domains one reusable module-level schema.",
28349
- url: docsUrl(NAME117)
28675
+ url: docsUrl(NAME118)
28350
28676
  },
28351
28677
  schema: [],
28352
28678
  messages: {
@@ -28403,7 +28729,7 @@ var prefer_shared_zod_enum_default = defineRule({
28403
28729
  });
28404
28730
 
28405
28731
  // src/rules/prefer-switch-for-repeated-equality.ts
28406
- var NAME118 = "prefer-switch-for-repeated-equality";
28732
+ var NAME119 = "prefer-switch-for-repeated-equality";
28407
28733
  function discriminantName(test) {
28408
28734
  if (test.type !== "BinaryExpression" || test.operator !== "===") return null;
28409
28735
  const leftIsCase = isCaseValue(test.left);
@@ -28480,7 +28806,7 @@ var prefer_switch_for_repeated_equality_default = defineRule({
28480
28806
  fixable: "code",
28481
28807
  docs: {
28482
28808
  description: "Prefer switch over long if/else-if chains that compare one value for strict equality.",
28483
- url: docsUrl(NAME118)
28809
+ url: docsUrl(NAME119)
28484
28810
  },
28485
28811
  schema: [],
28486
28812
  messages: {
@@ -28530,8 +28856,8 @@ var prefer_switch_for_repeated_equality_default = defineRule({
28530
28856
  });
28531
28857
 
28532
28858
  // src/rules/prefer-test-fixture-reuse.ts
28533
- var NAME119 = "prefer-test-fixture-reuse";
28534
- var MAX_DEPTH = 8;
28859
+ var NAME120 = "prefer-test-fixture-reuse";
28860
+ var MAX_DEPTH2 = 8;
28535
28861
  var FRAMEWORKS = /* @__PURE__ */ new Set(["vitest", "@playwright/test"]);
28536
28862
  var TEST_MODIFIERS4 = /* @__PURE__ */ new Set(["only", "skip", "concurrent", "sequential"]);
28537
28863
  function stableBinding(source, identifier) {
@@ -28549,7 +28875,7 @@ function valueImport(definition) {
28549
28875
  }
28550
28876
  function constructorBinding(source, node, depth = 0) {
28551
28877
  node = unwrapExpression(node);
28552
- if (node.type !== "Identifier" || depth >= MAX_DEPTH) return null;
28878
+ if (node.type !== "Identifier" || depth >= MAX_DEPTH2) return null;
28553
28879
  const variable = stableBinding(source, node);
28554
28880
  const definition = variable?.defs[0];
28555
28881
  if (variable === null || definition === void 0) return null;
@@ -28559,7 +28885,7 @@ function constructorBinding(source, node, depth = 0) {
28559
28885
  }
28560
28886
  function fixtureApi(source, expression, depth = 0) {
28561
28887
  const node = unwrapExpression(expression);
28562
- if (node.type !== "Identifier" || depth >= MAX_DEPTH) return null;
28888
+ if (node.type !== "Identifier" || depth >= MAX_DEPTH2) return null;
28563
28889
  const variable = stableBinding(source, node);
28564
28890
  const definition = variable?.defs[0];
28565
28891
  if (variable === null || definition === void 0) return null;
@@ -28659,7 +28985,7 @@ var prefer_test_fixture_reuse_default = defineRule({
28659
28985
  type: "suggestion",
28660
28986
  docs: {
28661
28987
  description: "Reuse a requested test fixture instead of constructing another instance of its class.",
28662
- url: docsUrl(NAME119)
28988
+ url: docsUrl(NAME120)
28663
28989
  },
28664
28990
  schema: [],
28665
28991
  messages: { reuseFixture: "This class is already supplied by the requested `{{fixture}}` fixture; reuse it or request a typed factory for independent instances." }
@@ -28693,7 +29019,7 @@ var prefer_test_fixture_reuse_default = defineRule({
28693
29019
  });
28694
29020
 
28695
29021
  // src/rules/prefer-typed-reflection.ts
28696
- var NAME120 = "prefer-typed-reflection";
29022
+ var NAME121 = "prefer-typed-reflection";
28697
29023
  function knownType(native, type) {
28698
29024
  if (type.isUnionType()) return type.getTypes().every((part) => knownType(native, part));
28699
29025
  const flags = native.sync.TypeFlags;
@@ -28723,7 +29049,7 @@ var prefer_typed_reflection_default = defineRule({
28723
29049
  fixable: "code",
28724
29050
  docs: {
28725
29051
  description: "Prefer typed access when Reflect.get or Reflect.apply discards a known contract.",
28726
- url: docsUrl(NAME120)
29052
+ url: docsUrl(NAME121)
28727
29053
  },
28728
29054
  schema: [],
28729
29055
  messages: {
@@ -28889,7 +29215,7 @@ var prefer_typed_reflection_default = defineRule({
28889
29215
  });
28890
29216
 
28891
29217
  // src/rules/prefer-whole-object-assertion.ts
28892
- var NAME121 = "prefer-whole-object-assertion";
29218
+ var NAME122 = "prefer-whole-object-assertion";
28893
29219
  var MERGEABLE_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
28894
29220
  var SYNTHETIC_LITERAL_MATCHERS = /* @__PURE__ */ new Map([
28895
29221
  ["toBeNull", "null"]
@@ -28979,7 +29305,7 @@ var prefer_whole_object_assertion_default = defineRule({
28979
29305
  type: "suggestion",
28980
29306
  docs: {
28981
29307
  description: "Collapse consecutive assertions on one object into a whole-object assertion so related mismatches are reported together.",
28982
- url: docsUrl(NAME121)
29308
+ url: docsUrl(NAME122)
28983
29309
  },
28984
29310
  messages: {
28985
29311
  combineAssertions: "Consider combining these {{count}} assertions on `{{receiver}}` with `toMatchObject` when structural matching preserves property presence and getter or proxy behavior.",
@@ -29126,7 +29452,7 @@ var prefer_whole_object_assertion_default = defineRule({
29126
29452
  });
29127
29453
 
29128
29454
  // src/rules/prefer-zod-enum-validator.ts
29129
- var NAME122 = "prefer-zod-enum-validator";
29455
+ var NAME123 = "prefer-zod-enum-validator";
29130
29456
  function isInput(node, name) {
29131
29457
  if (node == null) return false;
29132
29458
  const value = unwrapExpression(node);
@@ -29217,7 +29543,7 @@ var prefer_zod_enum_validator_default = defineRule({
29217
29543
  type: "suggestion",
29218
29544
  docs: {
29219
29545
  description: "Express closed string validators with a reusable Zod enum schema.",
29220
- url: docsUrl(NAME122)
29546
+ url: docsUrl(NAME123)
29221
29547
  },
29222
29548
  schema: [],
29223
29549
  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." }
@@ -29245,7 +29571,7 @@ var prefer_zod_enum_validator_default = defineRule({
29245
29571
  });
29246
29572
 
29247
29573
  // src/rules/prefer-zod-infer.ts
29248
- var NAME123 = "prefer-zod-infer";
29574
+ var NAME124 = "prefer-zod-infer";
29249
29575
  function absent(value) {
29250
29576
  return value === void 0 || value === null;
29251
29577
  }
@@ -29621,7 +29947,7 @@ var prefer_zod_infer_default = defineRule({
29621
29947
  fixable: "code",
29622
29948
  docs: {
29623
29949
  description: "Derive a type from its Zod schema with `z.infer` instead of hand-writing a twin declaration beside it.",
29624
- url: docsUrl(NAME123)
29950
+ url: docsUrl(NAME124)
29625
29951
  },
29626
29952
  schema: [
29627
29953
  {
@@ -30071,7 +30397,7 @@ function returnsContract(authority, returned2) {
30071
30397
  }
30072
30398
 
30073
30399
  // src/rules/prefer-zod-parse-output-type.ts
30074
- var NAME124 = "prefer-zod-parse-output-type";
30400
+ var NAME125 = "prefer-zod-parse-output-type";
30075
30401
  function isLocalZodObjectSchema(node, namespaces) {
30076
30402
  let current = node;
30077
30403
  while (current.type === "CallExpression") {
@@ -30217,7 +30543,7 @@ var prefer_zod_parse_output_type_default = defineRule({
30217
30543
  fixable: "code",
30218
30544
  docs: {
30219
30545
  description: "Consider deriving validated return contracts from the Zod schema when the schema owns the contract.",
30220
- url: docsUrl(NAME124)
30546
+ url: docsUrl(NAME125)
30221
30547
  },
30222
30548
  schema: [],
30223
30549
  messages: {
@@ -30505,7 +30831,7 @@ var production_derived_test_cases_default = defineRule({
30505
30831
  });
30506
30832
 
30507
30833
  // src/rules/repeated-static-call-cases.ts
30508
- var NAME125 = "repeated-static-call-cases";
30834
+ var NAME126 = "repeated-static-call-cases";
30509
30835
  var TEST_MODULES2 = /* @__PURE__ */ new Set(["@jest/globals", "@playwright/test", "bun:test", "node:test", "vitest"]);
30510
30836
  var TEST_NAMES3 = /* @__PURE__ */ new Set(["it", "test"]);
30511
30837
  var TEST_MODIFIERS5 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
@@ -30629,7 +30955,7 @@ var repeated_static_call_cases_default = defineRule({
30629
30955
  type: "suggestion",
30630
30956
  docs: {
30631
30957
  description: "Review three or more consecutive static-input call assertions as potential named cases.",
30632
- url: docsUrl(NAME125)
30958
+ url: docsUrl(NAME126)
30633
30959
  },
30634
30960
  schema: [],
30635
30961
  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." }
@@ -30771,7 +31097,7 @@ function isPrimitiveReturn(node, annotation) {
30771
31097
  }
30772
31098
 
30773
31099
  // src/rules/require-assert-never.ts
30774
- var NAME126 = "require-assert-never";
31100
+ var NAME127 = "require-assert-never";
30775
31101
  function isRuntimeHandlingStatement(statement) {
30776
31102
  if (statement.type === "EmptyStatement") return false;
30777
31103
  if (statement.type === "BreakStatement") return statement.label !== null;
@@ -30831,7 +31157,7 @@ var require_assert_never_default = defineRule({
30831
31157
  fixable: "code",
30832
31158
  docs: {
30833
31159
  description: "Require an empty switch default to call `assertNever` so discriminated unions remain exhaustive at compile time.",
30834
- url: docsUrl(NAME126)
31160
+ url: docsUrl(NAME127)
30835
31161
  },
30836
31162
  schema: [],
30837
31163
  messages: {
@@ -30875,7 +31201,7 @@ var require_assert_never_default = defineRule({
30875
31201
  });
30876
31202
 
30877
31203
  // src/rules/require-button-accessible-name.ts
30878
- var NAME127 = "require-button-accessible-name";
31204
+ var NAME128 = "require-button-accessible-name";
30879
31205
  var DELEGATING_PROPS = /* @__PURE__ */ new Set(["render", "asChild"]);
30880
31206
  function delegatesRendering(opening) {
30881
31207
  return opening.attributes.some(
@@ -30888,7 +31214,7 @@ var require_button_accessible_name_default = defineRule({
30888
31214
  type: "problem",
30889
31215
  docs: {
30890
31216
  description: "Require an accessible name on statically unnamed native or configured JSX buttons.",
30891
- url: docsUrl(NAME127)
31217
+ url: docsUrl(NAME128)
30892
31218
  },
30893
31219
  schema: [
30894
31220
  {
@@ -30942,7 +31268,7 @@ var require_button_accessible_name_default = defineRule({
30942
31268
  });
30943
31269
 
30944
31270
  // src/rules/require-camelcase-properties.ts
30945
- var NAME128 = "require-camelcase-properties";
31271
+ var NAME129 = "require-camelcase-properties";
30946
31272
  var SNAKE_CASE_RE2 = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)+$/u;
30947
31273
  function blocksRename(member3, name) {
30948
31274
  if (member3.type === "TSIndexSignature" || "computed" in member3 && member3.computed) return true;
@@ -30956,7 +31282,7 @@ var require_camelcase_properties_default = defineRule({
30956
31282
  fixable: "code",
30957
31283
  docs: {
30958
31284
  description: "Require unquoted lower snake_case TypeScript properties and dot access to use camelCase.",
30959
- url: docsUrl(NAME128)
31285
+ url: docsUrl(NAME129)
30960
31286
  },
30961
31287
  schema: [],
30962
31288
  defaultOptions: [],
@@ -31020,7 +31346,7 @@ var require_camelcase_properties_default = defineRule({
31020
31346
  });
31021
31347
 
31022
31348
  // src/rules/require-constrained-schema-integer.ts
31023
- var NAME129 = "require-constrained-schema-integer";
31349
+ var NAME130 = "require-constrained-schema-integer";
31024
31350
  var FIELD_MINIMUMS = /* @__PURE__ */ new Map([["limit", 1], ["version", 0]]);
31025
31351
  var NUMBER_FACTORIES = /* @__PURE__ */ new Set(["number", "int", "int32", "uint32"]);
31026
31352
  var OBJECT_FACTORIES = /* @__PURE__ */ new Set(["object", "strictObject", "looseObject"]);
@@ -31062,7 +31388,7 @@ var require_constrained_schema_integer_default = defineRule({
31062
31388
  type: "suggestion",
31063
31389
  docs: {
31064
31390
  description: "Declare integer and lower-bound validation for numeric limit and version schema fields.",
31065
- url: docsUrl(NAME129)
31391
+ url: docsUrl(NAME130)
31066
31392
  },
31067
31393
  schema: [],
31068
31394
  messages: { constrainInteger: "Declare `{{field}}` as an integer with a lower bound of {{minimum}} or greater, or reuse its named domain schema." }
@@ -31541,14 +31867,14 @@ function closedNominalInheritanceFix(sourceCode2, file, call, consumer, implemen
31541
31867
  }
31542
31868
 
31543
31869
  // src/rules/require-explicit-contract-implementation.ts
31544
- var NAME130 = "require-explicit-contract-implementation";
31870
+ var NAME131 = "require-explicit-contract-implementation";
31545
31871
  var require_explicit_contract_implementation_default = defineRule({
31546
31872
  meta: {
31547
31873
  type: "problem",
31548
31874
  fixable: "code",
31549
31875
  docs: {
31550
31876
  description: "Require nominal inheritance when an injected abstract class is rejected by an instanceof guard.",
31551
- url: docsUrl(NAME130)
31877
+ url: docsUrl(NAME131)
31552
31878
  },
31553
31879
  schema: [],
31554
31880
  messages: {
@@ -32239,7 +32565,7 @@ function abstractContractOperations(node, functionAliases) {
32239
32565
  }
32240
32566
 
32241
32567
  // src/rules/require-explicit-service-contract.ts
32242
- var NAME131 = "require-explicit-service-contract";
32568
+ var NAME132 = "require-explicit-service-contract";
32243
32569
  var JAVASCRIPT_FILE_RE2 = /\.(?:js|jsx|mjs|cjs)$/iu;
32244
32570
  var BOUNDARY_SUFFIX = /(?:Service|ServiceImpl|Store|Repository|Provider|Executor|Enqueuer|Runner|Platform|Manager|ManagerImpl|Detector|Control|Refresher|Reader|Settlement|Retry|Stop|Catalog|DAO)$/u;
32245
32571
  var NON_SERVICE_SUFFIX = /(?:Router|Middleware|Builder)$/u;
@@ -32255,7 +32581,7 @@ var require_explicit_service_contract_default = defineRule({
32255
32581
  type: "problem",
32256
32582
  docs: {
32257
32583
  description: "Require explicit contracts for classes that invoke retained collaborators.",
32258
- url: docsUrl(NAME131)
32584
+ url: docsUrl(NAME132)
32259
32585
  },
32260
32586
  schema: [],
32261
32587
  fixable: "code",
@@ -32291,7 +32617,7 @@ var require_explicit_service_contract_default = defineRule({
32291
32617
  });
32292
32618
 
32293
32619
  // src/rules/require-fetch-timeout.ts
32294
- var NAME132 = "require-fetch-timeout";
32620
+ var NAME133 = "require-fetch-timeout";
32295
32621
  function emptySignal(expression, resolvesToGlobal) {
32296
32622
  const value = unwrapExpression(expression);
32297
32623
  if (value.type === "Literal" && value.value === null)
@@ -32353,7 +32679,7 @@ var require_fetch_timeout_default = defineRule({
32353
32679
  type: "problem",
32354
32680
  docs: {
32355
32681
  description: "Require an explicit abort signal on locally analyzable global fetch calls.",
32356
- url: docsUrl(NAME132)
32682
+ url: docsUrl(NAME133)
32357
32683
  },
32358
32684
  schema: [
32359
32685
  {
@@ -32445,7 +32771,7 @@ var require_fetch_timeout_default = defineRule({
32445
32771
  });
32446
32772
 
32447
32773
  // src/rules/require-interface-for-exported-class.ts
32448
- var NAME133 = "require-interface-for-exported-class";
32774
+ var NAME134 = "require-interface-for-exported-class";
32449
32775
  var JAVASCRIPT_FILE_RE3 = /\.(?:js|jsx|mjs|cjs)$/iu;
32450
32776
  function isPublicInstanceMember2(member3) {
32451
32777
  return !member3.static && member3.accessibility !== "private" && member3.accessibility !== "protected" && member3.key.type !== "PrivateIdentifier";
@@ -32506,7 +32832,7 @@ var require_interface_for_exported_class_default = defineRule({
32506
32832
  type: "suggestion",
32507
32833
  docs: {
32508
32834
  description: "Require exported concrete classes with public behavior to declare a contract.",
32509
- url: docsUrl(NAME133)
32835
+ url: docsUrl(NAME134)
32510
32836
  },
32511
32837
  schema: [],
32512
32838
  fixable: "code",
@@ -32548,7 +32874,7 @@ var require_interface_for_exported_class_default = defineRule({
32548
32874
  });
32549
32875
 
32550
32876
  // src/rules/require-jwt-lifetime.ts
32551
- var NAME134 = "require-jwt-lifetime";
32877
+ var NAME135 = "require-jwt-lifetime";
32552
32878
  function isJoseValueImport(declaration) {
32553
32879
  return declaration.type === "ImportDeclaration" && declaration.importKind !== "type" && declaration.source.value === "jose";
32554
32880
  }
@@ -32557,7 +32883,7 @@ var require_jwt_lifetime_default = defineRule({
32557
32883
  type: "problem",
32558
32884
  docs: {
32559
32885
  description: "Require an expiration claim or a maximum token age when returning a verified JWT.",
32560
- url: docsUrl(NAME134)
32886
+ url: docsUrl(NAME135)
32561
32887
  },
32562
32888
  schema: [],
32563
32889
  messages: { lifetime: "Require the JWT exp claim or set maxTokenAge before returning this verification result." }
@@ -32616,7 +32942,7 @@ var require_jwt_lifetime_default = defineRule({
32616
32942
  });
32617
32943
 
32618
32944
  // src/rules/require-pascal-case-zod-schema-name.ts
32619
- var NAME135 = "require-pascal-case-zod-schema-name";
32945
+ var NAME136 = "require-pascal-case-zod-schema-name";
32620
32946
  var PASCAL_SCHEMA_NAME_RE = /^[A-Z][A-Za-z0-9]*Schema$/;
32621
32947
  var BENCHMARK_PATH_RE2 = /(^|[\\/])(?:benchmarks?|bench)[\\/]/;
32622
32948
  var NON_SCHEMA_TERMINALS2 = /* @__PURE__ */ new Set([
@@ -32787,7 +33113,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
32787
33113
  fixable: "code",
32788
33114
  docs: {
32789
33115
  description: "Require confirmed module-level Zod schema contracts to use PascalCase with a `Schema` suffix.",
32790
- url: docsUrl(NAME135)
33116
+ url: docsUrl(NAME136)
32791
33117
  },
32792
33118
  schema: [],
32793
33119
  defaultOptions: [],
@@ -32897,7 +33223,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
32897
33223
  });
32898
33224
 
32899
33225
  // src/rules/require-port-for-service.ts
32900
- var NAME136 = "require-port-for-service";
33226
+ var NAME137 = "require-port-for-service";
32901
33227
  var HTTP_TRANSPORT_TYPE_RE = /^(?:KyInstance|AxiosInstance|Session)$/;
32902
33228
  var TRANSPORT_WRAPPER_NAME_RE = /(?:Client$|^Http[A-Z])/;
32903
33229
  var ERROR_VALUE_NAME_RE = /Error$/;
@@ -33031,7 +33357,7 @@ var require_port_for_service_default = defineRule({
33031
33357
  type: "suggestion",
33032
33358
  docs: {
33033
33359
  description: "Advise when an exported service with injected collaborators has public methods not covered by its declared ports.",
33034
- url: docsUrl(NAME136)
33360
+ url: docsUrl(NAME137)
33035
33361
  },
33036
33362
  schema: [],
33037
33363
  fixable: "code",
@@ -33071,7 +33397,7 @@ var require_port_for_service_default = defineRule({
33071
33397
  });
33072
33398
 
33073
33399
  // src/rules/require-sql-access-class.ts
33074
- var NAME137 = "require-sql-access-class";
33400
+ var NAME138 = "require-sql-access-class";
33075
33401
  var DIRECT_EXECUTION_METHODS = /* @__PURE__ */ new Set([
33076
33402
  "all",
33077
33403
  "batch",
@@ -33269,7 +33595,7 @@ var require_sql_access_class_default = defineRule({
33269
33595
  type: "suggestion",
33270
33596
  docs: {
33271
33597
  description: "Keep SQL reads and writes inside a class that receives its database dependency.",
33272
- url: docsUrl(NAME137)
33598
+ url: docsUrl(NAME138)
33273
33599
  },
33274
33600
  schema: [],
33275
33601
  messages: {
@@ -33341,7 +33667,7 @@ function staticMatcherFix(sourceCode2, property) {
33341
33667
  }
33342
33668
 
33343
33669
  // src/rules/require-static-next-matcher.ts
33344
- var NAME138 = "require-static-next-matcher";
33670
+ var NAME139 = "require-static-next-matcher";
33345
33671
  var NEXT_ENTRY_FILE = /(?:^|[/\\])(?:middleware|proxy)\.[cm]?[jt]sx?$/u;
33346
33672
  function isStaticValue(node) {
33347
33673
  const value = unwrapExpression(node);
@@ -33373,7 +33699,7 @@ var require_static_next_matcher_default = defineRule({
33373
33699
  fixable: "code",
33374
33700
  docs: {
33375
33701
  description: "Require Next.js middleware and proxy matcher configuration to contain only build-time literals.",
33376
- url: docsUrl(NAME138)
33702
+ url: docsUrl(NAME139)
33377
33703
  },
33378
33704
  schema: [],
33379
33705
  messages: {
@@ -33417,7 +33743,7 @@ var require_static_next_matcher_default = defineRule({
33417
33743
  });
33418
33744
 
33419
33745
  // src/rules/require-svg-accessible-name.ts
33420
- var NAME139 = "require-svg-accessible-name";
33746
+ var NAME140 = "require-svg-accessible-name";
33421
33747
  var DECORATIVE_ROLES = /* @__PURE__ */ new Set(["none", "presentation"]);
33422
33748
  var NAME_ATTRIBUTES = ["aria-label", "aria-labelledby"];
33423
33749
  var NO_ICON_MODULES = [];
@@ -33426,7 +33752,7 @@ var require_svg_accessible_name_default = defineRule({
33426
33752
  type: "problem",
33427
33753
  docs: {
33428
33754
  description: "Require a name or explicit decorative semantics on inline SVG elements.",
33429
- url: docsUrl(NAME139)
33755
+ url: docsUrl(NAME140)
33430
33756
  },
33431
33757
  schema: [],
33432
33758
  messages: {
@@ -33458,7 +33784,7 @@ var require_svg_accessible_name_default = defineRule({
33458
33784
  });
33459
33785
 
33460
33786
  // src/rules/require-use-form-default-values.ts
33461
- var NAME140 = "require-use-form-default-values";
33787
+ var NAME141 = "require-use-form-default-values";
33462
33788
  var UNSAFE_FORM_MEMBERS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "__proto__", "valueOf"]);
33463
33789
  function staticPropertyName2(property) {
33464
33790
  return property.computed ? null : getPropertyName(property);
@@ -33501,7 +33827,7 @@ var require_use_form_default_values_default = defineRule({
33501
33827
  type: "problem",
33502
33828
  docs: {
33503
33829
  description: "Require explicit form-level initialization or a field default for directly bound Controller fields.",
33504
- url: docsUrl(NAME140)
33830
+ url: docsUrl(NAME141)
33505
33831
  },
33506
33832
  schema: [],
33507
33833
  messages: { requireUseFormDefaultValues: "Add non-undefined defaultValues/values to the associated useForm call or non-undefined defaultValue to this field." }
@@ -33640,7 +33966,7 @@ var require_use_form_default_values_default = defineRule({
33640
33966
  });
33641
33967
 
33642
33968
  // src/rules/require-use-server-in-actions-file.ts
33643
- var NAME141 = "require-use-server-in-actions-file";
33969
+ var NAME142 = "require-use-server-in-actions-file";
33644
33970
  var ACTION_MODULE_RE = /(?:^|\/)app\/.*\/(?:actions|[^/]+-actions)\.[cm]?[jt]s$/u;
33645
33971
  function isUseServerDirective2(statement) {
33646
33972
  return statement.type === "ExpressionStatement" && statement.directive === "use server";
@@ -33661,7 +33987,7 @@ var require_use_server_in_actions_file_default = defineRule({
33661
33987
  type: "problem",
33662
33988
  docs: {
33663
33989
  description: "route action module missing the use server directive",
33664
- url: docsUrl(NAME141)
33990
+ url: docsUrl(NAME142)
33665
33991
  },
33666
33992
  schema: [],
33667
33993
  messages: {
@@ -33687,7 +34013,7 @@ var require_use_server_in_actions_file_default = defineRule({
33687
34013
  });
33688
34014
 
33689
34015
  // src/rules/require-zod-form-validation.ts
33690
- var NAME142 = "require-zod-form-validation";
34016
+ var NAME143 = "require-zod-form-validation";
33691
34017
  var ZOD_PARSE_METHODS = /* @__PURE__ */ new Set([
33692
34018
  "parse",
33693
34019
  "safeParse",
@@ -33746,7 +34072,7 @@ var require_zod_form_validation_default = defineRule({
33746
34072
  type: "problem",
33747
34073
  docs: {
33748
34074
  description: "Require Zod validation (`Schema.parse(...)` / `Schema.safeParse(...)`) when reading values out of a `FormData` object.",
33749
- url: docsUrl(NAME142)
34075
+ url: docsUrl(NAME143)
33750
34076
  },
33751
34077
  schema: [],
33752
34078
  messages: {
@@ -34034,7 +34360,7 @@ function declaresFramework(metadata, name) {
34034
34360
  }
34035
34361
 
34036
34362
  // src/rules/sole-export-matches-filename.ts
34037
- var NAME143 = "sole-export-matches-filename";
34363
+ var NAME144 = "sole-export-matches-filename";
34038
34364
  var EXCLUDED_STEMS = /* @__PURE__ */ new Set(["global", "index", "types"]);
34039
34365
  function stem3(filename) {
34040
34366
  const base = filename.replaceAll("\\", "/").split("/").at(-1) ?? "";
@@ -34048,7 +34374,7 @@ var sole_export_matches_filename_default = defineRule({
34048
34374
  type: "suggestion",
34049
34375
  docs: {
34050
34376
  description: "Make a module filename reflect its sole named public runtime export.",
34051
- url: docsUrl(NAME143)
34377
+ url: docsUrl(NAME144)
34052
34378
  },
34053
34379
  schema: [],
34054
34380
  messages: {
@@ -34791,7 +35117,7 @@ var stepdown_default = defineRule({
34791
35117
  });
34792
35118
 
34793
35119
  // src/rules/store-insert-requires-on-conflict.ts
34794
- var NAME144 = "store-insert-requires-on-conflict";
35120
+ var NAME145 = "store-insert-requires-on-conflict";
34795
35121
  var INSERT_WRITE = /\bINSERT\s+(?:OR\s+\w+\s+)?INTO\s+[\w."'`?$:@-]+\s*(?:\([^)]*\)\s*)?(?:VALUES|SELECT|DEFAULT\s+VALUES)\b/i;
34796
35122
  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;
34797
35123
  var REPLAY_CONTRACT_NAME = /(?:enqueue|ensure|migrate|recordOnce|schedule|seed|upsert|getOrCreate|createIfAbsent|insertIfAbsent)/i;
@@ -34820,7 +35146,7 @@ var store_insert_requires_on_conflict_default = defineRule({
34820
35146
  type: "problem",
34821
35147
  docs: {
34822
35148
  description: "Review conflict handling for embedded inserts in replay-named callables.",
34823
- url: docsUrl(NAME144)
35149
+ url: docsUrl(NAME145)
34824
35150
  },
34825
35151
  schema: [],
34826
35152
  messages: {
@@ -34845,7 +35171,7 @@ var store_insert_requires_on_conflict_default = defineRule({
34845
35171
  });
34846
35172
 
34847
35173
  // src/rules/test-loops-over-literal-cases.ts
34848
- var NAME145 = "test-loops-over-literal-cases";
35174
+ var NAME146 = "test-loops-over-literal-cases";
34849
35175
  var TEST_CALLERS3 = /* @__PURE__ */ new Set(["it", "test"]);
34850
35176
  var TEST_MODIFIERS6 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
34851
35177
  var ASSERTION_ROOTS = /* @__PURE__ */ new Set([
@@ -34941,7 +35267,7 @@ var test_loops_over_literal_cases_default = defineRule({
34941
35267
  type: "suggestion",
34942
35268
  docs: {
34943
35269
  description: "Disallow assertions over an inline literal case loop in a test; parameterization reports and names every case independently.",
34944
- url: docsUrl(NAME145)
35270
+ url: docsUrl(NAME146)
34945
35271
  },
34946
35272
  schema: [],
34947
35273
  messages: {
@@ -35005,7 +35331,7 @@ var test_loops_over_literal_cases_default = defineRule({
35005
35331
  });
35006
35332
 
35007
35333
  // src/rules/test-phase-label-comment.ts
35008
- var NAME146 = "test-phase-label-comment";
35334
+ var NAME147 = "test-phase-label-comment";
35009
35335
  var PHASE_WORD = String.raw`arrange|act|assert(?:ion)?s?|given|when|then|exercise|execute|verif(?:y|ication)|cleanup|prepare|sanity(?:\s+check)?`;
35010
35336
  var PHASE_RE = new RegExp(
35011
35337
  String.raw`^[-=~*_#.\s]{0,40}(?:${PHASE_WORD})(?:\s*(?:[/&+,|]|->|and)\s*(?:${PHASE_WORD}))*[-=~*_#.\s:;!–—]{0,40}$`,
@@ -35033,7 +35359,7 @@ var test_phase_label_comment_default = defineRule({
35033
35359
  fixable: "code",
35034
35360
  docs: {
35035
35361
  description: "Tests must not use bare Arrange, Act, Assert, Given, When, or Then phase comments.",
35036
- url: docsUrl(NAME146)
35362
+ url: docsUrl(NAME147)
35037
35363
  },
35038
35364
  schema: [],
35039
35365
  messages: { removeLabel: "Bare test phase label \u2014 delete it and let the test names and helpers carry the structure." }
@@ -35174,6 +35500,7 @@ var RULES = {
35174
35500
  "no-zod-native-enum": no_zod_native_enum_default,
35175
35501
  "no-zod-parse-typed-object": no_zod_parse_typed_object_default,
35176
35502
  "prefer-await-in-async-return": prefer_await_in_async_return_default,
35503
+ "prefer-coded-error-result": prefer_coded_error_result_default,
35177
35504
  "prefer-constant-time-secret-compare": prefer_constant_time_secret_compare_default,
35178
35505
  "prefer-dependency-interface": prefer_dependency_interface_default,
35179
35506
  "prefer-discriminated-union": prefer_discriminated_union_default,