@sarj/eslint-plugin 15.27.0 → 15.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -15710,8 +15710,134 @@ var prefer_multi_value_zod_literal_default = createRule({
15710
15710
  }
15711
15711
  });
15712
15712
 
15713
+ // src/rules/prefer-nominal-id-types.ts
15714
+ import { AST_NODE_TYPES as AST_NODE_TYPES75, ASTUtils as ASTUtils35 } from "@typescript-eslint/utils";
15715
+ var OPERATIONAL_ROLES = /* @__PURE__ */ new Set([
15716
+ "request",
15717
+ "trace",
15718
+ "span",
15719
+ "correlation",
15720
+ "process",
15721
+ "thread",
15722
+ "timeout",
15723
+ "interval"
15724
+ ]);
15725
+ var MAX_ALIAS_DEPTH = 16;
15726
+ var PREFER_NOMINAL_ID_TYPES_DOCUMENTATION = {
15727
+ defaultLevel: "warning",
15728
+ summary: "Distinguish identifier roles sharing primitive types at callable boundaries.",
15729
+ rationale: "Two identifier roles represented by the same primitive accept each other's values, so swapped arguments survive type checking. Transparent aliases do not prevent this.",
15730
+ remediation: "Introduce distinct branded identifier types at a validated domain boundary and use them in the callable contract. Keep wire representations primitive until validation; suppress a required external signature locally with a reason.",
15731
+ category: "correctness",
15732
+ limitations: [
15733
+ "Requires two distinct Id/Ids or _id/_ids parameter roles with the same proven string, number, or homogeneous array carrier. Plural names require array carriers. Scalars and arrays remain distinct; object fields, destructuring, tuples, inferred types and generic aliases are not checked.",
15734
+ "Resolves only scope-correct file-local transparent aliases, up to 16 levels. Intersections, imported types, ambiguous declarations and mixed branded/raw pairs are deliberately skipped.",
15735
+ "Generated files and request, trace, span, correlation, process, thread, timeout and interval identifiers are excluded. Raw wire object schemas are not callable boundaries; required external callable signatures need a local suppression. API and adapter paths are not blanket-excluded."
15736
+ ],
15737
+ examples: [
15738
+ { id: "raw-identifiers", title: "Do not accept interchangeable identifiers", outcome: "match", files: [{ path: "src/store.ts", source: "function load(accountId: string, invoiceId: string): void {}" }], focusPath: "src/store.ts", expectedCount: 1, public: true },
15739
+ { id: "branded-identifiers", title: "Distinguish domain identifiers", outcome: "no-match", files: [{ path: "src/store.ts", source: "type AccountId = string & { readonly account: unique symbol }; type InvoiceId = string & { readonly invoice: unique symbol }; function load(accountId: AccountId, invoiceId: InvoiceId): void {}" }], focusPath: "src/store.ts", expectedCount: 0, public: true }
15740
+ ]
15741
+ };
15742
+ function arrayCarrier(carrier) {
15743
+ if (carrier === "string") return "string[]";
15744
+ if (carrier === "number") return "number[]";
15745
+ return void 0;
15746
+ }
15747
+ function isNullish(node) {
15748
+ return node.type === AST_NODE_TYPES75.TSUndefinedKeyword || node.type === AST_NODE_TYPES75.TSNullKeyword || node.type === AST_NODE_TYPES75.TSLiteralType && node.literal.type === AST_NODE_TYPES75.Literal && node.literal.value === null;
15749
+ }
15750
+ function referenceCarrier(node, context, depth) {
15751
+ if (node.typeName.type !== AST_NODE_TYPES75.Identifier) return void 0;
15752
+ const variable = ASTUtils35.findVariable(context.sourceCode.getScope(node), node.typeName.name);
15753
+ const definitions = variable?.defs ?? [];
15754
+ const args = node.typeArguments?.params;
15755
+ if (definitions.length === 0 && ["Array", "ReadonlyArray"].includes(node.typeName.name) && args?.length === 1) {
15756
+ return arrayCarrier(rawCarrier(args[0], context, depth + 1));
15757
+ }
15758
+ if (args !== void 0 || definitions.length !== 1) return void 0;
15759
+ const declaration = definitions[0]?.node;
15760
+ if (declaration?.type !== AST_NODE_TYPES75.TSTypeAliasDeclaration || declaration.typeParameters !== void 0) return void 0;
15761
+ return rawCarrier(declaration.typeAnnotation, context, depth + 1);
15762
+ }
15763
+ function rawCarrier(node, context, depth = 0) {
15764
+ if (node === void 0 || depth >= MAX_ALIAS_DEPTH) return void 0;
15765
+ switch (node.type) {
15766
+ case AST_NODE_TYPES75.TSStringKeyword:
15767
+ return "string";
15768
+ case AST_NODE_TYPES75.TSNumberKeyword:
15769
+ return "number";
15770
+ case AST_NODE_TYPES75.TSArrayType:
15771
+ return arrayCarrier(rawCarrier(node.elementType, context, depth + 1));
15772
+ case AST_NODE_TYPES75.TSTypeOperator:
15773
+ return node.operator === "readonly" ? rawCarrier(node.typeAnnotation, context, depth + 1) : void 0;
15774
+ case AST_NODE_TYPES75.TSUnionType: {
15775
+ const members = node.types.filter((member) => !isNullish(member));
15776
+ if (members.length !== 1) return void 0;
15777
+ return rawCarrier(members[0], context, depth + 1);
15778
+ }
15779
+ case AST_NODE_TYPES75.TSTypeReference:
15780
+ return referenceCarrier(node, context, depth);
15781
+ default:
15782
+ return void 0;
15783
+ }
15784
+ }
15785
+ function checkBoundary(node, context) {
15786
+ const roles = /* @__PURE__ */ new Map();
15787
+ for (const parameter of node.params) {
15788
+ const identifier = parameterIdentifier(parameter);
15789
+ if (identifier?.typeAnnotation === void 0) continue;
15790
+ const role = identifierRole(identifier.name);
15791
+ if (role === void 0) continue;
15792
+ const carrier = rawCarrier(identifier.typeAnnotation.typeAnnotation, context);
15793
+ if (carrier === void 0 || /(?:Ids|_ids)$/u.test(identifier.name) && !carrier.endsWith("[]")) continue;
15794
+ const previous = roles.get(carrier);
15795
+ if (previous !== void 0 && previous !== role) {
15796
+ context.report({ node: identifier, messageId: "preferNominalIds" });
15797
+ return;
15798
+ }
15799
+ roles.set(carrier, role);
15800
+ }
15801
+ }
15802
+ function identifierRole(name) {
15803
+ const match = /^(.*?)(?:Ids?|_ids?)$/u.exec(name);
15804
+ const stem4 = match?.[1];
15805
+ if (stem4 === void 0 || stem4.length === 0) return void 0;
15806
+ const role = stem4.replaceAll("_", "").toLowerCase();
15807
+ return OPERATIONAL_ROLES.has(role) ? void 0 : role;
15808
+ }
15809
+ function parameterIdentifier(parameter) {
15810
+ if (parameter.type === AST_NODE_TYPES75.Identifier) return parameter;
15811
+ if (parameter.type === AST_NODE_TYPES75.AssignmentPattern && parameter.left.type === AST_NODE_TYPES75.Identifier) return parameter.left;
15812
+ if (parameter.type === AST_NODE_TYPES75.TSParameterProperty) return parameterIdentifier(parameter.parameter);
15813
+ return void 0;
15814
+ }
15815
+ var prefer_nominal_id_types_default = createRule({
15816
+ name: "prefer-nominal-id-types",
15817
+ documentation: PREFER_NOMINAL_ID_TYPES_DOCUMENTATION,
15818
+ meta: {
15819
+ type: "suggestion",
15820
+ docs: { description: "Distinguish identifier roles sharing primitive types at callable boundaries." },
15821
+ schema: [],
15822
+ messages: { preferNominalIds: "Distinct identifier roles share an interchangeable primitive type. Use distinct branded identifier types at this callable boundary." }
15823
+ },
15824
+ defaultOptions: [],
15825
+ create(context) {
15826
+ if (isGeneratedFile(context.filename, context.sourceCode.text)) return {};
15827
+ return {
15828
+ ArrowFunctionExpression: (node) => checkBoundary(node, context),
15829
+ FunctionDeclaration: (node) => checkBoundary(node, context),
15830
+ FunctionExpression: (node) => checkBoundary(node, context),
15831
+ TSDeclareFunction: (node) => checkBoundary(node, context),
15832
+ TSEmptyBodyFunctionExpression: (node) => checkBoundary(node, context),
15833
+ TSFunctionType: (node) => checkBoundary(node, context),
15834
+ TSMethodSignature: (node) => checkBoundary(node, context)
15835
+ };
15836
+ }
15837
+ });
15838
+
15713
15839
  // src/rules/prefer-named-callback-domain.ts
15714
- import { AST_NODE_TYPES as AST_NODE_TYPES75 } from "@typescript-eslint/utils";
15840
+ import { AST_NODE_TYPES as AST_NODE_TYPES76 } from "@typescript-eslint/utils";
15715
15841
  var PREFER_NAMED_CALLBACK_DOMAIN_DOCUMENTATION = {
15716
15842
  summary: "Name literal-union domains used by callbacks in exported contracts.",
15717
15843
  rationale: "An inline callback domain hides a reusable vocabulary at the point where callers and implementations must agree.",
@@ -15724,13 +15850,13 @@ var PREFER_NAMED_CALLBACK_DOMAIN_DOCUMENTATION = {
15724
15850
  ]
15725
15851
  };
15726
15852
  function isLiteralUnion(node) {
15727
- return node.type === AST_NODE_TYPES75.TSUnionType && node.types.length >= 2 && node.types.every((part) => part.type === AST_NODE_TYPES75.TSLiteralType);
15853
+ return node.type === AST_NODE_TYPES76.TSUnionType && node.types.length >= 2 && node.types.every((part) => part.type === AST_NODE_TYPES76.TSLiteralType);
15728
15854
  }
15729
15855
  function exportedContract(node) {
15730
15856
  let current = node;
15731
15857
  while (current !== void 0) {
15732
- if (current.type === AST_NODE_TYPES75.TSTypeAliasDeclaration || current.type === AST_NODE_TYPES75.TSInterfaceDeclaration) return current.parent.type === AST_NODE_TYPES75.ExportNamedDeclaration;
15733
- if (current.type === AST_NODE_TYPES75.Program) return false;
15858
+ if (current.type === AST_NODE_TYPES76.TSTypeAliasDeclaration || current.type === AST_NODE_TYPES76.TSInterfaceDeclaration) return current.parent.type === AST_NODE_TYPES76.ExportNamedDeclaration;
15859
+ if (current.type === AST_NODE_TYPES76.Program) return false;
15734
15860
  current = current.parent ?? void 0;
15735
15861
  }
15736
15862
  return false;
@@ -15751,7 +15877,7 @@ var prefer_named_callback_domain_default = createRule({
15751
15877
  TSFunctionType(node) {
15752
15878
  if (!exportedContract(node)) return;
15753
15879
  for (const parameter of node.params) {
15754
- if (parameter.type !== AST_NODE_TYPES75.TSParameterProperty && parameter.typeAnnotation !== void 0 && isLiteralUnion(parameter.typeAnnotation.typeAnnotation)) {
15880
+ if (parameter.type !== AST_NODE_TYPES76.TSParameterProperty && parameter.typeAnnotation !== void 0 && isLiteralUnion(parameter.typeAnnotation.typeAnnotation)) {
15755
15881
  context.report({ node: parameter.typeAnnotation.typeAnnotation, messageId: "nameCallbackDomain" });
15756
15882
  }
15757
15883
  }
@@ -15761,7 +15887,7 @@ var prefer_named_callback_domain_default = createRule({
15761
15887
  });
15762
15888
 
15763
15889
  // src/rules/prefer-named-complex-return-type.ts
15764
- import { AST_NODE_TYPES as AST_NODE_TYPES76 } from "@typescript-eslint/utils";
15890
+ import { AST_NODE_TYPES as AST_NODE_TYPES77 } from "@typescript-eslint/utils";
15765
15891
  var PREFER_NAMED_COMPLEX_RETURN_TYPE_DOCUMENTATION = {
15766
15892
  defaultLevel: "warning",
15767
15893
  summary: "Prefer a named contract for structurally complex function return types.",
@@ -15778,7 +15904,7 @@ var PREFER_NAMED_COMPLEX_RETURN_TYPE_DOCUMENTATION = {
15778
15904
  ]
15779
15905
  };
15780
15906
  function unwrap5(node) {
15781
- if (node.type === AST_NODE_TYPES76.TSTypeReference && node.typeArguments?.params.length === 1) {
15907
+ if (node.type === AST_NODE_TYPES77.TSTypeReference && node.typeArguments?.params.length === 1) {
15782
15908
  const [inner] = node.typeArguments.params;
15783
15909
  if (inner !== void 0) return unwrap5(inner);
15784
15910
  }
@@ -15792,9 +15918,9 @@ function report(context, node) {
15792
15918
  }
15793
15919
  function isComplex(node) {
15794
15920
  const type = unwrap5(node);
15795
- if (type.type === AST_NODE_TYPES76.TSTypeLiteral) return type.members.length >= 3;
15796
- if (type.type !== AST_NODE_TYPES76.TSUnionType || type.types.length < 3) return false;
15797
- return type.types.every((member) => unwrap5(member).type === AST_NODE_TYPES76.TSTypeLiteral);
15921
+ if (type.type === AST_NODE_TYPES77.TSTypeLiteral) return type.members.length >= 3;
15922
+ if (type.type !== AST_NODE_TYPES77.TSUnionType || type.types.length < 3) return false;
15923
+ return type.types.every((member) => unwrap5(member).type === AST_NODE_TYPES77.TSTypeLiteral);
15798
15924
  }
15799
15925
  var prefer_named_complex_return_type_default = createRule({
15800
15926
  name: "prefer-named-complex-return-type",
@@ -15821,7 +15947,7 @@ var prefer_named_complex_return_type_default = createRule({
15821
15947
  });
15822
15948
 
15823
15949
  // src/rules/prefer-native-random-uuid.ts
15824
- import { AST_NODE_TYPES as AST_NODE_TYPES77, ASTUtils as ASTUtils35 } from "@typescript-eslint/utils";
15950
+ import { AST_NODE_TYPES as AST_NODE_TYPES78, ASTUtils as ASTUtils36 } from "@typescript-eslint/utils";
15825
15951
  var PREFER_NATIVE_RANDOM_UUID_DOCUMENTATION = {
15826
15952
  summary: "Prefer `globalThis.crypto.randomUUID()` over resolved zero-argument UUID v4 bindings from the `uuid` package.",
15827
15953
  rationale: "The platform implementation avoids an unnecessary dependency for standard random UUID generation.",
@@ -15835,7 +15961,7 @@ var PREFER_NATIVE_RANDOM_UUID_DOCUMENTATION = {
15835
15961
  ]
15836
15962
  };
15837
15963
  function requireUuid(node) {
15838
- return node?.type === AST_NODE_TYPES77.CallExpression && node.callee.type === AST_NODE_TYPES77.Identifier && node.callee.name === "require" && node.arguments.length === 1 && node.arguments[0]?.type === AST_NODE_TYPES77.Literal && node.arguments[0].value === "uuid";
15964
+ return node?.type === AST_NODE_TYPES78.CallExpression && node.callee.type === AST_NODE_TYPES78.Identifier && node.callee.name === "require" && node.arguments.length === 1 && node.arguments[0]?.type === AST_NODE_TYPES78.Literal && node.arguments[0].value === "uuid";
15839
15965
  }
15840
15966
  var prefer_native_random_uuid_default = createRule({
15841
15967
  name: "prefer-native-random-uuid",
@@ -15857,14 +15983,14 @@ var prefer_native_random_uuid_default = createRule({
15857
15983
  const directBindings = /* @__PURE__ */ new Set();
15858
15984
  const namespaceBindings = /* @__PURE__ */ new Set();
15859
15985
  function resolve2(identifier) {
15860
- return ASTUtils35.findVariable(context.sourceCode.getScope(identifier), identifier.name);
15986
+ return ASTUtils36.findVariable(context.sourceCode.getScope(identifier), identifier.name);
15861
15987
  }
15862
15988
  function record(identifier, destination) {
15863
15989
  const variable = resolve2(identifier);
15864
15990
  if (variable !== null) destination.add(variable);
15865
15991
  }
15866
15992
  function report2(node) {
15867
- const globalBinding = ASTUtils35.findVariable(context.sourceCode.getScope(node), "globalThis");
15993
+ const globalBinding = ASTUtils36.findVariable(context.sourceCode.getScope(node), "globalThis");
15868
15994
  const canSuggest = (globalBinding?.defs.length ?? 0) === 0 && context.sourceCode.getCommentsInside(node).length === 0;
15869
15995
  context.report({
15870
15996
  node,
@@ -15881,37 +16007,37 @@ var prefer_native_random_uuid_default = createRule({
15881
16007
  ImportDeclaration(node) {
15882
16008
  if (node.source.value !== "uuid") return;
15883
16009
  for (const specifier of node.specifiers) {
15884
- if (specifier.type === AST_NODE_TYPES77.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES77.Identifier ? specifier.imported.name === "v4" : specifier.imported.value === "v4")) {
16010
+ if (specifier.type === AST_NODE_TYPES78.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES78.Identifier ? specifier.imported.name === "v4" : specifier.imported.value === "v4")) {
15885
16011
  record(specifier.local, directBindings);
15886
- } else if (specifier.type === AST_NODE_TYPES77.ImportNamespaceSpecifier) {
16012
+ } else if (specifier.type === AST_NODE_TYPES78.ImportNamespaceSpecifier) {
15887
16013
  record(specifier.local, namespaceBindings);
15888
16014
  }
15889
16015
  }
15890
16016
  },
15891
16017
  VariableDeclarator(node) {
15892
16018
  if (node.parent.kind !== "const" || !requireUuid(node.init)) return;
15893
- if (node.init?.type !== AST_NODE_TYPES77.CallExpression || node.init.callee.type !== AST_NODE_TYPES77.Identifier || (resolve2(node.init.callee)?.defs.length ?? 0) > 0) {
16019
+ if (node.init?.type !== AST_NODE_TYPES78.CallExpression || node.init.callee.type !== AST_NODE_TYPES78.Identifier || (resolve2(node.init.callee)?.defs.length ?? 0) > 0) {
15894
16020
  return;
15895
16021
  }
15896
- if (node.id.type === AST_NODE_TYPES77.Identifier) {
16022
+ if (node.id.type === AST_NODE_TYPES78.Identifier) {
15897
16023
  record(node.id, namespaceBindings);
15898
16024
  return;
15899
16025
  }
15900
- if (node.id.type !== AST_NODE_TYPES77.ObjectPattern) return;
16026
+ if (node.id.type !== AST_NODE_TYPES78.ObjectPattern) return;
15901
16027
  for (const property of node.id.properties) {
15902
- if (property.type === AST_NODE_TYPES77.Property && !property.computed && (property.key.type === AST_NODE_TYPES77.Identifier && property.key.name === "v4" || property.key.type === AST_NODE_TYPES77.Literal && property.key.value === "v4") && property.value.type === AST_NODE_TYPES77.Identifier) {
16028
+ if (property.type === AST_NODE_TYPES78.Property && !property.computed && (property.key.type === AST_NODE_TYPES78.Identifier && property.key.name === "v4" || property.key.type === AST_NODE_TYPES78.Literal && property.key.value === "v4") && property.value.type === AST_NODE_TYPES78.Identifier) {
15903
16029
  record(property.value, directBindings);
15904
16030
  }
15905
16031
  }
15906
16032
  },
15907
16033
  "CallExpression:exit"(node) {
15908
16034
  if (node.arguments.length !== 0) return;
15909
- if (node.callee.type === AST_NODE_TYPES77.Identifier) {
16035
+ if (node.callee.type === AST_NODE_TYPES78.Identifier) {
15910
16036
  const variable2 = resolve2(node.callee);
15911
16037
  if (variable2 !== null && directBindings.has(variable2)) report2(node);
15912
16038
  return;
15913
16039
  }
15914
- if (node.callee.type !== AST_NODE_TYPES77.MemberExpression || node.callee.computed || node.callee.object.type !== AST_NODE_TYPES77.Identifier || node.callee.property.type !== AST_NODE_TYPES77.Identifier || node.callee.property.name !== "v4") {
16040
+ if (node.callee.type !== AST_NODE_TYPES78.MemberExpression || node.callee.computed || node.callee.object.type !== AST_NODE_TYPES78.Identifier || node.callee.property.type !== AST_NODE_TYPES78.Identifier || node.callee.property.name !== "v4") {
15915
16041
  return;
15916
16042
  }
15917
16043
  const variable = resolve2(node.callee.object);
@@ -15922,7 +16048,7 @@ var prefer_native_random_uuid_default = createRule({
15922
16048
  });
15923
16049
 
15924
16050
  // src/rules/prefer-node-crypto-hash.ts
15925
- import { AST_NODE_TYPES as AST_NODE_TYPES78, ASTUtils as ASTUtils36 } from "@typescript-eslint/utils";
16051
+ import { AST_NODE_TYPES as AST_NODE_TYPES79, ASTUtils as ASTUtils37 } from "@typescript-eslint/utils";
15926
16052
  var PREFER_NODE_CRYPTO_HASH_DOCUMENTATION = {
15927
16053
  defaultLevel: "warning",
15928
16054
  summary: "Prefer the modern one-shot node:crypto hash API when streaming state is unnecessary.",
@@ -15941,33 +16067,33 @@ var PREFER_NODE_CRYPTO_HASH_DOCUMENTATION = {
15941
16067
  ]
15942
16068
  };
15943
16069
  function memberName5(node) {
15944
- if (!node.computed && node.property.type === AST_NODE_TYPES78.Identifier) return node.property.name;
15945
- if (node.computed && node.property.type === AST_NODE_TYPES78.Literal && typeof node.property.value === "string") {
16070
+ if (!node.computed && node.property.type === AST_NODE_TYPES79.Identifier) return node.property.name;
16071
+ if (node.computed && node.property.type === AST_NODE_TYPES79.Literal && typeof node.property.value === "string") {
15946
16072
  return node.property.value;
15947
16073
  }
15948
16074
  return null;
15949
16075
  }
15950
16076
  function isCryptoLoader(node, resolve2) {
15951
- if (node.type !== AST_NODE_TYPES78.CallExpression || node.arguments.length !== 1) return false;
16077
+ if (node.type !== AST_NODE_TYPES79.CallExpression || node.arguments.length !== 1) return false;
15952
16078
  const [argument] = node.arguments;
15953
- if (argument === void 0 || argument.type === AST_NODE_TYPES78.SpreadElement || !isCryptoSpecifier(argument)) {
16079
+ if (argument === void 0 || argument.type === AST_NODE_TYPES79.SpreadElement || !isCryptoSpecifier(argument)) {
15954
16080
  return false;
15955
16081
  }
15956
- if (node.callee.type === AST_NODE_TYPES78.Identifier) {
16082
+ if (node.callee.type === AST_NODE_TYPES79.Identifier) {
15957
16083
  return node.callee.name === "require" && isUnshadowedBuiltinIdentifier(node.callee, resolve2);
15958
16084
  }
15959
- return node.callee.type === AST_NODE_TYPES78.MemberExpression && node.callee.object.type === AST_NODE_TYPES78.Identifier && node.callee.object.name === "process" && isUnshadowedBuiltinIdentifier(node.callee.object, resolve2) && memberName5(node.callee) === "getBuiltinModule";
16085
+ return node.callee.type === AST_NODE_TYPES79.MemberExpression && node.callee.object.type === AST_NODE_TYPES79.Identifier && node.callee.object.name === "process" && isUnshadowedBuiltinIdentifier(node.callee.object, resolve2) && memberName5(node.callee) === "getBuiltinModule";
15960
16086
  }
15961
16087
  function isCryptoSpecifier(node) {
15962
- return node.type === AST_NODE_TYPES78.Literal && (node.value === "crypto" || node.value === "node:crypto");
16088
+ return node.type === AST_NODE_TYPES79.Literal && (node.value === "crypto" || node.value === "node:crypto");
15963
16089
  }
15964
16090
  function isUnshadowedBuiltinIdentifier(identifier, resolve2) {
15965
16091
  const variable = resolve2(identifier);
15966
16092
  return variable === null || variable.defs.length === 0;
15967
16093
  }
15968
16094
  function propertyName3(node) {
15969
- if (!node.computed && node.key.type === AST_NODE_TYPES78.Identifier) return node.key.name;
15970
- if (node.key.type === AST_NODE_TYPES78.Literal && typeof node.key.value === "string") {
16095
+ if (!node.computed && node.key.type === AST_NODE_TYPES79.Identifier) return node.key.name;
16096
+ if (node.key.type === AST_NODE_TYPES79.Literal && typeof node.key.value === "string") {
15971
16097
  return node.key.value;
15972
16098
  }
15973
16099
  return null;
@@ -15981,7 +16107,7 @@ var prefer_node_crypto_hash_default = createRule({
15981
16107
  const directBindings = /* @__PURE__ */ new Set();
15982
16108
  const namespaceBindings = /* @__PURE__ */ new Set();
15983
16109
  function resolve2(identifier) {
15984
- return ASTUtils36.findVariable(
16110
+ return ASTUtils37.findVariable(
15985
16111
  context.sourceCode.getScope(identifier),
15986
16112
  identifier.name
15987
16113
  );
@@ -15994,9 +16120,9 @@ var prefer_node_crypto_hash_default = createRule({
15994
16120
  ImportDeclaration(node) {
15995
16121
  if (node.source.value !== "crypto" && node.source.value !== "node:crypto") return;
15996
16122
  for (const specifier of node.specifiers) {
15997
- if (specifier.type === AST_NODE_TYPES78.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES78.ImportDefaultSpecifier) {
16123
+ if (specifier.type === AST_NODE_TYPES79.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES79.ImportDefaultSpecifier) {
15998
16124
  record(specifier.local, namespaceBindings);
15999
- } else if (specifier.type === AST_NODE_TYPES78.ImportSpecifier && importedName6(specifier.imported) === "createHash") {
16125
+ } else if (specifier.type === AST_NODE_TYPES79.ImportSpecifier && importedName6(specifier.imported) === "createHash") {
16000
16126
  record(specifier.local, directBindings);
16001
16127
  }
16002
16128
  }
@@ -16005,13 +16131,13 @@ var prefer_node_crypto_hash_default = createRule({
16005
16131
  if (node.parent.kind !== "const" || node.init === null || !isCryptoLoader(node.init, resolve2)) {
16006
16132
  return;
16007
16133
  }
16008
- if (node.id.type === AST_NODE_TYPES78.Identifier) {
16134
+ if (node.id.type === AST_NODE_TYPES79.Identifier) {
16009
16135
  record(node.id, namespaceBindings);
16010
16136
  return;
16011
16137
  }
16012
- if (node.id.type !== AST_NODE_TYPES78.ObjectPattern) return;
16138
+ if (node.id.type !== AST_NODE_TYPES79.ObjectPattern) return;
16013
16139
  for (const property of node.id.properties) {
16014
- if (property.type === AST_NODE_TYPES78.Property && propertyName3(property) === "createHash" && property.value.type === AST_NODE_TYPES78.Identifier) {
16140
+ if (property.type === AST_NODE_TYPES79.Property && propertyName3(property) === "createHash" && property.value.type === AST_NODE_TYPES79.Identifier) {
16015
16141
  record(property.value, directBindings);
16016
16142
  }
16017
16143
  }
@@ -16019,10 +16145,10 @@ var prefer_node_crypto_hash_default = createRule({
16019
16145
  CallExpression(node) {
16020
16146
  if (!isMemberCall(node, "digest")) return;
16021
16147
  const update = node.callee.object;
16022
- if (update.type !== AST_NODE_TYPES78.CallExpression || update.arguments.length !== 1 || !isMemberCall(update, "update"))
16148
+ if (update.type !== AST_NODE_TYPES79.CallExpression || update.arguments.length !== 1 || !isMemberCall(update, "update"))
16023
16149
  return;
16024
16150
  const create = update.callee.object;
16025
- if (create.type !== AST_NODE_TYPES78.CallExpression || create.arguments.length !== 1 || create.arguments[0]?.type !== AST_NODE_TYPES78.Literal || typeof create.arguments[0].value !== "string" || !isCreateHashCall(
16151
+ if (create.type !== AST_NODE_TYPES79.CallExpression || create.arguments.length !== 1 || create.arguments[0]?.type !== AST_NODE_TYPES79.Literal || typeof create.arguments[0].value !== "string" || !isCreateHashCall(
16026
16152
  create,
16027
16153
  directBindings,
16028
16154
  namespaceBindings,
@@ -16035,27 +16161,27 @@ var prefer_node_crypto_hash_default = createRule({
16035
16161
  }
16036
16162
  });
16037
16163
  function importedName6(node) {
16038
- return node.type === AST_NODE_TYPES78.Identifier ? node.name : node.value;
16164
+ return node.type === AST_NODE_TYPES79.Identifier ? node.name : node.value;
16039
16165
  }
16040
16166
  function isMemberCall(node, name) {
16041
- return node.callee.type === AST_NODE_TYPES78.MemberExpression && memberName5(node.callee) === name;
16167
+ return node.callee.type === AST_NODE_TYPES79.MemberExpression && memberName5(node.callee) === name;
16042
16168
  }
16043
16169
  function isCreateHashCall(node, directBindings, namespaceBindings, resolve2) {
16044
- if (node.callee.type === AST_NODE_TYPES78.Identifier) {
16170
+ if (node.callee.type === AST_NODE_TYPES79.Identifier) {
16045
16171
  const variable2 = resolve2(node.callee);
16046
16172
  return variable2 !== null && directBindings.has(variable2);
16047
16173
  }
16048
- if (node.callee.type !== AST_NODE_TYPES78.MemberExpression || memberName5(node.callee) !== "createHash") {
16174
+ if (node.callee.type !== AST_NODE_TYPES79.MemberExpression || memberName5(node.callee) !== "createHash") {
16049
16175
  return false;
16050
16176
  }
16051
16177
  if (isCryptoLoader(node.callee.object, resolve2)) return true;
16052
- if (node.callee.object.type !== AST_NODE_TYPES78.Identifier) return false;
16178
+ if (node.callee.object.type !== AST_NODE_TYPES79.Identifier) return false;
16053
16179
  const variable = resolve2(node.callee.object);
16054
16180
  return variable !== null && namespaceBindings.has(variable);
16055
16181
  }
16056
16182
 
16057
16183
  // src/rules/prefer-node-fs-promises.ts
16058
- import { AST_NODE_TYPES as AST_NODE_TYPES79, ASTUtils as ASTUtils37 } from "@typescript-eslint/utils";
16184
+ import { AST_NODE_TYPES as AST_NODE_TYPES80, ASTUtils as ASTUtils38 } from "@typescript-eslint/utils";
16059
16185
  var PREFER_NODE_FS_PROMISES_DOCUMENTATION = {
16060
16186
  defaultLevel: "warning",
16061
16187
  summary: "Prefer promise-based Node.js filesystem APIs over synchronous calls in production modules.",
@@ -16074,30 +16200,30 @@ var PREFER_NODE_FS_PROMISES_DOCUMENTATION = {
16074
16200
  ]
16075
16201
  };
16076
16202
  function memberName6(node) {
16077
- if (!node.computed && node.property.type === AST_NODE_TYPES79.Identifier) return node.property.name;
16078
- if (node.computed && node.property.type === AST_NODE_TYPES79.Literal && typeof node.property.value === "string") {
16203
+ if (!node.computed && node.property.type === AST_NODE_TYPES80.Identifier) return node.property.name;
16204
+ if (node.computed && node.property.type === AST_NODE_TYPES80.Literal && typeof node.property.value === "string") {
16079
16205
  return node.property.value;
16080
16206
  }
16081
16207
  return null;
16082
16208
  }
16083
16209
  function unwrapAwait2(node) {
16084
- return node.type === AST_NODE_TYPES79.AwaitExpression ? node.argument : node;
16210
+ return node.type === AST_NODE_TYPES80.AwaitExpression ? node.argument : node;
16085
16211
  }
16086
16212
  function isFsLoader(node, isGlobal) {
16087
16213
  const expression = unwrapAwait2(node);
16088
- if (expression.type === AST_NODE_TYPES79.ImportExpression) return isFsSpecifier(expression.source);
16089
- if (expression.type !== AST_NODE_TYPES79.CallExpression || expression.arguments.length !== 1) return false;
16214
+ if (expression.type === AST_NODE_TYPES80.ImportExpression) return isFsSpecifier(expression.source);
16215
+ if (expression.type !== AST_NODE_TYPES80.CallExpression || expression.arguments.length !== 1) return false;
16090
16216
  const [argument] = expression.arguments;
16091
- if (argument === void 0 || argument.type === AST_NODE_TYPES79.SpreadElement || !isFsSpecifier(argument)) return false;
16092
- if (expression.callee.type === AST_NODE_TYPES79.Identifier) return expression.callee.name === "require" && isGlobal(expression.callee);
16093
- return expression.callee.type === AST_NODE_TYPES79.MemberExpression && expression.callee.object.type === AST_NODE_TYPES79.Identifier && expression.callee.object.name === "process" && isGlobal(expression.callee.object) && memberName6(expression.callee) === "getBuiltinModule";
16217
+ if (argument === void 0 || argument.type === AST_NODE_TYPES80.SpreadElement || !isFsSpecifier(argument)) return false;
16218
+ if (expression.callee.type === AST_NODE_TYPES80.Identifier) return expression.callee.name === "require" && isGlobal(expression.callee);
16219
+ return expression.callee.type === AST_NODE_TYPES80.MemberExpression && expression.callee.object.type === AST_NODE_TYPES80.Identifier && expression.callee.object.name === "process" && isGlobal(expression.callee.object) && memberName6(expression.callee) === "getBuiltinModule";
16094
16220
  }
16095
16221
  function isFsSpecifier(node) {
16096
- return node.type === AST_NODE_TYPES79.Literal && (node.value === "node:fs" || node.value === "fs");
16222
+ return node.type === AST_NODE_TYPES80.Literal && (node.value === "node:fs" || node.value === "fs");
16097
16223
  }
16098
16224
  function propertyName4(node) {
16099
- if (!node.computed && node.key.type === AST_NODE_TYPES79.Identifier) return node.key.name;
16100
- if (node.key.type === AST_NODE_TYPES79.Literal && typeof node.key.value === "string") return node.key.value;
16225
+ if (!node.computed && node.key.type === AST_NODE_TYPES80.Identifier) return node.key.name;
16226
+ if (node.key.type === AST_NODE_TYPES80.Literal && typeof node.key.value === "string") return node.key.value;
16101
16227
  return null;
16102
16228
  }
16103
16229
  var prefer_node_fs_promises_default = createRule({
@@ -16117,7 +16243,7 @@ var prefer_node_fs_promises_default = createRule({
16117
16243
  if (isTestFile(context.filename) || isGeneratedFile(context.filename, context.sourceCode.text) || normalizedFilename.includes("src/rules/"))
16118
16244
  return {};
16119
16245
  const namespaces = /* @__PURE__ */ new Set();
16120
- const bindingOf = (node) => ASTUtils37.findVariable(context.sourceCode.getScope(node), node.name);
16246
+ const bindingOf = (node) => ASTUtils38.findVariable(context.sourceCode.getScope(node), node.name);
16121
16247
  const isGlobal = (node) => {
16122
16248
  const binding = bindingOf(node);
16123
16249
  return binding === null || binding.defs.length === 0;
@@ -16135,11 +16261,11 @@ var prefer_node_fs_promises_default = createRule({
16135
16261
  if (node.source.value !== "node:fs" && node.source.value !== "fs") return;
16136
16262
  const synchronousImports = [];
16137
16263
  for (const specifier of node.specifiers) {
16138
- if (specifier.type === AST_NODE_TYPES79.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES79.ImportDefaultSpecifier) {
16264
+ if (specifier.type === AST_NODE_TYPES80.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES80.ImportDefaultSpecifier) {
16139
16265
  recordNamespace(specifier.local);
16140
16266
  continue;
16141
16267
  }
16142
- if (specifier.type === AST_NODE_TYPES79.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES79.Identifier && specifier.imported.name.endsWith("Sync")) synchronousImports.push(specifier.imported.name);
16268
+ if (specifier.type === AST_NODE_TYPES80.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES80.Identifier && specifier.imported.name.endsWith("Sync")) synchronousImports.push(specifier.imported.name);
16143
16269
  }
16144
16270
  if (synchronousImports.length > 0) {
16145
16271
  context.report({
@@ -16150,15 +16276,15 @@ var prefer_node_fs_promises_default = createRule({
16150
16276
  }
16151
16277
  },
16152
16278
  VariableDeclarator(node) {
16153
- if (node.init === null || !isFsLoader(node.init, isGlobal) && (node.init.type !== AST_NODE_TYPES79.Identifier || !isNamespace(node.init)))
16279
+ if (node.init === null || !isFsLoader(node.init, isGlobal) && (node.init.type !== AST_NODE_TYPES80.Identifier || !isNamespace(node.init)))
16154
16280
  return;
16155
- if (node.id.type === AST_NODE_TYPES79.Identifier) {
16281
+ if (node.id.type === AST_NODE_TYPES80.Identifier) {
16156
16282
  recordNamespace(node.id);
16157
16283
  return;
16158
16284
  }
16159
- if (node.id.type !== AST_NODE_TYPES79.ObjectPattern) return;
16285
+ if (node.id.type !== AST_NODE_TYPES80.ObjectPattern) return;
16160
16286
  const synchronousImports = node.id.properties.flatMap((property) => {
16161
- if (property.type !== AST_NODE_TYPES79.Property) return [];
16287
+ if (property.type !== AST_NODE_TYPES80.Property) return [];
16162
16288
  const name = propertyName4(property);
16163
16289
  return name?.endsWith("Sync") === true ? [name] : [];
16164
16290
  });
@@ -16174,7 +16300,7 @@ var prefer_node_fs_promises_default = createRule({
16174
16300
  const name = memberName6(node);
16175
16301
  if (name?.endsWith("Sync") !== true) return;
16176
16302
  const object = unwrapAwait2(node.object);
16177
- if (object.type === AST_NODE_TYPES79.Identifier && isNamespace(object) || isFsLoader(object, isGlobal)) {
16303
+ if (object.type === AST_NODE_TYPES80.Identifier && isNamespace(object) || isFsLoader(object, isGlobal)) {
16178
16304
  context.report({ node, messageId: "preferAsyncFs", data: { name } });
16179
16305
  }
16180
16306
  }
@@ -16183,7 +16309,7 @@ var prefer_node_fs_promises_default = createRule({
16183
16309
  });
16184
16310
 
16185
16311
  // src/rules/prefer-non-nullable-collection.ts
16186
- import { AST_NODE_TYPES as AST_NODE_TYPES80, ASTUtils as ASTUtils38 } from "@typescript-eslint/utils";
16312
+ import { AST_NODE_TYPES as AST_NODE_TYPES81, ASTUtils as ASTUtils39 } from "@typescript-eslint/utils";
16187
16313
  var PREFER_NON_NULLABLE_COLLECTION_DOCUMENTATION = {
16188
16314
  summary: "Suggest reviewing nullish arrays that use local empty-array defaults or a shared null-or-empty guard.",
16189
16315
  rationale: "A redundant nullish collection state spreads defaults and guards through consumers without carrying information.",
@@ -16199,33 +16325,33 @@ var ARRAY_TYPE_NAMES = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
16199
16325
  function propertyName5(node) {
16200
16326
  const key = node.key;
16201
16327
  if (node.computed) return null;
16202
- if (key.type === AST_NODE_TYPES80.Identifier) return key.name;
16203
- if (key.type === AST_NODE_TYPES80.Literal && typeof key.value === "string") return key.value;
16328
+ if (key.type === AST_NODE_TYPES81.Identifier) return key.name;
16329
+ if (key.type === AST_NODE_TYPES81.Literal && typeof key.value === "string") return key.value;
16204
16330
  return null;
16205
16331
  }
16206
16332
  function isArrayType(node) {
16207
- if (node.type === AST_NODE_TYPES80.TSArrayType) return true;
16208
- return node.type === AST_NODE_TYPES80.TSTypeReference && node.typeName.type === AST_NODE_TYPES80.Identifier && ARRAY_TYPE_NAMES.has(node.typeName.name);
16333
+ if (node.type === AST_NODE_TYPES81.TSArrayType) return true;
16334
+ return node.type === AST_NODE_TYPES81.TSTypeReference && node.typeName.type === AST_NODE_TYPES81.Identifier && ARRAY_TYPE_NAMES.has(node.typeName.name);
16209
16335
  }
16210
16336
  function nullableProperty(node) {
16211
16337
  if (node.optional) return null;
16212
16338
  const name = propertyName5(node);
16213
16339
  const annotation = node.typeAnnotation?.typeAnnotation;
16214
- if (name === null || annotation?.type !== AST_NODE_TYPES80.TSUnionType) return null;
16340
+ if (name === null || annotation?.type !== AST_NODE_TYPES81.TSUnionType) return null;
16215
16341
  const concrete = annotation.types.filter(
16216
- (member) => member.type !== AST_NODE_TYPES80.TSNullKeyword && member.type !== AST_NODE_TYPES80.TSUndefinedKeyword
16342
+ (member) => member.type !== AST_NODE_TYPES81.TSNullKeyword && member.type !== AST_NODE_TYPES81.TSUndefinedKeyword
16217
16343
  );
16218
16344
  if (concrete.length === 0 || !concrete.every(isArrayType)) return null;
16219
- const acceptsNull = annotation.types.some((member) => member.type === AST_NODE_TYPES80.TSNullKeyword);
16345
+ const acceptsNull = annotation.types.some((member) => member.type === AST_NODE_TYPES81.TSNullKeyword);
16220
16346
  const acceptsUndefined = annotation.types.some(
16221
- (member) => member.type === AST_NODE_TYPES80.TSUndefinedKeyword
16347
+ (member) => member.type === AST_NODE_TYPES81.TSUndefinedKeyword
16222
16348
  );
16223
16349
  if (!acceptsNull && !acceptsUndefined) return null;
16224
16350
  return { name, node, acceptsNull, acceptsUndefined };
16225
16351
  }
16226
16352
  function shapeProperties(members) {
16227
16353
  return members.flatMap((member) => {
16228
- if (member.type !== AST_NODE_TYPES80.TSPropertySignature) return [];
16354
+ if (member.type !== AST_NODE_TYPES81.TSPropertySignature) return [];
16229
16355
  const property = nullableProperty(member);
16230
16356
  return property === null ? [] : [property];
16231
16357
  });
@@ -16233,14 +16359,14 @@ function shapeProperties(members) {
16233
16359
  function typeIndex(program) {
16234
16360
  const index = /* @__PURE__ */ new Map();
16235
16361
  for (const statement of program.body) {
16236
- const exported = statement.type === AST_NODE_TYPES80.ExportNamedDeclaration;
16362
+ const exported = statement.type === AST_NODE_TYPES81.ExportNamedDeclaration;
16237
16363
  const declaration = exported ? statement.declaration : statement;
16238
- if (declaration?.type === AST_NODE_TYPES80.TSInterfaceDeclaration) {
16364
+ if (declaration?.type === AST_NODE_TYPES81.TSInterfaceDeclaration) {
16239
16365
  index.set(declaration.id.name, {
16240
16366
  exported,
16241
16367
  properties: shapeProperties(declaration.body.body)
16242
16368
  });
16243
- } else if (declaration?.type === AST_NODE_TYPES80.TSTypeAliasDeclaration && declaration.typeAnnotation.type === AST_NODE_TYPES80.TSTypeLiteral) {
16369
+ } else if (declaration?.type === AST_NODE_TYPES81.TSTypeAliasDeclaration && declaration.typeAnnotation.type === AST_NODE_TYPES81.TSTypeLiteral) {
16244
16370
  index.set(declaration.id.name, {
16245
16371
  exported,
16246
16372
  properties: shapeProperties(declaration.typeAnnotation.members)
@@ -16250,45 +16376,45 @@ function typeIndex(program) {
16250
16376
  return index;
16251
16377
  }
16252
16378
  function emptyArray(node) {
16253
- return node.type === AST_NODE_TYPES80.ArrayExpression && node.elements.length === 0;
16379
+ return node.type === AST_NODE_TYPES81.ArrayExpression && node.elements.length === 0;
16254
16380
  }
16255
16381
  function sameAccess(node, access) {
16256
16382
  if (access.kind === "identifier") {
16257
- return node.type === AST_NODE_TYPES80.Identifier && node.name === access.name;
16383
+ return node.type === AST_NODE_TYPES81.Identifier && node.name === access.name;
16258
16384
  }
16259
- return node.type === AST_NODE_TYPES80.MemberExpression && !node.computed && node.object.type === AST_NODE_TYPES80.Identifier && node.object.name === access.object && node.property.type === AST_NODE_TYPES80.Identifier && node.property.name === access.property;
16385
+ return node.type === AST_NODE_TYPES81.MemberExpression && !node.computed && node.object.type === AST_NODE_TYPES81.Identifier && node.object.name === access.object && node.property.type === AST_NODE_TYPES81.Identifier && node.property.name === access.property;
16260
16386
  }
16261
16387
  function memberLengthOf(node, access) {
16262
- const target = node.type === AST_NODE_TYPES80.ChainExpression ? node.expression : node;
16263
- return target.type === AST_NODE_TYPES80.MemberExpression && !target.computed && target.property.type === AST_NODE_TYPES80.Identifier && target.property.name === "length" && sameAccess(target.object, access);
16388
+ const target = node.type === AST_NODE_TYPES81.ChainExpression ? node.expression : node;
16389
+ return target.type === AST_NODE_TYPES81.MemberExpression && !target.computed && target.property.type === AST_NODE_TYPES81.Identifier && target.property.name === "length" && sameAccess(target.object, access);
16264
16390
  }
16265
16391
  function optionalMemberLengthOf(node, access) {
16266
- return node.type === AST_NODE_TYPES80.ChainExpression && node.expression.type === AST_NODE_TYPES80.MemberExpression && node.expression.optional && memberLengthOf(node, access);
16392
+ return node.type === AST_NODE_TYPES81.ChainExpression && node.expression.type === AST_NODE_TYPES81.MemberExpression && node.expression.optional && memberLengthOf(node, access);
16267
16393
  }
16268
16394
  function hasEquivalentLeadingGuard(fn, access, visitorKeys) {
16269
- if (fn.body.type !== AST_NODE_TYPES80.BlockStatement) return false;
16395
+ if (fn.body.type !== AST_NODE_TYPES81.BlockStatement) return false;
16270
16396
  const first = fn.body.body[0];
16271
- if (first?.type !== AST_NODE_TYPES80.IfStatement) return false;
16272
- const terminating = first.consequent.type === AST_NODE_TYPES80.ReturnStatement || first.consequent.type === AST_NODE_TYPES80.ThrowStatement || first.consequent.type === AST_NODE_TYPES80.BlockStatement && first.consequent.body.length === 1 && (first.consequent.body[0]?.type === AST_NODE_TYPES80.ReturnStatement || first.consequent.body[0]?.type === AST_NODE_TYPES80.ThrowStatement);
16397
+ if (first?.type !== AST_NODE_TYPES81.IfStatement) return false;
16398
+ const terminating = first.consequent.type === AST_NODE_TYPES81.ReturnStatement || first.consequent.type === AST_NODE_TYPES81.ThrowStatement || first.consequent.type === AST_NODE_TYPES81.BlockStatement && first.consequent.body.length === 1 && (first.consequent.body[0]?.type === AST_NODE_TYPES81.ReturnStatement || first.consequent.body[0]?.type === AST_NODE_TYPES81.ThrowStatement);
16273
16399
  if (!terminating) return false;
16274
16400
  if (contains(first.consequent, visitorKeys, (node) => sameAccess(node, access))) return false;
16275
- if (first.test.type === AST_NODE_TYPES80.UnaryExpression && first.test.operator === "!" && optionalMemberLengthOf(first.test.argument, access)) return true;
16276
- return first.test.type === AST_NODE_TYPES80.LogicalExpression && first.test.operator === "||" && isNullGuard(first.test.left, access) && isEmptyGuard(first.test.right, access);
16401
+ if (first.test.type === AST_NODE_TYPES81.UnaryExpression && first.test.operator === "!" && optionalMemberLengthOf(first.test.argument, access)) return true;
16402
+ return first.test.type === AST_NODE_TYPES81.LogicalExpression && first.test.operator === "||" && isNullGuard(first.test.left, access) && isEmptyGuard(first.test.right, access);
16277
16403
  }
16278
16404
  function isNullGuard(node, access) {
16279
- if (node.type === AST_NODE_TYPES80.UnaryExpression && node.operator === "!" && (sameAccess(node.argument, access) || optionalMemberLengthOf(node.argument, access))) return true;
16280
- if (node.type !== AST_NODE_TYPES80.BinaryExpression || !["==", "==="].includes(node.operator)) {
16405
+ if (node.type === AST_NODE_TYPES81.UnaryExpression && node.operator === "!" && (sameAccess(node.argument, access) || optionalMemberLengthOf(node.argument, access))) return true;
16406
+ if (node.type !== AST_NODE_TYPES81.BinaryExpression || !["==", "==="].includes(node.operator)) {
16281
16407
  return false;
16282
16408
  }
16283
- const nullish = (value) => value.type === AST_NODE_TYPES80.Literal && value.value === null || value.type === AST_NODE_TYPES80.Identifier && value.name === "undefined";
16409
+ const nullish = (value) => value.type === AST_NODE_TYPES81.Literal && value.value === null || value.type === AST_NODE_TYPES81.Identifier && value.name === "undefined";
16284
16410
  return sameAccess(node.left, access) && nullish(node.right) || sameAccess(node.right, access) && nullish(node.left);
16285
16411
  }
16286
16412
  function isEmptyGuard(node, access) {
16287
- if (node.type === AST_NODE_TYPES80.UnaryExpression && node.operator === "!" && memberLengthOf(node.argument, access)) return true;
16288
- if (node.type !== AST_NODE_TYPES80.BinaryExpression || !["==", "===", "<="].includes(node.operator)) {
16413
+ if (node.type === AST_NODE_TYPES81.UnaryExpression && node.operator === "!" && memberLengthOf(node.argument, access)) return true;
16414
+ if (node.type !== AST_NODE_TYPES81.BinaryExpression || !["==", "===", "<="].includes(node.operator)) {
16289
16415
  return false;
16290
16416
  }
16291
- const zero = (value) => value.type === AST_NODE_TYPES80.Literal && value.value === 0;
16417
+ const zero = (value) => value.type === AST_NODE_TYPES81.Literal && value.value === 0;
16292
16418
  return memberLengthOf(node.left, access) && zero(node.right) || node.operator !== "<=" && memberLengthOf(node.right, access) && zero(node.left);
16293
16419
  }
16294
16420
  function contains(node, visitorKeys, predicate) {
@@ -16298,30 +16424,30 @@ function contains(node, visitorKeys, predicate) {
16298
16424
  function belongsToFunction(node, fn) {
16299
16425
  let current = node;
16300
16426
  while (current !== void 0 && current !== fn) {
16301
- if (current !== node && (current.type === AST_NODE_TYPES80.ArrowFunctionExpression || current.type === AST_NODE_TYPES80.FunctionDeclaration || current.type === AST_NODE_TYPES80.FunctionExpression)) return false;
16427
+ if (current !== node && (current.type === AST_NODE_TYPES81.ArrowFunctionExpression || current.type === AST_NODE_TYPES81.FunctionDeclaration || current.type === AST_NODE_TYPES81.FunctionExpression)) return false;
16302
16428
  current = current.parent;
16303
16429
  }
16304
16430
  return current === fn;
16305
16431
  }
16306
16432
  function directlyCoalesced(node) {
16307
16433
  const parent = node.parent;
16308
- return parent?.type === AST_NODE_TYPES80.LogicalExpression && parent.left === node && (parent.operator === "??" || parent.operator === "||") && emptyArray(parent.right);
16434
+ return parent?.type === AST_NODE_TYPES81.LogicalExpression && parent.left === node && (parent.operator === "??" || parent.operator === "||") && emptyArray(parent.right);
16309
16435
  }
16310
16436
  function identifierIsOnlyCoalesced(context, binding, fn) {
16311
- const variable = ASTUtils38.findVariable(context.sourceCode.getScope(binding), binding.name);
16437
+ const variable = ASTUtils39.findVariable(context.sourceCode.getScope(binding), binding.name);
16312
16438
  if (variable === null || variable.references.length === 0) return false;
16313
16439
  return variable.references.every(
16314
16440
  (reference) => belongsToFunction(reference.identifier, fn) && directlyCoalesced(reference.identifier)
16315
16441
  );
16316
16442
  }
16317
16443
  function memberIsOnlyCoalesced(context, object, property, fn) {
16318
- const variable = ASTUtils38.findVariable(context.sourceCode.getScope(object), object.name);
16444
+ const variable = ASTUtils39.findVariable(context.sourceCode.getScope(object), object.name);
16319
16445
  if (variable === null) return false;
16320
16446
  const accesses = variable.references.flatMap((reference) => {
16321
16447
  if (!belongsToFunction(reference.identifier, fn)) return [null];
16322
16448
  const parent = reference.identifier.parent;
16323
- if (parent?.type === AST_NODE_TYPES80.MemberExpression && !parent.computed && parent.object === reference.identifier && parent.property.type === AST_NODE_TYPES80.Identifier && parent.property.name === property) return [parent];
16324
- return parent?.type === AST_NODE_TYPES80.MemberExpression && parent.object === reference.identifier ? [] : [null];
16449
+ if (parent?.type === AST_NODE_TYPES81.MemberExpression && !parent.computed && parent.object === reference.identifier && parent.property.type === AST_NODE_TYPES81.Identifier && parent.property.name === property) return [parent];
16450
+ return parent?.type === AST_NODE_TYPES81.MemberExpression && parent.object === reference.identifier ? [] : [null];
16325
16451
  });
16326
16452
  return accesses.length > 0 && accesses.every((access) => access !== null && directlyCoalesced(access));
16327
16453
  }
@@ -16346,8 +16472,8 @@ var prefer_non_nullable_collection_default = createRule({
16346
16472
  let shapes = /* @__PURE__ */ new Map();
16347
16473
  const evidence = /* @__PURE__ */ new Map();
16348
16474
  function propertiesFor(annotation) {
16349
- if (annotation?.type === AST_NODE_TYPES80.TSTypeLiteral) return shapeProperties(annotation.members);
16350
- if (annotation?.type === AST_NODE_TYPES80.TSTypeReference && annotation.typeName.type === AST_NODE_TYPES80.Identifier) {
16475
+ if (annotation?.type === AST_NODE_TYPES81.TSTypeLiteral) return shapeProperties(annotation.members);
16476
+ if (annotation?.type === AST_NODE_TYPES81.TSTypeReference && annotation.typeName.type === AST_NODE_TYPES81.Identifier) {
16351
16477
  const shape = shapes.get(annotation.typeName.name);
16352
16478
  return shape?.exported === false ? shape.properties : [];
16353
16479
  }
@@ -16360,13 +16486,13 @@ var prefer_non_nullable_collection_default = createRule({
16360
16486
  }
16361
16487
  function checkFunction(fn) {
16362
16488
  function checkParameter(rawParameter) {
16363
- const parameter = rawParameter.type === AST_NODE_TYPES80.AssignmentPattern ? rawParameter.left : rawParameter;
16364
- if (parameter.type === AST_NODE_TYPES80.ObjectPattern) {
16489
+ const parameter = rawParameter.type === AST_NODE_TYPES81.AssignmentPattern ? rawParameter.left : rawParameter;
16490
+ if (parameter.type === AST_NODE_TYPES81.ObjectPattern) {
16365
16491
  const properties2 = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
16366
16492
  checkDestructuredProperties(parameter, properties2);
16367
16493
  return;
16368
16494
  }
16369
- if (parameter.type !== AST_NODE_TYPES80.Identifier) return;
16495
+ if (parameter.type !== AST_NODE_TYPES81.Identifier) return;
16370
16496
  const properties = propertiesFor(parameter.typeAnnotation?.typeAnnotation);
16371
16497
  for (const property of properties) {
16372
16498
  const access = {
@@ -16383,16 +16509,16 @@ var prefer_non_nullable_collection_default = createRule({
16383
16509
  function checkDestructuredProperties(parameter, properties) {
16384
16510
  for (const property of properties) {
16385
16511
  const bindingProperty = parameter.properties.find(
16386
- (entry) => entry.type === AST_NODE_TYPES80.Property && !entry.computed && entry.key.type === AST_NODE_TYPES80.Identifier && entry.key.name === property.name
16512
+ (entry) => entry.type === AST_NODE_TYPES81.Property && !entry.computed && entry.key.type === AST_NODE_TYPES81.Identifier && entry.key.name === property.name
16387
16513
  );
16388
16514
  if (bindingProperty === void 0) continue;
16389
16515
  const value = bindingProperty.value;
16390
- const binding = value.type === AST_NODE_TYPES80.AssignmentPattern ? value.left : value;
16391
- if (binding.type !== AST_NODE_TYPES80.Identifier) {
16516
+ const binding = value.type === AST_NODE_TYPES81.AssignmentPattern ? value.left : value;
16517
+ if (binding.type !== AST_NODE_TYPES81.Identifier) {
16392
16518
  record(property, false);
16393
16519
  continue;
16394
16520
  }
16395
- if (value.type === AST_NODE_TYPES80.AssignmentPattern && emptyArray(value.right) && property.acceptsUndefined && !property.acceptsNull) {
16521
+ if (value.type === AST_NODE_TYPES81.AssignmentPattern && emptyArray(value.right) && property.acceptsUndefined && !property.acceptsNull) {
16396
16522
  record(property, true);
16397
16523
  continue;
16398
16524
  }
@@ -16430,8 +16556,8 @@ var prefer_non_nullable_collection_default = createRule({
16430
16556
 
16431
16557
  // src/rules/prefer-nullish-filter-predicate.ts
16432
16558
  import {
16433
- AST_NODE_TYPES as AST_NODE_TYPES81,
16434
- ASTUtils as ASTUtils39,
16559
+ AST_NODE_TYPES as AST_NODE_TYPES82,
16560
+ ASTUtils as ASTUtils40,
16435
16561
  ESLintUtils as ESLintUtils11
16436
16562
  } from "@typescript-eslint/utils";
16437
16563
  import ts9 from "typescript";
@@ -16477,7 +16603,7 @@ var PREFER_NULLISH_FILTER_PREDICATE_DOCUMENTATION = {
16477
16603
  ]
16478
16604
  };
16479
16605
  function isUnshadowedBoolean(node, context) {
16480
- const variable = ASTUtils39.findVariable(context.sourceCode.getScope(node), node.name);
16606
+ const variable = ASTUtils40.findVariable(context.sourceCode.getScope(node), node.name);
16481
16607
  return variable === null || variable.defs.length === 0;
16482
16608
  }
16483
16609
  function isBuiltinArrayFilter(node, services) {
@@ -16536,7 +16662,7 @@ function isProvablyTruthy(type, checker) {
16536
16662
  }
16537
16663
  function availableParameterName(node, context) {
16538
16664
  for (const name of ["value", "item", "element", "candidate"]) {
16539
- if (ASTUtils39.findVariable(context.sourceCode.getScope(node), name) === null) return name;
16665
+ if (ASTUtils40.findVariable(context.sourceCode.getScope(node), name) === null) return name;
16540
16666
  }
16541
16667
  return null;
16542
16668
  }
@@ -16567,7 +16693,7 @@ var prefer_nullish_filter_predicate_default = createRule({
16567
16693
  CallExpression(node) {
16568
16694
  const callee = node.callee;
16569
16695
  const callback = node.arguments[0];
16570
- if (node.arguments.length !== 1 || callback?.type !== AST_NODE_TYPES81.Identifier || callback.name !== "Boolean" || callee.type !== AST_NODE_TYPES81.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES81.Identifier || callee.property.name !== "filter" || !isUnshadowedBoolean(callback, context) || !isBuiltinArrayFilter(callee, services)) return;
16696
+ if (node.arguments.length !== 1 || callback?.type !== AST_NODE_TYPES82.Identifier || callback.name !== "Boolean" || callee.type !== AST_NODE_TYPES82.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES82.Identifier || callee.property.name !== "filter" || !isUnshadowedBoolean(callback, context) || !isBuiltinArrayFilter(callee, services)) return;
16571
16697
  const elementType = arrayElementType(callee.object, services);
16572
16698
  const checker = services.program.getTypeChecker();
16573
16699
  if (elementType === null || !isNullishPlusTruthy(elementType, checker)) return;
@@ -16590,9 +16716,9 @@ var prefer_nullish_filter_predicate_default = createRule({
16590
16716
 
16591
16717
  // src/rules/prefer-await-in-async-return.ts
16592
16718
  import {
16593
- ASTUtils as ASTUtils40,
16719
+ ASTUtils as ASTUtils41,
16594
16720
  ESLintUtils as ESLintUtils12,
16595
- AST_NODE_TYPES as AST_NODE_TYPES82
16721
+ AST_NODE_TYPES as AST_NODE_TYPES83
16596
16722
  } from "@typescript-eslint/utils";
16597
16723
  import * as ts10 from "typescript";
16598
16724
  var PREFER_AWAIT_IN_ASYNC_RETURN_DOCUMENTATION = {
@@ -16635,10 +16761,10 @@ var PREFER_AWAIT_IN_ASYNC_RETURN_DOCUMENTATION = {
16635
16761
  };
16636
16762
  function directAsyncReturnOwner(node) {
16637
16763
  const parent = node.parent;
16638
- if (parent.type === AST_NODE_TYPES82.ArrowFunctionExpression && parent.body === node) {
16764
+ if (parent.type === AST_NODE_TYPES83.ArrowFunctionExpression && parent.body === node) {
16639
16765
  return parent.async && !parent.generator ? parent : null;
16640
16766
  }
16641
- if (parent.type !== AST_NODE_TYPES82.ReturnStatement || parent.argument !== node) {
16767
+ if (parent.type !== AST_NODE_TYPES83.ReturnStatement || parent.argument !== node) {
16642
16768
  return null;
16643
16769
  }
16644
16770
  let owner = parent.parent;
@@ -16648,15 +16774,15 @@ function directAsyncReturnOwner(node) {
16648
16774
  return owner !== void 0 && owner.async && !owner.generator ? owner : null;
16649
16775
  }
16650
16776
  function isRuntimeFunction(node) {
16651
- return node.type === AST_NODE_TYPES82.ArrowFunctionExpression || node.type === AST_NODE_TYPES82.FunctionDeclaration || node.type === AST_NODE_TYPES82.FunctionExpression;
16777
+ return node.type === AST_NODE_TYPES83.ArrowFunctionExpression || node.type === AST_NODE_TYPES83.FunctionDeclaration || node.type === AST_NODE_TYPES83.FunctionExpression;
16652
16778
  }
16653
16779
  function promiseThenReceiver(node) {
16654
16780
  const callee = node.callee;
16655
- if (callee.type !== AST_NODE_TYPES82.MemberExpression || callee.computed || callee.optional || callee.property.type !== AST_NODE_TYPES82.Identifier || callee.property.name !== "then" || node.optional || node.arguments.length !== 1) {
16781
+ if (callee.type !== AST_NODE_TYPES83.MemberExpression || callee.computed || callee.optional || callee.property.type !== AST_NODE_TYPES83.Identifier || callee.property.name !== "then" || node.optional || node.arguments.length !== 1) {
16656
16782
  return null;
16657
16783
  }
16658
16784
  const callback = node.arguments[0];
16659
- if (callback === void 0 || callback.type !== AST_NODE_TYPES82.ArrowFunctionExpression && callback.type !== AST_NODE_TYPES82.FunctionExpression) {
16785
+ if (callback === void 0 || callback.type !== AST_NODE_TYPES83.ArrowFunctionExpression && callback.type !== AST_NODE_TYPES83.FunctionExpression) {
16660
16786
  return null;
16661
16787
  }
16662
16788
  return callee.object;
@@ -16704,25 +16830,25 @@ var prefer_await_in_async_return_default = createRule({
16704
16830
  if (services === null) return {};
16705
16831
  const frameworkLoaders = /* @__PURE__ */ new Set();
16706
16832
  const rememberFrameworkLoader = (identifier) => {
16707
- const variable = ASTUtils40.findVariable(context.sourceCode.getScope(identifier), identifier.name);
16833
+ const variable = ASTUtils41.findVariable(context.sourceCode.getScope(identifier), identifier.name);
16708
16834
  if (variable !== null) frameworkLoaders.add(variable);
16709
16835
  };
16710
16836
  const isFrameworkLoaderCallback = (owner) => {
16711
16837
  const parent = owner.parent;
16712
- if (parent.type !== AST_NODE_TYPES82.CallExpression || parent.arguments[0] !== owner || parent.callee.type !== AST_NODE_TYPES82.Identifier) return false;
16713
- const variable = ASTUtils40.findVariable(context.sourceCode.getScope(parent.callee), parent.callee.name);
16838
+ if (parent.type !== AST_NODE_TYPES83.CallExpression || parent.arguments[0] !== owner || parent.callee.type !== AST_NODE_TYPES83.Identifier) return false;
16839
+ const variable = ASTUtils41.findVariable(context.sourceCode.getScope(parent.callee), parent.callee.name);
16714
16840
  return variable !== null && frameworkLoaders.has(variable);
16715
16841
  };
16716
16842
  return {
16717
16843
  ImportDeclaration(node) {
16718
16844
  if (node.source.value === "react") {
16719
16845
  for (const specifier of node.specifiers) {
16720
- if (specifier.type === AST_NODE_TYPES82.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES82.Identifier ? specifier.imported.name : specifier.imported.value) === "lazy") rememberFrameworkLoader(specifier.local);
16846
+ if (specifier.type === AST_NODE_TYPES83.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES83.Identifier ? specifier.imported.name : specifier.imported.value) === "lazy") rememberFrameworkLoader(specifier.local);
16721
16847
  }
16722
16848
  }
16723
16849
  if (node.source.value === "next/dynamic") {
16724
16850
  for (const specifier of node.specifiers) {
16725
- if (specifier.type === AST_NODE_TYPES82.ImportDefaultSpecifier) rememberFrameworkLoader(specifier.local);
16851
+ if (specifier.type === AST_NODE_TYPES83.ImportDefaultSpecifier) rememberFrameworkLoader(specifier.local);
16726
16852
  }
16727
16853
  }
16728
16854
  },
@@ -16740,7 +16866,7 @@ var prefer_await_in_async_return_default = createRule({
16740
16866
  });
16741
16867
 
16742
16868
  // src/rules/prefer-schema-for-api-payload.ts
16743
- import { AST_NODE_TYPES as AST_NODE_TYPES83, ASTUtils as ASTUtils41 } from "@typescript-eslint/utils";
16869
+ import { AST_NODE_TYPES as AST_NODE_TYPES84, ASTUtils as ASTUtils42 } from "@typescript-eslint/utils";
16744
16870
  var PREFER_SCHEMA_FOR_API_PAYLOAD_DOCUMENTATION = {
16745
16871
  summary: "Require Zod (or similar) schema validation on `response.json()` / `JSON.parse()` results before property access.",
16746
16872
  rationale: "External JSON is untrusted at runtime even when its expected TypeScript shape is known statically.",
@@ -16760,9 +16886,9 @@ var PREFER_SCHEMA_FOR_API_PAYLOAD_DOCUMENTATION = {
16760
16886
  var unwrap6 = (node) => {
16761
16887
  let current = node;
16762
16888
  while (current !== null && current !== void 0) {
16763
- if (current.type === AST_NODE_TYPES83.TSAsExpression || current.type === AST_NODE_TYPES83.TSTypeAssertion || current.type === AST_NODE_TYPES83.TSNonNullExpression || current.type === AST_NODE_TYPES83.TSSatisfiesExpression) {
16889
+ if (current.type === AST_NODE_TYPES84.TSAsExpression || current.type === AST_NODE_TYPES84.TSTypeAssertion || current.type === AST_NODE_TYPES84.TSNonNullExpression || current.type === AST_NODE_TYPES84.TSSatisfiesExpression) {
16764
16890
  current = current.expression;
16765
- } else if (current.type === AST_NODE_TYPES83.ChainExpression) {
16891
+ } else if (current.type === AST_NODE_TYPES84.ChainExpression) {
16766
16892
  current = current.expression;
16767
16893
  } else {
16768
16894
  break;
@@ -16777,23 +16903,23 @@ var PROMISE_CHAIN_METHODS = /* @__PURE__ */ new Set([
16777
16903
  ]);
16778
16904
  var isSchemaParseReference = (node) => {
16779
16905
  const inner = unwrap6(node);
16780
- return inner !== null && inner.type === AST_NODE_TYPES83.MemberExpression && !inner.computed && inner.property.type === AST_NODE_TYPES83.Identifier && (inner.property.name === "parse" || inner.property.name === "safeParse");
16906
+ return inner !== null && inner.type === AST_NODE_TYPES84.MemberExpression && !inner.computed && inner.property.type === AST_NODE_TYPES84.Identifier && (inner.property.name === "parse" || inner.property.name === "safeParse");
16781
16907
  };
16782
16908
  var isRawPayloadSource = (node, context, isKnownLocalText) => {
16783
16909
  let current = unwrap6(node);
16784
16910
  if (current === null) return false;
16785
- if (current.type === AST_NODE_TYPES83.AwaitExpression) {
16911
+ if (current.type === AST_NODE_TYPES84.AwaitExpression) {
16786
16912
  current = unwrap6(current.argument);
16787
16913
  }
16788
- if (current === null || current.type !== AST_NODE_TYPES83.CallExpression) {
16914
+ if (current === null || current.type !== AST_NODE_TYPES84.CallExpression) {
16789
16915
  return false;
16790
16916
  }
16791
16917
  const callee = unwrap6(current.callee);
16792
- if (callee === null || callee.type !== AST_NODE_TYPES83.MemberExpression) {
16918
+ if (callee === null || callee.type !== AST_NODE_TYPES84.MemberExpression) {
16793
16919
  return false;
16794
16920
  }
16795
16921
  const property = unwrap6(callee.property);
16796
- if (property === null || property.type !== AST_NODE_TYPES83.Identifier) {
16922
+ if (property === null || property.type !== AST_NODE_TYPES84.Identifier) {
16797
16923
  return false;
16798
16924
  }
16799
16925
  if (property.name === "json") {
@@ -16804,34 +16930,34 @@ var isRawPayloadSource = (node, context, isKnownLocalText) => {
16804
16930
  }
16805
16931
  const object = unwrap6(callee.object);
16806
16932
  const input = unwrap6(current.arguments[0]);
16807
- if (input?.type === AST_NODE_TYPES83.CallExpression && input.arguments.length === 1 && input.callee.type === AST_NODE_TYPES83.MemberExpression && !input.callee.computed && input.callee.object.type === AST_NODE_TYPES83.Identifier && input.callee.object.name === "JSON" && input.callee.property.type === AST_NODE_TYPES83.Identifier && input.callee.property.name === "stringify" && (ASTUtils41.findVariable(context.sourceCode.getScope(input.callee.object), "JSON")?.defs.length ?? 0) === 0) return false;
16808
- return property.name === "parse" && object !== null && object.type === AST_NODE_TYPES83.Identifier && object.name === "JSON" && (ASTUtils41.findVariable(context.sourceCode.getScope(object), "JSON")?.defs.length ?? 0) === 0 && !isLocalFileRead(current.arguments[0]) && isKnownLocalText?.(current.arguments[0]) !== true;
16933
+ if (input?.type === AST_NODE_TYPES84.CallExpression && input.arguments.length === 1 && input.callee.type === AST_NODE_TYPES84.MemberExpression && !input.callee.computed && input.callee.object.type === AST_NODE_TYPES84.Identifier && input.callee.object.name === "JSON" && input.callee.property.type === AST_NODE_TYPES84.Identifier && input.callee.property.name === "stringify" && (ASTUtils42.findVariable(context.sourceCode.getScope(input.callee.object), "JSON")?.defs.length ?? 0) === 0) return false;
16934
+ return property.name === "parse" && object !== null && object.type === AST_NODE_TYPES84.Identifier && object.name === "JSON" && (ASTUtils42.findVariable(context.sourceCode.getScope(object), "JSON")?.defs.length ?? 0) === 0 && !isLocalFileRead(current.arguments[0]) && isKnownLocalText?.(current.arguments[0]) !== true;
16809
16935
  };
16810
16936
  var isResponseSource = (node, context, seen = /* @__PURE__ */ new Set()) => {
16811
16937
  let current = unwrap6(node);
16812
- if (current?.type === AST_NODE_TYPES83.AwaitExpression) current = unwrap6(current.argument);
16938
+ if (current?.type === AST_NODE_TYPES84.AwaitExpression) current = unwrap6(current.argument);
16813
16939
  if (current === null || seen.has(current)) return false;
16814
16940
  seen.add(current);
16815
- const isGlobal = (identifier) => (ASTUtils41.findVariable(context.sourceCode.getScope(identifier), identifier.name)?.defs.length ?? 0) === 0;
16816
- if (current.type === AST_NODE_TYPES83.CallExpression) return current.callee.type === AST_NODE_TYPES83.Identifier && current.callee.name === "fetch" && isGlobal(current.callee);
16817
- if (current.type === AST_NODE_TYPES83.NewExpression) return current.callee.type === AST_NODE_TYPES83.Identifier && ["Request", "Response"].includes(current.callee.name) && isGlobal(current.callee);
16818
- if (current.type !== AST_NODE_TYPES83.Identifier) return false;
16819
- const binding = ASTUtils41.findVariable(context.sourceCode.getScope(current), current.name);
16941
+ const isGlobal = (identifier) => (ASTUtils42.findVariable(context.sourceCode.getScope(identifier), identifier.name)?.defs.length ?? 0) === 0;
16942
+ if (current.type === AST_NODE_TYPES84.CallExpression) return current.callee.type === AST_NODE_TYPES84.Identifier && current.callee.name === "fetch" && isGlobal(current.callee);
16943
+ if (current.type === AST_NODE_TYPES84.NewExpression) return current.callee.type === AST_NODE_TYPES84.Identifier && ["Request", "Response"].includes(current.callee.name) && isGlobal(current.callee);
16944
+ if (current.type !== AST_NODE_TYPES84.Identifier) return false;
16945
+ const binding = ASTUtils42.findVariable(context.sourceCode.getScope(current), current.name);
16820
16946
  if (binding?.defs.length !== 1 || binding.references.some((reference) => reference.isWrite() && reference.init !== true)) return false;
16821
16947
  const definition = binding.defs[0];
16822
- const annotation = definition?.name.type === AST_NODE_TYPES83.Identifier ? definition.name.typeAnnotation?.typeAnnotation : void 0;
16823
- if (annotation?.type === AST_NODE_TYPES83.TSTypeReference && annotation.typeName.type === AST_NODE_TYPES83.Identifier && ["Request", "Response"].includes(annotation.typeName.name) && isGlobal(annotation.typeName)) return true;
16948
+ const annotation = definition?.name.type === AST_NODE_TYPES84.Identifier ? definition.name.typeAnnotation?.typeAnnotation : void 0;
16949
+ if (annotation?.type === AST_NODE_TYPES84.TSTypeReference && annotation.typeName.type === AST_NODE_TYPES84.Identifier && ["Request", "Response"].includes(annotation.typeName.name) && isGlobal(annotation.typeName)) return true;
16824
16950
  return definition?.type === "Variable" && definition.parent.kind === "const" && definition.node.init !== null && isResponseSource(definition.node.init, context, seen);
16825
16951
  };
16826
16952
  var FILE_READ_RE = /^(readFile|readFileSync|readJson|readJsonSync|readJSON)$/;
16827
16953
  var isDirectLocalFileRead = (node) => {
16828
16954
  let current = unwrap6(node);
16829
- if (current?.type === AST_NODE_TYPES83.AwaitExpression) {
16955
+ if (current?.type === AST_NODE_TYPES84.AwaitExpression) {
16830
16956
  current = unwrap6(current.argument);
16831
16957
  }
16832
- if (current?.type !== AST_NODE_TYPES83.CallExpression) return false;
16958
+ if (current?.type !== AST_NODE_TYPES84.CallExpression) return false;
16833
16959
  const callee = unwrap6(current.callee);
16834
- const name = callee?.type === AST_NODE_TYPES83.Identifier ? callee.name : callee?.type === AST_NODE_TYPES83.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES83.Identifier ? callee.property.name : null;
16960
+ const name = callee?.type === AST_NODE_TYPES84.Identifier ? callee.name : callee?.type === AST_NODE_TYPES84.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES84.Identifier ? callee.property.name : null;
16835
16961
  return name !== null && FILE_READ_RE.test(name);
16836
16962
  };
16837
16963
  var isLocalFileRead = (node) => {
@@ -16853,15 +16979,15 @@ var isLocalFileRead = (node) => {
16853
16979
  var ASSERTION_CALLEE_RE = /^(expect|assert|should|invariant)$/;
16854
16980
  var isInsideAssertion = (node) => {
16855
16981
  for (let current = node.parent; current !== void 0 && current !== null; current = current.parent) {
16856
- if (current.type !== AST_NODE_TYPES83.CallExpression) continue;
16982
+ if (current.type !== AST_NODE_TYPES84.CallExpression) continue;
16857
16983
  let callee = current.callee;
16858
- while (callee.type === AST_NODE_TYPES83.MemberExpression) {
16984
+ while (callee.type === AST_NODE_TYPES84.MemberExpression) {
16859
16985
  callee = callee.object;
16860
16986
  }
16861
- if (callee.type === AST_NODE_TYPES83.CallExpression) {
16987
+ if (callee.type === AST_NODE_TYPES84.CallExpression) {
16862
16988
  callee = callee.callee;
16863
16989
  }
16864
- if (callee.type === AST_NODE_TYPES83.Identifier && ASSERTION_CALLEE_RE.test(callee.name)) {
16990
+ if (callee.type === AST_NODE_TYPES84.Identifier && ASSERTION_CALLEE_RE.test(callee.name)) {
16865
16991
  return true;
16866
16992
  }
16867
16993
  }
@@ -16880,22 +17006,22 @@ var GUARD_NAME_RE = /^(?:is|validate|parse|assert|decode|coerce)[A-Z]/;
16880
17006
  var isValidationRead = (node) => {
16881
17007
  let current = node;
16882
17008
  let parent = current.parent;
16883
- while (parent !== null && parent !== void 0 && (parent.type === AST_NODE_TYPES83.TSAsExpression || parent.type === AST_NODE_TYPES83.TSTypeAssertion || parent.type === AST_NODE_TYPES83.TSNonNullExpression || parent.type === AST_NODE_TYPES83.TSSatisfiesExpression || parent.type === AST_NODE_TYPES83.ChainExpression)) {
17009
+ while (parent !== null && parent !== void 0 && (parent.type === AST_NODE_TYPES84.TSAsExpression || parent.type === AST_NODE_TYPES84.TSTypeAssertion || parent.type === AST_NODE_TYPES84.TSNonNullExpression || parent.type === AST_NODE_TYPES84.TSSatisfiesExpression || parent.type === AST_NODE_TYPES84.ChainExpression)) {
16884
17010
  current = parent;
16885
17011
  parent = parent.parent;
16886
17012
  }
16887
17013
  if (parent === null || parent === void 0) return false;
16888
- if (parent.type === AST_NODE_TYPES83.UnaryExpression && parent.operator === "typeof" && parent.argument === current) {
17014
+ if (parent.type === AST_NODE_TYPES84.UnaryExpression && parent.operator === "typeof" && parent.argument === current) {
16889
17015
  return true;
16890
17016
  }
16891
- if (parent.type !== AST_NODE_TYPES83.CallExpression || !parent.arguments.some((arg) => arg === current)) {
17017
+ if (parent.type !== AST_NODE_TYPES84.CallExpression || !parent.arguments.some((arg) => arg === current)) {
16892
17018
  return false;
16893
17019
  }
16894
17020
  const callee = parent.callee;
16895
- if (callee.type === AST_NODE_TYPES83.MemberExpression && !callee.computed && callee.object.type === AST_NODE_TYPES83.Identifier && callee.object.name === "Array" && callee.property.type === AST_NODE_TYPES83.Identifier && callee.property.name === "isArray") {
17021
+ if (callee.type === AST_NODE_TYPES84.MemberExpression && !callee.computed && callee.object.type === AST_NODE_TYPES84.Identifier && callee.object.name === "Array" && callee.property.type === AST_NODE_TYPES84.Identifier && callee.property.name === "isArray") {
16896
17022
  return parent.arguments.length === 1;
16897
17023
  }
16898
- return callee.type === AST_NODE_TYPES83.Identifier && GUARD_NAME_RE.test(callee.name);
17024
+ return callee.type === AST_NODE_TYPES84.Identifier && GUARD_NAME_RE.test(callee.name);
16899
17025
  };
16900
17026
  var PRIMITIVE_TYPEOF_RESULTS = /* @__PURE__ */ new Set([
16901
17027
  "bigint",
@@ -16906,13 +17032,13 @@ var PRIMITIVE_TYPEOF_RESULTS = /* @__PURE__ */ new Set([
16906
17032
  "undefined"
16907
17033
  ]);
16908
17034
  var bindingValidationPolarity = (test, bindingName) => {
16909
- if (test.type === AST_NODE_TYPES83.UnaryExpression && test.operator === "!") {
17035
+ if (test.type === AST_NODE_TYPES84.UnaryExpression && test.operator === "!") {
16910
17036
  const inner = bindingValidationPolarity(test.argument, bindingName);
16911
17037
  return invertValidationPolarity(inner);
16912
17038
  }
16913
- if (test.type === AST_NODE_TYPES83.BinaryExpression) {
16914
- const typeofName = (node) => node.type === AST_NODE_TYPES83.UnaryExpression && node.operator === "typeof" && node.argument.type === AST_NODE_TYPES83.Identifier ? node.argument.name : null;
16915
- const literalType = (node) => node.type === AST_NODE_TYPES83.Literal && typeof node.value === "string" && PRIMITIVE_TYPEOF_RESULTS.has(node.value) ? node.value : null;
17039
+ if (test.type === AST_NODE_TYPES84.BinaryExpression) {
17040
+ const typeofName = (node) => node.type === AST_NODE_TYPES84.UnaryExpression && node.operator === "typeof" && node.argument.type === AST_NODE_TYPES84.Identifier ? node.argument.name : null;
17041
+ const literalType = (node) => node.type === AST_NODE_TYPES84.Literal && typeof node.value === "string" && PRIMITIVE_TYPEOF_RESULTS.has(node.value) ? node.value : null;
16916
17042
  const matches = typeofName(test.left) === bindingName && literalType(test.right) !== null || typeofName(test.right) === bindingName && literalType(test.left) !== null;
16917
17043
  if (!matches) return null;
16918
17044
  if (test.operator === "===" || test.operator === "==") {
@@ -16920,9 +17046,9 @@ var bindingValidationPolarity = (test, bindingName) => {
16920
17046
  }
16921
17047
  return test.operator === "!==" || test.operator === "!=" ? "valid-when-false" : null;
16922
17048
  }
16923
- return test.type === AST_NODE_TYPES83.CallExpression && test.arguments.length === 1 && test.arguments[0]?.type === AST_NODE_TYPES83.Identifier && test.arguments[0].name === bindingName && test.callee.type === AST_NODE_TYPES83.MemberExpression && !test.callee.computed && test.callee.object.type === AST_NODE_TYPES83.Identifier && test.callee.object.name === "Array" && test.callee.property.type === AST_NODE_TYPES83.Identifier && test.callee.property.name === "isArray" ? "valid-when-true" : null;
17049
+ return test.type === AST_NODE_TYPES84.CallExpression && test.arguments.length === 1 && test.arguments[0]?.type === AST_NODE_TYPES84.Identifier && test.arguments[0].name === bindingName && test.callee.type === AST_NODE_TYPES84.MemberExpression && !test.callee.computed && test.callee.object.type === AST_NODE_TYPES84.Identifier && test.callee.object.name === "Array" && test.callee.property.type === AST_NODE_TYPES84.Identifier && test.callee.property.name === "isArray" ? "valid-when-true" : null;
16924
17050
  };
16925
- var plainMemberAccess = (node) => node.type === AST_NODE_TYPES83.MemberExpression && !node.computed && node.object.type === AST_NODE_TYPES83.Identifier && node.property.type === AST_NODE_TYPES83.Identifier ? { object: node.object.name, property: node.property.name } : null;
17051
+ var plainMemberAccess = (node) => node.type === AST_NODE_TYPES84.MemberExpression && !node.computed && node.object.type === AST_NODE_TYPES84.Identifier && node.property.type === AST_NODE_TYPES84.Identifier ? { object: node.object.name, property: node.property.name } : null;
16926
17052
  var isSamePlainMember = (node, access) => {
16927
17053
  const candidate2 = plainMemberAccess(node);
16928
17054
  return candidate2 !== null && candidate2.object === access.object && candidate2.property === access.property;
@@ -16930,19 +17056,19 @@ var isSamePlainMember = (node, access) => {
16930
17056
  var nodeWithin2 = (node, container) => node.range[0] >= container.range[0] && node.range[1] <= container.range[1];
16931
17057
  var isUseWithinValidatedBranch = (node, bindingName) => {
16932
17058
  for (let current = node.parent; current !== void 0 && current !== null; current = current.parent) {
16933
- if (current.type === AST_NODE_TYPES83.ConditionalExpression) {
17059
+ if (current.type === AST_NODE_TYPES84.ConditionalExpression) {
16934
17060
  const polarity = bindingValidationPolarity(current.test, bindingName);
16935
17061
  if (polarity === "valid-when-true" && nodeWithin2(node, current.consequent) || polarity === "valid-when-false" && nodeWithin2(node, current.alternate)) {
16936
17062
  return true;
16937
17063
  }
16938
17064
  }
16939
- if (current.type === AST_NODE_TYPES83.IfStatement) {
17065
+ if (current.type === AST_NODE_TYPES84.IfStatement) {
16940
17066
  const polarity = bindingValidationPolarity(current.test, bindingName);
16941
17067
  if (validatedBranchContains(node, current, polarity)) {
16942
17068
  return true;
16943
17069
  }
16944
17070
  }
16945
- if (current.type === AST_NODE_TYPES83.FunctionDeclaration || current.type === AST_NODE_TYPES83.FunctionExpression || current.type === AST_NODE_TYPES83.ArrowFunctionExpression) {
17071
+ if (current.type === AST_NODE_TYPES84.FunctionDeclaration || current.type === AST_NODE_TYPES84.FunctionExpression || current.type === AST_NODE_TYPES84.ArrowFunctionExpression) {
16946
17072
  return false;
16947
17073
  }
16948
17074
  }
@@ -16950,32 +17076,32 @@ var isUseWithinValidatedBranch = (node, bindingName) => {
16950
17076
  };
16951
17077
  var isMemberUseWithinValidatedBranch = (node, access) => {
16952
17078
  for (let current = node.parent; current !== void 0 && current !== null; current = current.parent) {
16953
- if (current.type === AST_NODE_TYPES83.ConditionalExpression) {
17079
+ if (current.type === AST_NODE_TYPES84.ConditionalExpression) {
16954
17080
  const polarity = memberValidationPolarity(current.test, access);
16955
17081
  if (polarity === "valid-when-true" && nodeWithin2(node, current.consequent) || polarity === "valid-when-false" && nodeWithin2(node, current.alternate)) {
16956
17082
  return true;
16957
17083
  }
16958
17084
  }
16959
- if (current.type === AST_NODE_TYPES83.IfStatement) {
17085
+ if (current.type === AST_NODE_TYPES84.IfStatement) {
16960
17086
  const polarity = memberValidationPolarity(current.test, access);
16961
17087
  if (validatedBranchContains(node, current, polarity)) {
16962
17088
  return true;
16963
17089
  }
16964
17090
  }
16965
- if (current.type === AST_NODE_TYPES83.FunctionDeclaration || current.type === AST_NODE_TYPES83.FunctionExpression || current.type === AST_NODE_TYPES83.ArrowFunctionExpression) {
17091
+ if (current.type === AST_NODE_TYPES84.FunctionDeclaration || current.type === AST_NODE_TYPES84.FunctionExpression || current.type === AST_NODE_TYPES84.ArrowFunctionExpression) {
16966
17092
  return false;
16967
17093
  }
16968
17094
  }
16969
17095
  return false;
16970
17096
  };
16971
17097
  var memberValidationPolarity = (test, access) => {
16972
- if (test.type === AST_NODE_TYPES83.UnaryExpression && test.operator === "!") {
17098
+ if (test.type === AST_NODE_TYPES84.UnaryExpression && test.operator === "!") {
16973
17099
  const inner = memberValidationPolarity(test.argument, access);
16974
17100
  return invertValidationPolarity(inner);
16975
17101
  }
16976
- if (test.type === AST_NODE_TYPES83.BinaryExpression) {
16977
- const isMatchingTypeof = (node) => node.type === AST_NODE_TYPES83.UnaryExpression && node.operator === "typeof" && isSamePlainMember(node.argument, access);
16978
- const isPrimitiveType = (node) => node.type === AST_NODE_TYPES83.Literal && typeof node.value === "string" && PRIMITIVE_TYPEOF_RESULTS.has(node.value);
17102
+ if (test.type === AST_NODE_TYPES84.BinaryExpression) {
17103
+ const isMatchingTypeof = (node) => node.type === AST_NODE_TYPES84.UnaryExpression && node.operator === "typeof" && isSamePlainMember(node.argument, access);
17104
+ const isPrimitiveType = (node) => node.type === AST_NODE_TYPES84.Literal && typeof node.value === "string" && PRIMITIVE_TYPEOF_RESULTS.has(node.value);
16979
17105
  if (!(isMatchingTypeof(test.left) && isPrimitiveType(test.right) || isMatchingTypeof(test.right) && isPrimitiveType(test.left))) {
16980
17106
  return null;
16981
17107
  }
@@ -16984,15 +17110,15 @@ var memberValidationPolarity = (test, access) => {
16984
17110
  }
16985
17111
  return test.operator === "!==" || test.operator === "!=" ? "valid-when-false" : null;
16986
17112
  }
16987
- return test.type === AST_NODE_TYPES83.CallExpression && test.arguments.length === 1 && test.arguments[0] !== void 0 && test.arguments[0].type !== AST_NODE_TYPES83.SpreadElement && isSamePlainMember(test.arguments[0], access) && test.callee.type === AST_NODE_TYPES83.MemberExpression && !test.callee.computed && test.callee.object.type === AST_NODE_TYPES83.Identifier && test.callee.object.name === "Array" && test.callee.property.type === AST_NODE_TYPES83.Identifier && test.callee.property.name === "isArray" ? "valid-when-true" : null;
17113
+ return test.type === AST_NODE_TYPES84.CallExpression && test.arguments.length === 1 && test.arguments[0] !== void 0 && test.arguments[0].type !== AST_NODE_TYPES84.SpreadElement && isSamePlainMember(test.arguments[0], access) && test.callee.type === AST_NODE_TYPES84.MemberExpression && !test.callee.computed && test.callee.object.type === AST_NODE_TYPES84.Identifier && test.callee.object.name === "Array" && test.callee.property.type === AST_NODE_TYPES84.Identifier && test.callee.property.name === "isArray" ? "valid-when-true" : null;
16988
17114
  };
16989
17115
  var isFullyValidatedExtractedBinding = (member, source, context) => {
16990
17116
  const isValidationReference = (identifier) => {
16991
17117
  for (let current = identifier.parent; current !== void 0 && current !== null; current = current.parent) {
16992
- if ((current.type === AST_NODE_TYPES83.BinaryExpression || current.type === AST_NODE_TYPES83.CallExpression || current.type === AST_NODE_TYPES83.UnaryExpression) && bindingValidationPolarity(current, identifier.name) !== null) {
17118
+ if ((current.type === AST_NODE_TYPES84.BinaryExpression || current.type === AST_NODE_TYPES84.CallExpression || current.type === AST_NODE_TYPES84.UnaryExpression) && bindingValidationPolarity(current, identifier.name) !== null) {
16993
17119
  return true;
16994
17120
  }
16995
- if (current.type !== AST_NODE_TYPES83.UnaryExpression && current.type !== AST_NODE_TYPES83.MemberExpression && current.type !== AST_NODE_TYPES83.CallExpression) {
17121
+ if (current.type !== AST_NODE_TYPES84.UnaryExpression && current.type !== AST_NODE_TYPES84.MemberExpression && current.type !== AST_NODE_TYPES84.CallExpression) {
16996
17122
  return false;
16997
17123
  }
16998
17124
  }
@@ -17000,7 +17126,7 @@ var isFullyValidatedExtractedBinding = (member, source, context) => {
17000
17126
  };
17001
17127
  const isGuardedUse = (identifier) => isUseWithinValidatedBranch(identifier, identifier.name);
17002
17128
  const declarator = member.parent;
17003
- if (declarator.type !== AST_NODE_TYPES83.VariableDeclarator || declarator.init !== member || declarator.id.type !== AST_NODE_TYPES83.Identifier || declarator.parent.type !== AST_NODE_TYPES83.VariableDeclaration || declarator.parent.kind !== "const") {
17129
+ if (declarator.type !== AST_NODE_TYPES84.VariableDeclarator || declarator.init !== member || declarator.id.type !== AST_NODE_TYPES84.Identifier || declarator.parent.type !== AST_NODE_TYPES84.VariableDeclaration || declarator.parent.kind !== "const") {
17004
17130
  return false;
17005
17131
  }
17006
17132
  const extracted = context.sourceCode.getDeclaredVariables(declarator)[0];
@@ -17008,7 +17134,7 @@ var isFullyValidatedExtractedBinding = (member, source, context) => {
17008
17134
  let hasValueUse = false;
17009
17135
  for (const reference of extracted.references) {
17010
17136
  const identifier = reference.identifier;
17011
- if (identifier.type !== AST_NODE_TYPES83.Identifier) return false;
17137
+ if (identifier.type !== AST_NODE_TYPES84.Identifier) return false;
17012
17138
  if (nodeWithin2(identifier, declarator)) continue;
17013
17139
  if (isValidationReference(identifier)) continue;
17014
17140
  hasValueUse = true;
@@ -17021,17 +17147,17 @@ var isGuardTestPosition = (node) => {
17021
17147
  let parent = current.parent;
17022
17148
  while (parent !== void 0 && parent !== null) {
17023
17149
  switch (parent.type) {
17024
- case AST_NODE_TYPES83.UnaryExpression:
17025
- case AST_NODE_TYPES83.LogicalExpression:
17026
- case AST_NODE_TYPES83.ChainExpression:
17150
+ case AST_NODE_TYPES84.UnaryExpression:
17151
+ case AST_NODE_TYPES84.LogicalExpression:
17152
+ case AST_NODE_TYPES84.ChainExpression:
17027
17153
  current = parent;
17028
17154
  parent = parent.parent;
17029
17155
  continue;
17030
- case AST_NODE_TYPES83.IfStatement:
17031
- case AST_NODE_TYPES83.ConditionalExpression:
17032
- case AST_NODE_TYPES83.WhileStatement:
17033
- case AST_NODE_TYPES83.DoWhileStatement:
17034
- case AST_NODE_TYPES83.ForStatement:
17156
+ case AST_NODE_TYPES84.IfStatement:
17157
+ case AST_NODE_TYPES84.ConditionalExpression:
17158
+ case AST_NODE_TYPES84.WhileStatement:
17159
+ case AST_NODE_TYPES84.DoWhileStatement:
17160
+ case AST_NODE_TYPES84.ForStatement:
17035
17161
  return parent.test === current;
17036
17162
  default:
17037
17163
  return false;
@@ -17041,7 +17167,7 @@ var isGuardTestPosition = (node) => {
17041
17167
  };
17042
17168
  var unvalidatedVariableRef = (node, scope, tracked) => {
17043
17169
  const unwrapped = unwrap6(node);
17044
- if (unwrapped === null || unwrapped.type !== AST_NODE_TYPES83.Identifier) {
17170
+ if (unwrapped === null || unwrapped.type !== AST_NODE_TYPES84.Identifier) {
17045
17171
  return null;
17046
17172
  }
17047
17173
  const variable = findVariable2(scope, unwrapped.name);
@@ -17073,24 +17199,24 @@ var prefer_schema_for_api_payload_default = createRule({
17073
17199
  if (context.sourceCode.getScope(use).variableScope !== context.sourceCode.getScope(call).variableScope) return false;
17074
17200
  let guard = call;
17075
17201
  let positive = true;
17076
- while (guard.parent.type === AST_NODE_TYPES83.UnaryExpression && guard.parent.operator === "!") {
17202
+ while (guard.parent.type === AST_NODE_TYPES84.UnaryExpression && guard.parent.operator === "!") {
17077
17203
  positive = !positive;
17078
17204
  guard = guard.parent;
17079
17205
  }
17080
- while (positive && guard.parent.type === AST_NODE_TYPES83.LogicalExpression && guard.parent.operator === "&&") guard = guard.parent;
17206
+ while (positive && guard.parent.type === AST_NODE_TYPES84.LogicalExpression && guard.parent.operator === "&&") guard = guard.parent;
17081
17207
  const branch = guard.parent;
17082
- if (branch.type === AST_NODE_TYPES83.IfStatement && branch.test === guard) {
17208
+ if (branch.type === AST_NODE_TYPES84.IfStatement && branch.test === guard) {
17083
17209
  const dominated = ifGuardDominates(use, branch, positive);
17084
17210
  if (dominated !== null) return dominated;
17085
17211
  }
17086
- if (branch.type === AST_NODE_TYPES83.ConditionalExpression && branch.test === guard) return nodeWithin2(use, positive ? branch.consequent : branch.alternate);
17087
- if (positive && branch.type === AST_NODE_TYPES83.WhileStatement && branch.test === guard) return nodeWithin2(use, branch.body);
17088
- if (call.parent.type !== AST_NODE_TYPES83.ExpressionStatement || call.callee.type !== AST_NODE_TYPES83.Identifier || /^(?:is|has)[A-Z]/u.test(call.callee.name)) return false;
17212
+ if (branch.type === AST_NODE_TYPES84.ConditionalExpression && branch.test === guard) return nodeWithin2(use, positive ? branch.consequent : branch.alternate);
17213
+ if (positive && branch.type === AST_NODE_TYPES84.WhileStatement && branch.test === guard) return nodeWithin2(use, branch.body);
17214
+ if (call.parent.type !== AST_NODE_TYPES84.ExpressionStatement || call.callee.type !== AST_NODE_TYPES84.Identifier || /^(?:is|has)[A-Z]/u.test(call.callee.name)) return false;
17089
17215
  return followsInSameContainer(use, call.parent);
17090
17216
  };
17091
17217
  const localFileTextRef = (node, scope) => {
17092
17218
  const unwrapped = unwrap6(node);
17093
- if (unwrapped?.type !== AST_NODE_TYPES83.Identifier) return null;
17219
+ if (unwrapped?.type !== AST_NODE_TYPES84.Identifier) return null;
17094
17220
  const variable = findVariable2(scope, unwrapped.name);
17095
17221
  return variable !== null && localFileTextVariables.has(variable) ? variable : null;
17096
17222
  };
@@ -17142,19 +17268,19 @@ var prefer_schema_for_api_payload_default = createRule({
17142
17268
  const statement = declarator.parent;
17143
17269
  const block = statement.parent;
17144
17270
  const followsRejectingGuard = (identifier) => {
17145
- if (block.type !== AST_NODE_TYPES83.BlockStatement && block.type !== AST_NODE_TYPES83.Program) return false;
17271
+ if (block.type !== AST_NODE_TYPES84.BlockStatement && block.type !== AST_NODE_TYPES84.Program) return false;
17146
17272
  if (context.sourceCode.getScope(identifier).variableScope !== context.sourceCode.getScope(declarator).variableScope) return false;
17147
17273
  return block.body.some((candidate2) => {
17148
- if (candidate2.type !== AST_NODE_TYPES83.IfStatement || candidate2.range[1] >= identifier.range[0] || bindingValidationPolarity(candidate2.test, identifier.name) !== "valid-when-false") return false;
17149
- const terminal = candidate2.consequent.type === AST_NODE_TYPES83.BlockStatement ? candidate2.consequent.body.at(-1) : candidate2.consequent;
17150
- return terminal?.type === AST_NODE_TYPES83.ThrowStatement || terminal?.type === AST_NODE_TYPES83.ReturnStatement;
17274
+ if (candidate2.type !== AST_NODE_TYPES84.IfStatement || candidate2.range[1] >= identifier.range[0] || bindingValidationPolarity(candidate2.test, identifier.name) !== "valid-when-false") return false;
17275
+ const terminal = candidate2.consequent.type === AST_NODE_TYPES84.BlockStatement ? candidate2.consequent.body.at(-1) : candidate2.consequent;
17276
+ return terminal?.type === AST_NODE_TYPES84.ThrowStatement || terminal?.type === AST_NODE_TYPES84.ReturnStatement;
17151
17277
  });
17152
17278
  };
17153
17279
  return declared.length > 0 && declared.every(
17154
17280
  (variable) => variable.references.some((reference) => isValidationRead(reference.identifier)) && variable.references.every((reference) => {
17155
17281
  const identifier = reference.identifier;
17156
17282
  if (reference.init === true) return true;
17157
- if (reference.isWrite() || identifier.type !== AST_NODE_TYPES83.Identifier) return false;
17283
+ if (reference.isWrite() || identifier.type !== AST_NODE_TYPES84.Identifier) return false;
17158
17284
  return isValidationRead(identifier) || isUseWithinValidatedBranch(identifier, identifier.name) || followsRejectingGuard(identifier);
17159
17285
  })
17160
17286
  );
@@ -17174,7 +17300,7 @@ var prefer_schema_for_api_payload_default = createRule({
17174
17300
  return {
17175
17301
  VariableDeclarator(node) {
17176
17302
  const scope = context.sourceCode.getScope(node);
17177
- if (node.id.type === AST_NODE_TYPES83.Identifier) {
17303
+ if (node.id.type === AST_NODE_TYPES84.Identifier) {
17178
17304
  const variable = context.sourceCode.getDeclaredVariables(node)[0];
17179
17305
  if (variable !== void 0) {
17180
17306
  updateLocalFileText(variable, node.init, scope);
@@ -17182,7 +17308,7 @@ var prefer_schema_for_api_payload_default = createRule({
17182
17308
  trackInitializer(node, scope);
17183
17309
  return;
17184
17310
  }
17185
- if (node.id.type === AST_NODE_TYPES83.ObjectPattern || node.id.type === AST_NODE_TYPES83.ArrayPattern) {
17311
+ if (node.id.type === AST_NODE_TYPES84.ObjectPattern || node.id.type === AST_NODE_TYPES84.ArrayPattern) {
17186
17312
  if (isRawPayloadSource(
17187
17313
  node.init,
17188
17314
  context,
@@ -17200,7 +17326,7 @@ var prefer_schema_for_api_payload_default = createRule({
17200
17326
  },
17201
17327
  AssignmentExpression(node) {
17202
17328
  const scope = context.sourceCode.getScope(node);
17203
- if (node.left.type === AST_NODE_TYPES83.Identifier) {
17329
+ if (node.left.type === AST_NODE_TYPES84.Identifier) {
17204
17330
  const variable = findVariable2(scope, node.left.name);
17205
17331
  if (variable === null) return;
17206
17332
  const isLocalText = (candidate2) => localFileTextRef(candidate2, scope) !== null;
@@ -17214,7 +17340,7 @@ var prefer_schema_for_api_payload_default = createRule({
17214
17340
  }
17215
17341
  return;
17216
17342
  }
17217
- if (node.left.type === AST_NODE_TYPES83.ObjectPattern || node.left.type === AST_NODE_TYPES83.ArrayPattern) {
17343
+ if (node.left.type === AST_NODE_TYPES84.ObjectPattern || node.left.type === AST_NODE_TYPES84.ArrayPattern) {
17218
17344
  if (isRawPayloadSource(
17219
17345
  node.right,
17220
17346
  context,
@@ -17235,15 +17361,15 @@ var prefer_schema_for_api_payload_default = createRule({
17235
17361
  }
17236
17362
  },
17237
17363
  CallExpression(node) {
17238
- if (node.callee.type !== AST_NODE_TYPES83.Identifier) return;
17364
+ if (node.callee.type !== AST_NODE_TYPES84.Identifier) return;
17239
17365
  if (!GUARD_NAME_RE.test(node.callee.name) && !isGuardTestPosition(node)) {
17240
17366
  return;
17241
17367
  }
17242
17368
  const scope = context.sourceCode.getScope(node);
17243
17369
  for (const arg of node.arguments) {
17244
- if (arg.type === AST_NODE_TYPES83.SpreadElement) continue;
17370
+ if (arg.type === AST_NODE_TYPES84.SpreadElement) continue;
17245
17371
  const unwrapped = unwrap6(arg);
17246
- if (unwrapped === null || unwrapped.type !== AST_NODE_TYPES83.Identifier) {
17372
+ if (unwrapped === null || unwrapped.type !== AST_NODE_TYPES84.Identifier) {
17247
17373
  continue;
17248
17374
  }
17249
17375
  const variable = findVariable2(scope, unwrapped.name);
@@ -17267,14 +17393,14 @@ var prefer_schema_for_api_payload_default = createRule({
17267
17393
  (candidate2) => localFileTextRef(candidate2, scope) !== null
17268
17394
  )) {
17269
17395
  const parent = node.parent;
17270
- if (parent.type === AST_NODE_TYPES83.CallExpression && parent.callee === node && node.property.type === AST_NODE_TYPES83.Identifier && (node.property.name === "parse" || node.property.name === "safeParse" || PROMISE_CHAIN_METHODS.has(node.property.name))) {
17396
+ if (parent.type === AST_NODE_TYPES84.CallExpression && parent.callee === node && node.property.type === AST_NODE_TYPES84.Identifier && (node.property.name === "parse" || node.property.name === "safeParse" || PROMISE_CHAIN_METHODS.has(node.property.name))) {
17271
17397
  return;
17272
17398
  }
17273
17399
  context.report({ node, messageId: "unparsedJsonAccess" });
17274
17400
  return;
17275
17401
  }
17276
- const variable = obj?.type === AST_NODE_TYPES83.Identifier ? unvalidatedVariableRef(obj, scope, unvalidatedVariables) : null;
17277
- if (variable !== null && obj?.type === AST_NODE_TYPES83.Identifier) {
17402
+ const variable = obj?.type === AST_NODE_TYPES84.Identifier ? unvalidatedVariableRef(obj, scope, unvalidatedVariables) : null;
17403
+ if (variable !== null && obj?.type === AST_NODE_TYPES84.Identifier) {
17278
17404
  if (namedGuards.get(variable)?.some((call) => guardDominates(node, call))) return;
17279
17405
  if (isUseWithinValidatedBranch(node, obj.name)) {
17280
17406
  return;
@@ -17302,8 +17428,8 @@ function validatedBranchContains(node, branch, polarity) {
17302
17428
  }
17303
17429
  function followsInSameContainer(use, preceding) {
17304
17430
  let statement = use;
17305
- while (statement.parent !== void 0 && statement.parent !== preceding.parent && statement.parent.type !== AST_NODE_TYPES83.Program) {
17306
- if (statement.type === AST_NODE_TYPES83.FunctionDeclaration || statement.type === AST_NODE_TYPES83.FunctionExpression || statement.type === AST_NODE_TYPES83.ArrowFunctionExpression) return false;
17431
+ while (statement.parent !== void 0 && statement.parent !== preceding.parent && statement.parent.type !== AST_NODE_TYPES84.Program) {
17432
+ if (statement.type === AST_NODE_TYPES84.FunctionDeclaration || statement.type === AST_NODE_TYPES84.FunctionExpression || statement.type === AST_NODE_TYPES84.ArrowFunctionExpression) return false;
17307
17433
  statement = statement.parent;
17308
17434
  }
17309
17435
  return statement.parent === preceding.parent && statement.range[0] > preceding.range[1];
@@ -17311,15 +17437,15 @@ function followsInSameContainer(use, preceding) {
17311
17437
  function ifGuardDominates(use, branch, positive) {
17312
17438
  if (positive && nodeWithin2(use, branch.consequent)) return true;
17313
17439
  if (!positive && branch.alternate !== null && nodeWithin2(use, branch.alternate)) return true;
17314
- const terminal = branch.consequent.type === AST_NODE_TYPES83.BlockStatement ? branch.consequent.body.at(-1) : branch.consequent;
17315
- if (!positive && (terminal?.type === AST_NODE_TYPES83.ThrowStatement || terminal?.type === AST_NODE_TYPES83.ReturnStatement)) {
17440
+ const terminal = branch.consequent.type === AST_NODE_TYPES84.BlockStatement ? branch.consequent.body.at(-1) : branch.consequent;
17441
+ if (!positive && (terminal?.type === AST_NODE_TYPES84.ThrowStatement || terminal?.type === AST_NODE_TYPES84.ReturnStatement)) {
17316
17442
  return followsInSameContainer(use, branch);
17317
17443
  }
17318
17444
  return null;
17319
17445
  }
17320
17446
 
17321
17447
  // src/rules/prefer-shared-zod-enum.ts
17322
- import { AST_NODE_TYPES as AST_NODE_TYPES84, ASTUtils as ASTUtils42 } from "@typescript-eslint/utils";
17448
+ import { AST_NODE_TYPES as AST_NODE_TYPES85, ASTUtils as ASTUtils43 } from "@typescript-eslint/utils";
17323
17449
  var PREFER_SHARED_ZOD_ENUM_DOCUMENTATION = {
17324
17450
  defaultLevel: "warning",
17325
17451
  summary: "Give repeated literal Zod enum domains one reusable module-level schema.",
@@ -17335,24 +17461,24 @@ var PREFER_SHARED_ZOD_ENUM_DOCUMENTATION = {
17335
17461
  function literalDomain(node) {
17336
17462
  if (node.arguments.length !== 1) return null;
17337
17463
  const [argument] = node.arguments;
17338
- if (argument?.type !== AST_NODE_TYPES84.ArrayExpression || argument.elements.length < 2) return null;
17464
+ if (argument?.type !== AST_NODE_TYPES85.ArrayExpression || argument.elements.length < 2) return null;
17339
17465
  const values = [];
17340
17466
  for (const element of argument.elements) {
17341
- if (element?.type !== AST_NODE_TYPES84.Literal || typeof element.value !== "string") return null;
17467
+ if (element?.type !== AST_NODE_TYPES85.Literal || typeof element.value !== "string") return null;
17342
17468
  values.push(element.value);
17343
17469
  }
17344
17470
  return values;
17345
17471
  }
17346
17472
  function isModuleLevelNamedSchema(node) {
17347
17473
  let current = node;
17348
- while (current.parent?.type === AST_NODE_TYPES84.MemberExpression && current.parent.object === current) {
17474
+ while (current.parent?.type === AST_NODE_TYPES85.MemberExpression && current.parent.object === current) {
17349
17475
  current = current.parent;
17350
- if (current.parent?.type === AST_NODE_TYPES84.CallExpression && current.parent.callee === current) current = current.parent;
17476
+ if (current.parent?.type === AST_NODE_TYPES85.CallExpression && current.parent.callee === current) current = current.parent;
17351
17477
  }
17352
17478
  const declarator = current.parent;
17353
- if (declarator?.type !== AST_NODE_TYPES84.VariableDeclarator || declarator.init !== current || declarator.id.type !== AST_NODE_TYPES84.Identifier || declarator.parent.type !== AST_NODE_TYPES84.VariableDeclaration) return false;
17479
+ if (declarator?.type !== AST_NODE_TYPES85.VariableDeclarator || declarator.init !== current || declarator.id.type !== AST_NODE_TYPES85.Identifier || declarator.parent.type !== AST_NODE_TYPES85.VariableDeclaration) return false;
17354
17480
  const declarationParent = declarator.parent.parent;
17355
- return declarationParent.type === AST_NODE_TYPES84.Program || declarationParent.type === AST_NODE_TYPES84.ExportNamedDeclaration && declarationParent.parent.type === AST_NODE_TYPES84.Program;
17481
+ return declarationParent.type === AST_NODE_TYPES85.Program || declarationParent.type === AST_NODE_TYPES85.ExportNamedDeclaration && declarationParent.parent.type === AST_NODE_TYPES85.Program;
17356
17482
  }
17357
17483
  var prefer_shared_zod_enum_default = createRule({
17358
17484
  name: "prefer-shared-zod-enum",
@@ -17369,20 +17495,20 @@ var prefer_shared_zod_enum_default = createRule({
17369
17495
  create(context) {
17370
17496
  if (isTestFile(context.filename) || isGeneratedFile(context.filename, context.sourceCode.text)) return {};
17371
17497
  const zodBindings = /* @__PURE__ */ new Set();
17372
- const bindingOf = (node) => ASTUtils42.findVariable(context.sourceCode.getScope(node), node.name);
17498
+ const bindingOf = (node) => ASTUtils43.findVariable(context.sourceCode.getScope(node), node.name);
17373
17499
  const candidates = /* @__PURE__ */ new Map();
17374
17500
  return {
17375
17501
  ImportDeclaration(node) {
17376
17502
  if (!isZodModule(node.source.value)) return;
17377
17503
  for (const specifier of node.specifiers) {
17378
- if (specifier.type === AST_NODE_TYPES84.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES84.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES84.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES84.Identifier && specifier.imported.name === "z") {
17504
+ if (specifier.type === AST_NODE_TYPES85.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES85.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES85.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES85.Identifier && specifier.imported.name === "z") {
17379
17505
  const binding = bindingOf(specifier.local);
17380
17506
  if (binding !== null) zodBindings.add(binding);
17381
17507
  }
17382
17508
  }
17383
17509
  },
17384
17510
  CallExpression(node) {
17385
- if (node.callee.type !== AST_NODE_TYPES84.MemberExpression || node.callee.computed || node.callee.object.type !== AST_NODE_TYPES84.Identifier || node.callee.property.type !== AST_NODE_TYPES84.Identifier || node.callee.property.name !== "enum") return;
17511
+ if (node.callee.type !== AST_NODE_TYPES85.MemberExpression || node.callee.computed || node.callee.object.type !== AST_NODE_TYPES85.Identifier || node.callee.property.type !== AST_NODE_TYPES85.Identifier || node.callee.property.name !== "enum") return;
17386
17512
  const binding = bindingOf(node.callee.object);
17387
17513
  if (binding === null || !zodBindings.has(binding)) return;
17388
17514
  const domain = literalDomain(node);
@@ -17407,7 +17533,7 @@ var prefer_shared_zod_enum_default = createRule({
17407
17533
  });
17408
17534
 
17409
17535
  // src/rules/prefer-switch-for-repeated-equality.ts
17410
- import { AST_NODE_TYPES as AST_NODE_TYPES85 } from "@typescript-eslint/utils";
17536
+ import { AST_NODE_TYPES as AST_NODE_TYPES86 } from "@typescript-eslint/utils";
17411
17537
  var PREFER_SWITCH_FOR_REPEATED_EQUALITY_DOCUMENTATION = {
17412
17538
  defaultLevel: "warning",
17413
17539
  summary: "Prefer switch over long if/else-if chains that compare one value for strict equality.",
@@ -17426,18 +17552,18 @@ var PREFER_SWITCH_FOR_REPEATED_EQUALITY_DOCUMENTATION = {
17426
17552
  ]
17427
17553
  };
17428
17554
  function discriminantText(sourceCode, test) {
17429
- if (test.type !== AST_NODE_TYPES85.BinaryExpression || test.operator !== "===") return null;
17555
+ if (test.type !== AST_NODE_TYPES86.BinaryExpression || test.operator !== "===") return null;
17430
17556
  const leftIsCase = isCaseValue(test.left);
17431
17557
  const rightIsCase = isCaseValue(test.right);
17432
17558
  if (leftIsCase === rightIsCase) return null;
17433
17559
  const discriminant = leftIsCase ? test.right : test.left;
17434
- return discriminant.type === AST_NODE_TYPES85.Identifier ? sourceCode.getText(discriminant) : null;
17560
+ return discriminant.type === AST_NODE_TYPES86.Identifier ? sourceCode.getText(discriminant) : null;
17435
17561
  }
17436
17562
  function isCaseValue(node) {
17437
- if (node.type === AST_NODE_TYPES85.Literal) return true;
17438
- if (node.type === AST_NODE_TYPES85.Identifier) return /^[A-Z][A-Z0-9_]*$/u.test(node.name);
17439
- if (node.type !== AST_NODE_TYPES85.MemberExpression || node.computed) return false;
17440
- return node.property.type === AST_NODE_TYPES85.Identifier && (node.object.type === AST_NODE_TYPES85.Identifier || isCaseValue(node.object));
17563
+ if (node.type === AST_NODE_TYPES86.Literal) return true;
17564
+ if (node.type === AST_NODE_TYPES86.Identifier) return /^[A-Z][A-Z0-9_]*$/u.test(node.name);
17565
+ if (node.type !== AST_NODE_TYPES86.MemberExpression || node.computed) return false;
17566
+ return node.property.type === AST_NODE_TYPES86.Identifier && (node.object.type === AST_NODE_TYPES86.Identifier || isCaseValue(node.object));
17441
17567
  }
17442
17568
  var prefer_switch_for_repeated_equality_default = createRule({
17443
17569
  name: "prefer-switch-for-repeated-equality",
@@ -17454,12 +17580,12 @@ var prefer_switch_for_repeated_equality_default = createRule({
17454
17580
  create(context) {
17455
17581
  return {
17456
17582
  IfStatement(node) {
17457
- if (node.parent.type === AST_NODE_TYPES85.IfStatement && node.parent.alternate === node) return;
17583
+ if (node.parent.type === AST_NODE_TYPES86.IfStatement && node.parent.alternate === node) return;
17458
17584
  const first = discriminantText(context.sourceCode, node.test);
17459
17585
  if (first === null) return;
17460
17586
  let count = 1;
17461
17587
  let current = node.alternate;
17462
- while (current?.type === AST_NODE_TYPES85.IfStatement) {
17588
+ while (current?.type === AST_NODE_TYPES86.IfStatement) {
17463
17589
  if (discriminantText(context.sourceCode, current.test) !== first) return;
17464
17590
  count += 1;
17465
17591
  current = current.alternate;
@@ -17473,7 +17599,7 @@ var prefer_switch_for_repeated_equality_default = createRule({
17473
17599
  });
17474
17600
 
17475
17601
  // src/rules/prefer-semantic-colors.ts
17476
- import { AST_NODE_TYPES as AST_NODE_TYPES86 } from "@typescript-eslint/utils";
17602
+ import { AST_NODE_TYPES as AST_NODE_TYPES87 } from "@typescript-eslint/utils";
17477
17603
  import { existsSync as existsSync2, lstatSync as lstatSync2, readdirSync, readFileSync as readFileSync2 } from "fs";
17478
17604
  import { dirname as dirname2, join as join2, parse } from "path";
17479
17605
  var PREFER_SEMANTIC_COLORS_DOCUMENTATION = {
@@ -17583,7 +17709,7 @@ var SVG_EXEMPT_COLOR_VALUES = /* @__PURE__ */ new Set([
17583
17709
  var isInsideSvg = (node) => {
17584
17710
  let current = node.parent;
17585
17711
  while (current !== void 0 && current !== null) {
17586
- if (current.type === AST_NODE_TYPES86.JSXElement) {
17712
+ if (current.type === AST_NODE_TYPES87.JSXElement) {
17587
17713
  const name = jsxElementName(current);
17588
17714
  if (name !== null && isSvgLikeElementName(name)) return true;
17589
17715
  }
@@ -17593,8 +17719,8 @@ var isInsideSvg = (node) => {
17593
17719
  };
17594
17720
  function jsxElementName(node) {
17595
17721
  const name = node.openingElement.name;
17596
- if (name.type === AST_NODE_TYPES86.JSXIdentifier) return name.name;
17597
- if (name.type === AST_NODE_TYPES86.JSXMemberExpression && name.property.type === AST_NODE_TYPES86.JSXIdentifier) {
17722
+ if (name.type === AST_NODE_TYPES87.JSXIdentifier) return name.name;
17723
+ if (name.type === AST_NODE_TYPES87.JSXMemberExpression && name.property.type === AST_NODE_TYPES87.JSXIdentifier) {
17598
17724
  return name.property.name;
17599
17725
  }
17600
17726
  return null;
@@ -17626,7 +17752,7 @@ function isSvgLikeElementName(name) {
17626
17752
  var isInsideIconFactoryPath = (node) => {
17627
17753
  let current = node.parent;
17628
17754
  while (current !== void 0 && current !== null) {
17629
- if (current.type === AST_NODE_TYPES86.Property && propName(current.key) === "path" && current.parent.type === AST_NODE_TYPES86.ObjectExpression && current.parent.parent.type === AST_NODE_TYPES86.CallExpression && current.parent.parent.callee.type === AST_NODE_TYPES86.Identifier && current.parent.parent.callee.name === "createIcon") {
17755
+ if (current.type === AST_NODE_TYPES87.Property && propName(current.key) === "path" && current.parent.type === AST_NODE_TYPES87.ObjectExpression && current.parent.parent.type === AST_NODE_TYPES87.CallExpression && current.parent.parent.callee.type === AST_NODE_TYPES87.Identifier && current.parent.parent.callee.name === "createIcon") {
17630
17756
  return true;
17631
17757
  }
17632
17758
  current = current.parent;
@@ -17758,12 +17884,12 @@ var expandWorkspaceGlob = (root, glob) => {
17758
17884
  return readdirSync(parent, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).sort((left, right) => left.name.localeCompare(right.name)).map((entry) => join2(parent, entry.name));
17759
17885
  };
17760
17886
  var propName = (key) => {
17761
- if (key.type === AST_NODE_TYPES86.Identifier) return key.name;
17762
- if (key.type === AST_NODE_TYPES86.Literal && typeof key.value === "string") return key.value;
17887
+ if (key.type === AST_NODE_TYPES87.Identifier) return key.name;
17888
+ if (key.type === AST_NODE_TYPES87.Literal && typeof key.value === "string") return key.value;
17763
17889
  return null;
17764
17890
  };
17765
17891
  var staticallyImportsExternalRenderer = (program) => program.body.some((statement) => {
17766
- if (statement.type !== AST_NODE_TYPES86.ImportDeclaration && statement.type !== AST_NODE_TYPES86.ExportNamedDeclaration && statement.type !== AST_NODE_TYPES86.ExportAllDeclaration) {
17892
+ if (statement.type !== AST_NODE_TYPES87.ImportDeclaration && statement.type !== AST_NODE_TYPES87.ExportNamedDeclaration && statement.type !== AST_NODE_TYPES87.ExportAllDeclaration) {
17767
17893
  return false;
17768
17894
  }
17769
17895
  return statement.source !== null && typeof statement.source.value === "string" && EXTERNAL_RENDERER_MODULE_RE.test(statement.source.value);
@@ -17888,25 +18014,25 @@ var prefer_semantic_colors_default = createRule({
17888
18014
  const checkClassNode = (node, objectKeys = false) => {
17889
18015
  if (node === null) return;
17890
18016
  switch (node.type) {
17891
- case AST_NODE_TYPES86.Literal:
18017
+ case AST_NODE_TYPES87.Literal:
17892
18018
  if (typeof node.value === "string") reportClasses(node.value, node);
17893
18019
  break;
17894
- case AST_NODE_TYPES86.TemplateLiteral:
18020
+ case AST_NODE_TYPES87.TemplateLiteral:
17895
18021
  for (const quasi of node.quasis) reportClasses(quasi.value.cooked ?? "", quasi);
17896
18022
  break;
17897
- case AST_NODE_TYPES86.ArrayExpression:
18023
+ case AST_NODE_TYPES87.ArrayExpression:
17898
18024
  for (const element of node.elements) {
17899
- if (element !== null && element.type !== AST_NODE_TYPES86.SpreadElement) checkClassNode(element, objectKeys);
18025
+ if (element !== null && element.type !== AST_NODE_TYPES87.SpreadElement) checkClassNode(element, objectKeys);
17900
18026
  }
17901
18027
  break;
17902
- case AST_NODE_TYPES86.ObjectExpression:
18028
+ case AST_NODE_TYPES87.ObjectExpression:
17903
18029
  checkClassProperties(node, objectKeys);
17904
18030
  break;
17905
- case AST_NODE_TYPES86.ConditionalExpression:
18031
+ case AST_NODE_TYPES87.ConditionalExpression:
17906
18032
  checkClassNode(node.consequent, objectKeys);
17907
18033
  checkClassNode(node.alternate, objectKeys);
17908
18034
  break;
17909
- case AST_NODE_TYPES86.LogicalExpression:
18035
+ case AST_NODE_TYPES87.LogicalExpression:
17910
18036
  checkClassNode(node.right, objectKeys);
17911
18037
  break;
17912
18038
  default:
@@ -17915,10 +18041,10 @@ var prefer_semantic_colors_default = createRule({
17915
18041
  };
17916
18042
  function checkClassProperties(node, objectKeys) {
17917
18043
  for (const property of node.properties) {
17918
- if (property.type !== AST_NODE_TYPES86.Property) continue;
18044
+ if (property.type !== AST_NODE_TYPES87.Property) continue;
17919
18045
  if (objectKeys) {
17920
- if (property.value.type === AST_NODE_TYPES86.Literal && !property.value.value && !("regex" in property.value)) continue;
17921
- if (!property.computed && property.key.type === AST_NODE_TYPES86.Literal) {
18046
+ if (property.value.type === AST_NODE_TYPES87.Literal && !property.value.value && !("regex" in property.value)) continue;
18047
+ if (!property.computed && property.key.type === AST_NODE_TYPES87.Literal) {
17922
18048
  checkClassNode(property.key);
17923
18049
  }
17924
18050
  } else {
@@ -17927,34 +18053,34 @@ var prefer_semantic_colors_default = createRule({
17927
18053
  }
17928
18054
  }
17929
18055
  const checkColorValueNode = (node) => {
17930
- if (node.type === AST_NODE_TYPES86.Literal && typeof node.value === "string" && RAW_COLOR_VALUE_RE.test(node.value.replace(/url\(\s*(?:"[^"]*"|'[^']*'|[^)]*)\s*\)/giu, "")) && !CSS_VAR_REFERENCE_RE.test(node.value)) {
18056
+ if (node.type === AST_NODE_TYPES87.Literal && typeof node.value === "string" && RAW_COLOR_VALUE_RE.test(node.value.replace(/url\(\s*(?:"[^"]*"|'[^']*'|[^)]*)\s*\)/giu, "")) && !CSS_VAR_REFERENCE_RE.test(node.value)) {
17931
18057
  report2(node, "inlineColor", { value: node.value });
17932
18058
  }
17933
18059
  };
17934
18060
  return {
17935
18061
  "JSXAttribute[name.name='className']"(node) {
17936
18062
  if (node.value === null) return;
17937
- if (node.value.type === AST_NODE_TYPES86.Literal) checkClassNode(node.value);
17938
- else if (node.value.type === AST_NODE_TYPES86.JSXExpressionContainer) {
17939
- if (node.value.expression.type !== AST_NODE_TYPES86.JSXEmptyExpression) {
18063
+ if (node.value.type === AST_NODE_TYPES87.Literal) checkClassNode(node.value);
18064
+ else if (node.value.type === AST_NODE_TYPES87.JSXExpressionContainer) {
18065
+ if (node.value.expression.type !== AST_NODE_TYPES87.JSXEmptyExpression) {
17940
18066
  checkClassNode(node.value.expression);
17941
18067
  }
17942
18068
  }
17943
18069
  },
17944
18070
  CallExpression(node) {
17945
- if (node.callee.type === AST_NODE_TYPES86.Identifier && node.callee.name === "require" && node.arguments[0]?.type === AST_NODE_TYPES86.Literal && typeof node.arguments[0].value === "string" && EXTERNAL_RENDERER_MODULE_RE.test(node.arguments[0].value)) {
18071
+ if (node.callee.type === AST_NODE_TYPES87.Identifier && node.callee.name === "require" && node.arguments[0]?.type === AST_NODE_TYPES87.Literal && typeof node.arguments[0].value === "string" && EXTERNAL_RENDERER_MODULE_RE.test(node.arguments[0].value)) {
17946
18072
  importsExternalRenderer = true;
17947
18073
  }
17948
- if (node.callee.type === AST_NODE_TYPES86.Identifier && CLASS_FNS.has(node.callee.name)) {
18074
+ if (node.callee.type === AST_NODE_TYPES87.Identifier && CLASS_FNS.has(node.callee.name)) {
17949
18075
  for (const arg of node.arguments) {
17950
- if (arg.type !== AST_NODE_TYPES86.SpreadElement) {
18076
+ if (arg.type !== AST_NODE_TYPES87.SpreadElement) {
17951
18077
  checkClassNode(arg, node.callee.name !== "cva" && node.callee.name !== "tv");
17952
18078
  }
17953
18079
  }
17954
18080
  }
17955
18081
  },
17956
18082
  VariableDeclarator(node) {
17957
- if (node.id.type === AST_NODE_TYPES86.Identifier && CLASS_NAME_RE.test(node.id.name)) {
18083
+ if (node.id.type === AST_NODE_TYPES87.Identifier && CLASS_NAME_RE.test(node.id.name)) {
17958
18084
  checkClassNode(node.init);
17959
18085
  }
17960
18086
  },
@@ -17964,9 +18090,9 @@ var prefer_semantic_colors_default = createRule({
17964
18090
  },
17965
18091
  // SVG artwork colors are exempt; component presentation colors still report.
17966
18092
  "JSXAttribute[name.name=/^(fill|stroke|color)$/]"(node) {
17967
- if (node.value?.type !== AST_NODE_TYPES86.Literal) return;
18093
+ if (node.value?.type !== AST_NODE_TYPES87.Literal) return;
17968
18094
  const owner = node.parent.name;
17969
- if (owner.type === AST_NODE_TYPES86.JSXIdentifier && SVG_SHAPE_PRIMITIVES.has(owner.name)) {
18095
+ if (owner.type === AST_NODE_TYPES87.JSXIdentifier && SVG_SHAPE_PRIMITIVES.has(owner.name)) {
17970
18096
  return;
17971
18097
  }
17972
18098
  if (typeof node.value.value === "string" && SVG_EXEMPT_COLOR_VALUES.has(node.value.value.toLowerCase())) {
@@ -17980,7 +18106,7 @@ var prefer_semantic_colors_default = createRule({
17980
18106
  if (name !== null && STYLE_COLOR_PROPS.has(name)) checkColorValueNode(node.value);
17981
18107
  },
17982
18108
  ImportExpression(node) {
17983
- if (node.source.type === AST_NODE_TYPES86.Literal && typeof node.source.value === "string" && EXTERNAL_RENDERER_MODULE_RE.test(node.source.value)) {
18109
+ if (node.source.type === AST_NODE_TYPES87.Literal && typeof node.source.value === "string" && EXTERNAL_RENDERER_MODULE_RE.test(node.source.value)) {
17984
18110
  importsExternalRenderer = true;
17985
18111
  }
17986
18112
  },
@@ -18000,7 +18126,7 @@ function packageWorkspaceGlobs(parsed) {
18000
18126
  }
18001
18127
 
18002
18128
  // src/rules/prefer-server-actions.ts
18003
- import { ASTUtils as ASTUtils43 } from "@typescript-eslint/utils";
18129
+ import { ASTUtils as ASTUtils44 } from "@typescript-eslint/utils";
18004
18130
  var PREFER_SERVER_ACTIONS_DOCUMENTATION = {
18005
18131
  summary: "Prefer Next.js Server Actions over same-origin API mutations.",
18006
18132
  rationale: "Server Actions can remove a hand-written internal API wrapper while retaining typed application calls. Client invocations still cross a network and serialization boundary.",
@@ -18032,7 +18158,7 @@ function resolvesToGlobalFetch(context, identifier) {
18032
18158
  function resolveNode(node, context) {
18033
18159
  if (!node) return null;
18034
18160
  if (node.type !== "Identifier") return node;
18035
- const variable = ASTUtils43.findVariable(getScope(context, node), node.name);
18161
+ const variable = ASTUtils44.findVariable(getScope(context, node), node.name);
18036
18162
  const definition = variable?.defs.length === 1 ? variable.defs[0] : void 0;
18037
18163
  if (definition?.type !== "Variable" || definition.parent.kind !== "const" || definition.node.init === null || variable?.references.some((reference) => reference.isWrite() && reference.init !== true)) return node;
18038
18164
  if (definition.node.init.type === "ObjectExpression" && variable?.references.some((reference) => reference.identifier !== node && reference.init !== true)) return node;
@@ -18041,7 +18167,7 @@ function resolveNode(node, context) {
18041
18167
  function isAxiosClient(node, context, seen = /* @__PURE__ */ new Set()) {
18042
18168
  if (node.type !== "Identifier" || seen.has(node)) return false;
18043
18169
  seen.add(node);
18044
- const variable = ASTUtils43.findVariable(getScope(context, node), node.name);
18170
+ const variable = ASTUtils44.findVariable(getScope(context, node), node.name);
18045
18171
  const definition = variable?.defs.length === 1 ? variable.defs[0] : void 0;
18046
18172
  if (definition === void 0 || variable?.references.some((reference) => reference.isWrite() && reference.init !== true)) return false;
18047
18173
  if (variable?.references.some((reference) => {
@@ -18256,7 +18382,7 @@ var prefer_server_actions_default = createRule({
18256
18382
  });
18257
18383
 
18258
18384
  // src/rules/prefer-whole-object-assertion.ts
18259
- import { AST_NODE_TYPES as AST_NODE_TYPES87, ASTUtils as ASTUtils44 } from "@typescript-eslint/utils";
18385
+ import { AST_NODE_TYPES as AST_NODE_TYPES88, ASTUtils as ASTUtils45 } from "@typescript-eslint/utils";
18260
18386
  var MERGEABLE_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
18261
18387
  var SYNTHETIC_LITERAL_MATCHERS = /* @__PURE__ */ new Map([
18262
18388
  ["toBeNull", "null"],
@@ -18283,11 +18409,11 @@ var PREFER_WHOLE_OBJECT_ASSERTION_DOCUMENTATION = {
18283
18409
  };
18284
18410
  function literalText(node, getText) {
18285
18411
  switch (node.type) {
18286
- case AST_NODE_TYPES87.Literal:
18412
+ case AST_NODE_TYPES88.Literal:
18287
18413
  return "regex" in node ? null : getText(node);
18288
- case AST_NODE_TYPES87.TemplateLiteral:
18414
+ case AST_NODE_TYPES88.TemplateLiteral:
18289
18415
  return node.expressions.length === 0 ? getText(node) : null;
18290
- case AST_NODE_TYPES87.UnaryExpression:
18416
+ case AST_NODE_TYPES88.UnaryExpression:
18291
18417
  return NUMERIC_SIGNS2.has(node.operator) && literalText(node.argument, getText) !== null ? getText(node) : null;
18292
18418
  default:
18293
18419
  return null;
@@ -18295,15 +18421,15 @@ function literalText(node, getText) {
18295
18421
  }
18296
18422
  function isPureReceiver(node) {
18297
18423
  switch (node.type) {
18298
- case AST_NODE_TYPES87.Identifier:
18299
- case AST_NODE_TYPES87.ThisExpression:
18424
+ case AST_NODE_TYPES88.Identifier:
18425
+ case AST_NODE_TYPES88.ThisExpression:
18300
18426
  return true;
18301
- case AST_NODE_TYPES87.MemberExpression:
18427
+ case AST_NODE_TYPES88.MemberExpression:
18302
18428
  if (node.optional) {
18303
18429
  return false;
18304
18430
  }
18305
18431
  if (node.computed) {
18306
- return node.property.type === AST_NODE_TYPES87.Literal && isPureReceiver(node.object);
18432
+ return node.property.type === AST_NODE_TYPES88.Literal && isPureReceiver(node.object);
18307
18433
  }
18308
18434
  return isPureReceiver(node.object);
18309
18435
  default:
@@ -18311,7 +18437,7 @@ function isPureReceiver(node) {
18311
18437
  }
18312
18438
  }
18313
18439
  function literalIndex(node) {
18314
- if (node.type !== AST_NODE_TYPES87.Literal || typeof node.value !== "number") {
18440
+ if (node.type !== AST_NODE_TYPES88.Literal || typeof node.value !== "number") {
18315
18441
  return null;
18316
18442
  }
18317
18443
  return Number.isInteger(node.value) && node.value >= 0 ? node.value : null;
@@ -18319,8 +18445,8 @@ function literalIndex(node) {
18319
18445
  function propertyAccess(node) {
18320
18446
  const path = [];
18321
18447
  let current = node;
18322
- while (current.type === AST_NODE_TYPES87.MemberExpression && !current.computed && !current.optional) {
18323
- if (current.property.type !== AST_NODE_TYPES87.Identifier || COLLECTION_PROPERTIES.has(current.property.name) || LITERAL_KEY_HAZARDS.has(current.property.name)) return null;
18448
+ while (current.type === AST_NODE_TYPES88.MemberExpression && !current.computed && !current.optional) {
18449
+ if (current.property.type !== AST_NODE_TYPES88.Identifier || COLLECTION_PROPERTIES.has(current.property.name) || LITERAL_KEY_HAZARDS.has(current.property.name)) return null;
18324
18450
  path.unshift(current.property.name);
18325
18451
  current = current.object;
18326
18452
  }
@@ -18347,25 +18473,25 @@ var prefer_whole_object_assertion_default = createRule({
18347
18473
  }
18348
18474
  const { sourceCode } = context;
18349
18475
  function parseAssertion(statement) {
18350
- if (statement.type !== AST_NODE_TYPES87.ExpressionStatement) {
18476
+ if (statement.type !== AST_NODE_TYPES88.ExpressionStatement) {
18351
18477
  return null;
18352
18478
  }
18353
18479
  const call = statement.expression;
18354
- if (call.type !== AST_NODE_TYPES87.CallExpression) {
18480
+ if (call.type !== AST_NODE_TYPES88.CallExpression) {
18355
18481
  return null;
18356
18482
  }
18357
18483
  const callee = call.callee;
18358
- if (callee.type !== AST_NODE_TYPES87.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES87.Identifier) {
18484
+ if (callee.type !== AST_NODE_TYPES88.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES88.Identifier) {
18359
18485
  return null;
18360
18486
  }
18361
18487
  const matcher = callee.property.name;
18362
18488
  const expectCall = callee.object;
18363
- if (expectCall.type !== AST_NODE_TYPES87.CallExpression || expectCall.callee.type !== AST_NODE_TYPES87.Identifier || expectCall.callee.name !== "expect" || expectCall.arguments.length !== 1) {
18489
+ if (expectCall.type !== AST_NODE_TYPES88.CallExpression || expectCall.callee.type !== AST_NODE_TYPES88.Identifier || expectCall.callee.name !== "expect" || expectCall.arguments.length !== 1) {
18364
18490
  return null;
18365
18491
  }
18366
18492
  const actual = expectCall.arguments[0];
18367
18493
  if (!isTestExpect(expectCall.callee)) return null;
18368
- if (actual === void 0 || actual.type !== AST_NODE_TYPES87.MemberExpression || actual.optional) {
18494
+ if (actual === void 0 || actual.type !== AST_NODE_TYPES88.MemberExpression || actual.optional) {
18369
18495
  return null;
18370
18496
  }
18371
18497
  if (!isPureReceiver(actual.object)) {
@@ -18397,7 +18523,7 @@ var prefer_whole_object_assertion_default = createRule({
18397
18523
  return null;
18398
18524
  }
18399
18525
  const expected = call.arguments[0];
18400
- if (call.arguments.length !== 1 || expected === void 0 || expected.type === AST_NODE_TYPES87.SpreadElement) {
18526
+ if (call.arguments.length !== 1 || expected === void 0 || expected.type === AST_NODE_TYPES88.SpreadElement) {
18401
18527
  return null;
18402
18528
  }
18403
18529
  const literal = literalText(expected, (node) => sourceCode.getText(node));
@@ -18411,12 +18537,12 @@ var prefer_whole_object_assertion_default = createRule({
18411
18537
  };
18412
18538
  }
18413
18539
  function isTestExpect(callee) {
18414
- const variable = ASTUtils44.findVariable(sourceCode.getScope(callee), callee.name);
18540
+ const variable = ASTUtils45.findVariable(sourceCode.getScope(callee), callee.name);
18415
18541
  if (variable !== null && variable.defs.some((definition) => {
18416
- if (definition.node.type !== AST_NODE_TYPES87.ImportSpecifier) return true;
18542
+ if (definition.node.type !== AST_NODE_TYPES88.ImportSpecifier) return true;
18417
18543
  const declaration = definition.node.parent;
18418
18544
  const imported = definition.node.imported;
18419
- return declaration.type !== AST_NODE_TYPES87.ImportDeclaration || !["vitest", "@jest/globals", "@playwright/test", "bun:test"].includes(String(declaration.source.value)) || (imported.type === AST_NODE_TYPES87.Identifier ? imported.name : imported.value) !== "expect";
18545
+ return declaration.type !== AST_NODE_TYPES88.ImportDeclaration || !["vitest", "@jest/globals", "@playwright/test", "bun:test"].includes(String(declaration.source.value)) || (imported.type === AST_NODE_TYPES88.Identifier ? imported.name : imported.value) !== "expect";
18420
18546
  })) return false;
18421
18547
  return true;
18422
18548
  }
@@ -18541,7 +18667,7 @@ var prefer_whole_object_assertion_default = createRule({
18541
18667
  });
18542
18668
 
18543
18669
  // src/rules/repeated-static-call-cases.ts
18544
- import { AST_NODE_TYPES as AST_NODE_TYPES88, ASTUtils as ASTUtils45 } from "@typescript-eslint/utils";
18670
+ import { AST_NODE_TYPES as AST_NODE_TYPES89, ASTUtils as ASTUtils46 } from "@typescript-eslint/utils";
18545
18671
  var REPEATED_STATIC_CALL_CASES_DOCUMENTATION = {
18546
18672
  summary: "Review three or more consecutive static-input call assertions as potential named cases.",
18547
18673
  rationale: "Copy-pasted cases obscure the input table, and a thrown assertion can stop later cases from being reported.",
@@ -18562,67 +18688,67 @@ var EXPECT_MODIFIERS = /* @__PURE__ */ new Set(["not", "rejects", "resolves"]);
18562
18688
  var SNAPSHOT_MATCHERS = /snapshot/iu;
18563
18689
  var MIN_CASES2 = 3;
18564
18690
  function staticMemberName6(node) {
18565
- if (!node.computed && node.property.type === AST_NODE_TYPES88.Identifier) return node.property.name;
18566
- if (node.computed && node.property.type === AST_NODE_TYPES88.Literal && typeof node.property.value === "string") return node.property.value;
18691
+ if (!node.computed && node.property.type === AST_NODE_TYPES89.Identifier) return node.property.name;
18692
+ if (node.computed && node.property.type === AST_NODE_TYPES89.Literal && typeof node.property.value === "string") return node.property.value;
18567
18693
  return null;
18568
18694
  }
18569
18695
  function importedName7(identifier, context, modules) {
18570
- const variable = ASTUtils45.findVariable(context.sourceCode.getScope(identifier), identifier.name);
18696
+ const variable = ASTUtils46.findVariable(context.sourceCode.getScope(identifier), identifier.name);
18571
18697
  if (variable === null || variable.defs.length === 0) return identifier.name;
18572
18698
  for (const definition of variable.defs) {
18573
- if (definition.node.type !== AST_NODE_TYPES88.ImportSpecifier) continue;
18699
+ if (definition.node.type !== AST_NODE_TYPES89.ImportSpecifier) continue;
18574
18700
  const declaration = definition.node.parent;
18575
- if (declaration.type !== AST_NODE_TYPES88.ImportDeclaration || typeof declaration.source.value !== "string" || !modules.has(declaration.source.value)) continue;
18701
+ if (declaration.type !== AST_NODE_TYPES89.ImportDeclaration || typeof declaration.source.value !== "string" || !modules.has(declaration.source.value)) continue;
18576
18702
  const imported = definition.node.imported;
18577
- return imported.type === AST_NODE_TYPES88.Identifier ? imported.name : String(imported.value);
18703
+ return imported.type === AST_NODE_TYPES89.Identifier ? imported.name : String(imported.value);
18578
18704
  }
18579
18705
  return null;
18580
18706
  }
18581
18707
  function isDirectTestCallback2(node, context) {
18582
- if (node.type !== AST_NODE_TYPES88.ArrowFunctionExpression && node.type !== AST_NODE_TYPES88.FunctionExpression) return false;
18708
+ if (node.type !== AST_NODE_TYPES89.ArrowFunctionExpression && node.type !== AST_NODE_TYPES89.FunctionExpression) return false;
18583
18709
  const call = node.parent;
18584
- if (call?.type !== AST_NODE_TYPES88.CallExpression || !call.arguments.includes(node)) return false;
18710
+ if (call?.type !== AST_NODE_TYPES89.CallExpression || !call.arguments.includes(node)) return false;
18585
18711
  const root = testRoot2(call.callee);
18586
18712
  return root !== null && TEST_NAMES2.has(importedName7(root, context, TEST_MODULES4) ?? "");
18587
18713
  }
18588
18714
  function testRoot2(callee) {
18589
- if (callee.type === AST_NODE_TYPES88.Identifier) return callee;
18590
- if (callee.type !== AST_NODE_TYPES88.MemberExpression) return null;
18715
+ if (callee.type === AST_NODE_TYPES89.Identifier) return callee;
18716
+ if (callee.type !== AST_NODE_TYPES89.MemberExpression) return null;
18591
18717
  const modifier = staticMemberName6(callee);
18592
18718
  return modifier !== null && TEST_MODIFIERS4.has(modifier) ? testRoot2(callee.object) : null;
18593
18719
  }
18594
18720
  function isStatic(node) {
18595
- if (node.type === AST_NODE_TYPES88.TSAsExpression || node.type === AST_NODE_TYPES88.TSTypeAssertion || node.type === AST_NODE_TYPES88.TSSatisfiesExpression || node.type === AST_NODE_TYPES88.TSNonNullExpression) return isStatic(node.expression);
18721
+ if (node.type === AST_NODE_TYPES89.TSAsExpression || node.type === AST_NODE_TYPES89.TSTypeAssertion || node.type === AST_NODE_TYPES89.TSSatisfiesExpression || node.type === AST_NODE_TYPES89.TSNonNullExpression) return isStatic(node.expression);
18596
18722
  switch (node.type) {
18597
- case AST_NODE_TYPES88.Literal:
18723
+ case AST_NODE_TYPES89.Literal:
18598
18724
  return true;
18599
- case AST_NODE_TYPES88.TemplateLiteral:
18725
+ case AST_NODE_TYPES89.TemplateLiteral:
18600
18726
  return node.expressions.length === 0;
18601
- case AST_NODE_TYPES88.UnaryExpression:
18727
+ case AST_NODE_TYPES89.UnaryExpression:
18602
18728
  return (node.operator === "+" || node.operator === "-") && isStatic(node.argument);
18603
- case AST_NODE_TYPES88.ArrayExpression:
18604
- return node.elements.every((item) => item !== null && item.type !== AST_NODE_TYPES88.SpreadElement && isStatic(item));
18605
- case AST_NODE_TYPES88.ObjectExpression:
18606
- return node.properties.every((property) => property.type === AST_NODE_TYPES88.Property && !property.computed && property.kind === "init" && property.value.type !== AST_NODE_TYPES88.AssignmentPattern && isStatic(property.value));
18729
+ case AST_NODE_TYPES89.ArrayExpression:
18730
+ return node.elements.every((item) => item !== null && item.type !== AST_NODE_TYPES89.SpreadElement && isStatic(item));
18731
+ case AST_NODE_TYPES89.ObjectExpression:
18732
+ return node.properties.every((property) => property.type === AST_NODE_TYPES89.Property && !property.computed && property.kind === "init" && property.value.type !== AST_NODE_TYPES89.AssignmentPattern && isStatic(property.value));
18607
18733
  default:
18608
18734
  return false;
18609
18735
  }
18610
18736
  }
18611
18737
  function staticShape(node) {
18612
- if (node.type === AST_NODE_TYPES88.TSAsExpression || node.type === AST_NODE_TYPES88.TSTypeAssertion || node.type === AST_NODE_TYPES88.TSSatisfiesExpression || node.type === AST_NODE_TYPES88.TSNonNullExpression) return staticShape(node.expression);
18738
+ if (node.type === AST_NODE_TYPES89.TSAsExpression || node.type === AST_NODE_TYPES89.TSTypeAssertion || node.type === AST_NODE_TYPES89.TSSatisfiesExpression || node.type === AST_NODE_TYPES89.TSNonNullExpression) return staticShape(node.expression);
18613
18739
  switch (node.type) {
18614
- case AST_NODE_TYPES88.Literal:
18740
+ case AST_NODE_TYPES89.Literal:
18615
18741
  return `literal:${typeof node.value}`;
18616
- case AST_NODE_TYPES88.TemplateLiteral:
18742
+ case AST_NODE_TYPES89.TemplateLiteral:
18617
18743
  return "template";
18618
- case AST_NODE_TYPES88.UnaryExpression:
18744
+ case AST_NODE_TYPES89.UnaryExpression:
18619
18745
  return `unary:${node.operator}:${staticShape(node.argument)}`;
18620
- case AST_NODE_TYPES88.ArrayExpression:
18621
- return `array(${node.elements.map((item) => item === null || item.type === AST_NODE_TYPES88.SpreadElement ? "invalid" : staticShape(item)).join(",")})`;
18622
- case AST_NODE_TYPES88.ObjectExpression:
18746
+ case AST_NODE_TYPES89.ArrayExpression:
18747
+ return `array(${node.elements.map((item) => item === null || item.type === AST_NODE_TYPES89.SpreadElement ? "invalid" : staticShape(item)).join(",")})`;
18748
+ case AST_NODE_TYPES89.ObjectExpression:
18623
18749
  return `object(${node.properties.map((property) => {
18624
- if (property.type !== AST_NODE_TYPES88.Property || property.computed || property.value.type === AST_NODE_TYPES88.AssignmentPattern) return "invalid";
18625
- const key = property.key.type === AST_NODE_TYPES88.Identifier ? property.key.name : String(property.key.value);
18750
+ if (property.type !== AST_NODE_TYPES89.Property || property.computed || property.value.type === AST_NODE_TYPES89.AssignmentPattern) return "invalid";
18751
+ const key = property.key.type === AST_NODE_TYPES89.Identifier ? property.key.name : String(property.key.value);
18626
18752
  return `${key}:${staticShape(property.value)}`;
18627
18753
  }).join(",")})`;
18628
18754
  default:
@@ -18630,18 +18756,18 @@ function staticShape(node) {
18630
18756
  }
18631
18757
  }
18632
18758
  function assertionShape(statement, context, callback) {
18633
- if (statement.type !== AST_NODE_TYPES88.ExpressionStatement || statement.expression.type !== AST_NODE_TYPES88.CallExpression) return null;
18759
+ if (statement.type !== AST_NODE_TYPES89.ExpressionStatement || statement.expression.type !== AST_NODE_TYPES89.CallExpression) return null;
18634
18760
  const matcherCall = statement.expression;
18635
- if (matcherCall.callee.type !== AST_NODE_TYPES88.MemberExpression || matcherCall.callee.computed || matcherCall.callee.property.type !== AST_NODE_TYPES88.Identifier || matcherCall.arguments.length !== 1) return null;
18761
+ if (matcherCall.callee.type !== AST_NODE_TYPES89.MemberExpression || matcherCall.callee.computed || matcherCall.callee.property.type !== AST_NODE_TYPES89.Identifier || matcherCall.arguments.length !== 1) return null;
18636
18762
  const matcher = matcherCall.callee.property.name;
18637
18763
  if (SNAPSHOT_MATCHERS.test(matcher)) return null;
18638
18764
  const chain = expectCallFromMatcher(matcherCall.callee);
18639
- if (chain === null || chain.call.callee.type !== AST_NODE_TYPES88.Identifier || importedName7(chain.call.callee, context, ASSERTION_MODULES3) !== "expect" || chain.call.arguments.length !== 1) return null;
18765
+ if (chain === null || chain.call.callee.type !== AST_NODE_TYPES89.Identifier || importedName7(chain.call.callee, context, ASSERTION_MODULES3) !== "expect" || chain.call.arguments.length !== 1) return null;
18640
18766
  const observed = chain.call.arguments[0];
18641
18767
  const expected = matcherCall.arguments[0];
18642
- if (observed?.type !== AST_NODE_TYPES88.CallExpression || observed.callee.type !== AST_NODE_TYPES88.Identifier || observed.arguments.length === 0 || observed.arguments.some((arg) => arg.type === AST_NODE_TYPES88.SpreadElement || !isStatic(arg)) || expected?.type === AST_NODE_TYPES88.SpreadElement || expected === void 0 || !isStatic(expected)) return null;
18768
+ if (observed?.type !== AST_NODE_TYPES89.CallExpression || observed.callee.type !== AST_NODE_TYPES89.Identifier || observed.arguments.length === 0 || observed.arguments.some((arg) => arg.type === AST_NODE_TYPES89.SpreadElement || !isStatic(arg)) || expected?.type === AST_NODE_TYPES89.SpreadElement || expected === void 0 || !isStatic(expected)) return null;
18643
18769
  const skeleton = `${observed.callee.name}/${observed.arguments.map((item) => staticShape(item)).join(",")}/${chain.modifiers.join(".")}/${matcher}/${staticShape(expected)}`;
18644
- const binding = ASTUtils45.findVariable(context.sourceCode.getScope(observed.callee), observed.callee.name);
18770
+ const binding = ASTUtils46.findVariable(context.sourceCode.getScope(observed.callee), observed.callee.name);
18645
18771
  if (binding?.defs.some(
18646
18772
  (definition) => definition.node.range[0] >= callback.range[0] && definition.node.range[1] <= callback.range[1]
18647
18773
  )) return null;
@@ -18651,13 +18777,13 @@ function assertionShape(statement, context, callback) {
18651
18777
  function expectCallFromMatcher(node) {
18652
18778
  const modifiers = [];
18653
18779
  let receiver = node.object;
18654
- while (receiver.type === AST_NODE_TYPES88.MemberExpression) {
18780
+ while (receiver.type === AST_NODE_TYPES89.MemberExpression) {
18655
18781
  const modifier = staticMemberName6(receiver);
18656
18782
  if (modifier === null || !EXPECT_MODIFIERS.has(modifier)) return null;
18657
18783
  modifiers.unshift(modifier);
18658
18784
  receiver = receiver.object;
18659
18785
  }
18660
- return receiver.type === AST_NODE_TYPES88.CallExpression ? { call: receiver, modifiers } : null;
18786
+ return receiver.type === AST_NODE_TYPES89.CallExpression ? { call: receiver, modifiers } : null;
18661
18787
  }
18662
18788
  var repeated_static_call_cases_default = createRule({
18663
18789
  name: "repeated-static-call-cases",
@@ -18677,7 +18803,7 @@ var repeated_static_call_cases_default = createRule({
18677
18803
  return {
18678
18804
  "CallExpression > ArrowFunctionExpression, CallExpression > FunctionExpression"(node) {
18679
18805
  const call = node.parent;
18680
- if (call?.type === AST_NODE_TYPES88.CallExpression) {
18806
+ if (call?.type === AST_NODE_TYPES89.CallExpression) {
18681
18807
  const duplicate = duplicateTestBodyCandidate(call, sourceCode);
18682
18808
  if (duplicate !== null && duplicate.body === node) {
18683
18809
  const groups = duplicateGroups.get(duplicate.container) ?? /* @__PURE__ */ new Map();
@@ -18687,7 +18813,7 @@ var repeated_static_call_cases_default = createRule({
18687
18813
  duplicateGroups.set(duplicate.container, groups);
18688
18814
  }
18689
18815
  }
18690
- if (!isDirectTestCallback2(node, context) || node.body.type !== AST_NODE_TYPES88.BlockStatement) return;
18816
+ if (!isDirectTestCallback2(node, context) || node.body.type !== AST_NODE_TYPES89.BlockStatement) return;
18691
18817
  let run = [];
18692
18818
  const flush = () => {
18693
18819
  if (run.length >= MIN_CASES2 && new Set(run.map((item) => item.values)).size > 1) {
@@ -18728,7 +18854,7 @@ var repeated_static_call_cases_default = createRule({
18728
18854
  });
18729
18855
 
18730
18856
  // src/rules/prefer-zod-infer.ts
18731
- import { AST_NODE_TYPES as AST_NODE_TYPES89 } from "@typescript-eslint/utils";
18857
+ import { AST_NODE_TYPES as AST_NODE_TYPES90 } from "@typescript-eslint/utils";
18732
18858
  var PREFER_ZOD_INFER_DOCUMENTATION = {
18733
18859
  summary: "Derive a type from its Zod schema with `z.infer` instead of hand-writing a twin declaration beside it.",
18734
18860
  rationale: "A derived type stays synchronized when the runtime schema changes.",
@@ -18792,47 +18918,47 @@ function isPreferZodInferTypeConstraintName(name) {
18792
18918
  return ZOD_TYPE_CONSTRAINTS.has(name);
18793
18919
  }
18794
18920
  var LEAF_NODE_TYPES = {
18795
- string: [AST_NODE_TYPES89.TSStringKeyword],
18796
- email: [AST_NODE_TYPES89.TSStringKeyword],
18797
- url: [AST_NODE_TYPES89.TSStringKeyword],
18798
- uuid: [AST_NODE_TYPES89.TSStringKeyword],
18799
- ulid: [AST_NODE_TYPES89.TSStringKeyword],
18800
- cuid: [AST_NODE_TYPES89.TSStringKeyword],
18801
- cuid2: [AST_NODE_TYPES89.TSStringKeyword],
18802
- nanoid: [AST_NODE_TYPES89.TSStringKeyword],
18803
- iso: [AST_NODE_TYPES89.TSStringKeyword],
18804
- number: [AST_NODE_TYPES89.TSNumberKeyword],
18805
- int: [AST_NODE_TYPES89.TSNumberKeyword],
18806
- float32: [AST_NODE_TYPES89.TSNumberKeyword],
18807
- float64: [AST_NODE_TYPES89.TSNumberKeyword],
18808
- boolean: [AST_NODE_TYPES89.TSBooleanKeyword],
18809
- bigint: [AST_NODE_TYPES89.TSBigIntKeyword],
18810
- symbol: [AST_NODE_TYPES89.TSSymbolKeyword],
18811
- any: [AST_NODE_TYPES89.TSAnyKeyword],
18812
- unknown: [AST_NODE_TYPES89.TSUnknownKeyword],
18813
- never: [AST_NODE_TYPES89.TSNeverKeyword],
18814
- void: [AST_NODE_TYPES89.TSVoidKeyword],
18815
- null: [AST_NODE_TYPES89.TSNullKeyword],
18816
- undefined: [AST_NODE_TYPES89.TSUndefinedKeyword],
18817
- literal: [AST_NODE_TYPES89.TSLiteralType],
18818
- date: [AST_NODE_TYPES89.TSTypeReference],
18819
- array: [AST_NODE_TYPES89.TSArrayType, AST_NODE_TYPES89.TSTypeReference],
18820
- tuple: [AST_NODE_TYPES89.TSTupleType],
18821
- object: [AST_NODE_TYPES89.TSTypeLiteral, AST_NODE_TYPES89.TSTypeReference],
18822
- strictObject: [AST_NODE_TYPES89.TSTypeLiteral, AST_NODE_TYPES89.TSTypeReference],
18823
- looseObject: [AST_NODE_TYPES89.TSTypeLiteral, AST_NODE_TYPES89.TSTypeReference],
18824
- record: [AST_NODE_TYPES89.TSTypeReference, AST_NODE_TYPES89.TSTypeLiteral],
18825
- map: [AST_NODE_TYPES89.TSTypeReference],
18826
- set: [AST_NODE_TYPES89.TSTypeReference],
18827
- promise: [AST_NODE_TYPES89.TSTypeReference],
18828
- enum: [AST_NODE_TYPES89.TSUnionType, AST_NODE_TYPES89.TSTypeReference, AST_NODE_TYPES89.TSLiteralType],
18829
- nativeEnum: [AST_NODE_TYPES89.TSUnionType, AST_NODE_TYPES89.TSTypeReference, AST_NODE_TYPES89.TSLiteralType],
18830
- union: [AST_NODE_TYPES89.TSUnionType, AST_NODE_TYPES89.TSTypeReference],
18831
- discriminatedUnion: [AST_NODE_TYPES89.TSUnionType, AST_NODE_TYPES89.TSTypeReference],
18832
- intersection: [AST_NODE_TYPES89.TSIntersectionType, AST_NODE_TYPES89.TSTypeReference]
18921
+ string: [AST_NODE_TYPES90.TSStringKeyword],
18922
+ email: [AST_NODE_TYPES90.TSStringKeyword],
18923
+ url: [AST_NODE_TYPES90.TSStringKeyword],
18924
+ uuid: [AST_NODE_TYPES90.TSStringKeyword],
18925
+ ulid: [AST_NODE_TYPES90.TSStringKeyword],
18926
+ cuid: [AST_NODE_TYPES90.TSStringKeyword],
18927
+ cuid2: [AST_NODE_TYPES90.TSStringKeyword],
18928
+ nanoid: [AST_NODE_TYPES90.TSStringKeyword],
18929
+ iso: [AST_NODE_TYPES90.TSStringKeyword],
18930
+ number: [AST_NODE_TYPES90.TSNumberKeyword],
18931
+ int: [AST_NODE_TYPES90.TSNumberKeyword],
18932
+ float32: [AST_NODE_TYPES90.TSNumberKeyword],
18933
+ float64: [AST_NODE_TYPES90.TSNumberKeyword],
18934
+ boolean: [AST_NODE_TYPES90.TSBooleanKeyword],
18935
+ bigint: [AST_NODE_TYPES90.TSBigIntKeyword],
18936
+ symbol: [AST_NODE_TYPES90.TSSymbolKeyword],
18937
+ any: [AST_NODE_TYPES90.TSAnyKeyword],
18938
+ unknown: [AST_NODE_TYPES90.TSUnknownKeyword],
18939
+ never: [AST_NODE_TYPES90.TSNeverKeyword],
18940
+ void: [AST_NODE_TYPES90.TSVoidKeyword],
18941
+ null: [AST_NODE_TYPES90.TSNullKeyword],
18942
+ undefined: [AST_NODE_TYPES90.TSUndefinedKeyword],
18943
+ literal: [AST_NODE_TYPES90.TSLiteralType],
18944
+ date: [AST_NODE_TYPES90.TSTypeReference],
18945
+ array: [AST_NODE_TYPES90.TSArrayType, AST_NODE_TYPES90.TSTypeReference],
18946
+ tuple: [AST_NODE_TYPES90.TSTupleType],
18947
+ object: [AST_NODE_TYPES90.TSTypeLiteral, AST_NODE_TYPES90.TSTypeReference],
18948
+ strictObject: [AST_NODE_TYPES90.TSTypeLiteral, AST_NODE_TYPES90.TSTypeReference],
18949
+ looseObject: [AST_NODE_TYPES90.TSTypeLiteral, AST_NODE_TYPES90.TSTypeReference],
18950
+ record: [AST_NODE_TYPES90.TSTypeReference, AST_NODE_TYPES90.TSTypeLiteral],
18951
+ map: [AST_NODE_TYPES90.TSTypeReference],
18952
+ set: [AST_NODE_TYPES90.TSTypeReference],
18953
+ promise: [AST_NODE_TYPES90.TSTypeReference],
18954
+ enum: [AST_NODE_TYPES90.TSUnionType, AST_NODE_TYPES90.TSTypeReference, AST_NODE_TYPES90.TSLiteralType],
18955
+ nativeEnum: [AST_NODE_TYPES90.TSUnionType, AST_NODE_TYPES90.TSTypeReference, AST_NODE_TYPES90.TSLiteralType],
18956
+ union: [AST_NODE_TYPES90.TSUnionType, AST_NODE_TYPES90.TSTypeReference],
18957
+ discriminatedUnion: [AST_NODE_TYPES90.TSUnionType, AST_NODE_TYPES90.TSTypeReference],
18958
+ intersection: [AST_NODE_TYPES90.TSIntersectionType, AST_NODE_TYPES90.TSTypeReference]
18833
18959
  };
18834
18960
  function primitiveLiteralKey(node) {
18835
- if (node.type !== AST_NODE_TYPES89.Literal) {
18961
+ if (node.type !== AST_NODE_TYPES90.Literal) {
18836
18962
  return null;
18837
18963
  }
18838
18964
  if (node.value === null) {
@@ -18864,13 +18990,13 @@ function staticZodDomain(leaf, call) {
18864
18990
  }
18865
18991
  if (leaf === "literal") {
18866
18992
  const [argument] = call.arguments;
18867
- if (argument === void 0 || argument.type === AST_NODE_TYPES89.SpreadElement) {
18993
+ if (argument === void 0 || argument.type === AST_NODE_TYPES90.SpreadElement) {
18868
18994
  return null;
18869
18995
  }
18870
- if (argument.type === AST_NODE_TYPES89.ArrayExpression) {
18996
+ if (argument.type === AST_NODE_TYPES90.ArrayExpression) {
18871
18997
  return exactDomain(
18872
18998
  argument.elements.map(
18873
- (element) => element === null || element.type === AST_NODE_TYPES89.SpreadElement ? null : primitiveLiteralKey(element)
18999
+ (element) => element === null || element.type === AST_NODE_TYPES90.SpreadElement ? null : primitiveLiteralKey(element)
18874
19000
  )
18875
19001
  );
18876
19002
  }
@@ -18878,13 +19004,13 @@ function staticZodDomain(leaf, call) {
18878
19004
  }
18879
19005
  if (leaf === "enum") {
18880
19006
  const [argument] = call.arguments;
18881
- if (argument === void 0 || argument.type === AST_NODE_TYPES89.SpreadElement) {
19007
+ if (argument === void 0 || argument.type === AST_NODE_TYPES90.SpreadElement) {
18882
19008
  return null;
18883
19009
  }
18884
- if (argument.type === AST_NODE_TYPES89.ArrayExpression) {
19010
+ if (argument.type === AST_NODE_TYPES90.ArrayExpression) {
18885
19011
  return exactDomain(
18886
19012
  argument.elements.map((element) => {
18887
- if (element === null || element.type === AST_NODE_TYPES89.SpreadElement) {
19013
+ if (element === null || element.type === AST_NODE_TYPES90.SpreadElement) {
18888
19014
  return null;
18889
19015
  }
18890
19016
  const key = primitiveLiteralKey(element);
@@ -18892,10 +19018,10 @@ function staticZodDomain(leaf, call) {
18892
19018
  })
18893
19019
  );
18894
19020
  }
18895
- if (argument.type === AST_NODE_TYPES89.ObjectExpression) {
19021
+ if (argument.type === AST_NODE_TYPES90.ObjectExpression) {
18896
19022
  return exactDomain(
18897
19023
  argument.properties.map((property) => {
18898
- if (property.type !== AST_NODE_TYPES89.Property || property.computed || property.kind !== "init" || property.method || property.shorthand) {
19024
+ if (property.type !== AST_NODE_TYPES90.Property || property.computed || property.kind !== "init" || property.method || property.shorthand) {
18899
19025
  return null;
18900
19026
  }
18901
19027
  const key = primitiveLiteralKey(property.value);
@@ -18922,19 +19048,19 @@ function sameDomain(left, right) {
18922
19048
  return true;
18923
19049
  }
18924
19050
  function isExportedDeclaration(node) {
18925
- return node.parent?.type === AST_NODE_TYPES89.ExportNamedDeclaration;
19051
+ return node.parent?.type === AST_NODE_TYPES90.ExportNamedDeclaration;
18926
19052
  }
18927
19053
  function isModuleLevelDeclaration(node) {
18928
19054
  const parent = node.parent;
18929
- return parent?.type === AST_NODE_TYPES89.Program || parent?.type === AST_NODE_TYPES89.ExportNamedDeclaration && parent.parent.type === AST_NODE_TYPES89.Program;
19055
+ return parent?.type === AST_NODE_TYPES90.Program || parent?.type === AST_NODE_TYPES90.ExportNamedDeclaration && parent.parent.type === AST_NODE_TYPES90.Program;
18930
19056
  }
18931
19057
  function isModuleLevelConst(node) {
18932
19058
  const declaration = node.parent;
18933
- if (declaration.type !== AST_NODE_TYPES89.VariableDeclaration || declaration.kind !== "const") {
19059
+ if (declaration.type !== AST_NODE_TYPES90.VariableDeclaration || declaration.kind !== "const") {
18934
19060
  return false;
18935
19061
  }
18936
19062
  const container = declaration.parent;
18937
- return container.type === AST_NODE_TYPES89.Program || container.type === AST_NODE_TYPES89.ExportNamedDeclaration && container.parent.type === AST_NODE_TYPES89.Program;
19063
+ return container.type === AST_NODE_TYPES90.Program || container.type === AST_NODE_TYPES90.ExportNamedDeclaration && container.parent.type === AST_NODE_TYPES90.Program;
18938
19064
  }
18939
19065
  function normalizeSchemaName(name) {
18940
19066
  return name.replace(/Schema$/i, "").replace(/^Z(?=[A-Z])/, "").toLowerCase();
@@ -18943,20 +19069,20 @@ function normalizeTypeName(name) {
18943
19069
  return name.replace(/Type$/, "").toLowerCase();
18944
19070
  }
18945
19071
  function unwrapNullish(annotation) {
18946
- if (annotation.type !== AST_NODE_TYPES89.TSUnionType) {
19072
+ if (annotation.type !== AST_NODE_TYPES90.TSUnionType) {
18947
19073
  return {
18948
19074
  core: annotation,
18949
- nullable: annotation.type === AST_NODE_TYPES89.TSNullKeyword
19075
+ nullable: annotation.type === AST_NODE_TYPES90.TSNullKeyword
18950
19076
  };
18951
19077
  }
18952
19078
  const rest = [];
18953
19079
  let nullable = false;
18954
19080
  for (const member of annotation.types) {
18955
- if (member.type === AST_NODE_TYPES89.TSNullKeyword) {
19081
+ if (member.type === AST_NODE_TYPES90.TSNullKeyword) {
18956
19082
  nullable = true;
18957
19083
  continue;
18958
19084
  }
18959
- if (member.type === AST_NODE_TYPES89.TSUndefinedKeyword) {
19085
+ if (member.type === AST_NODE_TYPES90.TSUndefinedKeyword) {
18960
19086
  continue;
18961
19087
  }
18962
19088
  rest.push(member);
@@ -19008,18 +19134,18 @@ function leafAgrees(field, annotation) {
19008
19134
  return null;
19009
19135
  }
19010
19136
  if (leaf === "date") {
19011
- return core.type === AST_NODE_TYPES89.TSTypeReference && core.typeName.type === AST_NODE_TYPES89.Identifier && core.typeName.name === "Date";
19137
+ return core.type === AST_NODE_TYPES90.TSTypeReference && core.typeName.type === AST_NODE_TYPES90.Identifier && core.typeName.name === "Date";
19012
19138
  }
19013
19139
  return expected.includes(core.type);
19014
19140
  }
19015
19141
  function typeLiteralDomain(annotation) {
19016
- const members = annotation.type === AST_NODE_TYPES89.TSUnionType ? annotation.types : [annotation];
19142
+ const members = annotation.type === AST_NODE_TYPES90.TSUnionType ? annotation.types : [annotation];
19017
19143
  const keys = [];
19018
19144
  for (const member of members) {
19019
- if (member.type === AST_NODE_TYPES89.TSNullKeyword) {
19145
+ if (member.type === AST_NODE_TYPES90.TSNullKeyword) {
19020
19146
  continue;
19021
19147
  }
19022
- if (member.type !== AST_NODE_TYPES89.TSLiteralType) {
19148
+ if (member.type !== AST_NODE_TYPES90.TSLiteralType) {
19023
19149
  return null;
19024
19150
  }
19025
19151
  keys.push(primitiveLiteralKey(member.literal));
@@ -19027,11 +19153,11 @@ function typeLiteralDomain(annotation) {
19027
19153
  return exactDomain(keys);
19028
19154
  }
19029
19155
  function staticStringUnionDomain(node) {
19030
- if (node.type !== AST_NODE_TYPES89.TSUnionType) {
19156
+ if (node.type !== AST_NODE_TYPES90.TSUnionType) {
19031
19157
  return null;
19032
19158
  }
19033
19159
  const keys = node.types.map((member) => {
19034
- if (member.type !== AST_NODE_TYPES89.TSLiteralType) {
19160
+ if (member.type !== AST_NODE_TYPES90.TSLiteralType) {
19035
19161
  return null;
19036
19162
  }
19037
19163
  const key = primitiveLiteralKey(member.literal);
@@ -19043,13 +19169,13 @@ function staticStringUnionDomain(node) {
19043
19169
  function twinCallChain(node, zodNamespaces) {
19044
19170
  const chain = [];
19045
19171
  let current = node;
19046
- while (current.type === AST_NODE_TYPES89.CallExpression) {
19172
+ while (current.type === AST_NODE_TYPES90.CallExpression) {
19047
19173
  const callee = current.callee;
19048
- if (callee.type !== AST_NODE_TYPES89.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES89.Identifier) {
19174
+ if (callee.type !== AST_NODE_TYPES90.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES90.Identifier) {
19049
19175
  return null;
19050
19176
  }
19051
19177
  chain.push(current);
19052
- if (callee.object.type === AST_NODE_TYPES89.Identifier) {
19178
+ if (callee.object.type === AST_NODE_TYPES90.Identifier) {
19053
19179
  return zodNamespaces.has(callee.object.name) ? chain.reverse() : null;
19054
19180
  }
19055
19181
  current = callee.object;
@@ -19058,7 +19184,7 @@ function twinCallChain(node, zodNamespaces) {
19058
19184
  }
19059
19185
  function twinMethodName(call) {
19060
19186
  const callee = call.callee;
19061
- return callee.type === AST_NODE_TYPES89.MemberExpression && callee.property.type === AST_NODE_TYPES89.Identifier ? callee.property.name : "";
19187
+ return callee.type === AST_NODE_TYPES90.MemberExpression && callee.property.type === AST_NODE_TYPES90.Identifier ? callee.property.name : "";
19062
19188
  }
19063
19189
  function twinSchemaFields(initializer, zodNamespaces) {
19064
19190
  const chain = twinCallChain(initializer, zodNamespaces);
@@ -19069,10 +19195,10 @@ function twinSchemaFields(initializer, zodNamespaces) {
19069
19195
  if (baseMethod !== "object" && baseMethod !== "strictObject") return null;
19070
19196
  if (rest.some((call) => !SHAPE_PRESERVING_METHODS.has(twinMethodName(call)))) return null;
19071
19197
  const shape = base.arguments[0];
19072
- if (shape === void 0 || shape.type !== AST_NODE_TYPES89.ObjectExpression) return null;
19198
+ if (shape === void 0 || shape.type !== AST_NODE_TYPES90.ObjectExpression) return null;
19073
19199
  const fields = /* @__PURE__ */ new Map();
19074
19200
  for (const property of shape.properties) {
19075
- if (property.type !== AST_NODE_TYPES89.Property || property.computed) return null;
19201
+ if (property.type !== AST_NODE_TYPES90.Property || property.computed) return null;
19076
19202
  const { key } = property;
19077
19203
  const name = staticFieldName(key);
19078
19204
  if (name === null) return null;
@@ -19085,13 +19211,13 @@ function twinSchemaField(node, zodNamespaces) {
19085
19211
  let current = node;
19086
19212
  let leaf = null;
19087
19213
  let leafCall = null;
19088
- while (current.type === AST_NODE_TYPES89.CallExpression) {
19214
+ while (current.type === AST_NODE_TYPES90.CallExpression) {
19089
19215
  const callee = current.callee;
19090
- if (callee.type !== AST_NODE_TYPES89.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES89.Identifier) {
19216
+ if (callee.type !== AST_NODE_TYPES90.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES90.Identifier) {
19091
19217
  break;
19092
19218
  }
19093
19219
  const receiver = callee.object;
19094
- if (receiver.type === AST_NODE_TYPES89.Identifier && zodNamespaces.has(receiver.name)) {
19220
+ if (receiver.type === AST_NODE_TYPES90.Identifier && zodNamespaces.has(receiver.name)) {
19095
19221
  leaf = callee.property.name;
19096
19222
  leafCall = current;
19097
19223
  break;
@@ -19109,18 +19235,18 @@ function twinSchemaField(node, zodNamespaces) {
19109
19235
  }
19110
19236
  function twinTypeMembers(declaration) {
19111
19237
  let members;
19112
- if (declaration.type === AST_NODE_TYPES89.TSInterfaceDeclaration) {
19238
+ if (declaration.type === AST_NODE_TYPES90.TSInterfaceDeclaration) {
19113
19239
  if (declaration.typeParameters !== void 0 || (declaration.extends?.length ?? 0) > 0) return null;
19114
19240
  members = declaration.body.body;
19115
19241
  } else {
19116
- if (declaration.typeParameters !== void 0 || declaration.typeAnnotation.type !== AST_NODE_TYPES89.TSTypeLiteral) {
19242
+ if (declaration.typeParameters !== void 0 || declaration.typeAnnotation.type !== AST_NODE_TYPES90.TSTypeLiteral) {
19117
19243
  return null;
19118
19244
  }
19119
19245
  members = declaration.typeAnnotation.members;
19120
19246
  }
19121
19247
  const result = /* @__PURE__ */ new Map();
19122
19248
  for (const member of members) {
19123
- if (member.type !== AST_NODE_TYPES89.TSPropertySignature || member.computed) return null;
19249
+ if (member.type !== AST_NODE_TYPES90.TSPropertySignature || member.computed) return null;
19124
19250
  const { key } = member;
19125
19251
  const name = staticFieldName(key);
19126
19252
  if (name === null) return null;
@@ -19195,7 +19321,7 @@ var prefer_zod_infer_default = createRule({
19195
19321
  return;
19196
19322
  }
19197
19323
  for (const specifier of node.specifiers) {
19198
- if (specifier.type === AST_NODE_TYPES89.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES89.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES89.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES89.Identifier && specifier.imported.name === "z") {
19324
+ if (specifier.type === AST_NODE_TYPES90.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES90.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES90.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES90.Identifier && specifier.imported.name === "z") {
19199
19325
  zodNamespaces.add(specifier.local.name);
19200
19326
  }
19201
19327
  }
@@ -19213,20 +19339,20 @@ var prefer_zod_infer_default = createRule({
19213
19339
  return domain instanceof Set && domain.size >= 2 ? domain : null;
19214
19340
  }
19215
19341
  function inferredSchemaName(node) {
19216
- if (node.type !== AST_NODE_TYPES89.TSTypeReference || node.typeName.type !== AST_NODE_TYPES89.TSQualifiedName || node.typeName.left.type !== AST_NODE_TYPES89.Identifier || !zodNamespaces.has(node.typeName.left.name) || node.typeName.right.name !== "infer") {
19342
+ if (node.type !== AST_NODE_TYPES90.TSTypeReference || node.typeName.type !== AST_NODE_TYPES90.TSQualifiedName || node.typeName.left.type !== AST_NODE_TYPES90.Identifier || !zodNamespaces.has(node.typeName.left.name) || node.typeName.right.name !== "infer") {
19217
19343
  return null;
19218
19344
  }
19219
19345
  const arguments_ = node.typeArguments?.params ?? [];
19220
19346
  const [argument] = arguments_;
19221
- return arguments_.length === 1 && argument?.type === AST_NODE_TYPES89.TSTypeQuery && argument.exprName.type === AST_NODE_TYPES89.Identifier ? argument.exprName.name : null;
19347
+ return arguments_.length === 1 && argument?.type === AST_NODE_TYPES90.TSTypeQuery && argument.exprName.type === AST_NODE_TYPES90.Identifier ? argument.exprName.name : null;
19222
19348
  }
19223
19349
  function recordLiteralUnions(members, owner, ownerName, exported) {
19224
19350
  for (const member of members) {
19225
- if (member.type !== AST_NODE_TYPES89.TSPropertySignature || member.computed || member.optional || member.readonly || member.typeAnnotation === void 0) {
19351
+ if (member.type !== AST_NODE_TYPES90.TSPropertySignature || member.computed || member.optional || member.readonly || member.typeAnnotation === void 0) {
19226
19352
  continue;
19227
19353
  }
19228
19354
  const key = member.key;
19229
- const propertyName7 = key.type === AST_NODE_TYPES89.Identifier ? key.name : key.type === AST_NODE_TYPES89.Literal && typeof key.value === "string" ? key.value : null;
19355
+ const propertyName7 = key.type === AST_NODE_TYPES90.Identifier ? key.name : key.type === AST_NODE_TYPES90.Literal && typeof key.value === "string" ? key.value : null;
19230
19356
  if (propertyName7 === null) {
19231
19357
  continue;
19232
19358
  }
@@ -19236,7 +19362,7 @@ var prefer_zod_infer_default = createRule({
19236
19362
  }
19237
19363
  const annotation = member.typeAnnotation.typeAnnotation;
19238
19364
  const domain = staticStringUnionDomain(annotation);
19239
- if (domain === null || annotation.type !== AST_NODE_TYPES89.TSUnionType) {
19365
+ if (domain === null || annotation.type !== AST_NODE_TYPES90.TSUnionType) {
19240
19366
  continue;
19241
19367
  }
19242
19368
  literalUnionOccurrences.push({
@@ -19251,8 +19377,8 @@ var prefer_zod_infer_default = createRule({
19251
19377
  }
19252
19378
  }
19253
19379
  function collectConstrainedNames2(node) {
19254
- if (node.type === AST_NODE_TYPES89.TSTypeReference) {
19255
- if (node.typeName.type === AST_NODE_TYPES89.Identifier) {
19380
+ if (node.type === AST_NODE_TYPES90.TSTypeReference) {
19381
+ if (node.typeName.type === AST_NODE_TYPES90.Identifier) {
19256
19382
  constrainedTypeNames.add(node.typeName.name);
19257
19383
  }
19258
19384
  for (const argument of node.typeArguments?.params ?? []) {
@@ -19260,11 +19386,11 @@ var prefer_zod_infer_default = createRule({
19260
19386
  }
19261
19387
  return;
19262
19388
  }
19263
- if (node.type === AST_NODE_TYPES89.TSArrayType) {
19389
+ if (node.type === AST_NODE_TYPES90.TSArrayType) {
19264
19390
  collectConstrainedNames2(node.elementType);
19265
19391
  return;
19266
19392
  }
19267
- if (node.type === AST_NODE_TYPES89.TSUnionType || node.type === AST_NODE_TYPES89.TSIntersectionType) {
19393
+ if (node.type === AST_NODE_TYPES90.TSUnionType || node.type === AST_NODE_TYPES90.TSIntersectionType) {
19268
19394
  for (const member of node.types) {
19269
19395
  collectConstrainedNames2(member);
19270
19396
  }
@@ -19273,7 +19399,7 @@ var prefer_zod_infer_default = createRule({
19273
19399
  return {
19274
19400
  Program(node) {
19275
19401
  for (const statement of node.body) {
19276
- if (statement.type === AST_NODE_TYPES89.ImportDeclaration) {
19402
+ if (statement.type === AST_NODE_TYPES90.ImportDeclaration) {
19277
19403
  recordZodImport(statement);
19278
19404
  }
19279
19405
  }
@@ -19282,7 +19408,7 @@ var prefer_zod_infer_default = createRule({
19282
19408
  recordZodImport(node);
19283
19409
  },
19284
19410
  VariableDeclarator(node) {
19285
- if (node.id.type !== AST_NODE_TYPES89.Identifier || node.init == null || !isModuleLevelConst(node)) {
19411
+ if (node.id.type !== AST_NODE_TYPES90.Identifier || node.init == null || !isModuleLevelConst(node)) {
19286
19412
  return;
19287
19413
  }
19288
19414
  const fields = twinSchemaFields(node.init, zodNamespaces);
@@ -19299,14 +19425,14 @@ var prefer_zod_infer_default = createRule({
19299
19425
  },
19300
19426
  /** Records `XSchema.transform(...)` and equivalent module-level reshaping. */
19301
19427
  "MemberExpression[computed=false]"(node) {
19302
- if (node.object.type === AST_NODE_TYPES89.Identifier && node.property.type === AST_NODE_TYPES89.Identifier && isPreferZodInferModuleReshaper(node.property.name)) {
19428
+ if (node.object.type === AST_NODE_TYPES90.Identifier && node.property.type === AST_NODE_TYPES90.Identifier && isPreferZodInferModuleReshaper(node.property.name)) {
19303
19429
  reshapedSchemaNames.add(node.object.name);
19304
19430
  }
19305
19431
  },
19306
19432
  /** Records every type argument carried by a Zod constraint. */
19307
19433
  TSTypeReference(node) {
19308
19434
  const { typeName } = node;
19309
- const referenced = typeName.type === AST_NODE_TYPES89.Identifier ? typeName.name : typeName.type === AST_NODE_TYPES89.TSQualifiedName && typeName.right.type === AST_NODE_TYPES89.Identifier ? typeName.right.name : null;
19435
+ const referenced = typeName.type === AST_NODE_TYPES90.Identifier ? typeName.name : typeName.type === AST_NODE_TYPES90.TSQualifiedName && typeName.right.type === AST_NODE_TYPES90.Identifier ? typeName.right.name : null;
19310
19436
  if (referenced === null || !isPreferZodInferTypeConstraintName(referenced)) {
19311
19437
  return;
19312
19438
  }
@@ -19340,7 +19466,7 @@ var prefer_zod_infer_default = createRule({
19340
19466
  typeName: node.id.name
19341
19467
  });
19342
19468
  }
19343
- if (node.typeParameters !== void 0 || node.typeAnnotation.type !== AST_NODE_TYPES89.TSTypeLiteral) {
19469
+ if (node.typeParameters !== void 0 || node.typeAnnotation.type !== AST_NODE_TYPES90.TSTypeLiteral) {
19344
19470
  return;
19345
19471
  }
19346
19472
  const members = twinTypeMembers(node);
@@ -19452,12 +19578,12 @@ var prefer_zod_infer_default = createRule({
19452
19578
  }
19453
19579
  });
19454
19580
  function staticFieldName(key) {
19455
- return key.type === AST_NODE_TYPES89.Identifier ? key.name : key.type === AST_NODE_TYPES89.Literal && typeof key.value === "string" ? key.value : null;
19581
+ return key.type === AST_NODE_TYPES90.Identifier ? key.name : key.type === AST_NODE_TYPES90.Literal && typeof key.value === "string" ? key.value : null;
19456
19582
  }
19457
19583
 
19458
19584
  // src/rules/prefer-zod-parse-output-type.ts
19459
19585
  import {
19460
- AST_NODE_TYPES as AST_NODE_TYPES90,
19586
+ AST_NODE_TYPES as AST_NODE_TYPES91,
19461
19587
  ESLintUtils as ESLintUtils13
19462
19588
  } from "@typescript-eslint/utils";
19463
19589
  import ts11 from "typescript";
@@ -19513,20 +19639,20 @@ var PREFER_ZOD_PARSE_OUTPUT_TYPE_DOCUMENTATION = {
19513
19639
  };
19514
19640
  function isModuleLevelConst2(node) {
19515
19641
  const declaration = node.parent;
19516
- if (declaration.type !== AST_NODE_TYPES90.VariableDeclaration || declaration.kind !== "const") {
19642
+ if (declaration.type !== AST_NODE_TYPES91.VariableDeclaration || declaration.kind !== "const") {
19517
19643
  return false;
19518
19644
  }
19519
19645
  const container = declaration.parent;
19520
- return container.type === AST_NODE_TYPES90.Program || container.type === AST_NODE_TYPES90.ExportNamedDeclaration && container.parent.type === AST_NODE_TYPES90.Program;
19646
+ return container.type === AST_NODE_TYPES91.Program || container.type === AST_NODE_TYPES91.ExportNamedDeclaration && container.parent.type === AST_NODE_TYPES91.Program;
19521
19647
  }
19522
19648
  function isLocalZodObjectSchema(node, namespaces) {
19523
19649
  let current = node;
19524
- while (current.type === AST_NODE_TYPES90.CallExpression) {
19650
+ while (current.type === AST_NODE_TYPES91.CallExpression) {
19525
19651
  const { callee } = current;
19526
- if (callee.type !== AST_NODE_TYPES90.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES90.Identifier) {
19652
+ if (callee.type !== AST_NODE_TYPES91.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES91.Identifier) {
19527
19653
  return false;
19528
19654
  }
19529
- if (callee.object.type === AST_NODE_TYPES90.Identifier) {
19655
+ if (callee.object.type === AST_NODE_TYPES91.Identifier) {
19530
19656
  return namespaces.has(callee.object.name) && (callee.property.name === "object" || callee.property.name === "strictObject");
19531
19657
  }
19532
19658
  current = callee.object;
@@ -19535,7 +19661,7 @@ function isLocalZodObjectSchema(node, namespaces) {
19535
19661
  }
19536
19662
  function zodParseCall(node) {
19537
19663
  const { callee } = node;
19538
- if (callee.type !== AST_NODE_TYPES90.MemberExpression || callee.computed || callee.object.type !== AST_NODE_TYPES90.Identifier || callee.property.type !== AST_NODE_TYPES90.Identifier || callee.property.name !== "parse" && callee.property.name !== "safeParse") {
19664
+ if (callee.type !== AST_NODE_TYPES91.MemberExpression || callee.computed || callee.object.type !== AST_NODE_TYPES91.Identifier || callee.property.type !== AST_NODE_TYPES91.Identifier || callee.property.name !== "parse" && callee.property.name !== "safeParse") {
19539
19665
  return null;
19540
19666
  }
19541
19667
  return {
@@ -19550,7 +19676,7 @@ function returnedOutputCandidate(parsed, output) {
19550
19676
  const annotation = owner?.returnType?.typeAnnotation;
19551
19677
  if (annotation === void 0) return null;
19552
19678
  const typeReference = returnContractReference(annotation);
19553
- if (typeReference === null || typeReference.typeName.type !== AST_NODE_TYPES90.Identifier) {
19679
+ if (typeReference === null || typeReference.typeName.type !== AST_NODE_TYPES91.Identifier) {
19554
19680
  return null;
19555
19681
  }
19556
19682
  return {
@@ -19567,7 +19693,7 @@ function directParseReturnCandidate(node) {
19567
19693
  return parsed?.method === "parse" ? returnedOutputCandidate(parsed, node) : null;
19568
19694
  }
19569
19695
  function localParseReturnCandidates(node, sourceCode) {
19570
- if (node.id.type !== AST_NODE_TYPES90.Identifier || node.init?.type !== AST_NODE_TYPES90.CallExpression || node.parent.type !== AST_NODE_TYPES90.VariableDeclaration || node.parent.kind !== "const" || enclosingFunction4(node.init) === null) {
19696
+ if (node.id.type !== AST_NODE_TYPES91.Identifier || node.init?.type !== AST_NODE_TYPES91.CallExpression || node.parent.type !== AST_NODE_TYPES91.VariableDeclaration || node.parent.kind !== "const" || enclosingFunction4(node.init) === null) {
19571
19697
  return [];
19572
19698
  }
19573
19699
  const parsed = zodParseCall(node.init);
@@ -19578,7 +19704,7 @@ function localParseReturnCandidates(node, sourceCode) {
19578
19704
  for (const reference of variable.references) {
19579
19705
  const identifier = reference.identifier;
19580
19706
  const parent = identifier.parent;
19581
- const output = parsed.method === "parse" ? identifier : parent.type === AST_NODE_TYPES90.MemberExpression && parent.object === identifier && !parent.computed && parent.property.type === AST_NODE_TYPES90.Identifier && parent.property.name === "data" ? parent : null;
19707
+ const output = parsed.method === "parse" ? identifier : parent.type === AST_NODE_TYPES91.MemberExpression && parent.object === identifier && !parent.computed && parent.property.type === AST_NODE_TYPES91.Identifier && parent.property.name === "data" ? parent : null;
19582
19708
  if (output === null) continue;
19583
19709
  const candidate2 = returnedOutputCandidate(parsed, output);
19584
19710
  if (candidate2 !== null) candidates.push(candidate2);
@@ -19589,17 +19715,17 @@ function directReturnOwner(node) {
19589
19715
  let current = node;
19590
19716
  while (current.parent !== void 0) {
19591
19717
  const parent = current.parent;
19592
- if (parent.type === AST_NODE_TYPES90.ReturnStatement) {
19718
+ if (parent.type === AST_NODE_TYPES91.ReturnStatement) {
19593
19719
  return parent.argument === current ? enclosingFunction4(parent) : null;
19594
19720
  }
19595
- if (parent.type === AST_NODE_TYPES90.ArrowFunctionExpression && parent.expression && parent.body === current) {
19721
+ if (parent.type === AST_NODE_TYPES91.ArrowFunctionExpression && parent.expression && parent.body === current) {
19596
19722
  return parent;
19597
19723
  }
19598
- if (parent.type === AST_NODE_TYPES90.AwaitExpression && parent.argument === current) {
19724
+ if (parent.type === AST_NODE_TYPES91.AwaitExpression && parent.argument === current) {
19599
19725
  current = parent;
19600
19726
  continue;
19601
19727
  }
19602
- if (parent.type === AST_NODE_TYPES90.ConditionalExpression) {
19728
+ if (parent.type === AST_NODE_TYPES91.ConditionalExpression) {
19603
19729
  const parsedWhenTrue = parent.consequent === current && isNullishExpression(parent.alternate);
19604
19730
  const parsedWhenFalse = parent.alternate === current && isNullishExpression(parent.consequent);
19605
19731
  if (parsedWhenTrue || parsedWhenFalse) {
@@ -19612,12 +19738,12 @@ function directReturnOwner(node) {
19612
19738
  return null;
19613
19739
  }
19614
19740
  function isNullishExpression(node) {
19615
- return node.type === AST_NODE_TYPES90.Literal && node.value === null || node.type === AST_NODE_TYPES90.Identifier && node.name === "undefined";
19741
+ return node.type === AST_NODE_TYPES91.Literal && node.value === null || node.type === AST_NODE_TYPES91.Identifier && node.name === "undefined";
19616
19742
  }
19617
19743
  function enclosingFunction4(node) {
19618
19744
  let current = node.parent;
19619
19745
  while (current != null) {
19620
- if (current.type === AST_NODE_TYPES90.ArrowFunctionExpression || current.type === AST_NODE_TYPES90.FunctionDeclaration || current.type === AST_NODE_TYPES90.FunctionExpression) {
19746
+ if (current.type === AST_NODE_TYPES91.ArrowFunctionExpression || current.type === AST_NODE_TYPES91.FunctionDeclaration || current.type === AST_NODE_TYPES91.FunctionExpression) {
19621
19747
  return current;
19622
19748
  }
19623
19749
  current = current.parent;
@@ -19625,45 +19751,45 @@ function enclosingFunction4(node) {
19625
19751
  return null;
19626
19752
  }
19627
19753
  function returnContractReference(node) {
19628
- if (node.type === AST_NODE_TYPES90.TSUnionType) {
19754
+ if (node.type === AST_NODE_TYPES91.TSUnionType) {
19629
19755
  const substantive = node.types.filter(
19630
- (member) => member.type !== AST_NODE_TYPES90.TSNullKeyword && member.type !== AST_NODE_TYPES90.TSUndefinedKeyword
19756
+ (member) => member.type !== AST_NODE_TYPES91.TSNullKeyword && member.type !== AST_NODE_TYPES91.TSUndefinedKeyword
19631
19757
  );
19632
19758
  const [only] = substantive;
19633
19759
  return substantive.length === 1 && only !== void 0 ? returnContractReference(only) : null;
19634
19760
  }
19635
- if (node.type === AST_NODE_TYPES90.TSTypeReference && node.typeName.type === AST_NODE_TYPES90.Identifier && node.typeName.name === "Promise") {
19761
+ if (node.type === AST_NODE_TYPES91.TSTypeReference && node.typeName.type === AST_NODE_TYPES91.Identifier && node.typeName.name === "Promise") {
19636
19762
  const parameters = node.typeArguments?.params ?? [];
19637
19763
  const [only] = parameters;
19638
19764
  return parameters.length === 1 && only !== void 0 ? returnContractReference(only) : null;
19639
19765
  }
19640
- return node.type === AST_NODE_TYPES90.TSTypeReference && node.typeName.type === AST_NODE_TYPES90.Identifier && (node.typeArguments?.params.length ?? 0) === 0 ? node : null;
19766
+ return node.type === AST_NODE_TYPES91.TSTypeReference && node.typeName.type === AST_NODE_TYPES91.Identifier && (node.typeArguments?.params.length ?? 0) === 0 ? node : null;
19641
19767
  }
19642
19768
  function recordZodNamespaces(node, namespaces) {
19643
19769
  for (const statement of node.body) {
19644
- if (statement.type !== AST_NODE_TYPES90.ImportDeclaration || !isZodModule(statement.source.value)) {
19770
+ if (statement.type !== AST_NODE_TYPES91.ImportDeclaration || !isZodModule(statement.source.value)) {
19645
19771
  continue;
19646
19772
  }
19647
19773
  for (const specifier of statement.specifiers) {
19648
- if (specifier.type === AST_NODE_TYPES90.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES90.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES90.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES90.Identifier && specifier.imported.name === "z") {
19774
+ if (specifier.type === AST_NODE_TYPES91.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES91.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES91.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES91.Identifier && specifier.imported.name === "z") {
19649
19775
  namespaces.add(specifier.local.name);
19650
19776
  }
19651
19777
  }
19652
19778
  }
19653
19779
  }
19654
19780
  function collectConstrainedNames(node, names) {
19655
- if (node.type === AST_NODE_TYPES90.TSTypeReference) {
19656
- if (node.typeName.type === AST_NODE_TYPES90.Identifier) names.add(node.typeName.name);
19781
+ if (node.type === AST_NODE_TYPES91.TSTypeReference) {
19782
+ if (node.typeName.type === AST_NODE_TYPES91.Identifier) names.add(node.typeName.name);
19657
19783
  for (const argument of node.typeArguments?.params ?? []) {
19658
19784
  collectConstrainedNames(argument, names);
19659
19785
  }
19660
19786
  return;
19661
19787
  }
19662
- if (node.type === AST_NODE_TYPES90.TSArrayType) {
19788
+ if (node.type === AST_NODE_TYPES91.TSArrayType) {
19663
19789
  collectConstrainedNames(node.elementType, names);
19664
19790
  return;
19665
19791
  }
19666
- if (node.type === AST_NODE_TYPES90.TSUnionType || node.type === AST_NODE_TYPES90.TSIntersectionType) {
19792
+ if (node.type === AST_NODE_TYPES91.TSUnionType || node.type === AST_NODE_TYPES91.TSIntersectionType) {
19667
19793
  for (const member of node.types) collectConstrainedNames(member, names);
19668
19794
  }
19669
19795
  }
@@ -19697,7 +19823,7 @@ function reportCandidates(context, services, schemas, candidates, zodNamespaces,
19697
19823
  if (constrained) return;
19698
19824
  if (declaration.getSourceFile() === tsSchema.getSourceFile()) {
19699
19825
  const estreeDeclaration = services.tsNodeToESTreeNodeMap.get(declaration);
19700
- if ((estreeDeclaration.type === AST_NODE_TYPES90.TSInterfaceDeclaration || estreeDeclaration.type === AST_NODE_TYPES90.TSTypeAliasDeclaration) && preferZodInferOwnsDefaultTwin({
19826
+ if ((estreeDeclaration.type === AST_NODE_TYPES91.TSInterfaceDeclaration || estreeDeclaration.type === AST_NODE_TYPES91.TSTypeAliasDeclaration) && preferZodInferOwnsDefaultTwin({
19701
19827
  constrained,
19702
19828
  declaration: estreeDeclaration,
19703
19829
  initializer: schema.initializer,
@@ -19802,7 +19928,7 @@ var prefer_zod_parse_output_type_default = createRule({
19802
19928
  recordZodNamespaces(node, namespaces);
19803
19929
  },
19804
19930
  VariableDeclarator(node) {
19805
- if (node.id.type === AST_NODE_TYPES90.Identifier && node.init !== null && isModuleLevelConst2(node) && isLocalZodObjectSchema(node.init, namespaces)) {
19931
+ if (node.id.type === AST_NODE_TYPES91.Identifier && node.init !== null && isModuleLevelConst2(node) && isLocalZodObjectSchema(node.init, namespaces)) {
19806
19932
  schemas.push({ identifier: node.id, initializer: node.init, name: node.id.name });
19807
19933
  }
19808
19934
  candidates.push(...localParseReturnCandidates(node, context.sourceCode));
@@ -19812,13 +19938,13 @@ var prefer_zod_parse_output_type_default = createRule({
19812
19938
  if (candidate2 !== null) candidates.push(candidate2);
19813
19939
  },
19814
19940
  "MemberExpression[computed=false]"(node) {
19815
- if (node.object.type === AST_NODE_TYPES90.Identifier && node.property.type === AST_NODE_TYPES90.Identifier && isPreferZodInferModuleReshaper(node.property.name)) {
19941
+ if (node.object.type === AST_NODE_TYPES91.Identifier && node.property.type === AST_NODE_TYPES91.Identifier && isPreferZodInferModuleReshaper(node.property.name)) {
19816
19942
  reshapedSchemas.add(node.object.name);
19817
19943
  }
19818
19944
  },
19819
19945
  TSTypeReference(node) {
19820
19946
  const { typeName } = node;
19821
- const name = typeName.type === AST_NODE_TYPES90.Identifier ? typeName.name : typeName.type === AST_NODE_TYPES90.TSQualifiedName && typeName.right.type === AST_NODE_TYPES90.Identifier ? typeName.right.name : null;
19947
+ const name = typeName.type === AST_NODE_TYPES91.Identifier ? typeName.name : typeName.type === AST_NODE_TYPES91.TSQualifiedName && typeName.right.type === AST_NODE_TYPES91.Identifier ? typeName.right.name : null;
19822
19948
  if (name === null || !isPreferZodInferTypeConstraintName(name)) return;
19823
19949
  for (const argument of node.typeArguments?.params ?? []) {
19824
19950
  collectConstrainedNames(argument, constrainedTypeNames);
@@ -19842,7 +19968,7 @@ var prefer_zod_parse_output_type_default = createRule({
19842
19968
  // src/rules/require-assert-never.ts
19843
19969
  import {
19844
19970
  ESLintUtils as ESLintUtils14,
19845
- AST_NODE_TYPES as AST_NODE_TYPES91
19971
+ AST_NODE_TYPES as AST_NODE_TYPES92
19846
19972
  } from "@typescript-eslint/utils";
19847
19973
  import ts12 from "typescript";
19848
19974
  var REQUIRE_ASSERT_NEVER_DOCUMENTATION = {
@@ -19857,14 +19983,14 @@ var REQUIRE_ASSERT_NEVER_DOCUMENTATION = {
19857
19983
  ]
19858
19984
  };
19859
19985
  var isRuntimeHandlingStatement = (statement) => {
19860
- if (statement.type === AST_NODE_TYPES91.EmptyStatement) return false;
19861
- if (statement.type === AST_NODE_TYPES91.BreakStatement) {
19986
+ if (statement.type === AST_NODE_TYPES92.EmptyStatement) return false;
19987
+ if (statement.type === AST_NODE_TYPES92.BreakStatement) {
19862
19988
  return statement.label !== null;
19863
19989
  }
19864
- if (statement.type === AST_NODE_TYPES91.TSTypeAliasDeclaration || statement.type === AST_NODE_TYPES91.TSInterfaceDeclaration) {
19990
+ if (statement.type === AST_NODE_TYPES92.TSTypeAliasDeclaration || statement.type === AST_NODE_TYPES92.TSInterfaceDeclaration) {
19865
19991
  return false;
19866
19992
  }
19867
- if (statement.type === AST_NODE_TYPES91.BlockStatement) {
19993
+ if (statement.type === AST_NODE_TYPES92.BlockStatement) {
19868
19994
  return statement.body.some(isRuntimeHandlingStatement);
19869
19995
  }
19870
19996
  return true;
@@ -19880,7 +20006,7 @@ var isCommentOnlyNoopDefault = (defaultCase, sourceCode) => {
19880
20006
  return colonToken !== null && sourceCode.getCommentsAfter(colonToken).length > 0;
19881
20007
  }
19882
20008
  const only = defaultCase.consequent[0];
19883
- if (only !== void 0 && defaultCase.consequent.length === 1 && only.type === AST_NODE_TYPES91.BlockStatement && !only.body.some(isRuntimeHandlingStatement)) {
20009
+ if (only !== void 0 && defaultCase.consequent.length === 1 && only.type === AST_NODE_TYPES92.BlockStatement && !only.body.some(isRuntimeHandlingStatement)) {
19884
20010
  return sourceCode.getCommentsInside(only).length > 0;
19885
20011
  }
19886
20012
  return false;
@@ -19961,13 +20087,13 @@ var require_assert_never_default = createRule({
19961
20087
  });
19962
20088
 
19963
20089
  // src/rules/require-fetch-timeout.ts
19964
- import { AST_NODE_TYPES as AST_NODE_TYPES92, ASTUtils as ASTUtils46 } from "@typescript-eslint/utils";
20090
+ import { AST_NODE_TYPES as AST_NODE_TYPES93, ASTUtils as ASTUtils47 } from "@typescript-eslint/utils";
19965
20091
  var REQUIRE_FETCH_TIMEOUT_DOCUMENTATION = {
19966
20092
  summary: "Require an explicit abort signal on locally analyzable global fetch calls.",
19967
20093
  rationale: "An unbounded request can occupy work indefinitely when an upstream stalls.",
19968
20094
  remediation: "Pass an abort signal, such as `AbortSignal.timeout(ms)`, in the fetch init.",
19969
20095
  category: "correctness",
19970
- limitations: ["Signal presence establishes an explicit cancellation path, not a guaranteed timeout. Forwarded Request objects can carry an existing signal."],
20096
+ limitations: ["Signal presence establishes an explicit cancellation path, not a guaranteed timeout. Literal null, global undefined, and void 0 do not provide a signal. Unknown spreads and dynamic values are not inferred. Forwarded Request objects can carry an existing signal."],
19971
20097
  examples: [
19972
20098
  { id: "bounded-fetch", title: "Bound the request", outcome: "no-match", files: [{ path: "src/client.ts", source: "await fetch(url, { signal: AbortSignal.timeout(5000) });" }], focusPath: "src/client.ts", expectedCount: 0, public: true },
19973
20099
  { id: "unbounded-fetch", title: "Do not leave fetch unbounded", outcome: "match", files: [{ path: "src/client.ts", source: "await fetch('https://api.example.com/items');" }], focusPath: "src/client.ts", expectedCount: 1, public: true }
@@ -19987,25 +20113,26 @@ function matchesAnyPattern3(filename, patterns) {
19987
20113
  }
19988
20114
  return false;
19989
20115
  }
19990
- function initProvablyLacksSignal(init) {
19991
- if (init.type !== AST_NODE_TYPES92.ObjectExpression) {
19992
- return false;
19993
- }
20116
+ function initProvablyLacksSignal(init, resolvesToGlobal) {
20117
+ if (init.type !== AST_NODE_TYPES93.ObjectExpression) return false;
20118
+ let lacksSignal = true;
19994
20119
  for (const prop of init.properties) {
19995
- if (prop.type === AST_NODE_TYPES92.SpreadElement) {
19996
- return false;
20120
+ if (prop.type === AST_NODE_TYPES93.SpreadElement) {
20121
+ lacksSignal = false;
20122
+ continue;
19997
20123
  }
19998
- if (prop.key.type === AST_NODE_TYPES92.Identifier && prop.key.name === "signal" || prop.key.type === AST_NODE_TYPES92.Literal && prop.key.value === "signal") {
19999
- return false;
20000
- }
20001
- if (prop.computed) {
20002
- return false;
20124
+ const isSignal = !prop.computed && prop.key.type === AST_NODE_TYPES93.Identifier && prop.key.name === "signal" || prop.key.type === AST_NODE_TYPES93.Literal && prop.key.value === "signal";
20125
+ if (isSignal) {
20126
+ const value = prop.value;
20127
+ lacksSignal = prop.kind === "init" && !prop.method && (value.type === AST_NODE_TYPES93.Literal && value.value === null || value.type === AST_NODE_TYPES93.Identifier && value.name === "undefined" && resolvesToGlobal(value) || value.type === AST_NODE_TYPES93.UnaryExpression && value.operator === "void" && value.argument.type === AST_NODE_TYPES93.Literal && value.argument.value === 0);
20128
+ } else if (prop.computed && prop.key.type !== AST_NODE_TYPES93.Literal) {
20129
+ lacksSignal = false;
20003
20130
  }
20004
20131
  }
20005
- return true;
20132
+ return lacksSignal;
20006
20133
  }
20007
20134
  function isInlineUrl(node, resolvesToGlobal) {
20008
- return node.type === AST_NODE_TYPES92.Literal && typeof node.value === "string" || node.type === AST_NODE_TYPES92.TemplateLiteral || node.type === AST_NODE_TYPES92.NewExpression && node.callee.type === AST_NODE_TYPES92.Identifier && node.callee.name === "URL" && resolvesToGlobal(node.callee);
20135
+ return node.type === AST_NODE_TYPES93.Literal && typeof node.value === "string" || node.type === AST_NODE_TYPES93.TemplateLiteral || node.type === AST_NODE_TYPES93.NewExpression && node.callee.type === AST_NODE_TYPES93.Identifier && node.callee.name === "URL" && resolvesToGlobal(node.callee);
20009
20136
  }
20010
20137
  var require_fetch_timeout_default = createRule({
20011
20138
  name: "require-fetch-timeout",
@@ -20043,30 +20170,30 @@ var require_fetch_timeout_default = createRule({
20043
20170
  }
20044
20171
  function resolvesToGlobal(identifier) {
20045
20172
  const scope = context.sourceCode.getScope(identifier);
20046
- const variable = ASTUtils46.findVariable(scope, identifier.name);
20173
+ const variable = ASTUtils47.findVariable(scope, identifier.name);
20047
20174
  return variable === null || variable.defs.length === 0;
20048
20175
  }
20049
20176
  function isGlobalFetchCall2(callee) {
20050
- if (callee.type === AST_NODE_TYPES92.Identifier) {
20177
+ if (callee.type === AST_NODE_TYPES93.Identifier) {
20051
20178
  return callee.name === "fetch" && resolvesToGlobal(callee);
20052
20179
  }
20053
- return callee.type === AST_NODE_TYPES92.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES92.Identifier && callee.property.name === "fetch" && callee.object.type === AST_NODE_TYPES92.Identifier && GLOBAL_OBJECTS2.has(callee.object.name) && resolvesToGlobal(callee.object);
20180
+ return callee.type === AST_NODE_TYPES93.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES93.Identifier && callee.property.name === "fetch" && callee.object.type === AST_NODE_TYPES93.Identifier && GLOBAL_OBJECTS2.has(callee.object.name) && resolvesToGlobal(callee.object);
20054
20181
  }
20055
20182
  function localConstInitProvablyLacksSignal(identifier) {
20056
- const variable = ASTUtils46.findVariable(
20183
+ const variable = ASTUtils47.findVariable(
20057
20184
  context.sourceCode.getScope(identifier),
20058
20185
  identifier.name
20059
20186
  );
20060
20187
  if (variable?.defs.length !== 1) return false;
20061
20188
  const definition = variable.defs[0];
20062
- if (definition?.type !== "Variable" || definition.parent.kind !== "const" || definition.node.init?.type !== AST_NODE_TYPES92.ObjectExpression || !initProvablyLacksSignal(definition.node.init)) {
20189
+ if (definition?.type !== "Variable" || definition.parent.kind !== "const" || definition.node.init?.type !== AST_NODE_TYPES93.ObjectExpression || !initProvablyLacksSignal(definition.node.init, resolvesToGlobal)) {
20063
20190
  return false;
20064
20191
  }
20065
20192
  for (const reference of variable.references) {
20066
20193
  const ref = reference.identifier;
20067
20194
  if (ref === identifier || ref === definition.name) continue;
20068
20195
  const member = ref.parent;
20069
- if (member.type !== AST_NODE_TYPES92.MemberExpression || member.object !== ref || member.computed || member.property.type !== AST_NODE_TYPES92.Identifier || member.property.name === "signal" || member.parent.type !== AST_NODE_TYPES92.AssignmentExpression || member.parent.left !== member) {
20196
+ if (member.type !== AST_NODE_TYPES93.MemberExpression || member.object !== ref || member.computed || member.property.type !== AST_NODE_TYPES93.Identifier || member.property.name === "signal" || member.parent.type !== AST_NODE_TYPES93.AssignmentExpression || member.parent.left !== member) {
20070
20197
  return false;
20071
20198
  }
20072
20199
  }
@@ -20074,13 +20201,13 @@ var require_fetch_timeout_default = createRule({
20074
20201
  }
20075
20202
  function isForwardedRequest(argument) {
20076
20203
  let value = argument;
20077
- if (value.type === AST_NODE_TYPES92.Identifier) {
20078
- const binding = ASTUtils46.findVariable(context.sourceCode.getScope(value), value.name);
20204
+ if (value.type === AST_NODE_TYPES93.Identifier) {
20205
+ const binding = ASTUtils47.findVariable(context.sourceCode.getScope(value), value.name);
20079
20206
  const definition = binding?.defs.length === 1 ? binding.defs[0] : void 0;
20080
20207
  if (definition?.type !== "Variable" || definition.parent.kind !== "const" || definition.node.init === null || binding?.references.some((reference) => reference.isWrite() && reference.init !== true)) return false;
20081
20208
  value = definition.node.init;
20082
20209
  }
20083
- return value.type === AST_NODE_TYPES92.NewExpression && value.callee.type === AST_NODE_TYPES92.Identifier && value.callee.name === "Request" && resolvesToGlobal(value.callee);
20210
+ return value.type === AST_NODE_TYPES93.NewExpression && value.callee.type === AST_NODE_TYPES93.Identifier && value.callee.name === "Request" && resolvesToGlobal(value.callee);
20084
20211
  }
20085
20212
  return {
20086
20213
  CallExpression(node) {
@@ -20091,7 +20218,7 @@ var require_fetch_timeout_default = createRule({
20091
20218
  if (first !== void 0 && (node.arguments.length === 1 && !isInlineUrl(first, resolvesToGlobal) || isForwardedRequest(first))) {
20092
20219
  return;
20093
20220
  }
20094
- if (init === void 0 || initProvablyLacksSignal(init) || init.type === AST_NODE_TYPES92.Identifier && localConstInitProvablyLacksSignal(init)) {
20221
+ if (init === void 0 || initProvablyLacksSignal(init, resolvesToGlobal) || init.type === AST_NODE_TYPES93.Identifier && localConstInitProvablyLacksSignal(init)) {
20095
20222
  context.report({ node, messageId: "missingSignal" });
20096
20223
  }
20097
20224
  }
@@ -20100,7 +20227,7 @@ var require_fetch_timeout_default = createRule({
20100
20227
  });
20101
20228
 
20102
20229
  // src/rules/require-interface-for-exported-class.ts
20103
- import { AST_NODE_TYPES as AST_NODE_TYPES93 } from "@typescript-eslint/utils";
20230
+ import { AST_NODE_TYPES as AST_NODE_TYPES94 } from "@typescript-eslint/utils";
20104
20231
  var REQUIRE_INTERFACE_FOR_EXPORTED_CLASS_DOCUMENTATION = {
20105
20232
  defaultLevel: "warning",
20106
20233
  summary: "Require exported concrete classes with public behavior to declare a contract.",
@@ -20147,23 +20274,23 @@ var REQUIRE_INTERFACE_FOR_EXPORTED_CLASS_DOCUMENTATION = {
20147
20274
  };
20148
20275
  function hasPublicInstanceBehavior(node) {
20149
20276
  return node.body.body.some((member) => {
20150
- if (member.type === AST_NODE_TYPES93.MethodDefinition) {
20151
- return member.kind !== "constructor" && !member.static && member.accessibility !== "private" && member.accessibility !== "protected" && member.key.type !== AST_NODE_TYPES93.PrivateIdentifier;
20277
+ if (member.type === AST_NODE_TYPES94.MethodDefinition) {
20278
+ return member.kind !== "constructor" && !member.static && member.accessibility !== "private" && member.accessibility !== "protected" && member.key.type !== AST_NODE_TYPES94.PrivateIdentifier;
20152
20279
  }
20153
- if (member.type !== AST_NODE_TYPES93.PropertyDefinition || member.static)
20280
+ if (member.type !== AST_NODE_TYPES94.PropertyDefinition || member.static)
20154
20281
  return false;
20155
- if (member.accessibility === "private" || member.accessibility === "protected" || member.key.type === AST_NODE_TYPES93.PrivateIdentifier) return false;
20156
- return member.value?.type === AST_NODE_TYPES93.ArrowFunctionExpression || member.value?.type === AST_NODE_TYPES93.FunctionExpression || member.typeAnnotation?.typeAnnotation.type === AST_NODE_TYPES93.TSFunctionType;
20282
+ if (member.accessibility === "private" || member.accessibility === "protected" || member.key.type === AST_NODE_TYPES94.PrivateIdentifier) return false;
20283
+ return member.value?.type === AST_NODE_TYPES94.ArrowFunctionExpression || member.value?.type === AST_NODE_TYPES94.FunctionExpression || member.typeAnnotation?.typeAnnotation.type === AST_NODE_TYPES94.TSFunctionType;
20157
20284
  });
20158
20285
  }
20159
20286
  function classBindings(statement) {
20160
- const declaration = statement.type === AST_NODE_TYPES93.ExportNamedDeclaration ? statement.declaration : statement;
20161
- if (declaration?.type === AST_NODE_TYPES93.ClassDeclaration) {
20287
+ const declaration = statement.type === AST_NODE_TYPES94.ExportNamedDeclaration ? statement.declaration : statement;
20288
+ if (declaration?.type === AST_NODE_TYPES94.ClassDeclaration) {
20162
20289
  return declaration.id === null ? [] : [{ declaration, name: declaration.id.name }];
20163
20290
  }
20164
- if (declaration?.type !== AST_NODE_TYPES93.VariableDeclaration) return [];
20291
+ if (declaration?.type !== AST_NODE_TYPES94.VariableDeclaration) return [];
20165
20292
  return declaration.declarations.flatMap(
20166
- (item) => item.id.type === AST_NODE_TYPES93.Identifier && item.init?.type === AST_NODE_TYPES93.ClassExpression ? [{ declaration: item.init, name: item.id.name }] : []
20293
+ (item) => item.id.type === AST_NODE_TYPES94.Identifier && item.init?.type === AST_NODE_TYPES94.ClassExpression ? [{ declaration: item.init, name: item.id.name }] : []
20167
20294
  );
20168
20295
  }
20169
20296
  var require_interface_for_exported_class_default = createRule({
@@ -20197,7 +20324,7 @@ var require_interface_for_exported_class_default = createRule({
20197
20324
  }
20198
20325
  const exported = exportedClasses(program, classes);
20199
20326
  for (const [declaration, exportedName] of exported) {
20200
- const extendsLocalAbstractBase = declaration.superClass?.type === AST_NODE_TYPES93.Identifier && abstractBases.has(declaration.superClass.name);
20327
+ const extendsLocalAbstractBase = declaration.superClass?.type === AST_NODE_TYPES94.Identifier && abstractBases.has(declaration.superClass.name);
20201
20328
  if (declaration.abstract || declaration.implements.length > 0 || extendsLocalAbstractBase || !hasPublicInstanceBehavior(declaration)) continue;
20202
20329
  context.report({
20203
20330
  node: declaration.id ?? declaration,
@@ -20212,7 +20339,7 @@ var require_interface_for_exported_class_default = createRule({
20212
20339
  function exportedClasses(program, classes) {
20213
20340
  const exported = /* @__PURE__ */ new Map();
20214
20341
  function collectExportedClass(statement) {
20215
- if (statement.type === AST_NODE_TYPES93.ExportNamedDeclaration) {
20342
+ if (statement.type === AST_NODE_TYPES94.ExportNamedDeclaration) {
20216
20343
  for (const binding of classBindings(statement)) {
20217
20344
  exported.set(binding.declaration, binding.name);
20218
20345
  }
@@ -20220,13 +20347,13 @@ function exportedClasses(program, classes) {
20220
20347
  collectClassSpecifiers(statement);
20221
20348
  return;
20222
20349
  }
20223
- if (statement.type !== AST_NODE_TYPES93.ExportDefaultDeclaration) return;
20224
- if (statement.declaration.type === AST_NODE_TYPES93.ClassDeclaration || statement.declaration.type === AST_NODE_TYPES93.ClassExpression) {
20350
+ if (statement.type !== AST_NODE_TYPES94.ExportDefaultDeclaration) return;
20351
+ if (statement.declaration.type === AST_NODE_TYPES94.ClassDeclaration || statement.declaration.type === AST_NODE_TYPES94.ClassExpression) {
20225
20352
  exported.set(
20226
20353
  statement.declaration,
20227
20354
  statement.declaration.id?.name ?? "default"
20228
20355
  );
20229
- } else if (statement.declaration.type === AST_NODE_TYPES93.Identifier) {
20356
+ } else if (statement.declaration.type === AST_NODE_TYPES94.Identifier) {
20230
20357
  const candidate2 = classes.get(statement.declaration.name);
20231
20358
  if (candidate2 !== void 0) {
20232
20359
  exported.set(candidate2, statement.declaration.name);
@@ -20238,7 +20365,7 @@ function exportedClasses(program, classes) {
20238
20365
  if (specifier.exportKind === "type") continue;
20239
20366
  const candidate2 = classes.get(specifier.local.name);
20240
20367
  if (candidate2 === void 0) continue;
20241
- const exportedName = specifier.exported.type === AST_NODE_TYPES93.Identifier ? specifier.exported.name : specifier.exported.value;
20368
+ const exportedName = specifier.exported.type === AST_NODE_TYPES94.Identifier ? specifier.exported.name : specifier.exported.value;
20242
20369
  exported.set(candidate2, exportedName);
20243
20370
  }
20244
20371
  }
@@ -20249,7 +20376,7 @@ function exportedClasses(program, classes) {
20249
20376
  }
20250
20377
 
20251
20378
  // src/rules/require-port-for-service.ts
20252
- import { AST_NODE_TYPES as AST_NODE_TYPES94 } from "@typescript-eslint/utils";
20379
+ import { AST_NODE_TYPES as AST_NODE_TYPES95 } from "@typescript-eslint/utils";
20253
20380
  var REQUIRE_PORT_FOR_SERVICE_DOCUMENTATION = {
20254
20381
  summary: "Advise when an exported service with injected collaborators has public methods not covered by its declared ports.",
20255
20382
  rationale: "A declared port keeps consumers coupled to the service capability instead of its concrete implementation.",
@@ -20274,45 +20401,45 @@ var ROUTER_FACTORY_NAME = "Router";
20274
20401
  var FRAMEWORK_HTTP_TYPES = /* @__PURE__ */ new Set(["Request", "Response", "NextFunction"]);
20275
20402
  var STORAGE_ASSIGNMENT_OPERATORS2 = /* @__PURE__ */ new Set(["=", "&&=", "??=", "||="]);
20276
20403
  var staticMemberName7 = (member) => {
20277
- if (member.property.type === AST_NODE_TYPES94.PrivateIdentifier) return `#${member.property.name}`;
20278
- if (!member.computed && member.property.type === AST_NODE_TYPES94.Identifier) return member.property.name;
20279
- return member.computed && member.property.type === AST_NODE_TYPES94.Literal && typeof member.property.value === "string" ? member.property.value : null;
20404
+ if (member.property.type === AST_NODE_TYPES95.PrivateIdentifier) return `#${member.property.name}`;
20405
+ if (!member.computed && member.property.type === AST_NODE_TYPES95.Identifier) return member.property.name;
20406
+ return member.computed && member.property.type === AST_NODE_TYPES95.Literal && typeof member.property.value === "string" ? member.property.value : null;
20280
20407
  };
20281
20408
  var detachedValueExports = (program) => {
20282
20409
  const names = /* @__PURE__ */ new Set();
20283
20410
  for (const statement of program.body) {
20284
- if (statement.type === AST_NODE_TYPES94.ExportNamedDeclaration && statement.declaration === null && statement.source === null && statement.exportKind !== "type") {
20411
+ if (statement.type === AST_NODE_TYPES95.ExportNamedDeclaration && statement.declaration === null && statement.source === null && statement.exportKind !== "type") {
20285
20412
  for (const specifier of statement.specifiers) {
20286
20413
  if (specifier.exportKind !== "type") names.add(specifier.local.name);
20287
20414
  }
20288
- } else if (statement.type === AST_NODE_TYPES94.ExportDefaultDeclaration && statement.declaration.type === AST_NODE_TYPES94.Identifier) {
20415
+ } else if (statement.type === AST_NODE_TYPES95.ExportDefaultDeclaration && statement.declaration.type === AST_NODE_TYPES95.Identifier) {
20289
20416
  names.add(statement.declaration.name);
20290
- } else if (statement.type === AST_NODE_TYPES94.TSExportAssignment && statement.expression.type === AST_NODE_TYPES94.Identifier) {
20417
+ } else if (statement.type === AST_NODE_TYPES95.TSExportAssignment && statement.expression.type === AST_NODE_TYPES95.Identifier) {
20291
20418
  names.add(statement.expression.name);
20292
20419
  }
20293
20420
  }
20294
20421
  return names;
20295
20422
  };
20296
- var isExportedClass2 = (node, detached) => node.parent.type === AST_NODE_TYPES94.ExportNamedDeclaration || node.parent.type === AST_NODE_TYPES94.ExportDefaultDeclaration || node.id !== null && detached.has(node.id.name);
20423
+ var isExportedClass2 = (node, detached) => node.parent.type === AST_NODE_TYPES95.ExportNamedDeclaration || node.parent.type === AST_NODE_TYPES95.ExportDefaultDeclaration || node.id !== null && detached.has(node.id.name);
20297
20424
  var readTypeReference = (annotation) => {
20298
- if (annotation?.type === AST_NODE_TYPES94.TSUnionType) {
20425
+ if (annotation?.type === AST_NODE_TYPES95.TSUnionType) {
20299
20426
  const members = annotation.types.filter(
20300
- (member) => member.type !== AST_NODE_TYPES94.TSUndefinedKeyword && member.type !== AST_NODE_TYPES94.TSNullKeyword
20427
+ (member) => member.type !== AST_NODE_TYPES95.TSUndefinedKeyword && member.type !== AST_NODE_TYPES95.TSNullKeyword
20301
20428
  );
20302
20429
  annotation = members.length === 1 ? members[0] : void 0;
20303
20430
  }
20304
- if (annotation === void 0 || annotation.type !== AST_NODE_TYPES94.TSTypeReference) return null;
20431
+ if (annotation === void 0 || annotation.type !== AST_NODE_TYPES95.TSTypeReference) return null;
20305
20432
  const { typeName } = annotation;
20306
- const rightmost = typeName.type === AST_NODE_TYPES94.Identifier ? typeName.name : typeName.type === AST_NODE_TYPES94.TSQualifiedName ? typeName.right.name : null;
20433
+ const rightmost = typeName.type === AST_NODE_TYPES95.Identifier ? typeName.name : typeName.type === AST_NODE_TYPES95.TSQualifiedName ? typeName.right.name : null;
20307
20434
  if (rightmost === null) return null;
20308
20435
  return { typeName: rightmost, display: qualifiedName(typeName) };
20309
20436
  };
20310
- var qualifiedName = (name) => name.type === AST_NODE_TYPES94.Identifier ? name.name : name.type === AST_NODE_TYPES94.TSQualifiedName ? `${qualifiedName(name.left)}.${name.right.name}` : "";
20437
+ var qualifiedName = (name) => name.type === AST_NODE_TYPES95.Identifier ? name.name : name.type === AST_NODE_TYPES95.TSQualifiedName ? `${qualifiedName(name.left)}.${name.right.name}` : "";
20311
20438
  var propertySignatureTypes = (members) => {
20312
20439
  const types = /* @__PURE__ */ new Map();
20313
20440
  for (const member of members) {
20314
- if (member.type !== AST_NODE_TYPES94.TSPropertySignature) continue;
20315
- if (member.computed || member.key.type !== AST_NODE_TYPES94.Identifier) continue;
20441
+ if (member.type !== AST_NODE_TYPES95.TSPropertySignature) continue;
20442
+ if (member.computed || member.key.type !== AST_NODE_TYPES95.Identifier) continue;
20316
20443
  const reference = readTypeReference(member.typeAnnotation?.typeAnnotation);
20317
20444
  if (reference === null) continue;
20318
20445
  types.set(member.key.name, reference);
@@ -20323,18 +20450,18 @@ var fileTypeIndex = (program) => {
20323
20450
  const objects = /* @__PURE__ */ new Map();
20324
20451
  const functionAliases = /* @__PURE__ */ new Set();
20325
20452
  function collectDeclaredType(statement) {
20326
- const declaration = statement.type === AST_NODE_TYPES94.ExportNamedDeclaration ? statement.declaration : statement;
20327
- if (declaration?.type === AST_NODE_TYPES94.TSInterfaceDeclaration) {
20453
+ const declaration = statement.type === AST_NODE_TYPES95.ExportNamedDeclaration ? statement.declaration : statement;
20454
+ if (declaration?.type === AST_NODE_TYPES95.TSInterfaceDeclaration) {
20328
20455
  objects.set(declaration.id.name, propertySignatureTypes(declaration.body.body));
20329
20456
  return;
20330
20457
  }
20331
- if (declaration?.type !== AST_NODE_TYPES94.TSTypeAliasDeclaration) return;
20458
+ if (declaration?.type !== AST_NODE_TYPES95.TSTypeAliasDeclaration) return;
20332
20459
  const aliased = declaration.typeAnnotation;
20333
- if (aliased.type === AST_NODE_TYPES94.TSFunctionType || aliased.type === AST_NODE_TYPES94.TSConstructorType) {
20460
+ if (aliased.type === AST_NODE_TYPES95.TSFunctionType || aliased.type === AST_NODE_TYPES95.TSConstructorType) {
20334
20461
  functionAliases.add(declaration.id.name);
20335
20462
  return;
20336
20463
  }
20337
- const literals = aliased.type === AST_NODE_TYPES94.TSTypeLiteral ? [aliased] : aliased.type === AST_NODE_TYPES94.TSIntersectionType ? aliased.types.filter((part) => part.type === AST_NODE_TYPES94.TSTypeLiteral) : [];
20464
+ const literals = aliased.type === AST_NODE_TYPES95.TSTypeLiteral ? [aliased] : aliased.type === AST_NODE_TYPES95.TSIntersectionType ? aliased.types.filter((part) => part.type === AST_NODE_TYPES95.TSTypeLiteral) : [];
20338
20465
  if (literals.length === 0) return;
20339
20466
  const merged = /* @__PURE__ */ new Map();
20340
20467
  for (const literal of literals) {
@@ -20365,22 +20492,22 @@ var readConstructor = (ctor, declared, typeParameters) => {
20365
20492
  function scanStoredFields(body3) {
20366
20493
  const pending = [...body3.body];
20367
20494
  function recordStoredField(current) {
20368
- if (current.type === AST_NODE_TYPES94.ArrowFunctionExpression || current.type === AST_NODE_TYPES94.FunctionExpression || current.type === AST_NODE_TYPES94.FunctionDeclaration || current.type === AST_NODE_TYPES94.ClassExpression || current.type === AST_NODE_TYPES94.ClassDeclaration) return;
20369
- const expression = current.type === AST_NODE_TYPES94.ExpressionStatement ? current.expression : null;
20370
- const storedField = expression?.type === AST_NODE_TYPES94.AssignmentExpression && expression.left.type === AST_NODE_TYPES94.MemberExpression && expression.left.object.type === AST_NODE_TYPES94.ThisExpression ? staticMemberName7(expression.left) : null;
20371
- if (expression?.type !== AST_NODE_TYPES94.AssignmentExpression || !STORAGE_ASSIGNMENT_OPERATORS2.has(expression.operator) || expression.left.type !== AST_NODE_TYPES94.MemberExpression || expression.left.object.type !== AST_NODE_TYPES94.ThisExpression || storedField === null) {
20495
+ if (current.type === AST_NODE_TYPES95.ArrowFunctionExpression || current.type === AST_NODE_TYPES95.FunctionExpression || current.type === AST_NODE_TYPES95.FunctionDeclaration || current.type === AST_NODE_TYPES95.ClassExpression || current.type === AST_NODE_TYPES95.ClassDeclaration) return;
20496
+ const expression = current.type === AST_NODE_TYPES95.ExpressionStatement ? current.expression : null;
20497
+ const storedField = expression?.type === AST_NODE_TYPES95.AssignmentExpression && expression.left.type === AST_NODE_TYPES95.MemberExpression && expression.left.object.type === AST_NODE_TYPES95.ThisExpression ? staticMemberName7(expression.left) : null;
20498
+ if (expression?.type !== AST_NODE_TYPES95.AssignmentExpression || !STORAGE_ASSIGNMENT_OPERATORS2.has(expression.operator) || expression.left.type !== AST_NODE_TYPES95.MemberExpression || expression.left.object.type !== AST_NODE_TYPES95.ThisExpression || storedField === null) {
20372
20499
  enqueueChildren(current);
20373
20500
  return;
20374
20501
  }
20375
20502
  let source = expression.right;
20376
- while (source.type === AST_NODE_TYPES94.TSNonNullExpression || source.type === AST_NODE_TYPES94.TSAsExpression || source.type === AST_NODE_TYPES94.TSSatisfiesExpression || source.type === AST_NODE_TYPES94.TSTypeAssertion) source = source.expression;
20377
- if (source.type === AST_NODE_TYPES94.NewExpression) {
20503
+ while (source.type === AST_NODE_TYPES95.TSNonNullExpression || source.type === AST_NODE_TYPES95.TSAsExpression || source.type === AST_NODE_TYPES95.TSSatisfiesExpression || source.type === AST_NODE_TYPES95.TSTypeAssertion) source = source.expression;
20504
+ if (source.type === AST_NODE_TYPES95.NewExpression) {
20378
20505
  constructedFields += 1;
20379
- } else if (source.type === AST_NODE_TYPES94.Identifier) {
20506
+ } else if (source.type === AST_NODE_TYPES95.Identifier) {
20380
20507
  const fields = storedFieldsFrom.get(source.name) ?? /* @__PURE__ */ new Set();
20381
20508
  fields.add(storedField);
20382
20509
  storedFieldsFrom.set(source.name, fields);
20383
- } else if (source.type === AST_NODE_TYPES94.MemberExpression && source.object.type === AST_NODE_TYPES94.Identifier) {
20510
+ } else if (source.type === AST_NODE_TYPES95.MemberExpression && source.object.type === AST_NODE_TYPES95.Identifier) {
20384
20511
  const fields = storedFieldsFrom.get(source.object.name) ?? /* @__PURE__ */ new Set();
20385
20512
  fields.add(storedField);
20386
20513
  storedFieldsFrom.set(source.object.name, fields);
@@ -20408,7 +20535,7 @@ var readConstructor = (ctor, declared, typeParameters) => {
20408
20535
  const collaborators = [];
20409
20536
  function collectCollaborators(parameter) {
20410
20537
  for (const reference of parameterCollaborators(parameter, declared, storedMemberFieldsFrom)) {
20411
- const fields = parameter.type === AST_NODE_TYPES94.TSParameterProperty ? [reference.name] : reference.fields.length > 0 ? reference.fields : [...storedFieldsFrom.get(reference.name) ?? []];
20538
+ const fields = parameter.type === AST_NODE_TYPES95.TSParameterProperty ? [reference.name] : reference.fields.length > 0 ? reference.fields : [...storedFieldsFrom.get(reference.name) ?? []];
20412
20539
  if (fields.length === 0) continue;
20413
20540
  if (CONFIGISH_TYPE_RE.test(reference.typeName)) continue;
20414
20541
  if (CONFIGISH_NAME_RE.test(reference.name)) continue;
@@ -20426,8 +20553,8 @@ var readConstructor = (ctor, declared, typeParameters) => {
20426
20553
  };
20427
20554
  var parameterCollaborators = (parameter, declared, storedMemberFieldsFrom) => {
20428
20555
  let target = parameter;
20429
- if (target.type === AST_NODE_TYPES94.AssignmentPattern) target = target.left;
20430
- if (target.type === AST_NODE_TYPES94.ObjectPattern) {
20556
+ if (target.type === AST_NODE_TYPES95.AssignmentPattern) target = target.left;
20557
+ if (target.type === AST_NODE_TYPES95.ObjectPattern) {
20431
20558
  return objectPatternCollaborators(target, declared);
20432
20559
  }
20433
20560
  const named2 = namedParameterCollaborator(parameter);
@@ -20436,9 +20563,9 @@ var parameterCollaborators = (parameter, declared, storedMemberFieldsFrom) => {
20436
20563
  };
20437
20564
  var namedBagCollaborators = (annotated, declared, storedMemberFieldsFrom) => {
20438
20565
  let target = annotated;
20439
- if (target.type === AST_NODE_TYPES94.TSParameterProperty) target = target.parameter;
20440
- if (target.type === AST_NODE_TYPES94.AssignmentPattern) target = target.left;
20441
- if (target.type !== AST_NODE_TYPES94.Identifier) return [];
20566
+ if (target.type === AST_NODE_TYPES95.TSParameterProperty) target = target.parameter;
20567
+ if (target.type === AST_NODE_TYPES95.AssignmentPattern) target = target.left;
20568
+ if (target.type !== AST_NODE_TYPES95.Identifier) return [];
20442
20569
  const members = bagMemberTypes(target.typeAnnotation?.typeAnnotation, declared);
20443
20570
  if (members === null) return [];
20444
20571
  const storedMembers = storedMemberFieldsFrom.get(target.name);
@@ -20454,9 +20581,9 @@ var namedBagCollaborators = (annotated, declared, storedMemberFieldsFrom) => {
20454
20581
  };
20455
20582
  var namedParameterCollaborator = (annotated) => {
20456
20583
  let target = annotated;
20457
- if (target.type === AST_NODE_TYPES94.TSParameterProperty) target = target.parameter;
20458
- if (target.type === AST_NODE_TYPES94.AssignmentPattern) target = target.left;
20459
- if (target.type !== AST_NODE_TYPES94.Identifier) return null;
20584
+ if (target.type === AST_NODE_TYPES95.TSParameterProperty) target = target.parameter;
20585
+ if (target.type === AST_NODE_TYPES95.AssignmentPattern) target = target.left;
20586
+ if (target.type !== AST_NODE_TYPES95.Identifier) return null;
20460
20587
  const reference = readTypeReference(target.typeAnnotation?.typeAnnotation);
20461
20588
  if (reference === null) return null;
20462
20589
  return { name: target.name, ...reference, fields: [] };
@@ -20468,11 +20595,11 @@ var objectPatternCollaborators = (pattern, declared) => {
20468
20595
  if (members === null) return [];
20469
20596
  const collaborators = [];
20470
20597
  for (const property of pattern.properties) {
20471
- if (property.type !== AST_NODE_TYPES94.Property || property.computed) continue;
20472
- if (property.key.type !== AST_NODE_TYPES94.Identifier) continue;
20598
+ if (property.type !== AST_NODE_TYPES95.Property || property.computed) continue;
20599
+ if (property.key.type !== AST_NODE_TYPES95.Identifier) continue;
20473
20600
  const key = property.key.name;
20474
- const bound = property.value.type === AST_NODE_TYPES94.AssignmentPattern ? property.value.left : property.value;
20475
- if (bound.type !== AST_NODE_TYPES94.Identifier) continue;
20601
+ const bound = property.value.type === AST_NODE_TYPES95.AssignmentPattern ? property.value.left : property.value;
20602
+ if (bound.type !== AST_NODE_TYPES95.Identifier) continue;
20476
20603
  if (CONFIGISH_NAME_RE.test(key)) continue;
20477
20604
  const reference = members.get(key);
20478
20605
  if (reference === void 0) continue;
@@ -20482,21 +20609,21 @@ var objectPatternCollaborators = (pattern, declared) => {
20482
20609
  };
20483
20610
  var bagMemberTypes = (annotation, declared) => {
20484
20611
  if (annotation === void 0) return null;
20485
- if (annotation.type === AST_NODE_TYPES94.TSTypeLiteral) {
20612
+ if (annotation.type === AST_NODE_TYPES95.TSTypeLiteral) {
20486
20613
  return propertySignatureTypes(annotation.members);
20487
20614
  }
20488
- if (annotation.type !== AST_NODE_TYPES94.TSTypeReference || annotation.typeName.type !== AST_NODE_TYPES94.Identifier) {
20615
+ if (annotation.type !== AST_NODE_TYPES95.TSTypeReference || annotation.typeName.type !== AST_NODE_TYPES95.Identifier) {
20489
20616
  return null;
20490
20617
  }
20491
20618
  return declared().objects.get(annotation.typeName.name) ?? null;
20492
20619
  };
20493
20620
  var isFrameworkWiring = (body2) => subtreeHas(body2, (node) => {
20494
- if (node.type === AST_NODE_TYPES94.CallExpression) {
20621
+ if (node.type === AST_NODE_TYPES95.CallExpression) {
20495
20622
  const { callee } = node;
20496
- if (callee.type === AST_NODE_TYPES94.Identifier) return callee.name === ROUTER_FACTORY_NAME;
20497
- return callee.type === AST_NODE_TYPES94.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES94.Identifier && callee.property.name === ROUTER_FACTORY_NAME;
20623
+ if (callee.type === AST_NODE_TYPES95.Identifier) return callee.name === ROUTER_FACTORY_NAME;
20624
+ return callee.type === AST_NODE_TYPES95.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES95.Identifier && callee.property.name === ROUTER_FACTORY_NAME;
20498
20625
  }
20499
- return node.type === AST_NODE_TYPES94.TSTypeReference && node.typeName.type === AST_NODE_TYPES94.TSQualifiedName && FRAMEWORK_HTTP_TYPES.has(node.typeName.right.name);
20626
+ return node.type === AST_NODE_TYPES95.TSTypeReference && node.typeName.type === AST_NODE_TYPES95.TSQualifiedName && FRAMEWORK_HTTP_TYPES.has(node.typeName.right.name);
20500
20627
  });
20501
20628
  var subtreeHas = (root, found) => {
20502
20629
  let hit = false;
@@ -20518,33 +20645,33 @@ var invokedInstanceField = (call) => {
20518
20645
  const direct = instanceField(call.callee);
20519
20646
  if (direct !== null) return direct;
20520
20647
  let callee = call.callee;
20521
- while (callee.type === AST_NODE_TYPES94.ChainExpression || callee.type === AST_NODE_TYPES94.TSAsExpression || callee.type === AST_NODE_TYPES94.TSNonNullExpression || callee.type === AST_NODE_TYPES94.TSSatisfiesExpression || callee.type === AST_NODE_TYPES94.TSTypeAssertion) callee = callee.expression;
20522
- return callee.type === AST_NODE_TYPES94.MemberExpression ? instanceField(callee.object) : null;
20648
+ while (callee.type === AST_NODE_TYPES95.ChainExpression || callee.type === AST_NODE_TYPES95.TSAsExpression || callee.type === AST_NODE_TYPES95.TSNonNullExpression || callee.type === AST_NODE_TYPES95.TSSatisfiesExpression || callee.type === AST_NODE_TYPES95.TSTypeAssertion) callee = callee.expression;
20649
+ return callee.type === AST_NODE_TYPES95.MemberExpression ? instanceField(callee.object) : null;
20523
20650
  };
20524
20651
  var instanceField = (candidate2) => {
20525
20652
  let node = candidate2;
20526
- while (node.type === AST_NODE_TYPES94.ChainExpression || node.type === AST_NODE_TYPES94.TSAsExpression || node.type === AST_NODE_TYPES94.TSNonNullExpression || node.type === AST_NODE_TYPES94.TSSatisfiesExpression || node.type === AST_NODE_TYPES94.TSTypeAssertion) node = node.expression;
20527
- return node.type === AST_NODE_TYPES94.MemberExpression && node.object.type === AST_NODE_TYPES94.ThisExpression ? staticMemberName7(node) : null;
20653
+ while (node.type === AST_NODE_TYPES95.ChainExpression || node.type === AST_NODE_TYPES95.TSAsExpression || node.type === AST_NODE_TYPES95.TSNonNullExpression || node.type === AST_NODE_TYPES95.TSSatisfiesExpression || node.type === AST_NODE_TYPES95.TSTypeAssertion) node = node.expression;
20654
+ return node.type === AST_NODE_TYPES95.MemberExpression && node.object.type === AST_NODE_TYPES95.ThisExpression ? staticMemberName7(node) : null;
20528
20655
  };
20529
20656
  var behaviorallyInvokedFields = (body2) => {
20530
20657
  const invoked = /* @__PURE__ */ new Set();
20531
20658
  const visit = (current) => {
20532
- if (current.type === AST_NODE_TYPES94.ClassDeclaration || current.type === AST_NODE_TYPES94.ClassExpression || current.type === AST_NODE_TYPES94.FunctionDeclaration || current.type === AST_NODE_TYPES94.FunctionExpression) return;
20533
- if (current.type === AST_NODE_TYPES94.CallExpression) {
20659
+ if (current.type === AST_NODE_TYPES95.ClassDeclaration || current.type === AST_NODE_TYPES95.ClassExpression || current.type === AST_NODE_TYPES95.FunctionDeclaration || current.type === AST_NODE_TYPES95.FunctionExpression) return;
20660
+ if (current.type === AST_NODE_TYPES95.CallExpression) {
20534
20661
  const field = invokedInstanceField(current);
20535
20662
  if (field !== null) invoked.add(field);
20536
20663
  }
20537
20664
  forEachOwnAstChild(current, visit);
20538
20665
  };
20539
20666
  for (const member of body2.body) {
20540
- if (member.type === AST_NODE_TYPES94.StaticBlock || member.static) continue;
20541
- if (member.type === AST_NODE_TYPES94.MethodDefinition) {
20667
+ if (member.type === AST_NODE_TYPES95.StaticBlock || member.static) continue;
20668
+ if (member.type === AST_NODE_TYPES95.MethodDefinition) {
20542
20669
  if (member.value.body !== null && member.value.body !== void 0) visit(member.value.body);
20543
20670
  continue;
20544
20671
  }
20545
- if (member.type !== AST_NODE_TYPES94.PropertyDefinition || member.value === null) continue;
20672
+ if (member.type !== AST_NODE_TYPES95.PropertyDefinition || member.value === null) continue;
20546
20673
  visit(
20547
- member.value.type === AST_NODE_TYPES94.ArrowFunctionExpression ? member.value.body : member.value
20674
+ member.value.type === AST_NODE_TYPES95.ArrowFunctionExpression ? member.value.body : member.value
20548
20675
  );
20549
20676
  }
20550
20677
  return invoked;
@@ -20564,25 +20691,25 @@ var isTransportWrapper = (className, collaborators, program) => {
20564
20691
  var fileInterfaceNames = (program) => {
20565
20692
  const names = [];
20566
20693
  for (const statement of program.body) {
20567
- const declaration = statement.type === AST_NODE_TYPES94.ExportNamedDeclaration ? statement.declaration : statement;
20568
- if (declaration?.type === AST_NODE_TYPES94.TSInterfaceDeclaration) names.push(declaration.id.name);
20694
+ const declaration = statement.type === AST_NODE_TYPES95.ExportNamedDeclaration ? statement.declaration : statement;
20695
+ if (declaration?.type === AST_NODE_TYPES95.TSInterfaceDeclaration) names.push(declaration.id.name);
20569
20696
  }
20570
20697
  return names;
20571
20698
  };
20572
20699
  var publicMethodNames = (body2, functionAliases) => {
20573
20700
  const names = [];
20574
20701
  function collectPublicCallable(member) {
20575
- if (member.type === AST_NODE_TYPES94.PropertyDefinition) {
20702
+ if (member.type === AST_NODE_TYPES95.PropertyDefinition) {
20576
20703
  if (member.static || member.accessibility === "private" || member.accessibility === "protected") return;
20577
- if (member.key.type === AST_NODE_TYPES94.PrivateIdentifier) return;
20578
- if (member.value?.type !== AST_NODE_TYPES94.ArrowFunctionExpression && member.value?.type !== AST_NODE_TYPES94.FunctionExpression && member.typeAnnotation?.typeAnnotation.type !== AST_NODE_TYPES94.TSFunctionType && !(member.typeAnnotation?.typeAnnotation.type === AST_NODE_TYPES94.TSTypeReference && member.typeAnnotation.typeAnnotation.typeName.type === AST_NODE_TYPES94.Identifier && functionAliases.has(member.typeAnnotation.typeAnnotation.typeName.name))) return;
20704
+ if (member.key.type === AST_NODE_TYPES95.PrivateIdentifier) return;
20705
+ if (member.value?.type !== AST_NODE_TYPES95.ArrowFunctionExpression && member.value?.type !== AST_NODE_TYPES95.FunctionExpression && member.typeAnnotation?.typeAnnotation.type !== AST_NODE_TYPES95.TSFunctionType && !(member.typeAnnotation?.typeAnnotation.type === AST_NODE_TYPES95.TSTypeReference && member.typeAnnotation.typeAnnotation.typeName.type === AST_NODE_TYPES95.Identifier && functionAliases.has(member.typeAnnotation.typeAnnotation.typeName.name))) return;
20579
20706
  names.push(declaredMemberName(member) ?? "\u2026");
20580
20707
  return;
20581
20708
  }
20582
- if (member.type !== AST_NODE_TYPES94.MethodDefinition) return;
20709
+ if (member.type !== AST_NODE_TYPES95.MethodDefinition) return;
20583
20710
  if (member.kind !== "method" || member.static) return;
20584
20711
  if (member.accessibility === "private" || member.accessibility === "protected") return;
20585
- if (member.key.type === AST_NODE_TYPES94.PrivateIdentifier) return;
20712
+ if (member.key.type === AST_NODE_TYPES95.PrivateIdentifier) return;
20586
20713
  names.push(declaredMemberName(member) ?? "\u2026");
20587
20714
  }
20588
20715
  for (const member of body2.body) {
@@ -20593,13 +20720,13 @@ var publicMethodNames = (body2, functionAliases) => {
20593
20720
  var isFluentConstructionObject = (node, getText) => {
20594
20721
  if (node.id === null) return false;
20595
20722
  const methods = node.body.body.filter(
20596
- (member) => member.type === AST_NODE_TYPES94.MethodDefinition && member.kind === "method" && !member.static && member.accessibility !== "private" && member.accessibility !== "protected" && member.value.body !== null
20723
+ (member) => member.type === AST_NODE_TYPES95.MethodDefinition && member.kind === "method" && !member.static && member.accessibility !== "private" && member.accessibility !== "protected" && member.value.body !== null
20597
20724
  );
20598
20725
  if (methods.length === 0) return false;
20599
20726
  return methods.every((member) => {
20600
20727
  const result = member.value.returnType?.typeAnnotation;
20601
20728
  if (result === void 0) return false;
20602
- const returnsOwnType = result.type === AST_NODE_TYPES94.TSTypeReference && result.typeName.type === AST_NODE_TYPES94.Identifier && result.typeName.name === node.id?.name;
20729
+ const returnsOwnType = result.type === AST_NODE_TYPES95.TSTypeReference && result.typeName.type === AST_NODE_TYPES95.Identifier && result.typeName.name === node.id?.name;
20603
20730
  return returnsOwnType || FLUENT_BUILDER_NAME_RE.test(node.id?.name ?? "") && FLUENT_RESULT_TYPE_RE.test(getText(result));
20604
20731
  });
20605
20732
  };
@@ -20607,10 +20734,10 @@ function localClassAbstractness(program) {
20607
20734
  const classes = /* @__PURE__ */ new Map();
20608
20735
  const parents = /* @__PURE__ */ new Map();
20609
20736
  for (const statement of program.body) {
20610
- const declaration = statement.type === AST_NODE_TYPES94.ExportNamedDeclaration || statement.type === AST_NODE_TYPES94.ExportDefaultDeclaration ? statement.declaration : statement;
20611
- if (declaration?.type === AST_NODE_TYPES94.ClassDeclaration && declaration.id !== null) {
20737
+ const declaration = statement.type === AST_NODE_TYPES95.ExportNamedDeclaration || statement.type === AST_NODE_TYPES95.ExportDefaultDeclaration ? statement.declaration : statement;
20738
+ if (declaration?.type === AST_NODE_TYPES95.ClassDeclaration && declaration.id !== null) {
20612
20739
  classes.set(declaration.id.name, declaration.abstract === true);
20613
- if (declaration.superClass?.type === AST_NODE_TYPES94.Identifier) {
20740
+ if (declaration.superClass?.type === AST_NODE_TYPES95.Identifier) {
20614
20741
  parents.set(declaration.id.name, declaration.superClass.name);
20615
20742
  }
20616
20743
  }
@@ -20628,8 +20755,8 @@ function localClassAbstractness(program) {
20628
20755
  return classes;
20629
20756
  }
20630
20757
  function declaredMemberName(member) {
20631
- if (!member.computed && member.key.type === AST_NODE_TYPES94.Identifier) return member.key.name;
20632
- if (member.key.type === AST_NODE_TYPES94.Literal && typeof member.key.value === "string") return member.key.value;
20758
+ if (!member.computed && member.key.type === AST_NODE_TYPES95.Identifier) return member.key.name;
20759
+ if (member.key.type === AST_NODE_TYPES95.Literal && typeof member.key.value === "string") return member.key.value;
20633
20760
  return null;
20634
20761
  }
20635
20762
  function localInterfaceSurfaces(program) {
@@ -20637,28 +20764,28 @@ function localInterfaceSurfaces(program) {
20637
20764
  const parents = /* @__PURE__ */ new Map();
20638
20765
  const functionAliases = /* @__PURE__ */ new Set();
20639
20766
  for (const statement of program.body) {
20640
- const declaration = statement.type === AST_NODE_TYPES94.ExportNamedDeclaration ? statement.declaration : statement;
20641
- if (declaration?.type === AST_NODE_TYPES94.TSTypeAliasDeclaration && (declaration.typeAnnotation.type === AST_NODE_TYPES94.TSFunctionType || declaration.typeAnnotation.type === AST_NODE_TYPES94.TSConstructorType)) functionAliases.add(declaration.id.name);
20767
+ const declaration = statement.type === AST_NODE_TYPES95.ExportNamedDeclaration ? statement.declaration : statement;
20768
+ if (declaration?.type === AST_NODE_TYPES95.TSTypeAliasDeclaration && (declaration.typeAnnotation.type === AST_NODE_TYPES95.TSFunctionType || declaration.typeAnnotation.type === AST_NODE_TYPES95.TSConstructorType)) functionAliases.add(declaration.id.name);
20642
20769
  }
20643
20770
  function collectInterfaceSurface(statement) {
20644
- const declaration = statement.type === AST_NODE_TYPES94.ExportNamedDeclaration ? statement.declaration : statement;
20645
- if (declaration?.type === AST_NODE_TYPES94.TSTypeAliasDeclaration) {
20771
+ const declaration = statement.type === AST_NODE_TYPES95.ExportNamedDeclaration ? statement.declaration : statement;
20772
+ if (declaration?.type === AST_NODE_TYPES95.TSTypeAliasDeclaration) {
20646
20773
  const callables2 = interfaces.get(declaration.id.name) ?? /* @__PURE__ */ new Set();
20647
- const parts = declaration.typeAnnotation.type === AST_NODE_TYPES94.TSIntersectionType ? declaration.typeAnnotation.types : [declaration.typeAnnotation];
20774
+ const parts = declaration.typeAnnotation.type === AST_NODE_TYPES95.TSIntersectionType ? declaration.typeAnnotation.types : [declaration.typeAnnotation];
20648
20775
  const inherited = parents.get(declaration.id.name) ?? [];
20649
20776
  for (const part of parts) {
20650
- if (part.type === AST_NODE_TYPES94.TSTypeReference && part.typeName.type === AST_NODE_TYPES94.Identifier) {
20777
+ if (part.type === AST_NODE_TYPES95.TSTypeReference && part.typeName.type === AST_NODE_TYPES95.Identifier) {
20651
20778
  inherited.push(part.typeName.name);
20652
20779
  continue;
20653
20780
  }
20654
- if (part.type !== AST_NODE_TYPES94.TSTypeLiteral) continue;
20781
+ if (part.type !== AST_NODE_TYPES95.TSTypeLiteral) continue;
20655
20782
  addCallableMembers(part.members, callables2);
20656
20783
  }
20657
20784
  interfaces.set(declaration.id.name, callables2);
20658
20785
  parents.set(declaration.id.name, inherited);
20659
20786
  return;
20660
20787
  }
20661
- if (declaration?.type !== AST_NODE_TYPES94.TSInterfaceDeclaration) return;
20788
+ if (declaration?.type !== AST_NODE_TYPES95.TSInterfaceDeclaration) return;
20662
20789
  const callables = interfaces.get(declaration.id.name) ?? /* @__PURE__ */ new Set();
20663
20790
  addCallableMembers(declaration.body.body, callables);
20664
20791
  interfaces.set(declaration.id.name, callables);
@@ -20667,7 +20794,7 @@ function localInterfaceSurfaces(program) {
20667
20794
  [
20668
20795
  ...parents.get(declaration.id.name) ?? [],
20669
20796
  ...declaration.extends.flatMap(
20670
- (heritage) => heritage.expression.type === AST_NODE_TYPES94.Identifier ? [heritage.expression.name] : ["*"]
20797
+ (heritage) => heritage.expression.type === AST_NODE_TYPES95.Identifier ? [heritage.expression.name] : ["*"]
20671
20798
  )
20672
20799
  ]
20673
20800
  );
@@ -20677,16 +20804,16 @@ function localInterfaceSurfaces(program) {
20677
20804
  }
20678
20805
  function addCallableMembers(members, callables) {
20679
20806
  for (const member of members) {
20680
- if (member.type !== AST_NODE_TYPES94.TSMethodSignature && member.type !== AST_NODE_TYPES94.TSPropertySignature) continue;
20807
+ if (member.type !== AST_NODE_TYPES95.TSMethodSignature && member.type !== AST_NODE_TYPES95.TSPropertySignature) continue;
20681
20808
  const name = declaredMemberName(member);
20682
20809
  if (name === null) continue;
20683
- if (member.type === AST_NODE_TYPES94.TSMethodSignature) {
20810
+ if (member.type === AST_NODE_TYPES95.TSMethodSignature) {
20684
20811
  callables.add(name);
20685
20812
  continue;
20686
20813
  }
20687
- if (member.type !== AST_NODE_TYPES94.TSPropertySignature) continue;
20814
+ if (member.type !== AST_NODE_TYPES95.TSPropertySignature) continue;
20688
20815
  const annotation = member.typeAnnotation?.typeAnnotation;
20689
- if (annotation?.type === AST_NODE_TYPES94.TSFunctionType || annotation?.type === AST_NODE_TYPES94.TSTypeReference && annotation.typeName.type === AST_NODE_TYPES94.Identifier && functionAliases.has(annotation.typeName.name)) callables.add(name);
20816
+ if (annotation?.type === AST_NODE_TYPES95.TSFunctionType || annotation?.type === AST_NODE_TYPES95.TSTypeReference && annotation.typeName.type === AST_NODE_TYPES95.Identifier && functionAliases.has(annotation.typeName.name)) callables.add(name);
20690
20817
  }
20691
20818
  }
20692
20819
  function expandInheritedSurfaces() {
@@ -20715,7 +20842,7 @@ function localInterfaceSurfaces(program) {
20715
20842
  }
20716
20843
  function hasServicePort(node, methods, classes, interfaces) {
20717
20844
  if (node.superClass !== null) {
20718
- if (node.superClass.type !== AST_NODE_TYPES94.Identifier) return true;
20845
+ if (node.superClass.type !== AST_NODE_TYPES95.Identifier) return true;
20719
20846
  const localAbstract = classes.get(node.superClass.name);
20720
20847
  if (localAbstract === void 0 || localAbstract) return true;
20721
20848
  }
@@ -20756,7 +20883,7 @@ var require_port_for_service_default = createRule({
20756
20883
  if (node.abstract === true) return;
20757
20884
  if (node.decorators.length > 0) return;
20758
20885
  const ctor = node.body.body.find(
20759
- (member) => member.type === AST_NODE_TYPES94.MethodDefinition && member.kind === "constructor" && member.value.body !== null && member.value.body !== void 0
20886
+ (member) => member.type === AST_NODE_TYPES95.MethodDefinition && member.kind === "constructor" && member.value.body !== null && member.value.body !== void 0
20760
20887
  );
20761
20888
  if (ctor === void 0) return;
20762
20889
  const constructorFacts = readConstructor(
@@ -20798,7 +20925,7 @@ function hasStructuralPort(name, methods, interfaces) {
20798
20925
  function implementedSurfaceCovers(node, methods, classes, interfaces) {
20799
20926
  const combined = /* @__PURE__ */ new Set();
20800
20927
  for (const implementation of node.implements) {
20801
- if (implementation.expression.type !== AST_NODE_TYPES94.Identifier) return true;
20928
+ if (implementation.expression.type !== AST_NODE_TYPES95.Identifier) return true;
20802
20929
  const name = implementation.expression.name;
20803
20930
  const localAbstract = classes.get(name);
20804
20931
  if (localAbstract === true) return true;
@@ -20812,7 +20939,7 @@ function implementedSurfaceCovers(node, methods, classes, interfaces) {
20812
20939
  }
20813
20940
 
20814
20941
  // src/rules/require-sql-access-class.ts
20815
- import { AST_NODE_TYPES as AST_NODE_TYPES95, ASTUtils as ASTUtils47 } from "@typescript-eslint/utils";
20942
+ import { AST_NODE_TYPES as AST_NODE_TYPES96, ASTUtils as ASTUtils48 } from "@typescript-eslint/utils";
20816
20943
  var DIRECT_EXECUTION_METHODS = /* @__PURE__ */ new Set([
20817
20944
  "all",
20818
20945
  "batch",
@@ -20908,9 +21035,9 @@ var REQUIRE_SQL_ACCESS_CLASS_DOCUMENTATION = {
20908
21035
  ]
20909
21036
  };
20910
21037
  function memberName7(node) {
20911
- if (!node.computed && node.property.type === AST_NODE_TYPES95.Identifier)
21038
+ if (!node.computed && node.property.type === AST_NODE_TYPES96.Identifier)
20912
21039
  return node.property.name;
20913
- if (node.computed && node.property.type === AST_NODE_TYPES95.Literal && typeof node.property.value === "string")
21040
+ if (node.computed && node.property.type === AST_NODE_TYPES96.Literal && typeof node.property.value === "string")
20914
21041
  return node.property.value;
20915
21042
  return null;
20916
21043
  }
@@ -20922,89 +21049,89 @@ function isDatabaseOperation(method, receiver) {
20922
21049
  return BUILDER_SHORT_TERMINALS.has(method) && expressionCallsBuilder(receiver);
20923
21050
  }
20924
21051
  function databaseReceiver(node) {
20925
- if (node.type === AST_NODE_TYPES95.Identifier)
21052
+ if (node.type === AST_NODE_TYPES96.Identifier)
20926
21053
  return DATABASE_NAMES.test(node.name);
20927
- if (node.type !== AST_NODE_TYPES95.MemberExpression) return false;
21054
+ if (node.type !== AST_NODE_TYPES96.MemberExpression) return false;
20928
21055
  const name = memberName7(node);
20929
21056
  return name === "DB" || name !== null && DATABASE_NAMES.test(name);
20930
21057
  }
20931
21058
  function databaseRootMember(node) {
20932
21059
  let current = node;
20933
21060
  for (; ; ) {
20934
- if (current.type === AST_NODE_TYPES95.ChainExpression) {
21061
+ if (current.type === AST_NODE_TYPES96.ChainExpression) {
20935
21062
  current = current.expression;
20936
21063
  continue;
20937
21064
  }
20938
- if (current.type === AST_NODE_TYPES95.TSAsExpression || current.type === AST_NODE_TYPES95.TSNonNullExpression || current.type === AST_NODE_TYPES95.TSTypeAssertion) {
21065
+ if (current.type === AST_NODE_TYPES96.TSAsExpression || current.type === AST_NODE_TYPES96.TSNonNullExpression || current.type === AST_NODE_TYPES96.TSTypeAssertion) {
20939
21066
  current = current.expression;
20940
21067
  continue;
20941
21068
  }
20942
- if (current.type === AST_NODE_TYPES95.CallExpression) {
20943
- if (current.callee.type !== AST_NODE_TYPES95.MemberExpression) return null;
21069
+ if (current.type === AST_NODE_TYPES96.CallExpression) {
21070
+ if (current.callee.type !== AST_NODE_TYPES96.MemberExpression) return null;
20944
21071
  current = current.callee.object;
20945
21072
  continue;
20946
21073
  }
20947
- if (current.type === AST_NODE_TYPES95.MemberExpression) {
20948
- if (current.object.type === AST_NODE_TYPES95.ThisExpression)
21074
+ if (current.type === AST_NODE_TYPES96.MemberExpression) {
21075
+ if (current.object.type === AST_NODE_TYPES96.ThisExpression)
20949
21076
  return memberName7(current);
20950
21077
  current = current.object;
20951
21078
  continue;
20952
21079
  }
20953
- return current.type === AST_NODE_TYPES95.Identifier ? current.name : null;
21080
+ return current.type === AST_NODE_TYPES96.Identifier ? current.name : null;
20954
21081
  }
20955
21082
  }
20956
21083
  function expressionHasDatabaseMarker(node) {
20957
21084
  let current = node;
20958
21085
  for (; ; ) {
20959
- if (current.type === AST_NODE_TYPES95.ChainExpression) {
21086
+ if (current.type === AST_NODE_TYPES96.ChainExpression) {
20960
21087
  current = current.expression;
20961
21088
  continue;
20962
21089
  }
20963
- if (current.type === AST_NODE_TYPES95.TSAsExpression || current.type === AST_NODE_TYPES95.TSNonNullExpression || current.type === AST_NODE_TYPES95.TSTypeAssertion) {
21090
+ if (current.type === AST_NODE_TYPES96.TSAsExpression || current.type === AST_NODE_TYPES96.TSNonNullExpression || current.type === AST_NODE_TYPES96.TSTypeAssertion) {
20964
21091
  current = current.expression;
20965
21092
  continue;
20966
21093
  }
20967
- if (current.type === AST_NODE_TYPES95.CallExpression) {
20968
- if (current.callee.type !== AST_NODE_TYPES95.MemberExpression) return false;
21094
+ if (current.type === AST_NODE_TYPES96.CallExpression) {
21095
+ if (current.callee.type !== AST_NODE_TYPES96.MemberExpression) return false;
20969
21096
  current = current.callee.object;
20970
21097
  continue;
20971
21098
  }
20972
- if (current.type === AST_NODE_TYPES95.MemberExpression) {
21099
+ if (current.type === AST_NODE_TYPES96.MemberExpression) {
20973
21100
  const name = memberName7(current);
20974
21101
  if (name === "DB" || name !== null && DATABASE_NAMES.test(name))
20975
21102
  return true;
20976
21103
  current = current.object;
20977
21104
  continue;
20978
21105
  }
20979
- return current.type === AST_NODE_TYPES95.Identifier && DATABASE_NAMES.test(current.name);
21106
+ return current.type === AST_NODE_TYPES96.Identifier && DATABASE_NAMES.test(current.name);
20980
21107
  }
20981
21108
  }
20982
21109
  function expressionCallsBuilder(node) {
20983
21110
  let current = node;
20984
21111
  for (; ; ) {
20985
- if (current.type === AST_NODE_TYPES95.ChainExpression) {
21112
+ if (current.type === AST_NODE_TYPES96.ChainExpression) {
20986
21113
  current = current.expression;
20987
21114
  continue;
20988
21115
  }
20989
- if (current.type === AST_NODE_TYPES95.TSAsExpression || current.type === AST_NODE_TYPES95.TSNonNullExpression || current.type === AST_NODE_TYPES95.TSTypeAssertion) {
21116
+ if (current.type === AST_NODE_TYPES96.TSAsExpression || current.type === AST_NODE_TYPES96.TSNonNullExpression || current.type === AST_NODE_TYPES96.TSTypeAssertion) {
20990
21117
  current = current.expression;
20991
21118
  continue;
20992
21119
  }
20993
- if (current.type === AST_NODE_TYPES95.CallExpression) {
20994
- if (current.callee.type !== AST_NODE_TYPES95.MemberExpression) return false;
21120
+ if (current.type === AST_NODE_TYPES96.CallExpression) {
21121
+ if (current.callee.type !== AST_NODE_TYPES96.MemberExpression) return false;
20995
21122
  const name = memberName7(current.callee);
20996
21123
  if (name !== null && BUILDER_METHODS.has(name)) return true;
20997
21124
  current = current.callee.object;
20998
21125
  continue;
20999
21126
  }
21000
- if (current.type !== AST_NODE_TYPES95.MemberExpression) return false;
21127
+ if (current.type !== AST_NODE_TYPES96.MemberExpression) return false;
21001
21128
  current = current.object;
21002
21129
  }
21003
21130
  }
21004
21131
  function owningClass2(node) {
21005
21132
  let current = node.parent;
21006
21133
  while (current != null) {
21007
- if (current.type === AST_NODE_TYPES95.ClassDeclaration || current.type === AST_NODE_TYPES95.ClassExpression)
21134
+ if (current.type === AST_NODE_TYPES96.ClassDeclaration || current.type === AST_NODE_TYPES96.ClassExpression)
21008
21135
  return current;
21009
21136
  current = current.parent;
21010
21137
  }
@@ -21013,25 +21140,25 @@ function owningClass2(node) {
21013
21140
  function injectedMembers(owner) {
21014
21141
  const injected = /* @__PURE__ */ new Set();
21015
21142
  const constructor = owner.body.body.find(
21016
- (member) => member.type === AST_NODE_TYPES95.MethodDefinition && member.kind === "constructor"
21143
+ (member) => member.type === AST_NODE_TYPES96.MethodDefinition && member.kind === "constructor"
21017
21144
  );
21018
21145
  if (constructor === void 0) return injected;
21019
21146
  const parameters = /* @__PURE__ */ new Set();
21020
21147
  for (const parameter of constructor.value.params) {
21021
21148
  for (const name of parameterNames(parameter)) parameters.add(name);
21022
- if (parameter.type !== AST_NODE_TYPES95.TSParameterProperty) continue;
21023
- const value = parameter.parameter.type === AST_NODE_TYPES95.AssignmentPattern ? parameter.parameter.left : parameter.parameter;
21024
- if (value.type === AST_NODE_TYPES95.Identifier) injected.add(value.name);
21149
+ if (parameter.type !== AST_NODE_TYPES96.TSParameterProperty) continue;
21150
+ const value = parameter.parameter.type === AST_NODE_TYPES96.AssignmentPattern ? parameter.parameter.left : parameter.parameter;
21151
+ if (value.type === AST_NODE_TYPES96.Identifier) injected.add(value.name);
21025
21152
  }
21026
21153
  const body2 = constructor.value.body;
21027
21154
  if (body2 === null) return injected;
21028
21155
  function collectInjectedMember(statement) {
21029
- if (statement.type !== AST_NODE_TYPES95.ExpressionStatement || statement.expression.type !== AST_NODE_TYPES95.AssignmentExpression || statement.expression.operator !== "=") return;
21156
+ if (statement.type !== AST_NODE_TYPES96.ExpressionStatement || statement.expression.type !== AST_NODE_TYPES96.AssignmentExpression || statement.expression.operator !== "=") return;
21030
21157
  const { left, right } = statement.expression;
21031
- if (left.type !== AST_NODE_TYPES95.MemberExpression) return;
21158
+ if (left.type !== AST_NODE_TYPES96.MemberExpression) return;
21032
21159
  const target = thisRootMember(left);
21033
21160
  if (target === null) return;
21034
- const source = right.type === AST_NODE_TYPES95.Identifier ? right.name : right.type === AST_NODE_TYPES95.MemberExpression && right.object.type === AST_NODE_TYPES95.Identifier ? right.object.name : null;
21161
+ const source = right.type === AST_NODE_TYPES96.Identifier ? right.name : right.type === AST_NODE_TYPES96.MemberExpression && right.object.type === AST_NODE_TYPES96.Identifier ? right.object.name : null;
21035
21162
  if (source !== null && parameters.has(source)) injected.add(target);
21036
21163
  }
21037
21164
  for (const statement of body2.body) {
@@ -21042,26 +21169,26 @@ function injectedMembers(owner) {
21042
21169
  function thisRootMember(node) {
21043
21170
  let current = node;
21044
21171
  let root = null;
21045
- while (current.type === AST_NODE_TYPES95.MemberExpression) {
21172
+ while (current.type === AST_NODE_TYPES96.MemberExpression) {
21046
21173
  const name = memberName7(current);
21047
21174
  if (name === null) return null;
21048
21175
  root = name;
21049
21176
  current = current.object;
21050
21177
  }
21051
- return current.type === AST_NODE_TYPES95.ThisExpression ? root : null;
21178
+ return current.type === AST_NODE_TYPES96.ThisExpression ? root : null;
21052
21179
  }
21053
21180
  function parameterNames(parameter) {
21054
21181
  let value = parameter;
21055
- if (value.type === AST_NODE_TYPES95.TSParameterProperty) value = value.parameter;
21056
- if (value.type === AST_NODE_TYPES95.AssignmentPattern) value = value.left;
21057
- if (value.type === AST_NODE_TYPES95.Identifier) return /* @__PURE__ */ new Set([value.name]);
21058
- if (value.type !== AST_NODE_TYPES95.ObjectPattern) return /* @__PURE__ */ new Set();
21182
+ if (value.type === AST_NODE_TYPES96.TSParameterProperty) value = value.parameter;
21183
+ if (value.type === AST_NODE_TYPES96.AssignmentPattern) value = value.left;
21184
+ if (value.type === AST_NODE_TYPES96.Identifier) return /* @__PURE__ */ new Set([value.name]);
21185
+ if (value.type !== AST_NODE_TYPES96.ObjectPattern) return /* @__PURE__ */ new Set();
21059
21186
  return new Set(
21060
21187
  value.properties.flatMap((property) => {
21061
- if (property.type === AST_NODE_TYPES95.RestElement)
21062
- return property.argument.type === AST_NODE_TYPES95.Identifier ? [property.argument.name] : [];
21063
- const target = property.value.type === AST_NODE_TYPES95.AssignmentPattern ? property.value.left : property.value;
21064
- return target.type === AST_NODE_TYPES95.Identifier ? [target.name] : [];
21188
+ if (property.type === AST_NODE_TYPES96.RestElement)
21189
+ return property.argument.type === AST_NODE_TYPES96.Identifier ? [property.argument.name] : [];
21190
+ const target = property.value.type === AST_NODE_TYPES96.AssignmentPattern ? property.value.left : property.value;
21191
+ return target.type === AST_NODE_TYPES96.Identifier ? [target.name] : [];
21065
21192
  })
21066
21193
  );
21067
21194
  }
@@ -21085,17 +21212,17 @@ var require_sql_access_class_default = createRule({
21085
21212
  function knownNonDatabase(node, seen = /* @__PURE__ */ new Set()) {
21086
21213
  if (seen.has(node)) return false;
21087
21214
  seen.add(node);
21088
- if (node.type === AST_NODE_TYPES95.Identifier) {
21089
- const binding = ASTUtils47.findVariable(context.sourceCode.getScope(node), node.name);
21215
+ if (node.type === AST_NODE_TYPES96.Identifier) {
21216
+ const binding = ASTUtils48.findVariable(context.sourceCode.getScope(node), node.name);
21090
21217
  if (binding?.defs.length !== 1 || binding.references.some((reference) => reference.isWrite() && reference.init !== true)) return false;
21091
21218
  const definition = binding.defs[0];
21092
21219
  return definition?.type === "Variable" && definition.node.init !== null && knownNonDatabase(definition.node.init, seen);
21093
21220
  }
21094
- return node.type === AST_NODE_TYPES95.NewExpression && node.callee.type === AST_NODE_TYPES95.Identifier && ["Map", "WeakMap", "URLSearchParams"].includes(node.callee.name) && (ASTUtils47.findVariable(context.sourceCode.getScope(node.callee), node.callee.name)?.defs.length ?? 0) === 0;
21221
+ return node.type === AST_NODE_TYPES96.NewExpression && node.callee.type === AST_NODE_TYPES96.Identifier && ["Map", "WeakMap", "URLSearchParams"].includes(node.callee.name) && (ASTUtils48.findVariable(context.sourceCode.getScope(node.callee), node.callee.name)?.defs.length ?? 0) === 0;
21095
21222
  }
21096
21223
  return {
21097
21224
  CallExpression(node) {
21098
- if (node.callee.type !== AST_NODE_TYPES95.MemberExpression)
21225
+ if (node.callee.type !== AST_NODE_TYPES96.MemberExpression)
21099
21226
  return;
21100
21227
  const method = memberName7(node.callee);
21101
21228
  if (knownNonDatabase(node.callee.object)) return;
@@ -21113,7 +21240,7 @@ var require_sql_access_class_default = createRule({
21113
21240
  });
21114
21241
 
21115
21242
  // src/rules/require-static-next-matcher.ts
21116
- import { AST_NODE_TYPES as AST_NODE_TYPES96 } from "@typescript-eslint/utils";
21243
+ import { AST_NODE_TYPES as AST_NODE_TYPES97 } from "@typescript-eslint/utils";
21117
21244
  var REQUIRE_STATIC_NEXT_MATCHER_DOCUMENTATION = {
21118
21245
  summary: "Require Next.js middleware and proxy matcher configuration to contain only build-time literals.",
21119
21246
  rationale: "Next.js must statically analyze matcher values at build time; computed values are ignored.",
@@ -21128,34 +21255,34 @@ var REQUIRE_STATIC_NEXT_MATCHER_DOCUMENTATION = {
21128
21255
  };
21129
21256
  var NEXT_ENTRY_FILE = /(?:^|[/\\])(?:middleware|proxy)\.[cm]?[jt]sx?$/u;
21130
21257
  function unwrapExpression5(node) {
21131
- if (node.type === AST_NODE_TYPES96.TSAsExpression || node.type === AST_NODE_TYPES96.TSSatisfiesExpression || node.type === AST_NODE_TYPES96.TSNonNullExpression || node.type === AST_NODE_TYPES96.TSTypeAssertion) {
21258
+ if (node.type === AST_NODE_TYPES97.TSAsExpression || node.type === AST_NODE_TYPES97.TSSatisfiesExpression || node.type === AST_NODE_TYPES97.TSNonNullExpression || node.type === AST_NODE_TYPES97.TSTypeAssertion) {
21132
21259
  return unwrapExpression5(node.expression);
21133
21260
  }
21134
21261
  return node;
21135
21262
  }
21136
21263
  function isStaticValue(node) {
21137
21264
  const value = unwrapExpression5(node);
21138
- if (value.type === AST_NODE_TYPES96.Literal) {
21265
+ if (value.type === AST_NODE_TYPES97.Literal) {
21139
21266
  return true;
21140
21267
  }
21141
- if (value.type === AST_NODE_TYPES96.TemplateLiteral) {
21268
+ if (value.type === AST_NODE_TYPES97.TemplateLiteral) {
21142
21269
  return value.expressions.length === 0;
21143
21270
  }
21144
- if (value.type === AST_NODE_TYPES96.ArrayExpression) {
21271
+ if (value.type === AST_NODE_TYPES97.ArrayExpression) {
21145
21272
  return value.elements.every(
21146
- (element) => element !== null && element.type !== AST_NODE_TYPES96.SpreadElement && isStaticValue(element)
21273
+ (element) => element !== null && element.type !== AST_NODE_TYPES97.SpreadElement && isStaticValue(element)
21147
21274
  );
21148
21275
  }
21149
- if (value.type === AST_NODE_TYPES96.ObjectExpression) {
21276
+ if (value.type === AST_NODE_TYPES97.ObjectExpression) {
21150
21277
  return value.properties.every(
21151
- (property) => property.type === AST_NODE_TYPES96.Property && property.kind === "init" && !property.computed && property.value.type !== AST_NODE_TYPES96.AssignmentPattern && isStaticValue(property.value)
21278
+ (property) => property.type === AST_NODE_TYPES97.Property && property.kind === "init" && !property.computed && property.value.type !== AST_NODE_TYPES97.AssignmentPattern && isStaticValue(property.value)
21152
21279
  );
21153
21280
  }
21154
21281
  return false;
21155
21282
  }
21156
21283
  function propertyName6(property) {
21157
- if (!property.computed && property.key.type === AST_NODE_TYPES96.Identifier) return property.key.name;
21158
- return property.key.type === AST_NODE_TYPES96.Literal && typeof property.key.value === "string" ? property.key.value : null;
21284
+ if (!property.computed && property.key.type === AST_NODE_TYPES97.Identifier) return property.key.name;
21285
+ return property.key.type === AST_NODE_TYPES97.Literal && typeof property.key.value === "string" ? property.key.value : null;
21159
21286
  }
21160
21287
  var require_static_next_matcher_default = createRule({
21161
21288
  name: "require-static-next-matcher",
@@ -21177,19 +21304,19 @@ var require_static_next_matcher_default = createRule({
21177
21304
  }
21178
21305
  return {
21179
21306
  ExportNamedDeclaration(node) {
21180
- if (node.declaration?.type !== AST_NODE_TYPES96.VariableDeclaration) {
21307
+ if (node.declaration?.type !== AST_NODE_TYPES97.VariableDeclaration) {
21181
21308
  return;
21182
21309
  }
21183
21310
  for (const declaration of node.declaration.declarations) {
21184
- if (declaration.id.type !== AST_NODE_TYPES96.Identifier || declaration.id.name !== "config" || declaration.init === null) {
21311
+ if (declaration.id.type !== AST_NODE_TYPES97.Identifier || declaration.id.name !== "config" || declaration.init === null) {
21185
21312
  continue;
21186
21313
  }
21187
21314
  const config = unwrapExpression5(declaration.init);
21188
- if (config.type !== AST_NODE_TYPES96.ObjectExpression) {
21315
+ if (config.type !== AST_NODE_TYPES97.ObjectExpression) {
21189
21316
  continue;
21190
21317
  }
21191
21318
  for (const property of config.properties) {
21192
- if (property.type !== AST_NODE_TYPES96.Property || propertyName6(property) !== "matcher" || property.value.type === AST_NODE_TYPES96.AssignmentPattern) {
21319
+ if (property.type !== AST_NODE_TYPES97.Property || propertyName6(property) !== "matcher" || property.value.type === AST_NODE_TYPES97.AssignmentPattern) {
21193
21320
  continue;
21194
21321
  }
21195
21322
  if (!isStaticValue(property.value)) {
@@ -21203,7 +21330,7 @@ var require_static_next_matcher_default = createRule({
21203
21330
  });
21204
21331
 
21205
21332
  // src/rules/require-use-form-default-values.ts
21206
- import { AST_NODE_TYPES as AST_NODE_TYPES97, ASTUtils as ASTUtils48 } from "@typescript-eslint/utils";
21333
+ import { AST_NODE_TYPES as AST_NODE_TYPES98, ASTUtils as ASTUtils49 } from "@typescript-eslint/utils";
21207
21334
  var REQUIRE_USE_FORM_DEFAULT_VALUES_DOCUMENTATION = {
21208
21335
  summary: "Require explicit form-level initialization or a field default for directly bound Controller fields.",
21209
21336
  rationale: "React Hook Form exposes form-level defaultValues/values and field-level defaultValue as its explicit initialization mechanisms. A directly bound controlled field should not omit both mechanisms.",
@@ -21236,12 +21363,12 @@ var REQUIRE_USE_FORM_DEFAULT_VALUES_DOCUMENTATION = {
21236
21363
  };
21237
21364
  function staticPropertyName(property) {
21238
21365
  if (property.computed) return null;
21239
- if (property.key.type === AST_NODE_TYPES97.Identifier) return property.key.name;
21240
- if (property.key.type === AST_NODE_TYPES97.Literal && typeof property.key.value === "string") return property.key.value;
21366
+ if (property.key.type === AST_NODE_TYPES98.Identifier) return property.key.name;
21367
+ if (property.key.type === AST_NODE_TYPES98.Literal && typeof property.key.value === "string") return property.key.value;
21241
21368
  return null;
21242
21369
  }
21243
21370
  function unwrapExpression6(node) {
21244
- if (node.type === AST_NODE_TYPES97.TSAsExpression || node.type === AST_NODE_TYPES97.TSSatisfiesExpression || node.type === AST_NODE_TYPES97.TSNonNullExpression || node.type === AST_NODE_TYPES97.TSTypeAssertion) return unwrapExpression6(node.expression);
21371
+ if (node.type === AST_NODE_TYPES98.TSAsExpression || node.type === AST_NODE_TYPES98.TSSatisfiesExpression || node.type === AST_NODE_TYPES98.TSNonNullExpression || node.type === AST_NODE_TYPES98.TSTypeAssertion) return unwrapExpression6(node.expression);
21245
21372
  return node;
21246
21373
  }
21247
21374
  var require_use_form_default_values_default = createRule({
@@ -21258,7 +21385,7 @@ var require_use_form_default_values_default = createRule({
21258
21385
  const imported = /* @__PURE__ */ new Map();
21259
21386
  const uninitializedForms = /* @__PURE__ */ new Set();
21260
21387
  const uninitializedControls = /* @__PURE__ */ new Set();
21261
- const bindingNamed = (node, name) => ASTUtils48.findVariable(context.sourceCode.getScope(node), name);
21388
+ const bindingNamed = (node, name) => ASTUtils49.findVariable(context.sourceCode.getScope(node), name);
21262
21389
  const bindingOf = (node) => bindingNamed(node, node.name);
21263
21390
  const stable = (variable) => !variable.references.some((reference) => reference.isWrite() && reference.init !== true);
21264
21391
  const importedKind = (node) => {
@@ -21271,44 +21398,44 @@ var require_use_form_default_values_default = createRule({
21271
21398
  };
21272
21399
  const isDefinitelyUndefined = (node) => {
21273
21400
  const value = unwrapExpression6(node);
21274
- return value.type === AST_NODE_TYPES97.UnaryExpression && value.operator === "void" || value.type === AST_NODE_TYPES97.Identifier && value.name === "undefined" && (bindingOf(value)?.defs.length ?? 0) === 0;
21401
+ return value.type === AST_NODE_TYPES98.UnaryExpression && value.operator === "void" || value.type === AST_NODE_TYPES98.Identifier && value.name === "undefined" && (bindingOf(value)?.defs.length ?? 0) === 0;
21275
21402
  };
21276
21403
  const initializationState = (node) => {
21277
21404
  if (node === void 0) return "uninitialized";
21278
- if (node.type !== AST_NODE_TYPES97.ObjectExpression) return "unknown";
21405
+ if (node.type !== AST_NODE_TYPES98.ObjectExpression) return "unknown";
21279
21406
  const initialization = /* @__PURE__ */ new Map();
21280
21407
  for (const property of node.properties) {
21281
- if (property.type === AST_NODE_TYPES97.SpreadElement || property.computed) return "unknown";
21282
- if (property.type !== AST_NODE_TYPES97.Property) continue;
21408
+ if (property.type === AST_NODE_TYPES98.SpreadElement || property.computed) return "unknown";
21409
+ if (property.type !== AST_NODE_TYPES98.Property) continue;
21283
21410
  const name = staticPropertyName(property);
21284
21411
  if (name === "defaultValues" || name === "values") initialization.set(name, !isDefinitelyUndefined(property.value));
21285
21412
  }
21286
21413
  return [...initialization.values()].some(Boolean) ? "initialized" : "uninitialized";
21287
21414
  };
21288
21415
  const uninitializedUseFormCall = (node) => {
21289
- if (node.type !== AST_NODE_TYPES97.CallExpression || node.callee.type !== AST_NODE_TYPES97.Identifier || importedKind(node.callee) !== "useForm") return false;
21416
+ if (node.type !== AST_NODE_TYPES98.CallExpression || node.callee.type !== AST_NODE_TYPES98.Identifier || importedKind(node.callee) !== "useForm") return false;
21290
21417
  const options = node.arguments[0];
21291
- return options?.type !== AST_NODE_TYPES97.SpreadElement && initializationState(options) === "uninitialized";
21418
+ return options?.type !== AST_NODE_TYPES98.SpreadElement && initializationState(options) === "uninitialized";
21292
21419
  };
21293
21420
  const isUninitializedForm = (node) => {
21294
- if (node.type !== AST_NODE_TYPES97.Identifier) return false;
21421
+ if (node.type !== AST_NODE_TYPES98.Identifier) return false;
21295
21422
  const variable = bindingOf(node);
21296
21423
  return variable !== null && stable(variable) && uninitializedForms.has(variable);
21297
21424
  };
21298
21425
  const isUninitializedControl = (node) => {
21299
- if (node.type === AST_NODE_TYPES97.Identifier) {
21426
+ if (node.type === AST_NODE_TYPES98.Identifier) {
21300
21427
  const variable = bindingOf(node);
21301
21428
  return variable !== null && stable(variable) && uninitializedControls.has(variable);
21302
21429
  }
21303
- return node.type === AST_NODE_TYPES97.MemberExpression && !node.computed && node.property.type === AST_NODE_TYPES97.Identifier && node.property.name === "control" && isUninitializedForm(node.object);
21430
+ return node.type === AST_NODE_TYPES98.MemberExpression && !node.computed && node.property.type === AST_NODE_TYPES98.Identifier && node.property.name === "control" && isUninitializedForm(node.object);
21304
21431
  };
21305
21432
  const fieldOptionsNeedDefault = (node) => {
21306
- if (node?.type !== AST_NODE_TYPES97.ObjectExpression) return false;
21433
+ if (node?.type !== AST_NODE_TYPES98.ObjectExpression) return false;
21307
21434
  let control = null;
21308
21435
  let hasDefault = false;
21309
21436
  for (const property of node.properties) {
21310
- if (property.type === AST_NODE_TYPES97.SpreadElement || property.computed) return false;
21311
- if (property.type !== AST_NODE_TYPES97.Property) continue;
21437
+ if (property.type === AST_NODE_TYPES98.SpreadElement || property.computed) return false;
21438
+ if (property.type !== AST_NODE_TYPES98.Property) continue;
21312
21439
  const name = staticPropertyName(property);
21313
21440
  if (name === "control") control = property.value;
21314
21441
  if (name === "defaultValue") hasDefault = !isDefinitelyUndefined(property.value);
@@ -21318,14 +21445,14 @@ var require_use_form_default_values_default = createRule({
21318
21445
  const jsxAttribute = (node, name) => {
21319
21446
  let result = null;
21320
21447
  for (const attribute of node.attributes) {
21321
- if (attribute.type === AST_NODE_TYPES97.JSXSpreadAttribute) return null;
21322
- if (attribute.name.type === AST_NODE_TYPES97.JSXIdentifier && attribute.name.name === name) result = attribute;
21448
+ if (attribute.type === AST_NODE_TYPES98.JSXSpreadAttribute) return null;
21449
+ if (attribute.name.type === AST_NODE_TYPES98.JSXIdentifier && attribute.name.name === name) result = attribute;
21323
21450
  }
21324
21451
  return result;
21325
21452
  };
21326
21453
  const trackDestructuredControl = (pattern) => {
21327
21454
  for (const property of pattern.properties) {
21328
- if (property.type !== AST_NODE_TYPES97.Property || staticPropertyName(property) !== "control" || property.value.type !== AST_NODE_TYPES97.Identifier) continue;
21455
+ if (property.type !== AST_NODE_TYPES98.Property || staticPropertyName(property) !== "control" || property.value.type !== AST_NODE_TYPES98.Identifier) continue;
21329
21456
  const variable = bindingOf(property.value);
21330
21457
  if (variable !== null) uninitializedControls.add(variable);
21331
21458
  }
@@ -21334,8 +21461,8 @@ var require_use_form_default_values_default = createRule({
21334
21461
  ImportDeclaration(node) {
21335
21462
  if (node.source.value !== "react-hook-form") return;
21336
21463
  for (const specifier of node.specifiers) {
21337
- if (specifier.type !== AST_NODE_TYPES97.ImportSpecifier) continue;
21338
- const name = specifier.imported.type === AST_NODE_TYPES97.Identifier ? specifier.imported.name : String(specifier.imported.value);
21464
+ if (specifier.type !== AST_NODE_TYPES98.ImportSpecifier) continue;
21465
+ const name = specifier.imported.type === AST_NODE_TYPES98.Identifier ? specifier.imported.name : String(specifier.imported.value);
21339
21466
  if (name !== "Controller" && name !== "useController" && name !== "useForm") continue;
21340
21467
  const variable = bindingOf(specifier.local);
21341
21468
  if (variable !== null) imported.set(variable, name);
@@ -21344,34 +21471,34 @@ var require_use_form_default_values_default = createRule({
21344
21471
  VariableDeclarator(node) {
21345
21472
  if (node.init === null) return;
21346
21473
  if (uninitializedUseFormCall(node.init)) {
21347
- if (node.id.type === AST_NODE_TYPES97.Identifier) {
21474
+ if (node.id.type === AST_NODE_TYPES98.Identifier) {
21348
21475
  const variable = bindingOf(node.id);
21349
21476
  if (variable !== null) uninitializedForms.add(variable);
21350
- } else if (node.id.type === AST_NODE_TYPES97.ObjectPattern) {
21477
+ } else if (node.id.type === AST_NODE_TYPES98.ObjectPattern) {
21351
21478
  trackDestructuredControl(node.id);
21352
21479
  }
21353
21480
  return;
21354
21481
  }
21355
- if (node.id.type === AST_NODE_TYPES97.ObjectPattern && isUninitializedForm(node.init)) {
21482
+ if (node.id.type === AST_NODE_TYPES98.ObjectPattern && isUninitializedForm(node.init)) {
21356
21483
  trackDestructuredControl(node.id);
21357
21484
  return;
21358
21485
  }
21359
- if (node.id.type === AST_NODE_TYPES97.Identifier && node.init.type === AST_NODE_TYPES97.MemberExpression && !node.init.computed && node.init.property.type === AST_NODE_TYPES97.Identifier && node.init.property.name === "control" && isUninitializedForm(node.init.object)) {
21486
+ if (node.id.type === AST_NODE_TYPES98.Identifier && node.init.type === AST_NODE_TYPES98.MemberExpression && !node.init.computed && node.init.property.type === AST_NODE_TYPES98.Identifier && node.init.property.name === "control" && isUninitializedForm(node.init.object)) {
21360
21487
  const variable = bindingOf(node.id);
21361
21488
  if (variable !== null) uninitializedControls.add(variable);
21362
21489
  }
21363
21490
  },
21364
21491
  CallExpression(node) {
21365
- if (node.callee.type !== AST_NODE_TYPES97.Identifier || importedKind(node.callee) !== "useController" || !fieldOptionsNeedDefault(node.arguments[0]?.type === AST_NODE_TYPES97.SpreadElement ? void 0 : node.arguments[0])) return;
21492
+ if (node.callee.type !== AST_NODE_TYPES98.Identifier || importedKind(node.callee) !== "useController" || !fieldOptionsNeedDefault(node.arguments[0]?.type === AST_NODE_TYPES98.SpreadElement ? void 0 : node.arguments[0])) return;
21366
21493
  context.report({ node, messageId: "requireUseFormDefaultValues" });
21367
21494
  },
21368
21495
  JSXOpeningElement(node) {
21369
- if (node.name.type !== AST_NODE_TYPES97.JSXIdentifier || importedJsxKind(node.name) !== "Controller") return;
21370
- if (node.attributes.some((attribute) => attribute.type === AST_NODE_TYPES97.JSXSpreadAttribute)) return;
21496
+ if (node.name.type !== AST_NODE_TYPES98.JSXIdentifier || importedJsxKind(node.name) !== "Controller") return;
21497
+ if (node.attributes.some((attribute) => attribute.type === AST_NODE_TYPES98.JSXSpreadAttribute)) return;
21371
21498
  const control = jsxAttribute(node, "control");
21372
- if (control?.value?.type !== AST_NODE_TYPES97.JSXExpressionContainer || control.value.expression.type === AST_NODE_TYPES97.JSXEmptyExpression || !isUninitializedControl(control.value.expression)) return;
21499
+ if (control?.value?.type !== AST_NODE_TYPES98.JSXExpressionContainer || control.value.expression.type === AST_NODE_TYPES98.JSXEmptyExpression || !isUninitializedControl(control.value.expression)) return;
21373
21500
  const defaultValue = jsxAttribute(node, "defaultValue");
21374
- if (defaultValue !== null && (defaultValue.value === null || defaultValue.value.type !== AST_NODE_TYPES97.JSXExpressionContainer || defaultValue.value.expression.type !== AST_NODE_TYPES97.JSXEmptyExpression && !isDefinitelyUndefined(defaultValue.value.expression))) return;
21501
+ if (defaultValue !== null && (defaultValue.value === null || defaultValue.value.type !== AST_NODE_TYPES98.JSXExpressionContainer || defaultValue.value.expression.type !== AST_NODE_TYPES98.JSXEmptyExpression && !isDefinitelyUndefined(defaultValue.value.expression))) return;
21375
21502
  context.report({ node, messageId: "requireUseFormDefaultValues" });
21376
21503
  }
21377
21504
  };
@@ -21447,8 +21574,8 @@ var require_use_server_in_actions_file_default = createRule({
21447
21574
 
21448
21575
  // src/rules/require-zod-form-validation.ts
21449
21576
  import {
21450
- AST_NODE_TYPES as AST_NODE_TYPES98,
21451
- ASTUtils as ASTUtils49
21577
+ AST_NODE_TYPES as AST_NODE_TYPES99,
21578
+ ASTUtils as ASTUtils50
21452
21579
  } from "@typescript-eslint/utils";
21453
21580
  var REQUIRE_ZOD_FORM_VALIDATION_DOCUMENTATION = {
21454
21581
  summary: "Require Zod validation (`Schema.parse(...)` / `Schema.safeParse(...)`) when reading values out of a `FormData` object.",
@@ -21475,14 +21602,14 @@ var FORM_VALUE_METHODS = /* @__PURE__ */ new Set(["get", "getAll"]);
21475
21602
  var zodReceiverRoot = (node) => {
21476
21603
  let current = node;
21477
21604
  while (true) {
21478
- if (current.type === AST_NODE_TYPES98.Identifier) {
21605
+ if (current.type === AST_NODE_TYPES99.Identifier) {
21479
21606
  return current;
21480
21607
  }
21481
- if (current.type === AST_NODE_TYPES98.CallExpression) {
21608
+ if (current.type === AST_NODE_TYPES99.CallExpression) {
21482
21609
  current = current.callee;
21483
21610
  continue;
21484
21611
  }
21485
- if (current.type === AST_NODE_TYPES98.MemberExpression) {
21612
+ if (current.type === AST_NODE_TYPES99.MemberExpression) {
21486
21613
  current = current.object;
21487
21614
  continue;
21488
21615
  }
@@ -21491,12 +21618,12 @@ var zodReceiverRoot = (node) => {
21491
21618
  };
21492
21619
  var isFormDataMethodCall = (node) => {
21493
21620
  let current = node;
21494
- if (current.type === AST_NODE_TYPES98.AwaitExpression) {
21621
+ if (current.type === AST_NODE_TYPES99.AwaitExpression) {
21495
21622
  current = current.argument;
21496
21623
  }
21497
- if (current.type !== AST_NODE_TYPES98.CallExpression) return false;
21624
+ if (current.type !== AST_NODE_TYPES99.CallExpression) return false;
21498
21625
  const callee = current.callee;
21499
- return callee.type === AST_NODE_TYPES98.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES98.Identifier && callee.property.name === "formData";
21626
+ return callee.type === AST_NODE_TYPES99.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES99.Identifier && callee.property.name === "formData";
21500
21627
  };
21501
21628
  var require_zod_form_validation_default = createRule({
21502
21629
  name: "require-zod-form-validation",
@@ -21517,7 +21644,7 @@ var require_zod_form_validation_default = createRule({
21517
21644
  return {};
21518
21645
  }
21519
21646
  const zodBindings = /* @__PURE__ */ new Set();
21520
- const resolvedBinding = (identifier) => ASTUtils49.findVariable(
21647
+ const resolvedBinding = (identifier) => ASTUtils50.findVariable(
21521
21648
  context.sourceCode.getScope(identifier),
21522
21649
  identifier.name
21523
21650
  );
@@ -21527,16 +21654,16 @@ var require_zod_form_validation_default = createRule({
21527
21654
  return false;
21528
21655
  }
21529
21656
  const definition = binding.defs[0];
21530
- if (definition?.type !== "Variable" || definition.node.type !== AST_NODE_TYPES98.VariableDeclarator) {
21657
+ if (definition?.type !== "Variable" || definition.node.type !== AST_NODE_TYPES99.VariableDeclarator) {
21531
21658
  return false;
21532
21659
  }
21533
21660
  const init = definition.node.init;
21534
- return init?.type === AST_NODE_TYPES98.ObjectExpression || init?.type === AST_NODE_TYPES98.ArrayExpression || init?.type === AST_NODE_TYPES98.Literal || init?.type === AST_NODE_TYPES98.ArrowFunctionExpression || init?.type === AST_NODE_TYPES98.FunctionExpression;
21661
+ return init?.type === AST_NODE_TYPES99.ObjectExpression || init?.type === AST_NODE_TYPES99.ArrayExpression || init?.type === AST_NODE_TYPES99.Literal || init?.type === AST_NODE_TYPES99.ArrowFunctionExpression || init?.type === AST_NODE_TYPES99.FunctionExpression;
21535
21662
  };
21536
21663
  const isZodParseCall = (node) => {
21537
- if (node.type !== AST_NODE_TYPES98.CallExpression) return false;
21664
+ if (node.type !== AST_NODE_TYPES99.CallExpression) return false;
21538
21665
  const callee = node.callee;
21539
- if (callee.type !== AST_NODE_TYPES98.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES98.Identifier || !ZOD_PARSE_METHODS.has(callee.property.name)) {
21666
+ if (callee.type !== AST_NODE_TYPES99.MemberExpression || callee.computed || callee.property.type !== AST_NODE_TYPES99.Identifier || !ZOD_PARSE_METHODS.has(callee.property.name)) {
21540
21667
  return false;
21541
21668
  }
21542
21669
  const root = zodReceiverRoot(callee.object);
@@ -21545,14 +21672,14 @@ var require_zod_form_validation_default = createRule({
21545
21672
  return binding !== null && zodBindings.has(binding) || (root.name === "z" || ZOD_SCHEMA_NAME_RE.test(root.name)) && !isProvablyNonZodLocal(root);
21546
21673
  };
21547
21674
  const isFormSourceIdentifier = (node) => {
21548
- if (node.type !== AST_NODE_TYPES98.Identifier) return false;
21675
+ if (node.type !== AST_NODE_TYPES99.Identifier) return false;
21549
21676
  const conventionalName = /formdata/i.test(node.name);
21550
21677
  let scope = context.sourceCode.getScope(node);
21551
21678
  while (scope !== null) {
21552
21679
  const variable = scope.set.get(node.name);
21553
21680
  if (variable !== void 0 && variable.defs.length === 1) {
21554
21681
  const def = variable.defs[0];
21555
- if (def !== void 0 && def.type === "Variable" && def.node.type === AST_NODE_TYPES98.VariableDeclarator && def.node.init !== null) {
21682
+ if (def !== void 0 && def.type === "Variable" && def.node.type === AST_NODE_TYPES99.VariableDeclarator && def.node.init !== null) {
21556
21683
  return isFormDataMethodCall(def.node.init);
21557
21684
  }
21558
21685
  return def?.type === "Parameter" && conventionalName;
@@ -21563,8 +21690,8 @@ var require_zod_form_validation_default = createRule({
21563
21690
  };
21564
21691
  const isFormDataGetCall = (node) => {
21565
21692
  const callee = node.callee;
21566
- if (callee.type !== AST_NODE_TYPES98.MemberExpression) return false;
21567
- if (callee.property.type !== AST_NODE_TYPES98.Identifier || !FORM_VALUE_METHODS.has(callee.property.name)) {
21693
+ if (callee.type !== AST_NODE_TYPES99.MemberExpression) return false;
21694
+ if (callee.property.type !== AST_NODE_TYPES99.Identifier || !FORM_VALUE_METHODS.has(callee.property.name)) {
21568
21695
  return false;
21569
21696
  }
21570
21697
  return isFormSourceIdentifier(callee.object);
@@ -21573,15 +21700,15 @@ var require_zod_form_validation_default = createRule({
21573
21700
  let parent = node.parent;
21574
21701
  while (parent !== null && parent !== void 0) {
21575
21702
  if (isZodParseCall(parent)) return parent;
21576
- if (parent.type === AST_NODE_TYPES98.CallExpression && parent.callee.type === AST_NODE_TYPES98.Identifier && ["Number", "String", "Boolean"].includes(parent.callee.name) && parent.arguments.length === 1 && (resolvedBinding(parent.callee)?.defs.length ?? 0) === 0) {
21703
+ if (parent.type === AST_NODE_TYPES99.CallExpression && parent.callee.type === AST_NODE_TYPES99.Identifier && ["Number", "String", "Boolean"].includes(parent.callee.name) && parent.arguments.length === 1 && (resolvedBinding(parent.callee)?.defs.length ?? 0) === 0) {
21577
21704
  parent = parent.parent;
21578
21705
  continue;
21579
21706
  }
21580
- if (parent.type === AST_NODE_TYPES98.CallExpression && parent.callee.type === AST_NODE_TYPES98.MemberExpression && !parent.callee.computed && parent.callee.object.type === AST_NODE_TYPES98.Identifier && parent.callee.object.name === "Object" && parent.callee.property.type === AST_NODE_TYPES98.Identifier && parent.callee.property.name === "fromEntries" && (resolvedBinding(parent.callee.object)?.defs.length ?? 0) === 0) {
21707
+ if (parent.type === AST_NODE_TYPES99.CallExpression && parent.callee.type === AST_NODE_TYPES99.MemberExpression && !parent.callee.computed && parent.callee.object.type === AST_NODE_TYPES99.Identifier && parent.callee.object.name === "Object" && parent.callee.property.type === AST_NODE_TYPES99.Identifier && parent.callee.property.name === "fromEntries" && (resolvedBinding(parent.callee.object)?.defs.length ?? 0) === 0) {
21581
21708
  parent = parent.parent;
21582
21709
  continue;
21583
21710
  }
21584
- if (parent.type === AST_NODE_TYPES98.CallExpression || parent.type === AST_NODE_TYPES98.NewExpression || parent.type === AST_NODE_TYPES98.TaggedTemplateExpression || parent.type === AST_NODE_TYPES98.ArrowFunctionExpression || parent.type === AST_NODE_TYPES98.FunctionExpression || parent.type === AST_NODE_TYPES98.FunctionDeclaration) return null;
21711
+ if (parent.type === AST_NODE_TYPES99.CallExpression || parent.type === AST_NODE_TYPES99.NewExpression || parent.type === AST_NODE_TYPES99.TaggedTemplateExpression || parent.type === AST_NODE_TYPES99.ArrowFunctionExpression || parent.type === AST_NODE_TYPES99.FunctionExpression || parent.type === AST_NODE_TYPES99.FunctionDeclaration) return null;
21585
21712
  parent = parent.parent;
21586
21713
  }
21587
21714
  return null;
@@ -21589,16 +21716,16 @@ var require_zod_form_validation_default = createRule({
21589
21716
  const hasZodParseAncestor = (node) => zodParseAncestor(node) !== null;
21590
21717
  const isInstanceofNarrowing = (node) => {
21591
21718
  const parent = node.parent;
21592
- return parent !== null && parent !== void 0 && parent.type === AST_NODE_TYPES98.BinaryExpression && parent.operator === "instanceof" && parent.left === node && parent.right.type === AST_NODE_TYPES98.Identifier && (parent.right.name === "File" || parent.right.name === "Blob");
21719
+ return parent !== null && parent !== void 0 && parent.type === AST_NODE_TYPES99.BinaryExpression && parent.operator === "instanceof" && parent.left === node && parent.right.type === AST_NODE_TYPES99.Identifier && (parent.right.name === "File" || parent.right.name === "Blob");
21593
21720
  };
21594
21721
  const boundDeclarator = (node) => {
21595
21722
  let current = node;
21596
21723
  let parent = current.parent;
21597
- while ((parent.type === AST_NODE_TYPES98.TSAsExpression || parent.type === AST_NODE_TYPES98.TSSatisfiesExpression || parent.type === AST_NODE_TYPES98.TSNonNullExpression || parent.type === AST_NODE_TYPES98.ChainExpression) && parent.expression === current) {
21724
+ while ((parent.type === AST_NODE_TYPES99.TSAsExpression || parent.type === AST_NODE_TYPES99.TSSatisfiesExpression || parent.type === AST_NODE_TYPES99.TSNonNullExpression || parent.type === AST_NODE_TYPES99.ChainExpression) && parent.expression === current) {
21598
21725
  current = parent;
21599
21726
  parent = current.parent;
21600
21727
  }
21601
- if (parent.type === AST_NODE_TYPES98.VariableDeclarator && parent.init === current && parent.id.type === AST_NODE_TYPES98.Identifier) {
21728
+ if (parent.type === AST_NODE_TYPES99.VariableDeclarator && parent.init === current && parent.id.type === AST_NODE_TYPES99.Identifier) {
21602
21729
  return parent;
21603
21730
  }
21604
21731
  return null;
@@ -21607,7 +21734,7 @@ var require_zod_form_validation_default = createRule({
21607
21734
  let current = node;
21608
21735
  while (current.parent !== void 0) {
21609
21736
  const parent = current.parent;
21610
- if (parent.type === AST_NODE_TYPES98.BlockStatement || parent.type === AST_NODE_TYPES98.Program) {
21737
+ if (parent.type === AST_NODE_TYPES99.BlockStatement || parent.type === AST_NODE_TYPES99.Program) {
21611
21738
  return current;
21612
21739
  }
21613
21740
  current = parent;
@@ -21616,12 +21743,12 @@ var require_zod_form_validation_default = createRule({
21616
21743
  };
21617
21744
  const zodParseMethod = (call) => {
21618
21745
  const callee = call.callee;
21619
- return callee.type === AST_NODE_TYPES98.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES98.Identifier ? callee.property.name : null;
21746
+ return callee.type === AST_NODE_TYPES99.MemberExpression && !callee.computed && callee.property.type === AST_NODE_TYPES99.Identifier ? callee.property.name : null;
21620
21747
  };
21621
21748
  const hasConditionalAncestorBeforeStatement = (node, statement) => {
21622
21749
  let current = node.parent;
21623
21750
  while (current !== void 0 && current !== statement) {
21624
- if (current.type === AST_NODE_TYPES98.LogicalExpression || current.type === AST_NODE_TYPES98.ConditionalExpression) {
21751
+ if (current.type === AST_NODE_TYPES99.LogicalExpression || current.type === AST_NODE_TYPES99.ConditionalExpression) {
21625
21752
  return true;
21626
21753
  }
21627
21754
  current = current.parent;
@@ -21631,7 +21758,7 @@ var require_zod_form_validation_default = createRule({
21631
21758
  const isAwaitedBeforeStatement = (node, statement) => {
21632
21759
  let current = node.parent;
21633
21760
  while (current !== void 0 && current !== statement) {
21634
- if (current.type === AST_NODE_TYPES98.AwaitExpression) return true;
21761
+ if (current.type === AST_NODE_TYPES99.AwaitExpression) return true;
21635
21762
  current = current.parent;
21636
21763
  }
21637
21764
  return false;
@@ -21644,7 +21771,7 @@ var require_zod_form_validation_default = createRule({
21644
21771
  if (declarationStatement === null || validationStatement === null || declarationStatement.parent !== validationStatement.parent || validationStatement.range[0] <= declarationStatement.range[1] || hasConditionalAncestorBeforeStatement(parse2, validationStatement)) {
21645
21772
  return null;
21646
21773
  }
21647
- if (validationStatement.type !== AST_NODE_TYPES98.VariableDeclaration && validationStatement.type !== AST_NODE_TYPES98.ExpressionStatement) {
21774
+ if (validationStatement.type !== AST_NODE_TYPES99.VariableDeclaration && validationStatement.type !== AST_NODE_TYPES99.ExpressionStatement) {
21648
21775
  return null;
21649
21776
  }
21650
21777
  const method = zodParseMethod(parse2);
@@ -21656,16 +21783,16 @@ var require_zod_form_validation_default = createRule({
21656
21783
  };
21657
21784
  const isSafePrevalidationInspection = (identifier) => {
21658
21785
  const parent = identifier.parent;
21659
- if (parent.type === AST_NODE_TYPES98.UnaryExpression && parent.operator === "typeof") {
21786
+ if (parent.type === AST_NODE_TYPES99.UnaryExpression && parent.operator === "typeof") {
21660
21787
  return true;
21661
21788
  }
21662
- if (parent.type !== AST_NODE_TYPES98.BinaryExpression || parent.left !== identifier) {
21789
+ if (parent.type !== AST_NODE_TYPES99.BinaryExpression || parent.left !== identifier) {
21663
21790
  return false;
21664
21791
  }
21665
21792
  if (parent.operator === "instanceof") {
21666
- return parent.right.type === AST_NODE_TYPES98.Identifier && (parent.right.name === "File" || parent.right.name === "Blob");
21793
+ return parent.right.type === AST_NODE_TYPES99.Identifier && (parent.right.name === "File" || parent.right.name === "Blob");
21667
21794
  }
21668
- return ["===", "!==", "==", "!="].includes(parent.operator) && (parent.right.type === AST_NODE_TYPES98.Literal && parent.right.value === null || parent.right.type === AST_NODE_TYPES98.Identifier && parent.right.name === "undefined");
21795
+ return ["===", "!==", "==", "!="].includes(parent.operator) && (parent.right.type === AST_NODE_TYPES99.Literal && parent.right.value === null || parent.right.type === AST_NODE_TYPES99.Identifier && parent.right.name === "undefined");
21669
21796
  };
21670
21797
  const isDescendantOf = (node, ancestor) => {
21671
21798
  let current = node;
@@ -21676,23 +21803,23 @@ var require_zod_form_validation_default = createRule({
21676
21803
  return false;
21677
21804
  };
21678
21805
  const blockTerminates = (node) => {
21679
- if (node.type === AST_NODE_TYPES98.ReturnStatement || node.type === AST_NODE_TYPES98.ThrowStatement) {
21806
+ if (node.type === AST_NODE_TYPES99.ReturnStatement || node.type === AST_NODE_TYPES99.ThrowStatement) {
21680
21807
  return true;
21681
21808
  }
21682
- if (node.type !== AST_NODE_TYPES98.BlockStatement || node.body.length === 0) return false;
21809
+ if (node.type !== AST_NODE_TYPES99.BlockStatement || node.body.length === 0) return false;
21683
21810
  const last = node.body.at(-1);
21684
21811
  return last !== void 0 && blockTerminates(last);
21685
21812
  };
21686
21813
  const narrowingIf = (identifier) => {
21687
21814
  const comparison = identifier.parent;
21688
- if (comparison?.type !== AST_NODE_TYPES98.BinaryExpression || comparison.operator !== "instanceof" || comparison.left !== identifier || comparison.right.type !== AST_NODE_TYPES98.Identifier || comparison.right.name !== "File" && comparison.right.name !== "Blob") {
21815
+ if (comparison?.type !== AST_NODE_TYPES99.BinaryExpression || comparison.operator !== "instanceof" || comparison.left !== identifier || comparison.right.type !== AST_NODE_TYPES99.Identifier || comparison.right.name !== "File" && comparison.right.name !== "Blob") {
21689
21816
  return null;
21690
21817
  }
21691
21818
  const maybeNegation = comparison.parent;
21692
- const negated = maybeNegation?.type === AST_NODE_TYPES98.UnaryExpression && maybeNegation.operator === "!";
21819
+ const negated = maybeNegation?.type === AST_NODE_TYPES99.UnaryExpression && maybeNegation.operator === "!";
21693
21820
  const test = negated ? maybeNegation : comparison;
21694
21821
  const branch = test.parent;
21695
- return branch?.type === AST_NODE_TYPES98.IfStatement && branch.test === test ? { branch, positive: !negated } : null;
21822
+ return branch?.type === AST_NODE_TYPES99.IfStatement && branch.test === test ? { branch, positive: !negated } : null;
21696
21823
  };
21697
21824
  const useDominatedByNarrowing = (use, narrowings) => narrowings.some(({ branch, positive }) => {
21698
21825
  if (positive) return isDescendantOf(use, branch.consequent);
@@ -21712,7 +21839,7 @@ var require_zod_form_validation_default = createRule({
21712
21839
  const variable = context.sourceCode.getDeclaredVariables(declarator)[0];
21713
21840
  if (variable === void 0) return false;
21714
21841
  const references = variable.references.filter((reference) => !reference.isWriteOnly()).map((reference) => reference.identifier).filter(
21715
- (identifier) => identifier.type === AST_NODE_TYPES98.Identifier
21842
+ (identifier) => identifier.type === AST_NODE_TYPES99.Identifier
21716
21843
  );
21717
21844
  if (references.length === 0) return false;
21718
21845
  const narrowings = references.map(narrowingIf).filter(
@@ -21738,7 +21865,7 @@ var require_zod_form_validation_default = createRule({
21738
21865
  ImportDeclaration(node) {
21739
21866
  if (!isZodModule(node.source.value)) return;
21740
21867
  for (const specifier of node.specifiers) {
21741
- if (specifier.type === AST_NODE_TYPES98.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES98.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES98.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES98.Identifier ? specifier.imported.name === "z" : specifier.imported.value === "z")) {
21868
+ if (specifier.type === AST_NODE_TYPES99.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES99.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES99.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES99.Identifier ? specifier.imported.name === "z" : specifier.imported.value === "z")) {
21742
21869
  const binding = resolvedBinding(specifier.local);
21743
21870
  if (binding !== null) zodBindings.add(binding);
21744
21871
  }
@@ -21827,7 +21954,7 @@ function expressionCallableName(current) {
21827
21954
  }
21828
21955
 
21829
21956
  // src/rules/stepdown.ts
21830
- import { AST_NODE_TYPES as AST_NODE_TYPES99, ASTUtils as ASTUtils50 } from "@typescript-eslint/utils";
21957
+ import { AST_NODE_TYPES as AST_NODE_TYPES100, ASTUtils as ASTUtils51 } from "@typescript-eslint/utils";
21831
21958
  var STEPDOWN_DOCUMENTATION = {
21832
21959
  summary: "Place a private helper below its sole direct same-scope caller.",
21833
21960
  rationale: "Caller-first ordering lets a reader follow the main flow before descending into implementation details.",
@@ -21845,7 +21972,7 @@ var STEPDOWN_DOCUMENTATION = {
21845
21972
  ]
21846
21973
  };
21847
21974
  function isFunction(node) {
21848
- return node.type === AST_NODE_TYPES99.ArrowFunctionExpression || node.type === AST_NODE_TYPES99.FunctionDeclaration || node.type === AST_NODE_TYPES99.FunctionExpression;
21975
+ return node.type === AST_NODE_TYPES100.ArrowFunctionExpression || node.type === AST_NODE_TYPES100.FunctionDeclaration || node.type === AST_NODE_TYPES100.FunctionExpression;
21849
21976
  }
21850
21977
  function reportMisordered(context, candidates, scopeDefinitions, calls, pinned, canMove = () => true) {
21851
21978
  const byName = new Map(scopeDefinitions.map((definition) => [definition.name, definition]));
@@ -21946,8 +22073,8 @@ function moduleScope(context, program) {
21946
22073
  for (const node of declarations) counts.set(node.name, (counts.get(node.name) ?? 0) + 1);
21947
22074
  const overloadNames = new Set(
21948
22075
  program.body.flatMap((statement) => {
21949
- const node = statement.type === AST_NODE_TYPES99.ExportNamedDeclaration ? statement.declaration : statement;
21950
- return node?.type === AST_NODE_TYPES99.TSDeclareFunction && node.id !== null ? [node.id.name] : [];
22076
+ const node = statement.type === AST_NODE_TYPES100.ExportNamedDeclaration ? statement.declaration : statement;
22077
+ return node?.type === AST_NODE_TYPES100.TSDeclareFunction && node.id !== null ? [node.id.name] : [];
21951
22078
  })
21952
22079
  );
21953
22080
  const exported = exportedNames(program);
@@ -21971,7 +22098,7 @@ function moduleScope(context, program) {
21971
22098
  const nearestFunction2 = [...ancestors].reverse().find(isFunction);
21972
22099
  const parent = identifier.parent;
21973
22100
  const callerDefinition = nearestFunction2 === void 0 ? void 0 : byFunction.get(nearestFunction2);
21974
- if (callerDefinition === void 0 || parent.type !== AST_NODE_TYPES99.CallExpression || parent.callee !== identifier) {
22101
+ if (callerDefinition === void 0 || parent.type !== AST_NODE_TYPES100.CallExpression || parent.callee !== identifier) {
21975
22102
  pinned.add(definition.name);
21976
22103
  continue;
21977
22104
  }
@@ -21986,17 +22113,17 @@ function moduleScope(context, program) {
21986
22113
  function exportedNames(program) {
21987
22114
  const names = /* @__PURE__ */ new Set();
21988
22115
  function collectNamedExports(statement) {
21989
- if (statement.type !== AST_NODE_TYPES99.ExportNamedDeclaration || statement.exportKind === "type" || statement.source !== null) return;
21990
- if (statement.declaration?.type === AST_NODE_TYPES99.FunctionDeclaration && statement.declaration.id !== null) {
22116
+ if (statement.type !== AST_NODE_TYPES100.ExportNamedDeclaration || statement.exportKind === "type" || statement.source !== null) return;
22117
+ if (statement.declaration?.type === AST_NODE_TYPES100.FunctionDeclaration && statement.declaration.id !== null) {
21991
22118
  names.add(statement.declaration.id.name);
21992
22119
  }
21993
- if (statement.declaration?.type === AST_NODE_TYPES99.VariableDeclaration) {
22120
+ if (statement.declaration?.type === AST_NODE_TYPES100.VariableDeclaration) {
21994
22121
  for (const declarator of statement.declaration.declarations) {
21995
- if (declarator.id.type === AST_NODE_TYPES99.Identifier) names.add(declarator.id.name);
22122
+ if (declarator.id.type === AST_NODE_TYPES100.Identifier) names.add(declarator.id.name);
21996
22123
  }
21997
22124
  }
21998
22125
  for (const specifier of statement.specifiers) {
21999
- if (specifier.exportKind !== "type" && specifier.local.type === AST_NODE_TYPES99.Identifier) {
22126
+ if (specifier.exportKind !== "type" && specifier.local.type === AST_NODE_TYPES100.Identifier) {
22000
22127
  names.add(specifier.local.name);
22001
22128
  }
22002
22129
  }
@@ -22005,22 +22132,22 @@ function exportedNames(program) {
22005
22132
  collectNamedExports(statement);
22006
22133
  }
22007
22134
  for (const statement of program.body) {
22008
- if (statement.type === AST_NODE_TYPES99.ExportDefaultDeclaration && statement.declaration.type === AST_NODE_TYPES99.Identifier) names.add(statement.declaration.name);
22009
- if (statement.type === AST_NODE_TYPES99.ExportDefaultDeclaration && statement.declaration.type === AST_NODE_TYPES99.FunctionDeclaration && statement.declaration.id !== null) names.add(statement.declaration.id.name);
22135
+ if (statement.type === AST_NODE_TYPES100.ExportDefaultDeclaration && statement.declaration.type === AST_NODE_TYPES100.Identifier) names.add(statement.declaration.name);
22136
+ if (statement.type === AST_NODE_TYPES100.ExportDefaultDeclaration && statement.declaration.type === AST_NODE_TYPES100.FunctionDeclaration && statement.declaration.id !== null) names.add(statement.declaration.id.name);
22010
22137
  }
22011
22138
  return names;
22012
22139
  }
22013
22140
  function moduleDefinitions(program) {
22014
22141
  const definitions = [];
22015
22142
  for (const statement of program.body) {
22016
- const node = statement.type === AST_NODE_TYPES99.ExportNamedDeclaration || statement.type === AST_NODE_TYPES99.ExportDefaultDeclaration ? statement.declaration : statement;
22017
- if (node?.type === AST_NODE_TYPES99.FunctionDeclaration && node.id !== null && node.body !== null) {
22143
+ const node = statement.type === AST_NODE_TYPES100.ExportNamedDeclaration || statement.type === AST_NODE_TYPES100.ExportDefaultDeclaration ? statement.declaration : statement;
22144
+ if (node?.type === AST_NODE_TYPES100.FunctionDeclaration && node.id !== null && node.body !== null) {
22018
22145
  definitions.push({ name: node.id.name, node, functionNode: node, bindingNode: node });
22019
22146
  continue;
22020
22147
  }
22021
- if (node?.type !== AST_NODE_TYPES99.VariableDeclaration || node.kind !== "const") continue;
22148
+ if (node?.type !== AST_NODE_TYPES100.VariableDeclaration || node.kind !== "const") continue;
22022
22149
  for (const declarator of node.declarations) {
22023
- if (declarator.id.type === AST_NODE_TYPES99.Identifier && declarator.init !== null && isFunction(declarator.init)) {
22150
+ if (declarator.id.type === AST_NODE_TYPES100.Identifier && declarator.init !== null && isFunction(declarator.init)) {
22024
22151
  definitions.push({
22025
22152
  name: declarator.id.name,
22026
22153
  node: declarator,
@@ -22033,21 +22160,21 @@ function moduleDefinitions(program) {
22033
22160
  return definitions;
22034
22161
  }
22035
22162
  function methodName2(node) {
22036
- if (node.key.type === AST_NODE_TYPES99.PrivateIdentifier) return `#${node.key.name}`;
22037
- return !node.computed && node.key.type === AST_NODE_TYPES99.Identifier ? node.key.name : null;
22163
+ if (node.key.type === AST_NODE_TYPES100.PrivateIdentifier) return `#${node.key.name}`;
22164
+ return !node.computed && node.key.type === AST_NODE_TYPES100.Identifier ? node.key.name : null;
22038
22165
  }
22039
22166
  function referencedMethod(context, node, classVariables) {
22040
- const objectVariable = node.object.type === AST_NODE_TYPES99.Identifier ? ASTUtils50.findVariable(context.sourceCode.getScope(node.object), node.object.name) : null;
22167
+ const objectVariable = node.object.type === AST_NODE_TYPES100.Identifier ? ASTUtils51.findVariable(context.sourceCode.getScope(node.object), node.object.name) : null;
22041
22168
  const isClassReference = objectVariable !== null && classVariables.has(objectVariable);
22042
- if (node.object.type !== AST_NODE_TYPES99.ThisExpression && !isClassReference) return null;
22043
- if (node.property.type === AST_NODE_TYPES99.PrivateIdentifier) return `#${node.property.name}`;
22044
- if (!node.computed && node.property.type === AST_NODE_TYPES99.Identifier) return node.property.name;
22045
- return node.computed && node.property.type === AST_NODE_TYPES99.Literal && typeof node.property.value === "string" ? node.property.value : null;
22169
+ if (node.object.type !== AST_NODE_TYPES100.ThisExpression && !isClassReference) return null;
22170
+ if (node.property.type === AST_NODE_TYPES100.PrivateIdentifier) return `#${node.property.name}`;
22171
+ if (!node.computed && node.property.type === AST_NODE_TYPES100.Identifier) return node.property.name;
22172
+ return node.computed && node.property.type === AST_NODE_TYPES100.Literal && typeof node.property.value === "string" ? node.property.value : null;
22046
22173
  }
22047
22174
  function referencedPropertyName(node) {
22048
- if (node.property.type === AST_NODE_TYPES99.PrivateIdentifier) return `#${node.property.name}`;
22049
- if (!node.computed && node.property.type === AST_NODE_TYPES99.Identifier) return node.property.name;
22050
- return node.computed && node.property.type === AST_NODE_TYPES99.Literal && typeof node.property.value === "string" ? node.property.value : null;
22175
+ if (node.property.type === AST_NODE_TYPES100.PrivateIdentifier) return `#${node.property.name}`;
22176
+ if (!node.computed && node.property.type === AST_NODE_TYPES100.Identifier) return node.property.name;
22177
+ return node.computed && node.property.type === AST_NODE_TYPES100.Literal && typeof node.property.value === "string" ? node.property.value : null;
22051
22178
  }
22052
22179
  function walk(node, visitorKeys, visit, nestedFunction = false) {
22053
22180
  visit(node, nestedFunction);
@@ -22056,7 +22183,7 @@ function walk(node, visitorKeys, visit, nestedFunction = false) {
22056
22183
  }
22057
22184
  function classScope(context, node, computedReferenceNames) {
22058
22185
  const methods = node.body.body.filter(
22059
- (member) => member.type === AST_NODE_TYPES99.MethodDefinition
22186
+ (member) => member.type === AST_NODE_TYPES100.MethodDefinition
22060
22187
  );
22061
22188
  const counts = classMethodCounts(node.body, methods);
22062
22189
  const scopeDefinitions = methods.flatMap((method) => {
@@ -22065,7 +22192,7 @@ function classScope(context, node, computedReferenceNames) {
22065
22192
  });
22066
22193
  const definitions = methods.flatMap((method) => {
22067
22194
  const name = methodName2(method);
22068
- const isPrivate = method.accessibility === "private" || method.key.type === AST_NODE_TYPES99.PrivateIdentifier;
22195
+ const isPrivate = method.accessibility === "private" || method.key.type === AST_NODE_TYPES100.PrivateIdentifier;
22069
22196
  return name !== null && isPrivate && counts.get(name) === 1 && method.decorators.length === 0 ? [{ name, node: method }] : [];
22070
22197
  });
22071
22198
  if (definitions.length === 0) return;
@@ -22074,11 +22201,11 @@ function classScope(context, node, computedReferenceNames) {
22074
22201
  const pinned = /* @__PURE__ */ new Set();
22075
22202
  const classVariables = /* @__PURE__ */ new Set();
22076
22203
  if (node.id !== null) {
22077
- const internal = ASTUtils50.findVariable(context.sourceCode.getScope(node), node.id.name);
22204
+ const internal = ASTUtils51.findVariable(context.sourceCode.getScope(node), node.id.name);
22078
22205
  if (internal !== null) classVariables.add(internal);
22079
22206
  }
22080
- if (node.type === AST_NODE_TYPES99.ClassExpression && node.parent.type === AST_NODE_TYPES99.VariableDeclarator && node.parent.id.type === AST_NODE_TYPES99.Identifier) {
22081
- const outer = ASTUtils50.findVariable(context.sourceCode.getScope(node.parent), node.parent.id.name);
22207
+ if (node.type === AST_NODE_TYPES100.ClassExpression && node.parent.type === AST_NODE_TYPES100.VariableDeclarator && node.parent.id.type === AST_NODE_TYPES100.Identifier) {
22208
+ const outer = ASTUtils51.findVariable(context.sourceCode.getScope(node.parent), node.parent.id.name);
22082
22209
  if (outer !== null) classVariables.add(outer);
22083
22210
  }
22084
22211
  function collectMethodCalls(method) {
@@ -22094,21 +22221,21 @@ function classScope(context, node, computedReferenceNames) {
22094
22221
  }
22095
22222
  const thisValue = (value) => {
22096
22223
  let current = value;
22097
- while (current?.type === AST_NODE_TYPES99.TSAsExpression || current?.type === AST_NODE_TYPES99.TSSatisfiesExpression || current?.type === AST_NODE_TYPES99.TSNonNullExpression) current = current.expression;
22098
- return current?.type === AST_NODE_TYPES99.ThisExpression;
22224
+ while (current?.type === AST_NODE_TYPES100.TSAsExpression || current?.type === AST_NODE_TYPES100.TSSatisfiesExpression || current?.type === AST_NODE_TYPES100.TSNonNullExpression) current = current.expression;
22225
+ return current?.type === AST_NODE_TYPES100.ThisExpression;
22099
22226
  };
22100
22227
  const collectAlias = (current, nestedFunction) => {
22101
- if (nestedFunction || current.type !== AST_NODE_TYPES99.VariableDeclarator && current.type !== AST_NODE_TYPES99.AssignmentPattern) return;
22102
- if (current.type === AST_NODE_TYPES99.VariableDeclarator && (current.parent.type !== AST_NODE_TYPES99.VariableDeclaration || current.parent.kind !== "const")) return;
22103
- const binding = current.type === AST_NODE_TYPES99.VariableDeclarator ? current.id : current.left;
22104
- const value = current.type === AST_NODE_TYPES99.VariableDeclarator ? current.init : current.right;
22228
+ if (nestedFunction || current.type !== AST_NODE_TYPES100.VariableDeclarator && current.type !== AST_NODE_TYPES100.AssignmentPattern) return;
22229
+ if (current.type === AST_NODE_TYPES100.VariableDeclarator && (current.parent.type !== AST_NODE_TYPES100.VariableDeclaration || current.parent.kind !== "const")) return;
22230
+ const binding = current.type === AST_NODE_TYPES100.VariableDeclarator ? current.id : current.left;
22231
+ const value = current.type === AST_NODE_TYPES100.VariableDeclarator ? current.init : current.right;
22105
22232
  if (!thisValue(value)) return;
22106
- if (binding.type === AST_NODE_TYPES99.ObjectPattern) {
22233
+ if (binding.type === AST_NODE_TYPES100.ObjectPattern) {
22107
22234
  pinDestructuredMembers(binding);
22108
22235
  return;
22109
22236
  }
22110
- if (binding.type !== AST_NODE_TYPES99.Identifier) return;
22111
- const variable = ASTUtils50.findVariable(context.sourceCode.getScope(binding), binding.name);
22237
+ if (binding.type !== AST_NODE_TYPES100.Identifier) return;
22238
+ const variable = ASTUtils51.findVariable(context.sourceCode.getScope(binding), binding.name);
22112
22239
  if (variable !== null) {
22113
22240
  methodClassVariables.add(variable);
22114
22241
  methodAliases.add(variable);
@@ -22122,18 +22249,18 @@ function classScope(context, node, computedReferenceNames) {
22122
22249
  }
22123
22250
  function pinDestructuredMembers(binding) {
22124
22251
  for (const property of binding.properties) {
22125
- if (property.type === AST_NODE_TYPES99.RestElement) {
22252
+ if (property.type === AST_NODE_TYPES100.RestElement) {
22126
22253
  for (const name of privateNames) pinned.add(name);
22127
- } else if (property.key.type === AST_NODE_TYPES99.Identifier && privateNames.has(property.key.name)) {
22254
+ } else if (property.key.type === AST_NODE_TYPES100.Identifier && privateNames.has(property.key.name)) {
22128
22255
  pinned.add(property.key.name);
22129
22256
  }
22130
22257
  }
22131
22258
  }
22132
22259
  const visitCall = (current, nestedFunction) => {
22133
- if (current.type === AST_NODE_TYPES99.VariableDeclarator && current.id.type === AST_NODE_TYPES99.ObjectPattern && thisValue(current.init)) {
22260
+ if (current.type === AST_NODE_TYPES100.VariableDeclarator && current.id.type === AST_NODE_TYPES100.ObjectPattern && thisValue(current.init)) {
22134
22261
  pinDestructuredMembers(current.id);
22135
22262
  }
22136
- if (current.type !== AST_NODE_TYPES99.MemberExpression) return;
22263
+ if (current.type !== AST_NODE_TYPES100.MemberExpression) return;
22137
22264
  const target = referencedMethod(context, current, methodClassVariables);
22138
22265
  if (target === null) {
22139
22266
  const possibleTarget = referencedPropertyName(current);
@@ -22141,12 +22268,12 @@ function classScope(context, node, computedReferenceNames) {
22141
22268
  return;
22142
22269
  }
22143
22270
  if (!privateNames.has(target)) return;
22144
- const objectVariable = current.object.type === AST_NODE_TYPES99.Identifier ? ASTUtils50.findVariable(context.sourceCode.getScope(current.object), current.object.name) : null;
22271
+ const objectVariable = current.object.type === AST_NODE_TYPES100.Identifier ? ASTUtils51.findVariable(context.sourceCode.getScope(current.object), current.object.name) : null;
22145
22272
  if (objectVariable !== null && methodAliases.has(objectVariable)) {
22146
22273
  pinned.add(target);
22147
22274
  return;
22148
22275
  }
22149
- if (current.computed || nestedFunction || parameterDecoratorNodes.has(current) || current.parent.type !== AST_NODE_TYPES99.CallExpression || current.parent.callee !== current) {
22276
+ if (current.computed || nestedFunction || parameterDecoratorNodes.has(current) || current.parent.type !== AST_NODE_TYPES100.CallExpression || current.parent.callee !== current) {
22150
22277
  pinned.add(target);
22151
22278
  return;
22152
22279
  }
@@ -22167,9 +22294,9 @@ function classScope(context, node, computedReferenceNames) {
22167
22294
  }
22168
22295
  for (const method of methods) collectMethodCalls(method);
22169
22296
  for (const member of node.body.body) {
22170
- if (member.type === AST_NODE_TYPES99.MethodDefinition || member.type === AST_NODE_TYPES99.TSAbstractMethodDefinition) continue;
22297
+ if (member.type === AST_NODE_TYPES100.MethodDefinition || member.type === AST_NODE_TYPES100.TSAbstractMethodDefinition) continue;
22171
22298
  walk(member, context.sourceCode.visitorKeys, (current) => {
22172
- if (current.type !== AST_NODE_TYPES99.MemberExpression) return;
22299
+ if (current.type !== AST_NODE_TYPES100.MemberExpression) return;
22173
22300
  const target = referencedMethod(context, current, classVariables);
22174
22301
  const possibleTarget = target ?? referencedPropertyName(current);
22175
22302
  if (possibleTarget !== null && privateNames.has(possibleTarget)) pinned.add(possibleTarget);
@@ -22191,12 +22318,12 @@ function classScope(context, node, computedReferenceNames) {
22191
22318
  }
22192
22319
  function isClassRuntimeBarrier(member) {
22193
22320
  switch (member.type) {
22194
- case AST_NODE_TYPES99.StaticBlock:
22321
+ case AST_NODE_TYPES100.StaticBlock:
22195
22322
  return true;
22196
- case AST_NODE_TYPES99.PropertyDefinition:
22197
- case AST_NODE_TYPES99.AccessorProperty:
22323
+ case AST_NODE_TYPES100.PropertyDefinition:
22324
+ case AST_NODE_TYPES100.AccessorProperty:
22198
22325
  return member.static || member.computed || member.decorators.length > 0 || member.value !== null;
22199
- case AST_NODE_TYPES99.MethodDefinition:
22326
+ case AST_NODE_TYPES100.MethodDefinition:
22200
22327
  return member.computed || member.decorators.length > 0;
22201
22328
  default:
22202
22329
  return false;
@@ -22228,7 +22355,7 @@ var stepdown_default = createRule({
22228
22355
  moduleScope(context, program);
22229
22356
  const computedReferenceNames = /* @__PURE__ */ new Set();
22230
22357
  walk(program, context.sourceCode.visitorKeys, (node) => {
22231
- if (node.type === AST_NODE_TYPES99.MemberExpression && node.computed && node.property.type === AST_NODE_TYPES99.Literal && typeof node.property.value === "string") computedReferenceNames.add(node.property.value);
22358
+ if (node.type === AST_NODE_TYPES100.MemberExpression && node.computed && node.property.type === AST_NODE_TYPES100.Literal && typeof node.property.value === "string") computedReferenceNames.add(node.property.value);
22232
22359
  });
22233
22360
  for (const node of classes) classScope(context, node, computedReferenceNames);
22234
22361
  }
@@ -22242,15 +22369,15 @@ function classMethodCounts(body2, methods) {
22242
22369
  if (name !== null) counts.set(name, (counts.get(name) ?? 0) + 1);
22243
22370
  }
22244
22371
  for (const member of body2.body) {
22245
- if (member.type !== AST_NODE_TYPES99.TSAbstractMethodDefinition) continue;
22246
- const name = !member.computed && member.key.type === AST_NODE_TYPES99.Identifier ? member.key.name : null;
22372
+ if (member.type !== AST_NODE_TYPES100.TSAbstractMethodDefinition) continue;
22373
+ const name = !member.computed && member.key.type === AST_NODE_TYPES100.Identifier ? member.key.name : null;
22247
22374
  if (name !== null) counts.set(name, (counts.get(name) ?? 0) + 1);
22248
22375
  }
22249
22376
  return counts;
22250
22377
  }
22251
22378
 
22252
22379
  // src/rules/source-coupled-test.ts
22253
- import { AST_NODE_TYPES as AST_NODE_TYPES100, ASTUtils as ASTUtils51 } from "@typescript-eslint/utils";
22380
+ import { AST_NODE_TYPES as AST_NODE_TYPES101, ASTUtils as ASTUtils52 } from "@typescript-eslint/utils";
22254
22381
  var GENERAL_SOURCE_SUFFIX_RE = /\.(?:bash|sh|ya?ml|jsonc?|toml|py|[cm]?[jt]s)$/iu;
22255
22382
  var FS_MODULES = /* @__PURE__ */ new Set(["fs", "node:fs", "fs/promises", "node:fs/promises"]);
22256
22383
  var FS_READERS = /* @__PURE__ */ new Set(["readFile", "readFileSync"]);
@@ -22322,21 +22449,21 @@ var SOURCE_COUPLED_TEST_DOCUMENTATION = {
22322
22449
  ]
22323
22450
  };
22324
22451
  function staticMemberName8(node) {
22325
- if (!node.computed && node.property.type === AST_NODE_TYPES100.Identifier) return node.property.name;
22326
- if (node.computed && node.property.type === AST_NODE_TYPES100.Literal && typeof node.property.value === "string") return node.property.value;
22452
+ if (!node.computed && node.property.type === AST_NODE_TYPES101.Identifier) return node.property.name;
22453
+ if (node.computed && node.property.type === AST_NODE_TYPES101.Literal && typeof node.property.value === "string") return node.property.value;
22327
22454
  return null;
22328
22455
  }
22329
22456
  function unwrap7(node) {
22330
- if (node.type === AST_NODE_TYPES100.AwaitExpression) return unwrap7(node.argument);
22331
- if (node.type === AST_NODE_TYPES100.ChainExpression) return unwrap7(node.expression);
22332
- if (node.type === AST_NODE_TYPES100.TSAsExpression || node.type === AST_NODE_TYPES100.TSNonNullExpression || node.type === AST_NODE_TYPES100.TSTypeAssertion) return unwrap7(node.expression);
22457
+ if (node.type === AST_NODE_TYPES101.AwaitExpression) return unwrap7(node.argument);
22458
+ if (node.type === AST_NODE_TYPES101.ChainExpression) return unwrap7(node.expression);
22459
+ if (node.type === AST_NODE_TYPES101.TSAsExpression || node.type === AST_NODE_TYPES101.TSNonNullExpression || node.type === AST_NODE_TYPES101.TSTypeAssertion) return unwrap7(node.expression);
22333
22460
  return node;
22334
22461
  }
22335
22462
  function stringValue(node) {
22336
22463
  const current = unwrap7(node);
22337
- if (current.type === AST_NODE_TYPES100.Literal && typeof current.value === "string") return current.value;
22338
- if (current.type === AST_NODE_TYPES100.TemplateLiteral && current.expressions.length === 0) return current.quasis[0]?.value.cooked ?? null;
22339
- if (current.type === AST_NODE_TYPES100.BinaryExpression && current.operator === "+") {
22464
+ if (current.type === AST_NODE_TYPES101.Literal && typeof current.value === "string") return current.value;
22465
+ if (current.type === AST_NODE_TYPES101.TemplateLiteral && current.expressions.length === 0) return current.quasis[0]?.value.cooked ?? null;
22466
+ if (current.type === AST_NODE_TYPES101.BinaryExpression && current.operator === "+") {
22340
22467
  const left = stringValue(current.left);
22341
22468
  const right = stringValue(current.right);
22342
22469
  return left === null || right === null ? null : left + right;
@@ -22348,7 +22475,7 @@ function importSource(node) {
22348
22475
  }
22349
22476
  function requireSource(node) {
22350
22477
  const current = unwrap7(node);
22351
- if (current.type !== AST_NODE_TYPES100.CallExpression || current.callee.type !== AST_NODE_TYPES100.Identifier || current.callee.name !== "require" || current.arguments.length !== 1 || current.arguments[0]?.type === AST_NODE_TYPES100.SpreadElement) return null;
22478
+ if (current.type !== AST_NODE_TYPES101.CallExpression || current.callee.type !== AST_NODE_TYPES101.Identifier || current.callee.name !== "require" || current.arguments.length !== 1 || current.arguments[0]?.type === AST_NODE_TYPES101.SpreadElement) return null;
22352
22479
  return stringValue(current.arguments[0]);
22353
22480
  }
22354
22481
  function newScope() {
@@ -22370,7 +22497,7 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
22370
22497
  const scopes = [newScope()];
22371
22498
  const reportedOrigins = /* @__PURE__ */ new Set();
22372
22499
  const currentScope = () => scopes.at(-1) ?? scopes[0];
22373
- const bindingOf = (node) => ASTUtils51.findVariable(context.sourceCode.getScope(node), node.name);
22500
+ const bindingOf = (node) => ASTUtils52.findVariable(context.sourceCode.getScope(node), node.name);
22374
22501
  const assertionKind = (node) => {
22375
22502
  const binding = bindingOf(node);
22376
22503
  if (binding === null || binding.defs.length === 0) {
@@ -22404,37 +22531,37 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
22404
22531
  const current = unwrap7(node);
22405
22532
  const value = stringValue(current);
22406
22533
  if (value !== null) return sourceSuffixRe.test(value);
22407
- if (current.type === AST_NODE_TYPES100.Identifier) return visible("paths", current);
22408
- if (current.type === AST_NODE_TYPES100.CallExpression || current.type === AST_NODE_TYPES100.NewExpression) {
22534
+ if (current.type === AST_NODE_TYPES101.Identifier) return visible("paths", current);
22535
+ if (current.type === AST_NODE_TYPES101.CallExpression || current.type === AST_NODE_TYPES101.NewExpression) {
22409
22536
  const callee = current.callee;
22410
22537
  const first = current.arguments[0];
22411
- if (first === void 0 || first.type === AST_NODE_TYPES100.SpreadElement) return false;
22412
- if (current.type === AST_NODE_TYPES100.NewExpression && callee.type === AST_NODE_TYPES100.Identifier && callee.name === "URL" && (bindingOf(callee)?.defs.length ?? 0) === 0) return sourcePath(first);
22413
- if (callee.type === AST_NODE_TYPES100.Identifier && bindingOf(callee)?.defs.some((definition) => definition.node.type === AST_NODE_TYPES100.ImportSpecifier && definition.node.imported.type === AST_NODE_TYPES100.Identifier && definition.node.imported.name === "fileURLToPath" && definition.node.parent.type === AST_NODE_TYPES100.ImportDeclaration && ["node:url", "url"].includes(String(definition.node.parent.source.value)))) return sourcePath(first);
22538
+ if (first === void 0 || first.type === AST_NODE_TYPES101.SpreadElement) return false;
22539
+ if (current.type === AST_NODE_TYPES101.NewExpression && callee.type === AST_NODE_TYPES101.Identifier && callee.name === "URL" && (bindingOf(callee)?.defs.length ?? 0) === 0) return sourcePath(first);
22540
+ if (callee.type === AST_NODE_TYPES101.Identifier && bindingOf(callee)?.defs.some((definition) => definition.node.type === AST_NODE_TYPES101.ImportSpecifier && definition.node.imported.type === AST_NODE_TYPES101.Identifier && definition.node.imported.name === "fileURLToPath" && definition.node.parent.type === AST_NODE_TYPES101.ImportDeclaration && ["node:url", "url"].includes(String(definition.node.parent.source.value)))) return sourcePath(first);
22414
22541
  }
22415
22542
  return false;
22416
22543
  };
22417
22544
  const rawRead = (node) => {
22418
22545
  const current = unwrap7(node);
22419
- if (current.type !== AST_NODE_TYPES100.CallExpression || current.arguments.length === 0) return false;
22546
+ if (current.type !== AST_NODE_TYPES101.CallExpression || current.arguments.length === 0) return false;
22420
22547
  const callee = unwrap7(current.callee);
22421
- if (callee.type === AST_NODE_TYPES100.Identifier) {
22548
+ if (callee.type === AST_NODE_TYPES101.Identifier) {
22422
22549
  return visible("fsReaders", callee) && sourcePath(current.arguments[0]);
22423
22550
  }
22424
- if (callee.type !== AST_NODE_TYPES100.MemberExpression) return false;
22551
+ if (callee.type !== AST_NODE_TYPES101.MemberExpression) return false;
22425
22552
  const name2 = staticMemberName8(callee);
22426
22553
  const object = unwrap7(callee.object);
22427
- return name2 !== null && FS_READERS.has(name2) && object.type === AST_NODE_TYPES100.Identifier && visible("fsObjects", object) && sourcePath(current.arguments[0]);
22554
+ return name2 !== null && FS_READERS.has(name2) && object.type === AST_NODE_TYPES101.Identifier && visible("fsObjects", object) && sourcePath(current.arguments[0]);
22428
22555
  };
22429
22556
  const rawOrigins = (node) => {
22430
22557
  const current = unwrap7(node);
22431
- if (current.type === AST_NODE_TYPES100.Identifier) return visibleRawOrigins(current);
22558
+ if (current.type === AST_NODE_TYPES101.Identifier) return visibleRawOrigins(current);
22432
22559
  if (rawRead(current)) return /* @__PURE__ */ new Set([`${current.range[0]}:${current.range[1]}`]);
22433
- if (current.type === AST_NODE_TYPES100.BinaryExpression && current.operator === "+") return /* @__PURE__ */ new Set([...rawOrigins(current.left), ...rawOrigins(current.right)]);
22434
- if (current.type === AST_NODE_TYPES100.MemberExpression && staticMemberName8(current) === "length") return rawOrigins(current.object);
22435
- if (current.type !== AST_NODE_TYPES100.CallExpression) return /* @__PURE__ */ new Set();
22560
+ if (current.type === AST_NODE_TYPES101.BinaryExpression && current.operator === "+") return /* @__PURE__ */ new Set([...rawOrigins(current.left), ...rawOrigins(current.right)]);
22561
+ if (current.type === AST_NODE_TYPES101.MemberExpression && staticMemberName8(current) === "length") return rawOrigins(current.object);
22562
+ if (current.type !== AST_NODE_TYPES101.CallExpression) return /* @__PURE__ */ new Set();
22436
22563
  const callee = unwrap7(current.callee);
22437
- if (callee.type !== AST_NODE_TYPES100.MemberExpression) return /* @__PURE__ */ new Set();
22564
+ if (callee.type !== AST_NODE_TYPES101.MemberExpression) return /* @__PURE__ */ new Set();
22438
22565
  const name2 = staticMemberName8(callee);
22439
22566
  return name2 !== null && TEXT_TRANSFORMS.has(name2) ? rawOrigins(callee.object) : /* @__PURE__ */ new Set();
22440
22567
  };
@@ -22442,32 +22569,32 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
22442
22569
  const current = unwrap7(node);
22443
22570
  const direct = rawOrigins(current);
22444
22571
  if (direct.size > 0) return direct;
22445
- if (current.type === AST_NODE_TYPES100.BinaryExpression || current.type === AST_NODE_TYPES100.LogicalExpression) return /* @__PURE__ */ new Set([...evidenceOrigins(current.left), ...evidenceOrigins(current.right)]);
22446
- if (current.type === AST_NODE_TYPES100.UnaryExpression) return evidenceOrigins(current.argument);
22447
- if (current.type !== AST_NODE_TYPES100.CallExpression) return /* @__PURE__ */ new Set();
22572
+ if (current.type === AST_NODE_TYPES101.BinaryExpression || current.type === AST_NODE_TYPES101.LogicalExpression) return /* @__PURE__ */ new Set([...evidenceOrigins(current.left), ...evidenceOrigins(current.right)]);
22573
+ if (current.type === AST_NODE_TYPES101.UnaryExpression) return evidenceOrigins(current.argument);
22574
+ if (current.type !== AST_NODE_TYPES101.CallExpression) return /* @__PURE__ */ new Set();
22448
22575
  const callee = unwrap7(current.callee);
22449
- if (callee.type !== AST_NODE_TYPES100.MemberExpression) return /* @__PURE__ */ new Set();
22576
+ if (callee.type !== AST_NODE_TYPES101.MemberExpression) return /* @__PURE__ */ new Set();
22450
22577
  const name2 = staticMemberName8(callee);
22451
22578
  if (name2 !== null && TEXT_PREDICATES.has(name2)) return rawOrigins(callee.object);
22452
- if (name2 !== null && REGEXP_PREDICATES.has(name2)) return new Set(current.arguments.flatMap((argument) => argument.type === AST_NODE_TYPES100.SpreadElement ? [] : [...rawOrigins(argument)]));
22579
+ if (name2 !== null && REGEXP_PREDICATES.has(name2)) return new Set(current.arguments.flatMap((argument) => argument.type === AST_NODE_TYPES101.SpreadElement ? [] : [...rawOrigins(argument)]));
22453
22580
  return /* @__PURE__ */ new Set();
22454
22581
  };
22455
22582
  const rawAssertionOrigins = (node) => {
22456
22583
  const callee = unwrap7(node.callee);
22457
- if (callee.type === AST_NODE_TYPES100.Identifier && assertionKind(callee) === "assert") {
22458
- return new Set(node.arguments.flatMap((argument) => argument.type === AST_NODE_TYPES100.SpreadElement ? [] : [...evidenceOrigins(argument)]));
22584
+ if (callee.type === AST_NODE_TYPES101.Identifier && assertionKind(callee) === "assert") {
22585
+ return new Set(node.arguments.flatMap((argument) => argument.type === AST_NODE_TYPES101.SpreadElement ? [] : [...evidenceOrigins(argument)]));
22459
22586
  }
22460
- if (callee.type !== AST_NODE_TYPES100.MemberExpression) return /* @__PURE__ */ new Set();
22587
+ if (callee.type !== AST_NODE_TYPES101.MemberExpression) return /* @__PURE__ */ new Set();
22461
22588
  const matcher = staticMemberName8(callee);
22462
22589
  if (matcher === null) return /* @__PURE__ */ new Set();
22463
22590
  let receiver = unwrap7(callee.object);
22464
- while (receiver.type === AST_NODE_TYPES100.MemberExpression && EXPECT_MODIFIERS2.has(staticMemberName8(receiver) ?? "")) receiver = unwrap7(receiver.object);
22465
- if (receiver.type === AST_NODE_TYPES100.CallExpression && receiver.callee.type === AST_NODE_TYPES100.Identifier && assertionKind(receiver.callee) === "expect") {
22591
+ while (receiver.type === AST_NODE_TYPES101.MemberExpression && EXPECT_MODIFIERS2.has(staticMemberName8(receiver) ?? "")) receiver = unwrap7(receiver.object);
22592
+ if (receiver.type === AST_NODE_TYPES101.CallExpression && receiver.callee.type === AST_NODE_TYPES101.Identifier && assertionKind(receiver.callee) === "expect") {
22466
22593
  if (!EXPECT_MATCHERS.has(matcher)) return /* @__PURE__ */ new Set();
22467
- return new Set([...receiver.arguments, ...node.arguments].flatMap((argument) => argument.type === AST_NODE_TYPES100.SpreadElement ? [] : [...evidenceOrigins(argument)]));
22594
+ return new Set([...receiver.arguments, ...node.arguments].flatMap((argument) => argument.type === AST_NODE_TYPES101.SpreadElement ? [] : [...evidenceOrigins(argument)]));
22468
22595
  }
22469
- if (receiver.type !== AST_NODE_TYPES100.Identifier || assertionKind(receiver) !== "assert" || !ASSERT_MATCHERS.has(matcher)) return /* @__PURE__ */ new Set();
22470
- return new Set(node.arguments.flatMap((argument) => argument.type === AST_NODE_TYPES100.SpreadElement ? [] : [...evidenceOrigins(argument)]));
22596
+ if (receiver.type !== AST_NODE_TYPES101.Identifier || assertionKind(receiver) !== "assert" || !ASSERT_MATCHERS.has(matcher)) return /* @__PURE__ */ new Set();
22597
+ return new Set(node.arguments.flatMap((argument) => argument.type === AST_NODE_TYPES101.SpreadElement ? [] : [...evidenceOrigins(argument)]));
22471
22598
  };
22472
22599
  const declare = (node, state) => {
22473
22600
  const name2 = bindingOf(node);
@@ -22489,7 +22616,7 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
22489
22616
  };
22490
22617
  const sourceCollection = (node) => {
22491
22618
  const current = unwrap7(node);
22492
- return current.type === AST_NODE_TYPES100.ArrayExpression && current.elements.length > 0 && current.elements.every((element) => element !== null && element.type !== AST_NODE_TYPES100.SpreadElement && sourcePath(element));
22619
+ return current.type === AST_NODE_TYPES101.ArrayExpression && current.elements.length > 0 && current.elements.every((element) => element !== null && element.type !== AST_NODE_TYPES101.SpreadElement && sourcePath(element));
22493
22620
  };
22494
22621
  const enterFunction = () => {
22495
22622
  scopes.push(newScope());
@@ -22499,8 +22626,8 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
22499
22626
  };
22500
22627
  function declareFsReaders(pattern) {
22501
22628
  for (const property of pattern.properties) {
22502
- if (property.type !== AST_NODE_TYPES100.Property || property.value.type !== AST_NODE_TYPES100.Identifier) continue;
22503
- const key = property.key.type === AST_NODE_TYPES100.Identifier ? property.key.name : property.key.type === AST_NODE_TYPES100.Literal ? String(property.key.value) : "";
22629
+ if (property.type !== AST_NODE_TYPES101.Property || property.value.type !== AST_NODE_TYPES101.Identifier) continue;
22630
+ const key = property.key.type === AST_NODE_TYPES101.Identifier ? property.key.name : property.key.type === AST_NODE_TYPES101.Literal ? String(property.key.value) : "";
22504
22631
  if (FS_READERS.has(key)) declare(property.value, { fsReader: true });
22505
22632
  }
22506
22633
  }
@@ -22509,8 +22636,8 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
22509
22636
  const source = importSource(node);
22510
22637
  if (source === null || !FS_MODULES.has(source)) return;
22511
22638
  for (const specifier of node.specifiers) {
22512
- if (specifier.type === AST_NODE_TYPES100.ImportSpecifier) {
22513
- const imported = specifier.imported.type === AST_NODE_TYPES100.Identifier ? specifier.imported.name : String(specifier.imported.value);
22639
+ if (specifier.type === AST_NODE_TYPES101.ImportSpecifier) {
22640
+ const imported = specifier.imported.type === AST_NODE_TYPES101.Identifier ? specifier.imported.name : String(specifier.imported.value);
22514
22641
  if (FS_READERS.has(imported)) declare(specifier.local, { fsReader: true });
22515
22642
  } else {
22516
22643
  declare(specifier.local, { fsObject: true });
@@ -22523,26 +22650,26 @@ function createSourceCoupledRule(name, documentation, sourceSuffixRe) {
22523
22650
  if (node.init === null) return;
22524
22651
  const required = requireSource(node.init);
22525
22652
  const initializer = unwrap7(node.init);
22526
- if (required !== null && initializer.type === AST_NODE_TYPES100.CallExpression && initializer.callee.type === AST_NODE_TYPES100.Identifier && (bindingOf(initializer.callee)?.defs.length ?? 0) > 0) return;
22527
- if (required !== null && FS_MODULES.has(required) && node.id.type === AST_NODE_TYPES100.Identifier) {
22653
+ if (required !== null && initializer.type === AST_NODE_TYPES101.CallExpression && initializer.callee.type === AST_NODE_TYPES101.Identifier && (bindingOf(initializer.callee)?.defs.length ?? 0) > 0) return;
22654
+ if (required !== null && FS_MODULES.has(required) && node.id.type === AST_NODE_TYPES101.Identifier) {
22528
22655
  declare(node.id, { fsObject: true });
22529
22656
  return;
22530
22657
  }
22531
- if (node.id.type === AST_NODE_TYPES100.ObjectPattern && required !== null && FS_MODULES.has(required)) {
22658
+ if (node.id.type === AST_NODE_TYPES101.ObjectPattern && required !== null && FS_MODULES.has(required)) {
22532
22659
  declareFsReaders(node.id);
22533
22660
  return;
22534
22661
  }
22535
- if (node.id.type !== AST_NODE_TYPES100.Identifier) return;
22662
+ if (node.id.type !== AST_NODE_TYPES101.Identifier) return;
22536
22663
  declare(node.id, { collection: sourceCollection(node.init), path: sourcePath(node.init), rawOrigins: rawOrigins(node.init) });
22537
22664
  },
22538
22665
  AssignmentExpression(node) {
22539
- if (node.left.type === AST_NODE_TYPES100.Identifier) declare(node.left, {});
22666
+ if (node.left.type === AST_NODE_TYPES101.Identifier) declare(node.left, {});
22540
22667
  },
22541
22668
  ForOfStatement(node) {
22542
22669
  const right = unwrap7(node.right);
22543
- const collection = right.type === AST_NODE_TYPES100.Identifier && visible("collections", right);
22544
- const left = node.left.type === AST_NODE_TYPES100.VariableDeclaration ? node.left.declarations[0]?.id : node.left;
22545
- if (collection && left?.type === AST_NODE_TYPES100.Identifier) declare(left, { path: true });
22670
+ const collection = right.type === AST_NODE_TYPES101.Identifier && visible("collections", right);
22671
+ const left = node.left.type === AST_NODE_TYPES101.VariableDeclaration ? node.left.declarations[0]?.id : node.left;
22672
+ if (collection && left?.type === AST_NODE_TYPES101.Identifier) declare(left, { path: true });
22546
22673
  },
22547
22674
  CallExpression(node) {
22548
22675
  const origins = rawAssertionOrigins(node);
@@ -22560,22 +22687,22 @@ var source_coupled_test_default = createSourceCoupledRule(
22560
22687
  GENERAL_SOURCE_SUFFIX_RE
22561
22688
  );
22562
22689
  function importedAssertionKind(specifier) {
22563
- if (specifier.type !== AST_NODE_TYPES100.ImportSpecifier && specifier.type !== AST_NODE_TYPES100.ImportDefaultSpecifier && specifier.type !== AST_NODE_TYPES100.ImportNamespaceSpecifier || specifier.parent.type !== AST_NODE_TYPES100.ImportDeclaration) return null;
22690
+ if (specifier.type !== AST_NODE_TYPES101.ImportSpecifier && specifier.type !== AST_NODE_TYPES101.ImportDefaultSpecifier && specifier.type !== AST_NODE_TYPES101.ImportNamespaceSpecifier || specifier.parent.type !== AST_NODE_TYPES101.ImportDeclaration) return null;
22564
22691
  const source = importSource(specifier.parent);
22565
22692
  if (source !== null && ASSERT_MODULES.has(source)) {
22566
- if (specifier.type !== AST_NODE_TYPES100.ImportSpecifier) return "assert";
22567
- const imported2 = specifier.imported.type === AST_NODE_TYPES100.Identifier ? specifier.imported.name : String(specifier.imported.value);
22693
+ if (specifier.type !== AST_NODE_TYPES101.ImportSpecifier) return "assert";
22694
+ const imported2 = specifier.imported.type === AST_NODE_TYPES101.Identifier ? specifier.imported.name : String(specifier.imported.value);
22568
22695
  if (imported2 === "strict" || ASSERT_MATCHERS.has(imported2)) return "assert";
22569
22696
  return null;
22570
22697
  }
22571
- if (source === null || !EXPECT_MODULES.has(source) || specifier.type !== AST_NODE_TYPES100.ImportSpecifier) return null;
22572
- const imported = specifier.imported.type === AST_NODE_TYPES100.Identifier ? specifier.imported.name : String(specifier.imported.value);
22698
+ if (source === null || !EXPECT_MODULES.has(source) || specifier.type !== AST_NODE_TYPES101.ImportSpecifier) return null;
22699
+ const imported = specifier.imported.type === AST_NODE_TYPES101.Identifier ? specifier.imported.name : String(specifier.imported.value);
22573
22700
  if (imported === "assert" || imported === "expect") return imported;
22574
22701
  return null;
22575
22702
  }
22576
22703
 
22577
22704
  // src/rules/sole-export-matches-filename.ts
22578
- import { AST_NODE_TYPES as AST_NODE_TYPES101 } from "@typescript-eslint/utils";
22705
+ import { AST_NODE_TYPES as AST_NODE_TYPES102 } from "@typescript-eslint/utils";
22579
22706
  var SOLE_EXPORT_MATCHES_FILENAME_DOCUMENTATION = {
22580
22707
  defaultLevel: "warning",
22581
22708
  summary: "Make a module filename reflect its sole named public runtime export.",
@@ -22656,10 +22783,10 @@ function reflectsExportName(fileStem, exportedStem) {
22656
22783
  function declarationExport(statement) {
22657
22784
  const declaration = statement.declaration;
22658
22785
  if (declaration === null || declaration.declare === true) return [];
22659
- if (declaration.type === AST_NODE_TYPES101.ClassDeclaration || declaration.type === AST_NODE_TYPES101.FunctionDeclaration || declaration.type === AST_NODE_TYPES101.TSEnumDeclaration) return declaration.id === null ? [] : [{ name: declaration.id.name, node: declaration }];
22660
- if (declaration.type !== AST_NODE_TYPES101.VariableDeclaration) return [];
22786
+ if (declaration.type === AST_NODE_TYPES102.ClassDeclaration || declaration.type === AST_NODE_TYPES102.FunctionDeclaration || declaration.type === AST_NODE_TYPES102.TSEnumDeclaration) return declaration.id === null ? [] : [{ name: declaration.id.name, node: declaration }];
22787
+ if (declaration.type !== AST_NODE_TYPES102.VariableDeclaration) return [];
22661
22788
  return declaration.declarations.flatMap(
22662
- (item) => item.id.type === AST_NODE_TYPES101.Identifier ? [{ name: item.id.name, node: item }] : []
22789
+ (item) => item.id.type === AST_NODE_TYPES102.Identifier ? [{ name: item.id.name, node: item }] : []
22663
22790
  );
22664
22791
  }
22665
22792
  var sole_export_matches_filename_default = createRule({
@@ -22683,29 +22810,29 @@ var sole_export_matches_filename_default = createRule({
22683
22810
  const exports = [];
22684
22811
  const publicExports = /* @__PURE__ */ new Set();
22685
22812
  function collectPublicExport(statement) {
22686
- if (statement.type === AST_NODE_TYPES101.ExportAllDeclaration || statement.type === AST_NODE_TYPES101.ExportNamedDeclaration && statement.source !== null) return false;
22687
- if (statement.type === AST_NODE_TYPES101.ExportDefaultDeclaration) {
22813
+ if (statement.type === AST_NODE_TYPES102.ExportAllDeclaration || statement.type === AST_NODE_TYPES102.ExportNamedDeclaration && statement.source !== null) return false;
22814
+ if (statement.type === AST_NODE_TYPES102.ExportDefaultDeclaration) {
22688
22815
  publicExports.add("default");
22689
22816
  const declaration = statement.declaration;
22690
- if ((declaration.type === AST_NODE_TYPES101.ClassDeclaration || declaration.type === AST_NODE_TYPES101.FunctionDeclaration) && declaration.id !== null) exports.push({ name: declaration.id.name, node: declaration });
22817
+ if ((declaration.type === AST_NODE_TYPES102.ClassDeclaration || declaration.type === AST_NODE_TYPES102.FunctionDeclaration) && declaration.id !== null) exports.push({ name: declaration.id.name, node: declaration });
22691
22818
  else return false;
22692
22819
  }
22693
- if (statement.type !== AST_NODE_TYPES101.ExportNamedDeclaration) return true;
22820
+ if (statement.type !== AST_NODE_TYPES102.ExportNamedDeclaration) return true;
22694
22821
  return collectNamedExport(statement);
22695
22822
  }
22696
22823
  function collectNamedExport(statement) {
22697
22824
  const declaration = statement.declaration;
22698
- if (declaration !== null && "id" in declaration && declaration.id?.type === AST_NODE_TYPES101.Identifier) {
22825
+ if (declaration !== null && "id" in declaration && declaration.id?.type === AST_NODE_TYPES102.Identifier) {
22699
22826
  publicExports.add(declaration.id.name);
22700
22827
  }
22701
- if (declaration?.type === AST_NODE_TYPES101.VariableDeclaration) {
22702
- if (declaration.declarations.some((item) => item.id.type !== AST_NODE_TYPES101.Identifier)) return false;
22828
+ if (declaration?.type === AST_NODE_TYPES102.VariableDeclaration) {
22829
+ if (declaration.declarations.some((item) => item.id.type !== AST_NODE_TYPES102.Identifier)) return false;
22703
22830
  for (const item of declaration.declarations) {
22704
- if (item.id.type === AST_NODE_TYPES101.Identifier) publicExports.add(item.id.name);
22831
+ if (item.id.type === AST_NODE_TYPES102.Identifier) publicExports.add(item.id.name);
22705
22832
  }
22706
22833
  }
22707
22834
  for (const specifier of statement.specifiers) {
22708
- const exported = specifier.exported.type === AST_NODE_TYPES101.Identifier ? specifier.exported.name : specifier.exported.value;
22835
+ const exported = specifier.exported.type === AST_NODE_TYPES102.Identifier ? specifier.exported.name : specifier.exported.value;
22709
22836
  publicExports.add(String(exported));
22710
22837
  }
22711
22838
  if (statement.exportKind === "type") return true;
@@ -22715,7 +22842,7 @@ var sole_export_matches_filename_default = createRule({
22715
22842
  }
22716
22843
  function collectRuntimeSpecifiers(statement) {
22717
22844
  for (const specifier of statement.specifiers) {
22718
- const exported = specifier.exported.type === AST_NODE_TYPES101.Identifier ? specifier.exported.name : specifier.exported.value;
22845
+ const exported = specifier.exported.type === AST_NODE_TYPES102.Identifier ? specifier.exported.name : specifier.exported.value;
22719
22846
  publicExports.add(String(exported));
22720
22847
  if (specifier.exportKind === "type") continue;
22721
22848
  if (exported === "default") exports.push({ name: specifier.local.name, node: specifier });
@@ -22730,7 +22857,7 @@ var sole_export_matches_filename_default = createRule({
22730
22857
  const only = [...unique.values()][0];
22731
22858
  if (only === void 0) return;
22732
22859
  if (only.name === "onRouterTransitionStart" && /(?:^|\/)instrumentation-client\.[jt]s$/u.test(normalizedFilename)) return;
22733
- if (only.name === "collections" && /(?:^|\/)src\/content\.config\.(?:ts|js|mjs)$/u.test(normalizedFilename) && program.body.some((statement) => statement.type === AST_NODE_TYPES101.ImportDeclaration && statement.source.value === "astro:content")) return;
22860
+ if (only.name === "collections" && /(?:^|\/)src\/content\.config\.(?:ts|js|mjs)$/u.test(normalizedFilename) && program.body.some((statement) => statement.type === AST_NODE_TYPES102.ImportDeclaration && statement.source.value === "astro:content")) return;
22734
22861
  const exportedStem = kebabCase(only.name);
22735
22862
  if (exportedStem === "") return;
22736
22863
  const expected = `${fileStem.startsWith("_") ? "_" : ""}${exportedStem}`;
@@ -22781,8 +22908,8 @@ var iac_source_coupled_test_default = createSourceCoupledRule(
22781
22908
 
22782
22909
  // src/rules/require-pascal-case-zod-schema-name.ts
22783
22910
  import {
22784
- AST_NODE_TYPES as AST_NODE_TYPES102,
22785
- ASTUtils as ASTUtils52
22911
+ AST_NODE_TYPES as AST_NODE_TYPES103,
22912
+ ASTUtils as ASTUtils53
22786
22913
  } from "@typescript-eslint/utils";
22787
22914
  var REQUIRE_PASCAL_CASE_ZOD_SCHEMA_NAME_DOCUMENTATION = {
22788
22915
  summary: "Require confirmed module-level Zod schema contracts to use PascalCase with a `Schema` suffix.",
@@ -22915,18 +23042,18 @@ var SCHEMA_RETURNING_METHODS = /* @__PURE__ */ new Set([
22915
23042
  "superRefine",
22916
23043
  "transform"
22917
23044
  ]);
22918
- var terminalMethodName = (callee) => !callee.computed && callee.property.type === AST_NODE_TYPES102.Identifier ? callee.property.name : null;
23045
+ var terminalMethodName = (callee) => !callee.computed && callee.property.type === AST_NODE_TYPES103.Identifier ? callee.property.name : null;
22919
23046
  var calleeChainRoot2 = (node) => {
22920
23047
  let current = node;
22921
23048
  for (; ; ) {
22922
- if (current.type === AST_NODE_TYPES102.Identifier) {
23049
+ if (current.type === AST_NODE_TYPES103.Identifier) {
22923
23050
  return current;
22924
23051
  }
22925
- if (current.type === AST_NODE_TYPES102.MemberExpression) {
23052
+ if (current.type === AST_NODE_TYPES103.MemberExpression) {
22926
23053
  current = current.object;
22927
23054
  continue;
22928
23055
  }
22929
- if (current.type === AST_NODE_TYPES102.CallExpression) {
23056
+ if (current.type === AST_NODE_TYPES103.CallExpression) {
22930
23057
  current = current.callee;
22931
23058
  continue;
22932
23059
  }
@@ -22937,13 +23064,13 @@ var chainMemberNames2 = (node) => {
22937
23064
  const names = [];
22938
23065
  let current = node;
22939
23066
  for (; ; ) {
22940
- if (current.type === AST_NODE_TYPES102.MemberExpression) {
22941
- if (current.computed || current.property.type !== AST_NODE_TYPES102.Identifier) return [];
23067
+ if (current.type === AST_NODE_TYPES103.MemberExpression) {
23068
+ if (current.computed || current.property.type !== AST_NODE_TYPES103.Identifier) return [];
22942
23069
  names.push(current.property.name);
22943
23070
  current = current.object;
22944
23071
  continue;
22945
23072
  }
22946
- if (current.type === AST_NODE_TYPES102.CallExpression) {
23073
+ if (current.type === AST_NODE_TYPES103.CallExpression) {
22947
23074
  current = current.callee;
22948
23075
  continue;
22949
23076
  }
@@ -22954,16 +23081,16 @@ var chainMemberNames2 = (node) => {
22954
23081
  };
22955
23082
  var unwrapExpression7 = (node) => {
22956
23083
  let current = node;
22957
- while (current.type === AST_NODE_TYPES102.TSAsExpression || current.type === AST_NODE_TYPES102.TSSatisfiesExpression || current.type === AST_NODE_TYPES102.TSNonNullExpression || current.type === AST_NODE_TYPES102.TSTypeAssertion) {
23084
+ while (current.type === AST_NODE_TYPES103.TSAsExpression || current.type === AST_NODE_TYPES103.TSSatisfiesExpression || current.type === AST_NODE_TYPES103.TSNonNullExpression || current.type === AST_NODE_TYPES103.TSTypeAssertion) {
22958
23085
  current = current.expression;
22959
23086
  }
22960
23087
  return current;
22961
23088
  };
22962
23089
  var isModuleDeclarator = (node) => {
22963
23090
  const declaration = node.parent;
22964
- if (declaration.type !== AST_NODE_TYPES102.VariableDeclaration) return false;
23091
+ if (declaration.type !== AST_NODE_TYPES103.VariableDeclaration) return false;
22965
23092
  const owner = declaration.parent;
22966
- return owner.type === AST_NODE_TYPES102.Program || owner.type === AST_NODE_TYPES102.ExportNamedDeclaration && owner.parent.type === AST_NODE_TYPES102.Program;
23093
+ return owner.type === AST_NODE_TYPES103.Program || owner.type === AST_NODE_TYPES103.ExportNamedDeclaration && owner.parent.type === AST_NODE_TYPES103.Program;
22967
23094
  };
22968
23095
  var require_pascal_case_zod_schema_name_default = createRule({
22969
23096
  name: "require-pascal-case-zod-schema-name",
@@ -22983,7 +23110,7 @@ var require_pascal_case_zod_schema_name_default = createRule({
22983
23110
  const zodBindings = /* @__PURE__ */ new Set();
22984
23111
  const schemaBindings = /* @__PURE__ */ new Set();
22985
23112
  function resolvedBinding(identifier) {
22986
- return ASTUtils52.findVariable(
23113
+ return ASTUtils53.findVariable(
22987
23114
  context.sourceCode.getScope(identifier),
22988
23115
  identifier.name
22989
23116
  );
@@ -23004,8 +23131,8 @@ var require_pascal_case_zod_schema_name_default = createRule({
23004
23131
  }
23005
23132
  function isConfirmedSchema(expression) {
23006
23133
  const init = unwrapExpression7(expression);
23007
- if (init.type === AST_NODE_TYPES102.Identifier) return isSchemaBinding(init);
23008
- if (init.type !== AST_NODE_TYPES102.CallExpression || init.callee.type !== AST_NODE_TYPES102.MemberExpression) {
23134
+ if (init.type === AST_NODE_TYPES103.Identifier) return isSchemaBinding(init);
23135
+ if (init.type !== AST_NODE_TYPES103.CallExpression || init.callee.type !== AST_NODE_TYPES103.MemberExpression) {
23009
23136
  return false;
23010
23137
  }
23011
23138
  const terminal = terminalMethodName(init.callee);
@@ -23025,7 +23152,7 @@ var require_pascal_case_zod_schema_name_default = createRule({
23025
23152
  ImportDeclaration(node) {
23026
23153
  if (!isZodModule(node.source.value)) return;
23027
23154
  for (const specifier of node.specifiers) {
23028
- if (specifier.type === AST_NODE_TYPES102.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES102.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES102.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES102.Identifier ? specifier.imported.name === "z" : specifier.imported.value === "z")) {
23155
+ if (specifier.type === AST_NODE_TYPES103.ImportNamespaceSpecifier || specifier.type === AST_NODE_TYPES103.ImportDefaultSpecifier || specifier.type === AST_NODE_TYPES103.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES103.Identifier ? specifier.imported.name === "z" : specifier.imported.value === "z")) {
23029
23156
  recordZodBinding(specifier.local);
23030
23157
  }
23031
23158
  }
@@ -23034,7 +23161,7 @@ var require_pascal_case_zod_schema_name_default = createRule({
23034
23161
  if (!isModuleDeclarator(node)) return;
23035
23162
  const init = node.init;
23036
23163
  if (init === null || init === void 0) return;
23037
- if (node.id.type !== AST_NODE_TYPES102.Identifier) return;
23164
+ if (node.id.type !== AST_NODE_TYPES103.Identifier) return;
23038
23165
  if (!isConfirmedSchema(init)) return;
23039
23166
  const binding = resolvedBinding(node.id);
23040
23167
  if (binding !== null) schemaBindings.add(binding);
@@ -23217,6 +23344,7 @@ var RULES = {
23217
23344
  "prefer-module-level-refined-schema": prefer_module_level_refined_schema_default,
23218
23345
  "prefer-multi-value-zod-literal": prefer_multi_value_zod_literal_default,
23219
23346
  "prefer-named-callback-domain": prefer_named_callback_domain_default,
23347
+ "prefer-nominal-id-types": prefer_nominal_id_types_default,
23220
23348
  "prefer-named-complex-return-type": prefer_named_complex_return_type_default,
23221
23349
  "prefer-native-random-uuid": prefer_native_random_uuid_default,
23222
23350
  "prefer-node-crypto-hash": prefer_node_crypto_hash_default,
@@ -23248,7 +23376,7 @@ var RULES = {
23248
23376
  };
23249
23377
  var meta = {
23250
23378
  name: "@sarj/eslint-plugin",
23251
- version: "15.27.0"
23379
+ version: "15.28.1"
23252
23380
  };
23253
23381
  var APPLICATION_ONLY_RULES = [];
23254
23382
  var LIBRARY_IMPORT_POLICY = ["error", {
@@ -23267,6 +23395,7 @@ var ADVISORY_RULES = [
23267
23395
  "@sarj/prefer-named-complex-return-type",
23268
23396
  "@sarj/prefer-node-crypto-hash",
23269
23397
  "@sarj/prefer-node-fs-promises",
23398
+ "@sarj/prefer-nominal-id-types",
23270
23399
  "@sarj/prefer-shared-zod-enum",
23271
23400
  "@sarj/prefer-switch-for-repeated-equality",
23272
23401
  "@sarj/prefer-whole-object-assertion",
@@ -23357,6 +23486,7 @@ var RECOMMENDED_RULES = {
23357
23486
  "@sarj/prefer-module-level-refined-schema": "warn",
23358
23487
  "@sarj/prefer-multi-value-zod-literal": ["warn", { zodMajorVersion: 4 }],
23359
23488
  "@sarj/prefer-named-callback-domain": "error",
23489
+ "@sarj/prefer-nominal-id-types": "warn",
23360
23490
  "@sarj/prefer-named-complex-return-type": "warn",
23361
23491
  "@sarj/prefer-node-crypto-hash": "warn",
23362
23492
  "@sarj/prefer-node-fs-promises": "warn",
@@ -23474,6 +23604,7 @@ var STRICT_RULES = {
23474
23604
  "@sarj/prefer-module-level-refined-schema": "warn",
23475
23605
  "@sarj/prefer-multi-value-zod-literal": ["warn", { zodMajorVersion: 4 }],
23476
23606
  "@sarj/prefer-named-callback-domain": "error",
23607
+ "@sarj/prefer-nominal-id-types": "warn",
23477
23608
  "@sarj/prefer-named-complex-return-type": "warn",
23478
23609
  "@sarj/prefer-node-crypto-hash": "warn",
23479
23610
  "@sarj/prefer-node-fs-promises": "warn",