@sarj/eslint-plugin 19.0.2 → 19.4.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." }
@@ -21773,11 +22099,43 @@ function discriminatedUnionReturns(node, sourceCode2) {
21773
22099
  if (member3.optional) continue;
21774
22100
  const domain = tagDomain(member3.typeAnnotation?.typeAnnotation);
21775
22101
  if (domain !== void 0 && hasTagSpecificPayload(name, domain, shape.optional, returned2)) {
21776
- return { reportNode: contract.reportNode, tag: name, members: shape.members, returned: returned2 };
22102
+ return { reportNode: contract.reportNode, relationship: { kind: "presence", tag: name }, members: shape.members, returned: returned2 };
22103
+ }
22104
+ }
22105
+ const fields2 = correlatedBooleanFields(shape, returned2);
22106
+ return fields2 === void 0 ? void 0 : {
22107
+ reportNode: contract.reportNode,
22108
+ relationship: { kind: "boolean-pair", fields: fields2 },
22109
+ members: shape.members,
22110
+ returned: returned2
22111
+ };
22112
+ }
22113
+ function correlatedBooleanFields(shape, returned2) {
22114
+ const fields2 = [...shape.members].filter(([, member3]) => !member3.optional && member3.typeAnnotation?.typeAnnotation.type === "TSBooleanKeyword").map(([name]) => name);
22115
+ if (fields2.length > 8) return void 0;
22116
+ for (const [index, left] of fields2.entries()) {
22117
+ for (const right of fields2.slice(index + 1)) {
22118
+ const combinations = booleanCombinations(left, right, returned2);
22119
+ if (combinations !== void 0 && restrictedVaryingPair(combinations)) return { left, right };
21777
22120
  }
21778
22121
  }
21779
22122
  return void 0;
21780
22123
  }
22124
+ function booleanCombinations(left, right, returned2) {
22125
+ const combinations = /* @__PURE__ */ new Set();
22126
+ for (const properties2 of returned2) {
22127
+ const a = properties2.get(left);
22128
+ const b = properties2.get(right);
22129
+ if (a?.type !== "Literal" || typeof a.value !== "boolean" || b?.type !== "Literal" || typeof b.value !== "boolean") return void 0;
22130
+ combinations.add(`${Number(a.value)}${Number(b.value)}`);
22131
+ }
22132
+ return combinations;
22133
+ }
22134
+ function restrictedVaryingPair(combinations) {
22135
+ if (combinations.size < 2 || combinations.size === 4) return false;
22136
+ const values = [...combinations];
22137
+ return [0, 1].every((index) => values.some((value) => value[index] === "0") && values.some((value) => value[index] === "1"));
22138
+ }
21781
22139
  function returnContract(node, sourceCode2) {
21782
22140
  const annotation = node.returnType;
21783
22141
  if (!isPresent(annotation)) return void 0;
@@ -21822,33 +22180,33 @@ function objectContract(elements) {
21822
22180
  members2.set(name, member3);
21823
22181
  if (member3.optional) optional.add(name);
21824
22182
  }
21825
- return optional.size === 0 ? void 0 : { members: members2, optional };
22183
+ return { members: members2, optional };
21826
22184
  }
21827
22185
  function returnedProperties(objects, contract) {
21828
22186
  const returned2 = [];
21829
22187
  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);
22188
+ const properties2 = objectProperties(object);
22189
+ if (properties2 === void 0) return void 0;
22190
+ if ([...properties2.keys()].some((name) => !contract.members.has(name))) return void 0;
22191
+ if ([...contract.members].some(([name, member3]) => !member3.optional && !properties2.has(name))) return void 0;
22192
+ if (hasEmptyPayload(properties2, contract.optional)) return void 0;
22193
+ returned2.push(properties2);
21836
22194
  }
21837
22195
  return returned2;
21838
22196
  }
21839
22197
  function objectProperties(object) {
21840
- const properties = /* @__PURE__ */ new Map();
22198
+ const properties2 = /* @__PURE__ */ new Map();
21841
22199
  for (const property of object.properties) {
21842
22200
  if (property.type !== "Property" || property.kind !== "init" || property.method) return void 0;
21843
22201
  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);
22202
+ if (name === void 0 || name === "__proto__" || properties2.has(name) || property.value.type === "AssignmentPattern") return void 0;
22203
+ properties2.set(name, property.value);
21846
22204
  }
21847
- return properties;
22205
+ return properties2;
21848
22206
  }
21849
- function hasEmptyPayload(properties, optional) {
22207
+ function hasEmptyPayload(properties2, optional) {
21850
22208
  for (const name of optional) {
21851
- const value = properties.get(name);
22209
+ const value = properties2.get(name);
21852
22210
  if (value === void 0) continue;
21853
22211
  if (value.type === "Literal" && value.value === null) return true;
21854
22212
  if (value.type === "Identifier" && value.name === "undefined") return true;
@@ -21869,19 +22227,19 @@ function tagDomain(node) {
21869
22227
  return values.size > 1 ? values : void 0;
21870
22228
  }
21871
22229
  function hasTagSpecificPayload(tag, domain, optional, returned2) {
21872
- const variants = /* @__PURE__ */ new Map();
21873
- for (const properties of returned2) {
21874
- const value = properties.get(tag);
22230
+ const variants2 = /* @__PURE__ */ new Map();
22231
+ for (const properties2 of returned2) {
22232
+ const value = properties2.get(tag);
21875
22233
  const literal2 = value === void 0 ? void 0 : literalTag(value);
21876
22234
  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);
22235
+ const payload = new Set([...optional].filter((name) => properties2.has(name)));
22236
+ const previous = variants2.get(literal2);
21879
22237
  if (previous !== void 0 && (previous.size !== payload.size || [...previous].some((name) => !payload.has(name)))) return false;
21880
- variants.set(literal2, payload);
22238
+ variants2.set(literal2, payload);
21881
22239
  }
21882
- if (variants.size !== domain.size) return false;
22240
+ if (variants2.size !== domain.size) return false;
21883
22241
  return [...optional].some((name) => {
21884
- const presence = [...variants.values()].map((payload) => payload.has(name));
22242
+ const presence = [...variants2.values()].map((payload) => payload.has(name));
21885
22243
  return presence.includes(true) && presence.includes(false);
21886
22244
  });
21887
22245
  }
@@ -22007,103 +22365,19 @@ function literalTag(node) {
22007
22365
  }
22008
22366
 
22009
22367
  // src/rules/prefer-discriminated-union.ts
22010
- var NAME93 = "prefer-discriminated-union";
22011
- var STATUS_MEMBER_NAMES = /* @__PURE__ */ new Set([
22012
- "success",
22013
- "ok"
22014
- ]);
22015
- var FAILURE_MEMBER_NAMES = /* @__PURE__ */ new Set([
22016
- "error",
22017
- "errors",
22018
- "reason",
22019
- "cause"
22020
- ]);
22021
- var SUCCESS_PAYLOAD_MEMBER_NAMES = /* @__PURE__ */ new Set([
22022
- "data",
22023
- "events",
22024
- "payload",
22025
- "response",
22026
- "result",
22027
- "value"
22028
- ]);
22029
- var REQUIRED_STATUS_MEMBER_COUNT = 1;
22030
- var FUNCTION_RETURN_OWNER_TYPES = /* @__PURE__ */ new Set([
22031
- "ArrowFunctionExpression",
22032
- "FunctionDeclaration",
22033
- "FunctionExpression",
22034
- "TSDeclareFunction",
22035
- "TSEmptyBodyFunctionExpression",
22036
- "TSFunctionType",
22037
- "TSMethodSignature"
22038
- ]);
22039
- function looksLikeMutuallyExclusiveState(typeLiteral) {
22040
- let statusMemberCount = 0;
22041
- let hasFailurePayload = false;
22042
- let hasSuccessPayload = false;
22043
- let hasUnrecognizedMember = false;
22044
- for (const member3 of typeLiteral.members) {
22045
- if (member3.type !== "TSPropertySignature") {
22046
- hasUnrecognizedMember = true;
22047
- continue;
22048
- }
22049
- const name = getMemberName(member3);
22050
- if (name !== null && STATUS_MEMBER_NAMES.has(name) && isBooleanTyped(member3) && !member3.optional) {
22051
- statusMemberCount += 1;
22052
- continue;
22053
- }
22054
- if (!member3.optional || isBooleanTyped(member3) || name === null) {
22055
- hasUnrecognizedMember = true;
22056
- continue;
22057
- }
22058
- if (FAILURE_MEMBER_NAMES.has(name)) {
22059
- hasFailurePayload = true;
22060
- } else if (SUCCESS_PAYLOAD_MEMBER_NAMES.has(name)) {
22061
- hasSuccessPayload = true;
22062
- } else {
22063
- hasUnrecognizedMember = true;
22064
- }
22065
- }
22066
- return statusMemberCount === REQUIRED_STATUS_MEMBER_COUNT && hasFailurePayload && (hasSuccessPayload || !hasUnrecognizedMember);
22067
- }
22068
- function getMemberName(member3) {
22069
- if (member3.type !== "TSPropertySignature" || member3.computed) {
22070
- return null;
22071
- }
22072
- const { key } = member3;
22073
- if (key.type === "Identifier") {
22074
- return key.name;
22075
- }
22076
- if (key.type === "Literal" && typeof key.value === "string") {
22077
- return key.value;
22078
- }
22079
- return null;
22080
- }
22081
- function isBooleanTyped(member3) {
22082
- return member3.typeAnnotation?.typeAnnotation.type === "TSBooleanKeyword";
22083
- }
22084
- function inlineReturnTypeLiteral(node) {
22085
- let annotation = null;
22086
- if (node.parent.type === "TSTypeAnnotation") {
22087
- annotation = node.parent;
22088
- } else if (node.parent.type === "TSTypeParameterInstantiation" && node.parent.params.length === 1 && node.parent.params[0] === node && node.parent.parent.type === "TSTypeReference" && node.parent.parent.typeName.type === "Identifier" && node.parent.parent.typeName.name === "Promise" && node.parent.parent.parent.type === "TSTypeAnnotation") {
22089
- annotation = node.parent.parent.parent;
22090
- }
22091
- if (annotation === null) return null;
22092
- const owner = annotation.parent;
22093
- return FUNCTION_RETURN_OWNER_TYPES.has(owner.type) && "returnType" in owner && owner.returnType === annotation ? annotation : null;
22094
- }
22368
+ var NAME94 = "prefer-discriminated-union";
22095
22369
  var prefer_discriminated_union_default = defineRule({
22096
22370
  meta: {
22097
22371
  type: "suggestion",
22098
22372
  fixable: "code",
22099
22373
  docs: {
22100
- description: "Prefer discriminated unions for result contracts and locally proven tag-specific return payloads.",
22101
- url: docsUrl(NAME93)
22374
+ description: "Preserve producer-proven tag/payload and Boolean state relationships in return types.",
22375
+ url: docsUrl(NAME94)
22102
22376
  },
22103
22377
  schema: [],
22104
22378
  messages: {
22105
22379
  preferProducedVariants: "This producer returns tag-specific payloads for `{{tag}}`, but its flat return contract makes them optional. If these variants define the domain, use a discriminated union with each variant's required payload, or give this producer a precise return type separate from the broader contract.",
22106
- preferDiscriminatedUnion: "This object type combines a boolean status with optional payloads. If success and failure are mutually exclusive, consider a discriminated union such as `{ ok: true; data: T } | { ok: false; error: E }`."
22380
+ preferProducedState: "This producer returns a restricted set of literal combinations for `{{fields}}`, while its Boolean fields permit all four. Review a union preserving every returned combination, or a typed disposition if these are domain phases. Other writers and readers of a shared contract require review."
22107
22381
  }
22108
22382
  },
22109
22383
  createOnce(context) {
@@ -22117,30 +22391,13 @@ var prefer_discriminated_union_default = defineRule({
22117
22391
  if (result === void 0 || reportedContracts.has(result.reportNode)) return;
22118
22392
  reportedContracts.add(result.reportNode);
22119
22393
  const fix = privateVariantReturn(context.sourceCode, context.filename, node, result);
22394
+ const relationship = result.relationship;
22120
22395
  context.report({
22121
22396
  node: result.reportNode,
22122
- messageId: "preferProducedVariants",
22123
22397
  ...fix !== null && { fix },
22124
- data: { tag: result.tag }
22398
+ ...relationship.kind === "presence" ? { messageId: "preferProducedVariants", data: { tag: relationship.tag } } : { messageId: "preferProducedState", data: { fields: [relationship.fields.left, relationship.fields.right].join("`, `") } }
22125
22399
  });
22126
22400
  }
22127
- function checkTypeLiteral(typeLiteral, reportNode) {
22128
- if (looksLikeMutuallyExclusiveState(typeLiteral) && !reportedContracts.has(reportNode)) {
22129
- reportedContracts.add(reportNode);
22130
- const fix = inlineProducerFix(reportNode);
22131
- context.report({
22132
- node: reportNode,
22133
- messageId: "preferDiscriminatedUnion",
22134
- ...fix !== null && { fix }
22135
- });
22136
- }
22137
- }
22138
- function inlineProducerFix(reportNode) {
22139
- if (reportNode.type !== "TSTypeAnnotation" || reportNode.parent.type !== "FunctionDeclaration") return null;
22140
- const owner = reportNode.parent;
22141
- const result = discriminatedUnionReturns(owner, context.sourceCode);
22142
- return result === void 0 ? null : privateVariantReturn(context.sourceCode, context.filename, owner, result);
22143
- }
22144
22401
  return {
22145
22402
  before() {
22146
22403
  reportedContracts.clear();
@@ -22154,51 +22411,41 @@ var prefer_discriminated_union_default = defineRule({
22154
22411
  FunctionExpression: rememberProducer,
22155
22412
  "Program:exit"() {
22156
22413
  for (const producer of producers) checkProducer(producer);
22157
- },
22158
- TSInterfaceDeclaration(node) {
22159
- if (node.extends.length > 0) {
22160
- return;
22161
- }
22162
- checkTypeLiteral({ members: node.body.body }, node);
22163
- },
22164
- TSTypeLiteral(node) {
22165
- if (node.parent.type === "TSTypeAliasDeclaration") checkTypeLiteral(node, node.parent);
22166
- const annotation = inlineReturnTypeLiteral(node);
22167
- if (annotation !== null) checkTypeLiteral(node, annotation);
22168
22414
  }
22169
22415
  };
22170
22416
  }
22171
22417
  });
22172
22418
  function privateVariantReturn(sourceCode2, filename, owner, result) {
22173
22419
  const annotation = owner.returnType?.typeAnnotation;
22174
- 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, "")}`;
22420
+ if (owner.type !== "FunctionDeclaration" || owner.id === null || !returnsOnlyConditionalObject(owner) || annotation?.type !== "TSTypeLiteral" || result.reportNode !== owner.returnType || result.returned.length > 4 || sourceCode2.getCommentsInside(owner).length > 0 || !isUnusedPrivateBinding(sourceCode2, owner, owner.id, filename) || !retainsNamedTypeUses(sourceCode2, annotation)) return null;
22421
+ const variants2 = result.returned.map((properties2) => privateVariantType(properties2, result, sourceCode2));
22422
+ if (variants2.some((variant) => variant === null)) return null;
22423
+ const text = `${variants2.join(" | ")}${sourceCode2.getText(annotation).replace(/[^\r\n\u2028\u2029]/gu, "")}`;
22178
22424
  return (fixer) => fixer.replaceText(annotation, text);
22179
22425
  }
22180
22426
  function returnsOnlyConditionalObject(fn) {
22181
22427
  if (fn.async || fn.generator || isPresent(fn.typeParameters)) return false;
22182
22428
  const statements = fn.body?.body ?? [];
22183
22429
  const [returned2] = statements;
22184
- return statements.length === 1 && returned2?.type === "ReturnStatement" && returned2.argument?.type === "ConditionalExpression" && returned2.argument.consequent.type === "ObjectExpression" && returned2.argument.alternate.type === "ObjectExpression";
22430
+ return statements.length === 1 && returned2?.type === "ReturnStatement" && returned2.argument?.type === "ConditionalExpression";
22185
22431
  }
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;
22432
+ function privateVariantType(properties2, result, sourceCode2) {
22433
+ 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
22434
  const fields2 = [];
22189
22435
  for (const [name, member3] of result.members) {
22190
- const value = properties.get(name);
22436
+ const value = properties2.get(name);
22191
22437
  if (value === void 0) continue;
22192
22438
  const annotation = member3.typeAnnotation?.typeAnnotation;
22193
22439
  if (annotation === void 0) return null;
22194
- const type = name === result.tag ? sourceCode2.getText(value) : sourceCode2.getText(annotation);
22440
+ const narrow = result.relationship.kind === "presence" ? name === result.relationship.tag : name === result.relationship.fields.left || name === result.relationship.fields.right;
22441
+ const type = narrow ? sourceCode2.getText(value) : sourceCode2.getText(annotation);
22195
22442
  fields2.push(`${member3.readonly ? "readonly " : ""}${sourceCode2.getText(member3.key)}: ${type}`);
22196
22443
  }
22197
22444
  return `{ ${fields2.join("; ")} }`;
22198
22445
  }
22199
22446
 
22200
22447
  // src/rules/prefer-ecmascript-private-members.ts
22201
- var NAME94 = "prefer-ecmascript-private-members";
22448
+ var NAME95 = "prefer-ecmascript-private-members";
22202
22449
  function isConvertible(member3) {
22203
22450
  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
22451
  }
@@ -22208,7 +22455,7 @@ var prefer_ecmascript_private_members_default = defineRule({
22208
22455
  fixable: "code",
22209
22456
  docs: {
22210
22457
  description: "Prefer ECMAScript `#private` class members over TypeScript-only `private` members.",
22211
- url: docsUrl(NAME94)
22458
+ url: docsUrl(NAME95)
22212
22459
  },
22213
22460
  schema: [],
22214
22461
  messages: {
@@ -22262,7 +22509,7 @@ var prefer_ecmascript_private_members_default = defineRule({
22262
22509
  });
22263
22510
 
22264
22511
  // src/rules/prefer-immutable-module-constant.ts
22265
- var NAME95 = "prefer-immutable-module-constant";
22512
+ var NAME96 = "prefer-immutable-module-constant";
22266
22513
  var CONSTANT_NAME = /^_?[A-Z][A-Z0-9_]*$/;
22267
22514
  var JAVASCRIPT_FILE_RE = /\.[cm]?jsx?$/i;
22268
22515
  var MUTATING_METHODS = /* @__PURE__ */ new Set([
@@ -22435,7 +22682,7 @@ var prefer_immutable_module_constant_default = defineRule({
22435
22682
  fixable: "code",
22436
22683
  docs: {
22437
22684
  description: "Require module-level constant collections to expose readonly state.",
22438
- url: docsUrl(NAME95)
22685
+ url: docsUrl(NAME96)
22439
22686
  },
22440
22687
  schema: [],
22441
22688
  defaultOptions: [],
@@ -22541,7 +22788,7 @@ function unwrapTransparentExport(node) {
22541
22788
  }
22542
22789
 
22543
22790
  // src/rules/prefer-input-group-search.ts
22544
- var NAME96 = "prefer-input-group-search";
22791
+ var NAME97 = "prefer-input-group-search";
22545
22792
  var INPUT_MODULE = /(?:^|\/)components\/ui\/input$/u;
22546
22793
  var INPUT_GROUP_MODULE = /(?:^|\/)components\/ui\/input-group$/u;
22547
22794
  var MAX_JSX_DISTANCE = 2;
@@ -22612,7 +22859,7 @@ var prefer_input_group_search_default = defineRule({
22612
22859
  type: "suggestion",
22613
22860
  docs: {
22614
22861
  description: "Require search icons and shared Input controls in the same visual wrapper to use InputGroup.",
22615
- url: docsUrl(NAME96)
22862
+ url: docsUrl(NAME97)
22616
22863
  },
22617
22864
  schema: [],
22618
22865
  messages: {
@@ -22696,7 +22943,7 @@ var prefer_input_group_search_default = defineRule({
22696
22943
  });
22697
22944
 
22698
22945
  // src/rules/prefer-logical-tailwind-utilities.ts
22699
- var NAME97 = "prefer-logical-tailwind-utilities";
22946
+ var NAME98 = "prefer-logical-tailwind-utilities";
22700
22947
  var PREFIXES = {
22701
22948
  ml: "ms",
22702
22949
  mr: "me",
@@ -22750,7 +22997,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
22750
22997
  type: "suggestion",
22751
22998
  docs: {
22752
22999
  description: "Prefer logical Tailwind utilities in explicitly opted-in bidirectional interfaces.",
22753
- url: docsUrl(NAME97)
23000
+ url: docsUrl(NAME98)
22754
23001
  },
22755
23002
  schema: [
22756
23003
  {
@@ -22817,7 +23064,7 @@ var prefer_logical_tailwind_utilities_default = defineRule({
22817
23064
  });
22818
23065
 
22819
23066
  // src/rules/prefer-millisecond-control-duration-schema.ts
22820
- var NAME98 = "prefer-millisecond-control-duration-schema";
23067
+ var NAME99 = "prefer-millisecond-control-duration-schema";
22821
23068
  var CONTROL_SECONDS_RE = /(?:^|_)(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)_seconds$/i;
22822
23069
  var CONTROL_SECONDS_CAMEL_RE = /(?:timeout|delay|interval|backoff|ttl|lease|heartbeat|debounce|throttle)Seconds$/i;
22823
23070
  var NUMERIC_REFINEMENTS = /* @__PURE__ */ new Set(["int", "min", "max", "positive", "nonnegative", "finite", "multipleOf", "optional", "nullable", "nullish", "default", "describe", "brand", "readonly"]);
@@ -22829,7 +23076,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
22829
23076
  type: "suggestion",
22830
23077
  docs: {
22831
23078
  description: "Require application-owned Zod control-duration fields to use millisecond granularity.",
22832
- url: docsUrl(NAME98)
23079
+ url: docsUrl(NAME99)
22833
23080
  },
22834
23081
  schema: [],
22835
23082
  messages: {
@@ -22915,7 +23162,7 @@ var prefer_millisecond_control_duration_schema_default = defineRule({
22915
23162
  });
22916
23163
 
22917
23164
  // src/rules/prefer-minimal-parameter-contract.ts
22918
- var NAME99 = "prefer-minimal-parameter-contract";
23165
+ var NAME100 = "prefer-minimal-parameter-contract";
22919
23166
  function inlineFields(ast, node, reads) {
22920
23167
  const fields2 = /* @__PURE__ */ new Map();
22921
23168
  for (const member3 of node.members) {
@@ -22934,7 +23181,7 @@ var prefer_minimal_parameter_contract_default = defineRule({
22934
23181
  meta: {
22935
23182
  type: "suggestion",
22936
23183
  fixable: "code",
22937
- docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(NAME99) },
23184
+ docs: { description: "Prefer the proven read-only subset for a private consumer parameter.", url: docsUrl(NAME100) },
22938
23185
  schema: [],
22939
23186
  messages: {
22940
23187
  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 +23580,7 @@ var prefer_module_level_constant_default = defineRule({
23333
23580
  });
23334
23581
 
23335
23582
  // src/rules/prefer-module-level-schema.ts
23336
- var NAME100 = "prefer-module-level-schema";
23583
+ var NAME101 = "prefer-module-level-schema";
23337
23584
  var DEFAULT_FACTORIES = [
23338
23585
  "discriminatedUnion",
23339
23586
  "intersection",
@@ -23515,7 +23762,7 @@ var prefer_module_level_schema_default = defineRule({
23515
23762
  type: "problem",
23516
23763
  docs: {
23517
23764
  description: "Declare a Zod schema at module scope when it closes over nothing in the enclosing function",
23518
- url: docsUrl(NAME100)
23765
+ url: docsUrl(NAME101)
23519
23766
  },
23520
23767
  schema: [
23521
23768
  {
@@ -23665,7 +23912,7 @@ var prefer_module_level_schema_default = defineRule({
23665
23912
  });
23666
23913
 
23667
23914
  // src/rules/prefer-module-level-refined-schema.ts
23668
- var NAME101 = "prefer-module-level-refined-schema";
23915
+ var NAME102 = "prefer-module-level-refined-schema";
23669
23916
  var BENCHMARK_PATH_RE = /(^|[/\\])(?:benchmarks?|bench)[/\\]/;
23670
23917
  var FACTORIES = /* @__PURE__ */ new Set([
23671
23918
  "array",
@@ -23815,7 +24062,7 @@ var prefer_module_level_refined_schema_default = defineRule({
23815
24062
  type: "suggestion",
23816
24063
  docs: {
23817
24064
  description: "Declare closed Zod scalar, format, and wrapper schemas at module scope.",
23818
- url: docsUrl(NAME101)
24065
+ url: docsUrl(NAME102)
23819
24066
  },
23820
24067
  schema: [],
23821
24068
  messages: {
@@ -23913,7 +24160,7 @@ var prefer_module_level_refined_schema_default = defineRule({
23913
24160
  });
23914
24161
 
23915
24162
  // src/rules/prefer-multi-value-zod-literal.ts
23916
- var NAME102 = "prefer-multi-value-zod-literal";
24163
+ var NAME103 = "prefer-multi-value-zod-literal";
23917
24164
  function isStaticPrimitive(node, sourceCode2) {
23918
24165
  node = unwrapExpression(node);
23919
24166
  if (node.type === "Literal") {
@@ -23940,7 +24187,7 @@ var prefer_multi_value_zod_literal_default = defineRule({
23940
24187
  type: "suggestion",
23941
24188
  docs: {
23942
24189
  description: "Use the Zod 4 multi-value literal API instead of a union of literal schemas.",
23943
- url: docsUrl(NAME102)
24190
+ url: docsUrl(NAME103)
23944
24191
  },
23945
24192
  schema: [
23946
24193
  {
@@ -24103,7 +24350,7 @@ function closedType(node) {
24103
24350
  }
24104
24351
 
24105
24352
  // src/rules/prefer-named-callback-domain.ts
24106
- var NAME103 = "prefer-named-callback-domain";
24353
+ var NAME104 = "prefer-named-callback-domain";
24107
24354
  function isLiteralUnion(node) {
24108
24355
  return node.type === "TSUnionType" && node.types.length >= 2 && node.types.every((part) => part.type === "TSLiteralType");
24109
24356
  }
@@ -24123,7 +24370,7 @@ var prefer_named_callback_domain_default = defineRule({
24123
24370
  fixable: "code",
24124
24371
  docs: {
24125
24372
  description: "Name literal-union domains used by callbacks in exported contracts.",
24126
- url: docsUrl(NAME103)
24373
+ url: docsUrl(NAME104)
24127
24374
  },
24128
24375
  schema: [],
24129
24376
  messages: {
@@ -24162,7 +24409,7 @@ var prefer_named_callback_domain_default = defineRule({
24162
24409
  });
24163
24410
 
24164
24411
  // src/rules/prefer-named-complex-return-type.ts
24165
- var NAME104 = "prefer-named-complex-return-type";
24412
+ var NAME105 = "prefer-named-complex-return-type";
24166
24413
  function unwrap5(node) {
24167
24414
  if (node.type === "TSTypeReference" && node.typeArguments?.params.length === 1) {
24168
24415
  const [inner] = node.typeArguments.params;
@@ -24200,7 +24447,7 @@ var prefer_named_complex_return_type_default = defineRule({
24200
24447
  fixable: "code",
24201
24448
  docs: {
24202
24449
  description: "Prefer a named contract for structurally complex function return types.",
24203
- url: docsUrl(NAME104)
24450
+ url: docsUrl(NAME105)
24204
24451
  },
24205
24452
  schema: [],
24206
24453
  messages: {
@@ -24223,14 +24470,14 @@ var prefer_named_complex_return_type_default = defineRule({
24223
24470
  });
24224
24471
 
24225
24472
  // src/rules/prefer-native-fetch-in-server-actions.ts
24226
- var NAME105 = "prefer-native-fetch-in-server-actions";
24473
+ var NAME106 = "prefer-native-fetch-in-server-actions";
24227
24474
  var KY_MODULE = /^ky(?:\/.*)?$/u;
24228
24475
  var prefer_native_fetch_in_server_actions_default = defineRule({
24229
24476
  meta: {
24230
24477
  type: "problem",
24231
24478
  docs: {
24232
24479
  description: "Server action modules should call native fetch instead of importing ky.",
24233
- url: docsUrl(NAME105)
24480
+ url: docsUrl(NAME106)
24234
24481
  },
24235
24482
  schema: [],
24236
24483
  defaultOptions: [],
@@ -24266,7 +24513,7 @@ function isTypeOnly(node) {
24266
24513
  }
24267
24514
 
24268
24515
  // src/rules/prefer-native-random-uuid.ts
24269
- var NAME106 = "prefer-native-random-uuid";
24516
+ var NAME107 = "prefer-native-random-uuid";
24270
24517
  function requireUuidCallee(node) {
24271
24518
  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
24519
  }
@@ -24279,7 +24526,7 @@ var prefer_native_random_uuid_default = defineRule({
24279
24526
  type: "suggestion",
24280
24527
  docs: {
24281
24528
  description: "Prefer `globalThis.crypto.randomUUID()` over resolved zero-argument UUID v4 bindings from the `uuid` package.",
24282
- url: docsUrl(NAME106)
24529
+ url: docsUrl(NAME107)
24283
24530
  },
24284
24531
  hasSuggestions: true,
24285
24532
  fixable: "code",
@@ -24293,11 +24540,11 @@ var prefer_native_random_uuid_default = defineRule({
24293
24540
  let sourceCode2;
24294
24541
  let directBindings = /* @__PURE__ */ new Set();
24295
24542
  let namespaceBindings = /* @__PURE__ */ new Set();
24296
- function resolve3(identifier) {
24543
+ function resolve4(identifier) {
24297
24544
  return findVariable(sourceCode2.getScope(identifier), identifier.name);
24298
24545
  }
24299
24546
  function record(identifier, destination) {
24300
- const variable = resolve3(identifier);
24547
+ const variable = resolve4(identifier);
24301
24548
  if (variable !== null) destination.add(variable);
24302
24549
  }
24303
24550
  function report2(node) {
@@ -24336,7 +24583,7 @@ var prefer_native_random_uuid_default = defineRule({
24336
24583
  const declaration = node.parent;
24337
24584
  if (declaration.kind !== "const") return;
24338
24585
  const require2 = requireUuidCallee(node.init);
24339
- if (require2 === null || (resolve3(require2)?.defs.length ?? 0) > 0) return;
24586
+ if (require2 === null || (resolve4(require2)?.defs.length ?? 0) > 0) return;
24340
24587
  if (node.id.type === "Identifier") {
24341
24588
  record(node.id, namespaceBindings);
24342
24589
  return;
@@ -24352,14 +24599,14 @@ var prefer_native_random_uuid_default = defineRule({
24352
24599
  if (node.arguments.length !== 0 || directBindings.size === 0 && namespaceBindings.size === 0) return;
24353
24600
  const callee = unwrapExpression(node.callee);
24354
24601
  if (callee.type === "Identifier") {
24355
- const variable2 = resolve3(callee);
24602
+ const variable2 = resolve4(callee);
24356
24603
  if (variable2 !== null && directBindings.has(variable2)) report2(node);
24357
24604
  return;
24358
24605
  }
24359
24606
  if (callee.type !== "MemberExpression" || callee.computed || callee.object.type !== "Identifier" || callee.property.type !== "Identifier" || callee.property.name !== "v4") {
24360
24607
  return;
24361
24608
  }
24362
- const variable = resolve3(callee.object);
24609
+ const variable = resolve4(callee.object);
24363
24610
  if (variable !== null && namespaceBindings.has(variable)) report2(node);
24364
24611
  }
24365
24612
  };
@@ -24367,7 +24614,7 @@ var prefer_native_random_uuid_default = defineRule({
24367
24614
  });
24368
24615
 
24369
24616
  // src/rules/prefer-node-crypto-hash.ts
24370
- var NAME107 = "prefer-node-crypto-hash";
24617
+ var NAME108 = "prefer-node-crypto-hash";
24371
24618
  var UNSAFE_NAMESPACE_METHODS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "valueOf"]);
24372
24619
  var UNSAFE_AUTHORITY_IDENTIFIERS = [
24373
24620
  "eval",
@@ -24416,13 +24663,13 @@ function readonlyNamespaceUse(receiver) {
24416
24663
  const parent = parentOf(use);
24417
24664
  return name !== null && !UNSAFE_NAMESPACE_METHODS.has(name) && parent?.type === "CallExpression" && parent.callee === use;
24418
24665
  }
24419
- function readonlyLoaderUse(node, resolve3, stable2) {
24666
+ function readonlyLoaderUse(node, resolve4, stable2) {
24420
24667
  const receiver = outerExpression(node);
24421
24668
  const parent = parentOf(receiver);
24422
24669
  if (parent?.type === "VariableDeclarator" && parent.init === receiver) {
24423
24670
  if (parent.id.type === "ObjectPattern") return true;
24424
24671
  if (parent.id.type !== "Identifier") return false;
24425
- const variable = resolve3(parent.id);
24672
+ const variable = resolve4(parent.id);
24426
24673
  return variable !== null && stable2(variable);
24427
24674
  }
24428
24675
  return parent?.type === "ExpressionStatement" || readonlyNamespaceUse(receiver);
@@ -24439,7 +24686,7 @@ function namespaceDefaultMayEscape(variable) {
24439
24686
  return (name === null || name === "default") && !readonlyNamespaceUse(outerExpression(member3));
24440
24687
  });
24441
24688
  }
24442
- function isBuiltinLoader(node, resolve3, builtin = "crypto") {
24689
+ function isBuiltinLoader(node, resolve4, builtin = "crypto") {
24443
24690
  if (node.type !== "CallExpression" || node.arguments.length !== 1) return false;
24444
24691
  const [argument] = node.arguments;
24445
24692
  if (argument === void 0 || argument.type === "SpreadElement" || !isBuiltinSpecifier(argument, builtin)) {
@@ -24447,15 +24694,15 @@ function isBuiltinLoader(node, resolve3, builtin = "crypto") {
24447
24694
  }
24448
24695
  const unwrappedNodeCallee = unwrapExpression(node.callee);
24449
24696
  if (unwrappedNodeCallee.type === "Identifier") {
24450
- return unwrappedNodeCallee.name === "require" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee, resolve3);
24697
+ return unwrappedNodeCallee.name === "require" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee, resolve4);
24451
24698
  }
24452
- return unwrappedNodeCallee.type === "MemberExpression" && unwrappedNodeCallee.object.type === "Identifier" && unwrappedNodeCallee.object.name === "process" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee.object, resolve3) && getPropertyName(unwrappedNodeCallee) === "getBuiltinModule";
24699
+ return unwrappedNodeCallee.type === "MemberExpression" && unwrappedNodeCallee.object.type === "Identifier" && unwrappedNodeCallee.object.name === "process" && isUnshadowedBuiltinIdentifier(unwrappedNodeCallee.object, resolve4) && getPropertyName(unwrappedNodeCallee) === "getBuiltinModule";
24453
24700
  }
24454
24701
  function isBuiltinSpecifier(node, builtin) {
24455
24702
  return node.type === "Literal" && (node.value === builtin || node.value === `node:${builtin}`);
24456
24703
  }
24457
- function isUnshadowedBuiltinIdentifier(identifier, resolve3) {
24458
- const variable = resolve3(identifier);
24704
+ function isUnshadowedBuiltinIdentifier(identifier, resolve4) {
24705
+ const variable = resolve4(identifier);
24459
24706
  return variable === null || variable.defs.length === 0;
24460
24707
  }
24461
24708
  function propertyName2(node) {
@@ -24471,7 +24718,7 @@ var prefer_node_crypto_hash_default = defineRule({
24471
24718
  fixable: "code",
24472
24719
  docs: {
24473
24720
  description: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary.",
24474
- url: docsUrl(NAME107)
24721
+ url: docsUrl(NAME108)
24475
24722
  },
24476
24723
  schema: [],
24477
24724
  messages: { preferNodeCryptoHash: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary." }
@@ -24496,11 +24743,11 @@ var prefer_node_crypto_hash_default = defineRule({
24496
24743
  namespaceStability.set(variable, stable2);
24497
24744
  return stable2;
24498
24745
  }
24499
- function resolve3(identifier) {
24746
+ function resolve4(identifier) {
24500
24747
  return findVariable(context.sourceCode.getScope(identifier), identifier.name);
24501
24748
  }
24502
24749
  function record(identifier, destination, shared = false) {
24503
- const variable = resolve3(identifier);
24750
+ const variable = resolve4(identifier);
24504
24751
  if (variable === null) return;
24505
24752
  const stable2 = destination === namespaceBindings ? namespaceStable(variable) : stableValueBinding(variable);
24506
24753
  if (shared && destination === namespaceBindings && !stable2) sharedNamespaceUnsafe = true;
@@ -24520,7 +24767,7 @@ var prefer_node_crypto_hash_default = defineRule({
24520
24767
  if (node.source.value !== "node:crypto" || node.importKind === "type") return;
24521
24768
  for (const specifier of node.specifiers) {
24522
24769
  if (specifier.type !== "ImportSpecifier" || specifier.importKind === "type") continue;
24523
- const binding3 = resolve3(specifier.local);
24770
+ const binding3 = resolve4(specifier.local);
24524
24771
  if (binding3 === null) continue;
24525
24772
  const name = importSpecifierName(specifier);
24526
24773
  if (name === "hash") hashBindings.set(binding3, specifier.local);
@@ -24532,7 +24779,7 @@ var prefer_node_crypto_hash_default = defineRule({
24532
24779
  const { sourceCode: sourceCode2 } = context;
24533
24780
  const constructor = unwrapExpression(create.callee);
24534
24781
  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);
24782
+ const creator = resolve4(constructor);
24536
24783
  if (creator === null || !canonicalCreators.has(creator) || !hasOnlyDirectFactoryUses(creator) || !hasRetainedFactoryCall(creator, candidates2.map((candidate2) => candidate2.node))) return null;
24537
24784
  const hash = visibleHashImport(node);
24538
24785
  if (hash === void 0) return null;
@@ -24582,7 +24829,7 @@ var prefer_node_crypto_hash_default = defineRule({
24582
24829
  const shared = specifier.type === "ImportDefaultSpecifier" || specifier.type === "ImportSpecifier" && importSpecifierName(specifier) === "default";
24583
24830
  if (specifier.type === "ImportNamespaceSpecifier" || shared) {
24584
24831
  record(specifier.local, namespaceBindings, shared);
24585
- const variable = resolve3(specifier.local);
24832
+ const variable = resolve4(specifier.local);
24586
24833
  if (!shared && variable !== null && namespaceDefaultMayEscape(variable)) sharedNamespaceUnsafe = true;
24587
24834
  } else if (specifier.type === "ImportSpecifier" && importSpecifierName(specifier) === "createHash") {
24588
24835
  record(specifier.local, directBindings);
@@ -24591,8 +24838,8 @@ var prefer_node_crypto_hash_default = defineRule({
24591
24838
  },
24592
24839
  VariableDeclarator(node) {
24593
24840
  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;
24841
+ const crypto = isBuiltinLoader(node.init, resolve4);
24842
+ if (!crypto && !isBuiltinLoader(node.init, resolve4, "module")) return;
24596
24843
  if (node.id.type === "Identifier") {
24597
24844
  record(node.id, crypto ? namespaceBindings : moduleBindings, crypto);
24598
24845
  return;
@@ -24605,16 +24852,16 @@ var prefer_node_crypto_hash_default = defineRule({
24605
24852
  }
24606
24853
  },
24607
24854
  CallExpression(node) {
24608
- if (isBuiltinLoader(node, resolve3) && !readonlyLoaderUse(node, resolve3, namespaceStable)) sharedNamespaceUnsafe = true;
24855
+ if (isBuiltinLoader(node, resolve4) && !readonlyLoaderUse(node, resolve4, namespaceStable)) sharedNamespaceUnsafe = true;
24609
24856
  const callee = unwrapExpression(node.callee);
24610
24857
  if (callee.type === "Identifier" || callee.type === "MemberExpression" && getPropertyName(callee) === "syncBuiltinESMExports") possibleSynchronizations.push(node);
24611
24858
  const chain = digestChain(node);
24612
24859
  if (chain === null) return;
24613
- const provider = builtinCallProvider(chain.create, directBindings, namespaceBindings, sharedBindings, resolve3);
24860
+ const provider = builtinCallProvider(chain.create, directBindings, namespaceBindings, sharedBindings, resolve4);
24614
24861
  if (provider !== null) candidates2.push({ node, ...chain, shared: provider === "shared" });
24615
24862
  },
24616
24863
  "Program:exit"() {
24617
- const exportsMaySynchronize = sharedNamespaceUnsafe && possibleSynchronizations.some((node) => builtinCallProvider(node, syncBindings, moduleBindings, sharedBindings, resolve3, "module") !== null);
24864
+ const exportsMaySynchronize = sharedNamespaceUnsafe && possibleSynchronizations.some((node) => builtinCallProvider(node, syncBindings, moduleBindings, sharedBindings, resolve4, "module") !== null);
24618
24865
  for (const candidate2 of candidates2) {
24619
24866
  if (!sharedNamespaceUnsafe || !candidate2.shared && !exportsMaySynchronize) {
24620
24867
  const fix = existingHashFix(candidate2);
@@ -24647,19 +24894,19 @@ function isPlainCall(call) {
24647
24894
  const callee = unwrapExpression(call.callee);
24648
24895
  return !call.optional && !isPresent(call.typeArguments) && (callee.type !== "MemberExpression" || !callee.optional);
24649
24896
  }
24650
- function builtinCallProvider(node, directBindings, namespaceBindings, sharedBindings, resolve3, builtin = "crypto") {
24897
+ function builtinCallProvider(node, directBindings, namespaceBindings, sharedBindings, resolve4, builtin = "crypto") {
24651
24898
  const unwrappedNodeCallee = unwrapExpression(node.callee);
24652
24899
  if (unwrappedNodeCallee.type === "Identifier") {
24653
- const variable2 = resolve3(unwrappedNodeCallee);
24900
+ const variable2 = resolve4(unwrappedNodeCallee);
24654
24901
  if (variable2 === null || !directBindings.has(variable2)) return null;
24655
24902
  return sharedBindings.has(variable2) ? "shared" : "snapshot";
24656
24903
  }
24657
24904
  if (unwrappedNodeCallee.type !== "MemberExpression" || getPropertyName(unwrappedNodeCallee) !== (builtin === "crypto" ? "createHash" : "syncBuiltinESMExports")) {
24658
24905
  return null;
24659
24906
  }
24660
- if (isBuiltinLoader(unwrappedNodeCallee.object, resolve3, builtin)) return "shared";
24907
+ if (isBuiltinLoader(unwrappedNodeCallee.object, resolve4, builtin)) return "shared";
24661
24908
  if (unwrappedNodeCallee.object.type !== "Identifier") return null;
24662
- const variable = resolve3(unwrappedNodeCallee.object);
24909
+ const variable = resolve4(unwrappedNodeCallee.object);
24663
24910
  if (variable === null || !namespaceBindings.has(variable)) return null;
24664
24911
  return sharedBindings.has(variable) ? "shared" : "snapshot";
24665
24912
  }
@@ -24701,7 +24948,7 @@ function hasRetainedFactoryCall(binding3, removed) {
24701
24948
  }
24702
24949
 
24703
24950
  // src/rules/prefer-node-fs-promises.ts
24704
- var NAME108 = "prefer-node-fs-promises";
24951
+ var NAME109 = "prefer-node-fs-promises";
24705
24952
  function memberName3(node) {
24706
24953
  if (!node.computed && node.property.type === "Identifier") return node.property.name;
24707
24954
  if (node.computed && node.property.type === "Literal" && typeof node.property.value === "string") {
@@ -24734,7 +24981,7 @@ var prefer_node_fs_promises_default = defineRule({
24734
24981
  type: "suggestion",
24735
24982
  docs: {
24736
24983
  description: "Prefer promise-based Node.js filesystem APIs over synchronous calls in production modules.",
24737
- url: docsUrl(NAME108)
24984
+ url: docsUrl(NAME109)
24738
24985
  },
24739
24986
  schema: [],
24740
24987
  messages: {
@@ -24877,7 +25124,7 @@ function sameTypeBinding(sourceCode2, alias, annotation, parameter) {
24877
25124
  }
24878
25125
 
24879
25126
  // src/rules/prefer-nominal-id-types.ts
24880
- var NAME109 = "prefer-nominal-id-types";
25127
+ var NAME110 = "prefer-nominal-id-types";
24881
25128
  var OPERATIONAL_ROLES = /* @__PURE__ */ new Set([
24882
25129
  "request",
24883
25130
  "trace",
@@ -24993,7 +25240,7 @@ var prefer_nominal_id_types_default = defineRule({
24993
25240
  fixable: "code",
24994
25241
  docs: {
24995
25242
  description: "Distinguish identifier roles sharing primitive types at callable boundaries.",
24996
- url: docsUrl(NAME109)
25243
+ url: docsUrl(NAME110)
24997
25244
  },
24998
25245
  schema: [],
24999
25246
  messages: {
@@ -25022,7 +25269,7 @@ var prefer_nominal_id_types_default = defineRule({
25022
25269
  });
25023
25270
 
25024
25271
  // src/rules/prefer-non-nullable-collection.ts
25025
- var NAME110 = "prefer-non-nullable-collection";
25272
+ var NAME111 = "prefer-non-nullable-collection";
25026
25273
  var ARRAY_TYPE_NAMES2 = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
25027
25274
  var NULL_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "==="]);
25028
25275
  var EMPTY_GUARD_OPERATORS = /* @__PURE__ */ new Set(["==", "===", "<="]);
@@ -25377,7 +25624,7 @@ var prefer_non_nullable_collection_default = defineRule({
25377
25624
  fixable: "code",
25378
25625
  docs: {
25379
25626
  description: "Suggest reviewing nullish arrays that use local empty-array defaults or a shared null-or-empty guard.",
25380
- url: docsUrl(NAME110)
25627
+ url: docsUrl(NAME111)
25381
25628
  },
25382
25629
  schema: [],
25383
25630
  messages: {
@@ -25413,13 +25660,13 @@ var prefer_non_nullable_collection_default = defineRule({
25413
25660
  function checkParameter(rawParameter) {
25414
25661
  const parameter = rawParameter.type === "AssignmentPattern" ? rawParameter.left : rawParameter;
25415
25662
  if (parameter.type === "ObjectPattern") {
25416
- const properties2 = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25417
- checkDestructuredProperties(parameter, properties2);
25663
+ const properties3 = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25664
+ checkDestructuredProperties(parameter, properties3);
25418
25665
  return;
25419
25666
  }
25420
25667
  if (parameter.type !== "Identifier") return;
25421
- const properties = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25422
- for (const property of properties) {
25668
+ const properties2 = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
25669
+ for (const property of properties2) {
25423
25670
  const access = { kind: "member", object: parameter.name, property: property.name };
25424
25671
  record(
25425
25672
  property,
@@ -25427,8 +25674,8 @@ var prefer_non_nullable_collection_default = defineRule({
25427
25674
  );
25428
25675
  }
25429
25676
  }
25430
- function checkDestructuredProperties(parameter, properties) {
25431
- for (const property of properties) {
25677
+ function checkDestructuredProperties(parameter, properties2) {
25678
+ for (const property of properties2) {
25432
25679
  const bindingProperty = parameter.properties.find(
25433
25680
  (entry) => entry.type === "Property" && !entry.computed && getPropertyName(entry) === property.name
25434
25681
  );
@@ -25488,7 +25735,7 @@ var prefer_non_nullable_collection_default = defineRule({
25488
25735
  });
25489
25736
 
25490
25737
  // src/rules/prefer-nullish-filter-predicate.ts
25491
- var NAME111 = "prefer-nullish-filter-predicate";
25738
+ var NAME112 = "prefer-nullish-filter-predicate";
25492
25739
  var SUMMARY = "Prefer an explicit nullish predicate when `filter(Boolean)` removes only nullish values but does not narrow the result type.";
25493
25740
  function isBuiltinArrayFilter(native, symbol) {
25494
25741
  const kinds2 = native.ast.SyntaxKind;
@@ -25545,7 +25792,7 @@ function isLiteralValue(node) {
25545
25792
  var prefer_nullish_filter_predicate_default = defineRule({
25546
25793
  meta: {
25547
25794
  type: "suggestion",
25548
- docs: { description: SUMMARY, url: docsUrl(NAME111) },
25795
+ docs: { description: SUMMARY, url: docsUrl(NAME112) },
25549
25796
  hasSuggestions: true,
25550
25797
  fixable: "code",
25551
25798
  schema: [],
@@ -25590,7 +25837,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
25590
25837
  while (findVariable(scope, `value${String(suffix)}`) !== null) suffix += 1;
25591
25838
  return `value${String(suffix)}`;
25592
25839
  }
25593
- function resolve3(native) {
25840
+ function resolve4(native) {
25594
25841
  const { checker, file } = native;
25595
25842
  const symbols = file.symbolsOf(candidates2.map((candidate2) => candidate2.callee.property));
25596
25843
  const receivers = file.typesOf(candidates2.map((candidate2) => candidate2.callee.object));
@@ -25627,7 +25874,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
25627
25874
  },
25628
25875
  "Program:exit"() {
25629
25876
  if (candidates2.length === 0 || tsrs === null) return;
25630
- const found = tsrs.run((file) => resolve3(nativeTypes(file)));
25877
+ const found = tsrs.run((file) => resolve4(nativeTypes(file)));
25631
25878
  if (found === null) return;
25632
25879
  candidates2.forEach((candidate2, i) => {
25633
25880
  if (found[i] === true) report2(candidate2);
@@ -25638,7 +25885,7 @@ var prefer_nullish_filter_predicate_default = defineRule({
25638
25885
  });
25639
25886
 
25640
25887
  // src/rules/prefer-schema-for-api-payload.ts
25641
- var NAME112 = "prefer-schema-for-api-payload";
25888
+ var NAME113 = "prefer-schema-for-api-payload";
25642
25889
  var unwrap6 = (node) => {
25643
25890
  let current = node ?? null;
25644
25891
  while (current !== null && (isErasedExpression(current) || current.type === "ChainExpression")) current = current.expression;
@@ -25921,7 +26168,7 @@ var prefer_schema_for_api_payload_default = defineRule({
25921
26168
  type: "problem",
25922
26169
  docs: {
25923
26170
  description: "Require Zod (or similar) schema validation on `response.json()` / `JSON.parse()` results before property access.",
25924
- url: docsUrl(NAME112)
26171
+ url: docsUrl(NAME113)
25925
26172
  },
25926
26173
  schema: [],
25927
26174
  messages: {
@@ -26104,7 +26351,7 @@ var prefer_schema_for_api_payload_default = defineRule({
26104
26351
  // src/rules/prefer-semantic-colors.ts
26105
26352
  import { existsSync as existsSync3, lstatSync, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "fs";
26106
26353
  import { dirname as dirname3, join as join3, parse } from "path";
26107
- var NAME113 = "prefer-semantic-colors";
26354
+ var NAME114 = "prefer-semantic-colors";
26108
26355
  var COLOR_PREFIXES = "text|bg|border(?:-[trblxyse])?|ring(?:-offset)?|fill|stroke|from|via|to|divide|decoration|placeholder|accent|caret|shadow|outline";
26109
26356
  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
26357
  var COLOR_FN = "rgba?|hsla?|hwb|oklch|oklab|lab|lch|color";
@@ -26436,7 +26683,7 @@ var prefer_semantic_colors_default = defineRule({
26436
26683
  type: "suggestion",
26437
26684
  docs: {
26438
26685
  description: "Enforce semantic color tokens over raw Tailwind palette classes, arbitrary color values, and inline color literals.",
26439
- url: docsUrl(NAME113)
26686
+ url: docsUrl(NAME114)
26440
26687
  },
26441
26688
  schema: [
26442
26689
  {
@@ -26623,7 +26870,7 @@ function packageWorkspaceGlobs(parsed) {
26623
26870
  }
26624
26871
 
26625
26872
  // src/rules/prefer-server-actions.ts
26626
- var NAME114 = "prefer-server-actions";
26873
+ var NAME115 = "prefer-server-actions";
26627
26874
  var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "DELETE", "PATCH"]);
26628
26875
  var AXIOS_MUTATION_METHODS = /* @__PURE__ */ new Set(["post", "put", "delete", "patch"]);
26629
26876
  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 +27009,7 @@ var prefer_server_actions_default = defineRule({
26762
27009
  type: "suggestion",
26763
27010
  docs: {
26764
27011
  description: "Prefer Next.js Server Actions over same-origin API mutations.",
26765
- url: docsUrl(NAME114)
27012
+ url: docsUrl(NAME115)
26766
27013
  },
26767
27014
  schema: [
26768
27015
  {
@@ -26848,7 +27095,7 @@ var prefer_server_actions_default = defineRule({
26848
27095
  });
26849
27096
 
26850
27097
  // src/rules/prefer-server-data-preparation.ts
26851
- var NAME115 = "prefer-server-data-preparation";
27098
+ var NAME116 = "prefer-server-data-preparation";
26852
27099
  var METHODS = /* @__PURE__ */ new Set(["map", "filter", "flatMap"]);
26853
27100
  var DOM_EVENTS = /* @__PURE__ */ new Set(["onClick", "onChange", "onInput", "onSubmit"]);
26854
27101
  var BINARY = /* @__PURE__ */ new Set(["===", "!==", "==", "!=", ">", ">=", "<", "<=", "+", "-", "*", "/", "%"]);
@@ -26980,7 +27227,7 @@ function typedProofs(native) {
26980
27227
  var prefer_server_data_preparation_default = defineRule({
26981
27228
  meta: {
26982
27229
  type: "suggestion",
26983
- docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(NAME115) },
27230
+ docs: { description: "Prepare data-only input collections before an interactive client view when possible.", url: docsUrl(NAME116) },
26984
27231
  schema: [],
26985
27232
  messages: {
26986
27233
  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 +27283,7 @@ var prefer_server_data_preparation_default = defineRule({
27036
27283
  // src/rules/prefer-shadcn-primitives.ts
27037
27284
  import { existsSync as existsSync4, lstatSync as lstatSync2, readFileSync as readFileSync3, realpathSync } from "fs";
27038
27285
  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";
27286
+ import { dirname as dirname4, isAbsolute, join as join4, parse as parsePath, relative, resolve as resolve3, sep } from "path";
27040
27287
 
27041
27288
  // node_modules/jsonc-parser/lib/esm/impl/scanner.js
27042
27289
  function createScanner(text, ignoreTrivia = false) {
@@ -27898,7 +28145,7 @@ var ParseErrorCode;
27898
28145
  })(ParseErrorCode || (ParseErrorCode = {}));
27899
28146
 
27900
28147
  // src/rules/prefer-shadcn-primitives.ts
27901
- var NAME116 = "prefer-shadcn-primitives";
28148
+ var NAME117 = "prefer-shadcn-primitives";
27902
28149
  var RAW_PRIMITIVES = {
27903
28150
  button: { capability: "Button", replacement: "Button" },
27904
28151
  dialog: { capability: "Dialog", replacement: "Dialog or AlertDialog family" },
@@ -28047,7 +28294,7 @@ function stringProperty(value, ...keys) {
28047
28294
  }
28048
28295
  function resolveAlias(packageRoot, alias) {
28049
28296
  if (isAbsolute(alias)) return null;
28050
- if (alias.startsWith(".")) return resolve2(packageRoot, alias);
28297
+ if (alias.startsWith(".")) return resolve3(packageRoot, alias);
28051
28298
  const configPath = ["tsconfig.json", "jsconfig.json"].map((name) => join4(packageRoot, name)).find(existsSync4);
28052
28299
  if (configPath === void 0) return null;
28053
28300
  const config = readJsonc(configPath);
@@ -28061,7 +28308,7 @@ function resolveAlias(packageRoot, alias) {
28061
28308
  const matches = matchingAliasTargets(paths, alias);
28062
28309
  const [match] = matches;
28063
28310
  if (matches.length !== 1 || match === void 0) return null;
28064
- return resolve2(packageRoot, baseUrl, match);
28311
+ return resolve3(packageRoot, baseUrl, match);
28065
28312
  }
28066
28313
  var parseModule;
28067
28314
  function exportsPrimitive(path, exportName) {
@@ -28200,7 +28447,7 @@ var prefer_shadcn_primitives_default = defineRule({
28200
28447
  type: "suggestion",
28201
28448
  docs: {
28202
28449
  description: "Require visible raw JSX controls to use the corresponding shared shadcn primitive.",
28203
- url: docsUrl(NAME116)
28450
+ url: docsUrl(NAME117)
28204
28451
  },
28205
28452
  schema: [
28206
28453
  {
@@ -28307,7 +28554,7 @@ function matchingAliasTargets(paths, alias) {
28307
28554
  }
28308
28555
 
28309
28556
  // src/rules/prefer-shared-zod-enum.ts
28310
- var NAME117 = "prefer-shared-zod-enum";
28557
+ var NAME118 = "prefer-shared-zod-enum";
28311
28558
  function literalDomain(node) {
28312
28559
  if (node.arguments.length !== 1) return null;
28313
28560
  const first = node.arguments[0];
@@ -28346,7 +28593,7 @@ var prefer_shared_zod_enum_default = defineRule({
28346
28593
  type: "suggestion",
28347
28594
  docs: {
28348
28595
  description: "Give repeated literal Zod enum domains one reusable module-level schema.",
28349
- url: docsUrl(NAME117)
28596
+ url: docsUrl(NAME118)
28350
28597
  },
28351
28598
  schema: [],
28352
28599
  messages: {
@@ -28403,7 +28650,7 @@ var prefer_shared_zod_enum_default = defineRule({
28403
28650
  });
28404
28651
 
28405
28652
  // src/rules/prefer-switch-for-repeated-equality.ts
28406
- var NAME118 = "prefer-switch-for-repeated-equality";
28653
+ var NAME119 = "prefer-switch-for-repeated-equality";
28407
28654
  function discriminantName(test) {
28408
28655
  if (test.type !== "BinaryExpression" || test.operator !== "===") return null;
28409
28656
  const leftIsCase = isCaseValue(test.left);
@@ -28480,7 +28727,7 @@ var prefer_switch_for_repeated_equality_default = defineRule({
28480
28727
  fixable: "code",
28481
28728
  docs: {
28482
28729
  description: "Prefer switch over long if/else-if chains that compare one value for strict equality.",
28483
- url: docsUrl(NAME118)
28730
+ url: docsUrl(NAME119)
28484
28731
  },
28485
28732
  schema: [],
28486
28733
  messages: {
@@ -28530,8 +28777,8 @@ var prefer_switch_for_repeated_equality_default = defineRule({
28530
28777
  });
28531
28778
 
28532
28779
  // src/rules/prefer-test-fixture-reuse.ts
28533
- var NAME119 = "prefer-test-fixture-reuse";
28534
- var MAX_DEPTH = 8;
28780
+ var NAME120 = "prefer-test-fixture-reuse";
28781
+ var MAX_DEPTH2 = 8;
28535
28782
  var FRAMEWORKS = /* @__PURE__ */ new Set(["vitest", "@playwright/test"]);
28536
28783
  var TEST_MODIFIERS4 = /* @__PURE__ */ new Set(["only", "skip", "concurrent", "sequential"]);
28537
28784
  function stableBinding(source, identifier) {
@@ -28549,7 +28796,7 @@ function valueImport(definition) {
28549
28796
  }
28550
28797
  function constructorBinding(source, node, depth = 0) {
28551
28798
  node = unwrapExpression(node);
28552
- if (node.type !== "Identifier" || depth >= MAX_DEPTH) return null;
28799
+ if (node.type !== "Identifier" || depth >= MAX_DEPTH2) return null;
28553
28800
  const variable = stableBinding(source, node);
28554
28801
  const definition = variable?.defs[0];
28555
28802
  if (variable === null || definition === void 0) return null;
@@ -28559,7 +28806,7 @@ function constructorBinding(source, node, depth = 0) {
28559
28806
  }
28560
28807
  function fixtureApi(source, expression, depth = 0) {
28561
28808
  const node = unwrapExpression(expression);
28562
- if (node.type !== "Identifier" || depth >= MAX_DEPTH) return null;
28809
+ if (node.type !== "Identifier" || depth >= MAX_DEPTH2) return null;
28563
28810
  const variable = stableBinding(source, node);
28564
28811
  const definition = variable?.defs[0];
28565
28812
  if (variable === null || definition === void 0) return null;
@@ -28659,7 +28906,7 @@ var prefer_test_fixture_reuse_default = defineRule({
28659
28906
  type: "suggestion",
28660
28907
  docs: {
28661
28908
  description: "Reuse a requested test fixture instead of constructing another instance of its class.",
28662
- url: docsUrl(NAME119)
28909
+ url: docsUrl(NAME120)
28663
28910
  },
28664
28911
  schema: [],
28665
28912
  messages: { reuseFixture: "This class is already supplied by the requested `{{fixture}}` fixture; reuse it or request a typed factory for independent instances." }
@@ -28693,7 +28940,7 @@ var prefer_test_fixture_reuse_default = defineRule({
28693
28940
  });
28694
28941
 
28695
28942
  // src/rules/prefer-typed-reflection.ts
28696
- var NAME120 = "prefer-typed-reflection";
28943
+ var NAME121 = "prefer-typed-reflection";
28697
28944
  function knownType(native, type) {
28698
28945
  if (type.isUnionType()) return type.getTypes().every((part) => knownType(native, part));
28699
28946
  const flags = native.sync.TypeFlags;
@@ -28723,7 +28970,7 @@ var prefer_typed_reflection_default = defineRule({
28723
28970
  fixable: "code",
28724
28971
  docs: {
28725
28972
  description: "Prefer typed access when Reflect.get or Reflect.apply discards a known contract.",
28726
- url: docsUrl(NAME120)
28973
+ url: docsUrl(NAME121)
28727
28974
  },
28728
28975
  schema: [],
28729
28976
  messages: {
@@ -28889,7 +29136,7 @@ var prefer_typed_reflection_default = defineRule({
28889
29136
  });
28890
29137
 
28891
29138
  // src/rules/prefer-whole-object-assertion.ts
28892
- var NAME121 = "prefer-whole-object-assertion";
29139
+ var NAME122 = "prefer-whole-object-assertion";
28893
29140
  var MERGEABLE_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
28894
29141
  var SYNTHETIC_LITERAL_MATCHERS = /* @__PURE__ */ new Map([
28895
29142
  ["toBeNull", "null"]
@@ -28979,7 +29226,7 @@ var prefer_whole_object_assertion_default = defineRule({
28979
29226
  type: "suggestion",
28980
29227
  docs: {
28981
29228
  description: "Collapse consecutive assertions on one object into a whole-object assertion so related mismatches are reported together.",
28982
- url: docsUrl(NAME121)
29229
+ url: docsUrl(NAME122)
28983
29230
  },
28984
29231
  messages: {
28985
29232
  combineAssertions: "Consider combining these {{count}} assertions on `{{receiver}}` with `toMatchObject` when structural matching preserves property presence and getter or proxy behavior.",
@@ -29126,7 +29373,7 @@ var prefer_whole_object_assertion_default = defineRule({
29126
29373
  });
29127
29374
 
29128
29375
  // src/rules/prefer-zod-enum-validator.ts
29129
- var NAME122 = "prefer-zod-enum-validator";
29376
+ var NAME123 = "prefer-zod-enum-validator";
29130
29377
  function isInput(node, name) {
29131
29378
  if (node == null) return false;
29132
29379
  const value = unwrapExpression(node);
@@ -29217,7 +29464,7 @@ var prefer_zod_enum_validator_default = defineRule({
29217
29464
  type: "suggestion",
29218
29465
  docs: {
29219
29466
  description: "Express closed string validators with a reusable Zod enum schema.",
29220
- url: docsUrl(NAME122)
29467
+ url: docsUrl(NAME123)
29221
29468
  },
29222
29469
  schema: [],
29223
29470
  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 +29492,7 @@ var prefer_zod_enum_validator_default = defineRule({
29245
29492
  });
29246
29493
 
29247
29494
  // src/rules/prefer-zod-infer.ts
29248
- var NAME123 = "prefer-zod-infer";
29495
+ var NAME124 = "prefer-zod-infer";
29249
29496
  function absent(value) {
29250
29497
  return value === void 0 || value === null;
29251
29498
  }
@@ -29621,7 +29868,7 @@ var prefer_zod_infer_default = defineRule({
29621
29868
  fixable: "code",
29622
29869
  docs: {
29623
29870
  description: "Derive a type from its Zod schema with `z.infer` instead of hand-writing a twin declaration beside it.",
29624
- url: docsUrl(NAME123)
29871
+ url: docsUrl(NAME124)
29625
29872
  },
29626
29873
  schema: [
29627
29874
  {
@@ -30071,7 +30318,7 @@ function returnsContract(authority, returned2) {
30071
30318
  }
30072
30319
 
30073
30320
  // src/rules/prefer-zod-parse-output-type.ts
30074
- var NAME124 = "prefer-zod-parse-output-type";
30321
+ var NAME125 = "prefer-zod-parse-output-type";
30075
30322
  function isLocalZodObjectSchema(node, namespaces) {
30076
30323
  let current = node;
30077
30324
  while (current.type === "CallExpression") {
@@ -30217,7 +30464,7 @@ var prefer_zod_parse_output_type_default = defineRule({
30217
30464
  fixable: "code",
30218
30465
  docs: {
30219
30466
  description: "Consider deriving validated return contracts from the Zod schema when the schema owns the contract.",
30220
- url: docsUrl(NAME124)
30467
+ url: docsUrl(NAME125)
30221
30468
  },
30222
30469
  schema: [],
30223
30470
  messages: {
@@ -30505,7 +30752,7 @@ var production_derived_test_cases_default = defineRule({
30505
30752
  });
30506
30753
 
30507
30754
  // src/rules/repeated-static-call-cases.ts
30508
- var NAME125 = "repeated-static-call-cases";
30755
+ var NAME126 = "repeated-static-call-cases";
30509
30756
  var TEST_MODULES2 = /* @__PURE__ */ new Set(["@jest/globals", "@playwright/test", "bun:test", "node:test", "vitest"]);
30510
30757
  var TEST_NAMES3 = /* @__PURE__ */ new Set(["it", "test"]);
30511
30758
  var TEST_MODIFIERS5 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
@@ -30629,7 +30876,7 @@ var repeated_static_call_cases_default = defineRule({
30629
30876
  type: "suggestion",
30630
30877
  docs: {
30631
30878
  description: "Review three or more consecutive static-input call assertions as potential named cases.",
30632
- url: docsUrl(NAME125)
30879
+ url: docsUrl(NAME126)
30633
30880
  },
30634
30881
  schema: [],
30635
30882
  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 +31018,7 @@ function isPrimitiveReturn(node, annotation) {
30771
31018
  }
30772
31019
 
30773
31020
  // src/rules/require-assert-never.ts
30774
- var NAME126 = "require-assert-never";
31021
+ var NAME127 = "require-assert-never";
30775
31022
  function isRuntimeHandlingStatement(statement) {
30776
31023
  if (statement.type === "EmptyStatement") return false;
30777
31024
  if (statement.type === "BreakStatement") return statement.label !== null;
@@ -30831,7 +31078,7 @@ var require_assert_never_default = defineRule({
30831
31078
  fixable: "code",
30832
31079
  docs: {
30833
31080
  description: "Require an empty switch default to call `assertNever` so discriminated unions remain exhaustive at compile time.",
30834
- url: docsUrl(NAME126)
31081
+ url: docsUrl(NAME127)
30835
31082
  },
30836
31083
  schema: [],
30837
31084
  messages: {
@@ -30875,7 +31122,7 @@ var require_assert_never_default = defineRule({
30875
31122
  });
30876
31123
 
30877
31124
  // src/rules/require-button-accessible-name.ts
30878
- var NAME127 = "require-button-accessible-name";
31125
+ var NAME128 = "require-button-accessible-name";
30879
31126
  var DELEGATING_PROPS = /* @__PURE__ */ new Set(["render", "asChild"]);
30880
31127
  function delegatesRendering(opening) {
30881
31128
  return opening.attributes.some(
@@ -30888,7 +31135,7 @@ var require_button_accessible_name_default = defineRule({
30888
31135
  type: "problem",
30889
31136
  docs: {
30890
31137
  description: "Require an accessible name on statically unnamed native or configured JSX buttons.",
30891
- url: docsUrl(NAME127)
31138
+ url: docsUrl(NAME128)
30892
31139
  },
30893
31140
  schema: [
30894
31141
  {
@@ -30942,7 +31189,7 @@ var require_button_accessible_name_default = defineRule({
30942
31189
  });
30943
31190
 
30944
31191
  // src/rules/require-camelcase-properties.ts
30945
- var NAME128 = "require-camelcase-properties";
31192
+ var NAME129 = "require-camelcase-properties";
30946
31193
  var SNAKE_CASE_RE2 = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)+$/u;
30947
31194
  function blocksRename(member3, name) {
30948
31195
  if (member3.type === "TSIndexSignature" || "computed" in member3 && member3.computed) return true;
@@ -30956,7 +31203,7 @@ var require_camelcase_properties_default = defineRule({
30956
31203
  fixable: "code",
30957
31204
  docs: {
30958
31205
  description: "Require unquoted lower snake_case TypeScript properties and dot access to use camelCase.",
30959
- url: docsUrl(NAME128)
31206
+ url: docsUrl(NAME129)
30960
31207
  },
30961
31208
  schema: [],
30962
31209
  defaultOptions: [],
@@ -31020,7 +31267,7 @@ var require_camelcase_properties_default = defineRule({
31020
31267
  });
31021
31268
 
31022
31269
  // src/rules/require-constrained-schema-integer.ts
31023
- var NAME129 = "require-constrained-schema-integer";
31270
+ var NAME130 = "require-constrained-schema-integer";
31024
31271
  var FIELD_MINIMUMS = /* @__PURE__ */ new Map([["limit", 1], ["version", 0]]);
31025
31272
  var NUMBER_FACTORIES = /* @__PURE__ */ new Set(["number", "int", "int32", "uint32"]);
31026
31273
  var OBJECT_FACTORIES = /* @__PURE__ */ new Set(["object", "strictObject", "looseObject"]);
@@ -31062,7 +31309,7 @@ var require_constrained_schema_integer_default = defineRule({
31062
31309
  type: "suggestion",
31063
31310
  docs: {
31064
31311
  description: "Declare integer and lower-bound validation for numeric limit and version schema fields.",
31065
- url: docsUrl(NAME129)
31312
+ url: docsUrl(NAME130)
31066
31313
  },
31067
31314
  schema: [],
31068
31315
  messages: { constrainInteger: "Declare `{{field}}` as an integer with a lower bound of {{minimum}} or greater, or reuse its named domain schema." }
@@ -31541,14 +31788,14 @@ function closedNominalInheritanceFix(sourceCode2, file, call, consumer, implemen
31541
31788
  }
31542
31789
 
31543
31790
  // src/rules/require-explicit-contract-implementation.ts
31544
- var NAME130 = "require-explicit-contract-implementation";
31791
+ var NAME131 = "require-explicit-contract-implementation";
31545
31792
  var require_explicit_contract_implementation_default = defineRule({
31546
31793
  meta: {
31547
31794
  type: "problem",
31548
31795
  fixable: "code",
31549
31796
  docs: {
31550
31797
  description: "Require nominal inheritance when an injected abstract class is rejected by an instanceof guard.",
31551
- url: docsUrl(NAME130)
31798
+ url: docsUrl(NAME131)
31552
31799
  },
31553
31800
  schema: [],
31554
31801
  messages: {
@@ -32239,7 +32486,7 @@ function abstractContractOperations(node, functionAliases) {
32239
32486
  }
32240
32487
 
32241
32488
  // src/rules/require-explicit-service-contract.ts
32242
- var NAME131 = "require-explicit-service-contract";
32489
+ var NAME132 = "require-explicit-service-contract";
32243
32490
  var JAVASCRIPT_FILE_RE2 = /\.(?:js|jsx|mjs|cjs)$/iu;
32244
32491
  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
32492
  var NON_SERVICE_SUFFIX = /(?:Router|Middleware|Builder)$/u;
@@ -32255,7 +32502,7 @@ var require_explicit_service_contract_default = defineRule({
32255
32502
  type: "problem",
32256
32503
  docs: {
32257
32504
  description: "Require explicit contracts for classes that invoke retained collaborators.",
32258
- url: docsUrl(NAME131)
32505
+ url: docsUrl(NAME132)
32259
32506
  },
32260
32507
  schema: [],
32261
32508
  fixable: "code",
@@ -32291,7 +32538,7 @@ var require_explicit_service_contract_default = defineRule({
32291
32538
  });
32292
32539
 
32293
32540
  // src/rules/require-fetch-timeout.ts
32294
- var NAME132 = "require-fetch-timeout";
32541
+ var NAME133 = "require-fetch-timeout";
32295
32542
  function emptySignal(expression, resolvesToGlobal) {
32296
32543
  const value = unwrapExpression(expression);
32297
32544
  if (value.type === "Literal" && value.value === null)
@@ -32353,7 +32600,7 @@ var require_fetch_timeout_default = defineRule({
32353
32600
  type: "problem",
32354
32601
  docs: {
32355
32602
  description: "Require an explicit abort signal on locally analyzable global fetch calls.",
32356
- url: docsUrl(NAME132)
32603
+ url: docsUrl(NAME133)
32357
32604
  },
32358
32605
  schema: [
32359
32606
  {
@@ -32445,7 +32692,7 @@ var require_fetch_timeout_default = defineRule({
32445
32692
  });
32446
32693
 
32447
32694
  // src/rules/require-interface-for-exported-class.ts
32448
- var NAME133 = "require-interface-for-exported-class";
32695
+ var NAME134 = "require-interface-for-exported-class";
32449
32696
  var JAVASCRIPT_FILE_RE3 = /\.(?:js|jsx|mjs|cjs)$/iu;
32450
32697
  function isPublicInstanceMember2(member3) {
32451
32698
  return !member3.static && member3.accessibility !== "private" && member3.accessibility !== "protected" && member3.key.type !== "PrivateIdentifier";
@@ -32506,7 +32753,7 @@ var require_interface_for_exported_class_default = defineRule({
32506
32753
  type: "suggestion",
32507
32754
  docs: {
32508
32755
  description: "Require exported concrete classes with public behavior to declare a contract.",
32509
- url: docsUrl(NAME133)
32756
+ url: docsUrl(NAME134)
32510
32757
  },
32511
32758
  schema: [],
32512
32759
  fixable: "code",
@@ -32548,7 +32795,7 @@ var require_interface_for_exported_class_default = defineRule({
32548
32795
  });
32549
32796
 
32550
32797
  // src/rules/require-jwt-lifetime.ts
32551
- var NAME134 = "require-jwt-lifetime";
32798
+ var NAME135 = "require-jwt-lifetime";
32552
32799
  function isJoseValueImport(declaration) {
32553
32800
  return declaration.type === "ImportDeclaration" && declaration.importKind !== "type" && declaration.source.value === "jose";
32554
32801
  }
@@ -32557,7 +32804,7 @@ var require_jwt_lifetime_default = defineRule({
32557
32804
  type: "problem",
32558
32805
  docs: {
32559
32806
  description: "Require an expiration claim or a maximum token age when returning a verified JWT.",
32560
- url: docsUrl(NAME134)
32807
+ url: docsUrl(NAME135)
32561
32808
  },
32562
32809
  schema: [],
32563
32810
  messages: { lifetime: "Require the JWT exp claim or set maxTokenAge before returning this verification result." }
@@ -32616,7 +32863,7 @@ var require_jwt_lifetime_default = defineRule({
32616
32863
  });
32617
32864
 
32618
32865
  // src/rules/require-pascal-case-zod-schema-name.ts
32619
- var NAME135 = "require-pascal-case-zod-schema-name";
32866
+ var NAME136 = "require-pascal-case-zod-schema-name";
32620
32867
  var PASCAL_SCHEMA_NAME_RE = /^[A-Z][A-Za-z0-9]*Schema$/;
32621
32868
  var BENCHMARK_PATH_RE2 = /(^|[\\/])(?:benchmarks?|bench)[\\/]/;
32622
32869
  var NON_SCHEMA_TERMINALS2 = /* @__PURE__ */ new Set([
@@ -32787,7 +33034,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
32787
33034
  fixable: "code",
32788
33035
  docs: {
32789
33036
  description: "Require confirmed module-level Zod schema contracts to use PascalCase with a `Schema` suffix.",
32790
- url: docsUrl(NAME135)
33037
+ url: docsUrl(NAME136)
32791
33038
  },
32792
33039
  schema: [],
32793
33040
  defaultOptions: [],
@@ -32897,7 +33144,7 @@ var require_pascal_case_zod_schema_name_default = defineRule({
32897
33144
  });
32898
33145
 
32899
33146
  // src/rules/require-port-for-service.ts
32900
- var NAME136 = "require-port-for-service";
33147
+ var NAME137 = "require-port-for-service";
32901
33148
  var HTTP_TRANSPORT_TYPE_RE = /^(?:KyInstance|AxiosInstance|Session)$/;
32902
33149
  var TRANSPORT_WRAPPER_NAME_RE = /(?:Client$|^Http[A-Z])/;
32903
33150
  var ERROR_VALUE_NAME_RE = /Error$/;
@@ -33031,7 +33278,7 @@ var require_port_for_service_default = defineRule({
33031
33278
  type: "suggestion",
33032
33279
  docs: {
33033
33280
  description: "Advise when an exported service with injected collaborators has public methods not covered by its declared ports.",
33034
- url: docsUrl(NAME136)
33281
+ url: docsUrl(NAME137)
33035
33282
  },
33036
33283
  schema: [],
33037
33284
  fixable: "code",
@@ -33071,7 +33318,7 @@ var require_port_for_service_default = defineRule({
33071
33318
  });
33072
33319
 
33073
33320
  // src/rules/require-sql-access-class.ts
33074
- var NAME137 = "require-sql-access-class";
33321
+ var NAME138 = "require-sql-access-class";
33075
33322
  var DIRECT_EXECUTION_METHODS = /* @__PURE__ */ new Set([
33076
33323
  "all",
33077
33324
  "batch",
@@ -33269,7 +33516,7 @@ var require_sql_access_class_default = defineRule({
33269
33516
  type: "suggestion",
33270
33517
  docs: {
33271
33518
  description: "Keep SQL reads and writes inside a class that receives its database dependency.",
33272
- url: docsUrl(NAME137)
33519
+ url: docsUrl(NAME138)
33273
33520
  },
33274
33521
  schema: [],
33275
33522
  messages: {
@@ -33341,7 +33588,7 @@ function staticMatcherFix(sourceCode2, property) {
33341
33588
  }
33342
33589
 
33343
33590
  // src/rules/require-static-next-matcher.ts
33344
- var NAME138 = "require-static-next-matcher";
33591
+ var NAME139 = "require-static-next-matcher";
33345
33592
  var NEXT_ENTRY_FILE = /(?:^|[/\\])(?:middleware|proxy)\.[cm]?[jt]sx?$/u;
33346
33593
  function isStaticValue(node) {
33347
33594
  const value = unwrapExpression(node);
@@ -33373,7 +33620,7 @@ var require_static_next_matcher_default = defineRule({
33373
33620
  fixable: "code",
33374
33621
  docs: {
33375
33622
  description: "Require Next.js middleware and proxy matcher configuration to contain only build-time literals.",
33376
- url: docsUrl(NAME138)
33623
+ url: docsUrl(NAME139)
33377
33624
  },
33378
33625
  schema: [],
33379
33626
  messages: {
@@ -33417,7 +33664,7 @@ var require_static_next_matcher_default = defineRule({
33417
33664
  });
33418
33665
 
33419
33666
  // src/rules/require-svg-accessible-name.ts
33420
- var NAME139 = "require-svg-accessible-name";
33667
+ var NAME140 = "require-svg-accessible-name";
33421
33668
  var DECORATIVE_ROLES = /* @__PURE__ */ new Set(["none", "presentation"]);
33422
33669
  var NAME_ATTRIBUTES = ["aria-label", "aria-labelledby"];
33423
33670
  var NO_ICON_MODULES = [];
@@ -33426,7 +33673,7 @@ var require_svg_accessible_name_default = defineRule({
33426
33673
  type: "problem",
33427
33674
  docs: {
33428
33675
  description: "Require a name or explicit decorative semantics on inline SVG elements.",
33429
- url: docsUrl(NAME139)
33676
+ url: docsUrl(NAME140)
33430
33677
  },
33431
33678
  schema: [],
33432
33679
  messages: {
@@ -33458,7 +33705,7 @@ var require_svg_accessible_name_default = defineRule({
33458
33705
  });
33459
33706
 
33460
33707
  // src/rules/require-use-form-default-values.ts
33461
- var NAME140 = "require-use-form-default-values";
33708
+ var NAME141 = "require-use-form-default-values";
33462
33709
  var UNSAFE_FORM_MEMBERS = /* @__PURE__ */ new Set(["__defineGetter__", "__defineSetter__", "__proto__", "valueOf"]);
33463
33710
  function staticPropertyName2(property) {
33464
33711
  return property.computed ? null : getPropertyName(property);
@@ -33501,7 +33748,7 @@ var require_use_form_default_values_default = defineRule({
33501
33748
  type: "problem",
33502
33749
  docs: {
33503
33750
  description: "Require explicit form-level initialization or a field default for directly bound Controller fields.",
33504
- url: docsUrl(NAME140)
33751
+ url: docsUrl(NAME141)
33505
33752
  },
33506
33753
  schema: [],
33507
33754
  messages: { requireUseFormDefaultValues: "Add non-undefined defaultValues/values to the associated useForm call or non-undefined defaultValue to this field." }
@@ -33640,7 +33887,7 @@ var require_use_form_default_values_default = defineRule({
33640
33887
  });
33641
33888
 
33642
33889
  // src/rules/require-use-server-in-actions-file.ts
33643
- var NAME141 = "require-use-server-in-actions-file";
33890
+ var NAME142 = "require-use-server-in-actions-file";
33644
33891
  var ACTION_MODULE_RE = /(?:^|\/)app\/.*\/(?:actions|[^/]+-actions)\.[cm]?[jt]s$/u;
33645
33892
  function isUseServerDirective2(statement) {
33646
33893
  return statement.type === "ExpressionStatement" && statement.directive === "use server";
@@ -33661,7 +33908,7 @@ var require_use_server_in_actions_file_default = defineRule({
33661
33908
  type: "problem",
33662
33909
  docs: {
33663
33910
  description: "route action module missing the use server directive",
33664
- url: docsUrl(NAME141)
33911
+ url: docsUrl(NAME142)
33665
33912
  },
33666
33913
  schema: [],
33667
33914
  messages: {
@@ -33687,7 +33934,7 @@ var require_use_server_in_actions_file_default = defineRule({
33687
33934
  });
33688
33935
 
33689
33936
  // src/rules/require-zod-form-validation.ts
33690
- var NAME142 = "require-zod-form-validation";
33937
+ var NAME143 = "require-zod-form-validation";
33691
33938
  var ZOD_PARSE_METHODS = /* @__PURE__ */ new Set([
33692
33939
  "parse",
33693
33940
  "safeParse",
@@ -33746,7 +33993,7 @@ var require_zod_form_validation_default = defineRule({
33746
33993
  type: "problem",
33747
33994
  docs: {
33748
33995
  description: "Require Zod validation (`Schema.parse(...)` / `Schema.safeParse(...)`) when reading values out of a `FormData` object.",
33749
- url: docsUrl(NAME142)
33996
+ url: docsUrl(NAME143)
33750
33997
  },
33751
33998
  schema: [],
33752
33999
  messages: {
@@ -34034,7 +34281,7 @@ function declaresFramework(metadata, name) {
34034
34281
  }
34035
34282
 
34036
34283
  // src/rules/sole-export-matches-filename.ts
34037
- var NAME143 = "sole-export-matches-filename";
34284
+ var NAME144 = "sole-export-matches-filename";
34038
34285
  var EXCLUDED_STEMS = /* @__PURE__ */ new Set(["global", "index", "types"]);
34039
34286
  function stem3(filename) {
34040
34287
  const base = filename.replaceAll("\\", "/").split("/").at(-1) ?? "";
@@ -34048,7 +34295,7 @@ var sole_export_matches_filename_default = defineRule({
34048
34295
  type: "suggestion",
34049
34296
  docs: {
34050
34297
  description: "Make a module filename reflect its sole named public runtime export.",
34051
- url: docsUrl(NAME143)
34298
+ url: docsUrl(NAME144)
34052
34299
  },
34053
34300
  schema: [],
34054
34301
  messages: {
@@ -34791,7 +35038,7 @@ var stepdown_default = defineRule({
34791
35038
  });
34792
35039
 
34793
35040
  // src/rules/store-insert-requires-on-conflict.ts
34794
- var NAME144 = "store-insert-requires-on-conflict";
35041
+ var NAME145 = "store-insert-requires-on-conflict";
34795
35042
  var INSERT_WRITE = /\bINSERT\s+(?:OR\s+\w+\s+)?INTO\s+[\w."'`?$:@-]+\s*(?:\([^)]*\)\s*)?(?:VALUES|SELECT|DEFAULT\s+VALUES)\b/i;
34796
35043
  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
35044
  var REPLAY_CONTRACT_NAME = /(?:enqueue|ensure|migrate|recordOnce|schedule|seed|upsert|getOrCreate|createIfAbsent|insertIfAbsent)/i;
@@ -34820,7 +35067,7 @@ var store_insert_requires_on_conflict_default = defineRule({
34820
35067
  type: "problem",
34821
35068
  docs: {
34822
35069
  description: "Review conflict handling for embedded inserts in replay-named callables.",
34823
- url: docsUrl(NAME144)
35070
+ url: docsUrl(NAME145)
34824
35071
  },
34825
35072
  schema: [],
34826
35073
  messages: {
@@ -34845,7 +35092,7 @@ var store_insert_requires_on_conflict_default = defineRule({
34845
35092
  });
34846
35093
 
34847
35094
  // src/rules/test-loops-over-literal-cases.ts
34848
- var NAME145 = "test-loops-over-literal-cases";
35095
+ var NAME146 = "test-loops-over-literal-cases";
34849
35096
  var TEST_CALLERS3 = /* @__PURE__ */ new Set(["it", "test"]);
34850
35097
  var TEST_MODIFIERS6 = /* @__PURE__ */ new Set(["concurrent", "fails", "only", "sequential", "skip"]);
34851
35098
  var ASSERTION_ROOTS = /* @__PURE__ */ new Set([
@@ -34941,7 +35188,7 @@ var test_loops_over_literal_cases_default = defineRule({
34941
35188
  type: "suggestion",
34942
35189
  docs: {
34943
35190
  description: "Disallow assertions over an inline literal case loop in a test; parameterization reports and names every case independently.",
34944
- url: docsUrl(NAME145)
35191
+ url: docsUrl(NAME146)
34945
35192
  },
34946
35193
  schema: [],
34947
35194
  messages: {
@@ -35005,7 +35252,7 @@ var test_loops_over_literal_cases_default = defineRule({
35005
35252
  });
35006
35253
 
35007
35254
  // src/rules/test-phase-label-comment.ts
35008
- var NAME146 = "test-phase-label-comment";
35255
+ var NAME147 = "test-phase-label-comment";
35009
35256
  var PHASE_WORD = String.raw`arrange|act|assert(?:ion)?s?|given|when|then|exercise|execute|verif(?:y|ication)|cleanup|prepare|sanity(?:\s+check)?`;
35010
35257
  var PHASE_RE = new RegExp(
35011
35258
  String.raw`^[-=~*_#.\s]{0,40}(?:${PHASE_WORD})(?:\s*(?:[/&+,|]|->|and)\s*(?:${PHASE_WORD}))*[-=~*_#.\s:;!–—]{0,40}$`,
@@ -35033,7 +35280,7 @@ var test_phase_label_comment_default = defineRule({
35033
35280
  fixable: "code",
35034
35281
  docs: {
35035
35282
  description: "Tests must not use bare Arrange, Act, Assert, Given, When, or Then phase comments.",
35036
- url: docsUrl(NAME146)
35283
+ url: docsUrl(NAME147)
35037
35284
  },
35038
35285
  schema: [],
35039
35286
  messages: { removeLabel: "Bare test phase label \u2014 delete it and let the test names and helpers carry the structure." }
@@ -35174,6 +35421,7 @@ var RULES = {
35174
35421
  "no-zod-native-enum": no_zod_native_enum_default,
35175
35422
  "no-zod-parse-typed-object": no_zod_parse_typed_object_default,
35176
35423
  "prefer-await-in-async-return": prefer_await_in_async_return_default,
35424
+ "prefer-coded-error-result": prefer_coded_error_result_default,
35177
35425
  "prefer-constant-time-secret-compare": prefer_constant_time_secret_compare_default,
35178
35426
  "prefer-dependency-interface": prefer_dependency_interface_default,
35179
35427
  "prefer-discriminated-union": prefer_discriminated_union_default,