@sarj/eslint-plugin 16.2.6 → 16.3.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.cjs CHANGED
@@ -2506,7 +2506,7 @@ var no_unlocalized_toast_default = createRule({
2506
2506
  return {
2507
2507
  CallExpression(node) {
2508
2508
  const callee = node.callee;
2509
- const receiver = callee.type === import_utils16.AST_NODE_TYPES.Identifier ? callee : callee.type === import_utils16.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils16.AST_NODE_TYPES.Identifier && callee.property.type === import_utils16.AST_NODE_TYPES.Identifier && methods.includes(callee.property.name) ? callee.object : null;
2509
+ const receiver = callee.type === import_utils16.AST_NODE_TYPES.Identifier ? callee : callee.type === import_utils16.AST_NODE_TYPES.MemberExpression && callee.object.type === import_utils16.AST_NODE_TYPES.Identifier && import_utils16.ASTUtils.getPropertyName(callee) !== null && methods.includes(import_utils16.ASTUtils.getPropertyName(callee) ?? "") ? callee.object : null;
2510
2510
  if (receiver === null) return;
2511
2511
  const imported = importedComponent(receiver, context.sourceCode);
2512
2512
  if (!functions.some(
@@ -4753,12 +4753,12 @@ function importedName(node) {
4753
4753
  return node.imported.type === import_utils27.AST_NODE_TYPES.Identifier ? node.imported.name : String(node.imported.value);
4754
4754
  }
4755
4755
  function registration(sourceCode, node) {
4756
- if (node.callee.type !== import_utils27.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils27.AST_NODE_TYPES.Identifier || !isUnshadowedGlobal(sourceCode, node.callee.object) || node.callee.property.type !== import_utils27.AST_NODE_TYPES.Identifier || node.callee.property.name !== "addEventListener" && node.callee.property.name !== "removeEventListener" || node.arguments.length < 2) return null;
4756
+ if (node.callee.type !== import_utils27.AST_NODE_TYPES.MemberExpression || node.callee.object.type !== import_utils27.AST_NODE_TYPES.Identifier || !isUnshadowedGlobal(sourceCode, node.callee.object) || import_utils27.ASTUtils.getPropertyName(node.callee) === null || (import_utils27.ASTUtils.getPropertyName(node.callee) ?? "") !== "addEventListener" && (import_utils27.ASTUtils.getPropertyName(node.callee) ?? "") !== "removeEventListener" || node.arguments.length < 2) return null;
4757
4757
  const event = node.arguments[0];
4758
4758
  const callback = node.arguments[1];
4759
4759
  if (event === void 0 || callback === void 0) return null;
4760
4760
  if (event.type !== import_utils27.AST_NODE_TYPES.Literal || typeof event.value !== "string" || callback.type !== import_utils27.AST_NODE_TYPES.Identifier) return null;
4761
- const operation = node.callee.property.name === "addEventListener" ? "add" : "remove";
4761
+ const operation = (import_utils27.ASTUtils.getPropertyName(node.callee) ?? "") === "addEventListener" ? "add" : "remove";
4762
4762
  if (node.callee.object.name === "window" && event.value === "focus") return { operation, event: "focus", callback };
4763
4763
  if (node.callee.object.name === "document" && event.value === "visibilitychange") return { operation, event: "visibilitychange", callback };
4764
4764
  return null;
@@ -4838,7 +4838,7 @@ var no_duplicate_lifecycle_refresh_listeners_default = createRule({
4838
4838
  registrations.set(container, callbacks);
4839
4839
  }
4840
4840
  }
4841
- if (node.callee.type !== import_utils27.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils27.AST_NODE_TYPES.Identifier || node.callee.property.type !== import_utils27.AST_NODE_TYPES.Identifier || node.callee.property.name !== "refresh") return;
4841
+ if (node.callee.type !== import_utils27.AST_NODE_TYPES.MemberExpression || node.callee.object.type !== import_utils27.AST_NODE_TYPES.Identifier || import_utils27.ASTUtils.getPropertyName(node.callee) === null || (import_utils27.ASTUtils.getPropertyName(node.callee) ?? "") !== "refresh") return;
4842
4842
  const router = import_utils27.ASTUtils.findVariable(context.sourceCode.getScope(node.callee.object), node.callee.object.name);
4843
4843
  if (router === null || !routers.has(router)) return;
4844
4844
  const fn = enclosingFunction(context.sourceCode, node);
@@ -5214,8 +5214,8 @@ function isStaticFragment(expression) {
5214
5214
  if (expression.type === import_utils30.AST_NODE_TYPES.Identifier) {
5215
5215
  return CONSTANT_CASE_RE.test(expression.name);
5216
5216
  }
5217
- if (expression.type === import_utils30.AST_NODE_TYPES.MemberExpression && !expression.computed && expression.property.type === import_utils30.AST_NODE_TYPES.Identifier) {
5218
- return CONSTANT_CASE_RE.test(expression.property.name);
5217
+ if (expression.type === import_utils30.AST_NODE_TYPES.MemberExpression && import_utils30.ASTUtils.getPropertyName(expression) !== null) {
5218
+ return CONSTANT_CASE_RE.test(import_utils30.ASTUtils.getPropertyName(expression) ?? "");
5219
5219
  }
5220
5220
  if (expression.type === import_utils30.AST_NODE_TYPES.Literal) {
5221
5221
  return typeof expression.value === "string";
@@ -5314,10 +5314,10 @@ function staticStatementText(node) {
5314
5314
  }
5315
5315
  function statementMethodName(node, methods) {
5316
5316
  const callee = node.callee;
5317
- if (callee.type !== import_utils30.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils30.AST_NODE_TYPES.Identifier) {
5317
+ if (callee.type !== import_utils30.AST_NODE_TYPES.MemberExpression || import_utils30.ASTUtils.getPropertyName(callee) === null) {
5318
5318
  return null;
5319
5319
  }
5320
- const name = callee.property.name;
5320
+ const name = import_utils30.ASTUtils.getPropertyName(callee) ?? "";
5321
5321
  return methods.has(name) ? name : null;
5322
5322
  }
5323
5323
  var no_dynamic_sql_default = createRule({
@@ -6420,11 +6420,11 @@ function isMathRandomCall(node) {
6420
6420
  return false;
6421
6421
  }
6422
6422
  const callee = node.callee;
6423
- if (callee.type !== "MemberExpression" || callee.computed) {
6423
+ if (callee.type !== "MemberExpression") {
6424
6424
  return false;
6425
6425
  }
6426
- const { object, property } = callee;
6427
- return object.type === "Identifier" && object.name === "Math" && property.type === "Identifier" && property.name === "random";
6426
+ const { object } = callee;
6427
+ return object.type === "Identifier" && object.name === "Math" && import_utils36.ASTUtils.getPropertyName(callee) === "random";
6428
6428
  }
6429
6429
  function findEnclosingNames(node) {
6430
6430
  const names = [];
@@ -6489,7 +6489,7 @@ function climbValueChain(node) {
6489
6489
  let current = node;
6490
6490
  let parent = current.parent;
6491
6491
  while (parent) {
6492
- if (parent.type === "MemberExpression" && parent.object === current && !parent.computed) {
6492
+ if (parent.type === "MemberExpression" && parent.object === current && import_utils36.ASTUtils.getPropertyName(parent) !== null) {
6493
6493
  current = parent;
6494
6494
  parent = current.parent;
6495
6495
  continue;
@@ -6565,8 +6565,8 @@ function appendPropertyName(property, names) {
6565
6565
  }
6566
6566
  function appendAssignedName(assignment, directBinding, names) {
6567
6567
  if (directBinding && assignment.left.type === "Identifier") names.push(assignment.left.name);
6568
- if (directBinding && assignment.left.type === "MemberExpression" && !assignment.left.computed && assignment.left.property.type === "Identifier") {
6569
- names.push(assignment.left.property.name);
6568
+ if (directBinding && assignment.left.type === "MemberExpression" && import_utils36.ASTUtils.getPropertyName(assignment.left) !== null) {
6569
+ names.push(import_utils36.ASTUtils.getPropertyName(assignment.left) ?? "");
6570
6570
  }
6571
6571
  }
6572
6572
  function appendDirectBindingName(id, directBinding, names) {
@@ -6857,7 +6857,7 @@ function nodeWithin(node, container) {
6857
6857
  return container !== null && node.range[0] >= container.range[0] && node.range[1] <= container.range[1];
6858
6858
  }
6859
6859
  function isJsonStringify(callee) {
6860
- return callee.type === "MemberExpression" && !callee.computed && callee.object.type === "Identifier" && callee.object.name === "JSON" && callee.property.type === "Identifier" && callee.property.name === "stringify";
6860
+ return callee.type === "MemberExpression" && callee.object.type === "Identifier" && callee.object.name === "JSON" && import_utils38.ASTUtils.getPropertyName(callee) !== null && (import_utils38.ASTUtils.getPropertyName(callee) ?? "") === "stringify";
6861
6861
  }
6862
6862
  function directLiteralValues(argument) {
6863
6863
  if (argument.type === "ObjectExpression") {
@@ -6887,7 +6887,7 @@ function expressionSuggestsError(expression, scope) {
6887
6887
  return expression.type === "MemberExpression" && memberSuggestsError(expression, scope);
6888
6888
  }
6889
6889
  function memberSuggestsError(member, scope) {
6890
- const propName2 = !member.computed && member.property.type === "Identifier" ? member.property.name : null;
6890
+ const propName2 = import_utils38.ASTUtils.getPropertyName(member) !== null ? import_utils38.ASTUtils.getPropertyName(member) ?? "" : null;
6891
6891
  const base = member.object;
6892
6892
  const baseSuggestsError = base.type === "Identifier" && identifierIsProvenError(base, scope);
6893
6893
  if (baseSuggestsError) {
@@ -7811,8 +7811,8 @@ function calleeName2(callee) {
7811
7811
  if (callee.type === "Identifier") {
7812
7812
  return callee.name;
7813
7813
  }
7814
- if (callee.type === "MemberExpression" && !callee.computed && callee.property.type === "Identifier") {
7815
- return callee.property.name;
7814
+ if (callee.type === "MemberExpression" && import_utils45.ASTUtils.getPropertyName(callee) !== null) {
7815
+ return import_utils45.ASTUtils.getPropertyName(callee) ?? "";
7816
7816
  }
7817
7817
  return null;
7818
7818
  }
@@ -7827,9 +7827,10 @@ function createLogMatcher(options = {}) {
7827
7827
  case "Identifier":
7828
7828
  return loggerNames.has(expr.name.toLowerCase());
7829
7829
  case "MemberExpression": {
7830
- const { property, object } = expr;
7831
- if (!expr.computed && property.type === "Identifier") {
7832
- const lowered = property.name.toLowerCase();
7830
+ const { object } = expr;
7831
+ const property = import_utils45.ASTUtils.getPropertyName(expr);
7832
+ if (property !== null) {
7833
+ const lowered = property.toLowerCase();
7833
7834
  if (loggerNames.has(lowered) || LOGGER_FACTORIES.has(lowered)) {
7834
7835
  return true;
7835
7836
  }
@@ -7838,7 +7839,7 @@ function createLogMatcher(options = {}) {
7838
7839
  }
7839
7840
  case "CallExpression": {
7840
7841
  const callee = expr.callee;
7841
- if (callee.type === "MemberExpression" && !callee.computed && callee.property.type === "Identifier" && LOGGER_FACTORIES.has(callee.property.name.toLowerCase())) {
7842
+ if (callee.type === "MemberExpression" && import_utils45.ASTUtils.getPropertyName(callee) !== null && LOGGER_FACTORIES.has((import_utils45.ASTUtils.getPropertyName(callee) ?? "").toLowerCase())) {
7842
7843
  return true;
7843
7844
  }
7844
7845
  if (callee.type !== "Super") {
@@ -7865,10 +7866,10 @@ function createLogMatcher(options = {}) {
7865
7866
  return true;
7866
7867
  }
7867
7868
  const callee = expr.callee;
7868
- if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier") {
7869
+ if (callee.type !== "MemberExpression" || import_utils45.ASTUtils.getPropertyName(callee) === null) {
7869
7870
  return false;
7870
7871
  }
7871
- if (!LOG_METHODS.has(callee.property.name.toLowerCase())) {
7872
+ if (!LOG_METHODS.has((import_utils45.ASTUtils.getPropertyName(callee) ?? "").toLowerCase())) {
7872
7873
  return false;
7873
7874
  }
7874
7875
  return isLoggerReceiver(callee.object);
@@ -8269,10 +8270,10 @@ function memberName5(node) {
8269
8270
  while (current.type === import_utils48.AST_NODE_TYPES.TSAsExpression || current.type === import_utils48.AST_NODE_TYPES.TSNonNullExpression || current.type === import_utils48.AST_NODE_TYPES.TSTypeAssertion) {
8270
8271
  current = current.expression;
8271
8272
  }
8272
- if (current.type !== import_utils48.AST_NODE_TYPES.MemberExpression || current.computed || current.property.type !== import_utils48.AST_NODE_TYPES.Identifier) {
8273
+ if (current.type !== import_utils48.AST_NODE_TYPES.MemberExpression || import_utils48.ASTUtils.getPropertyName(current) === null) {
8273
8274
  return null;
8274
8275
  }
8275
- return current.property.name;
8276
+ return import_utils48.ASTUtils.getPropertyName(current) ?? "";
8276
8277
  }
8277
8278
  function isDirectCaseTranslation(left, right) {
8278
8279
  if (SNAKE_CASE_RE2.test(left) && LOWER_CAMEL_CASE_RE.test(right)) {
@@ -9229,11 +9230,16 @@ var NO_RAW_ENV_DOCUMENTATION = {
9229
9230
  };
9230
9231
  var CONFIG_FILE_RE = /(^|[\\/])[\w.-]+\.config\.[cm]?[jt]sx?$/;
9231
9232
  var ENV_BOUNDARY_FILE_RE = /(^|[\\/])(?:env|client-env|server-env|client-settings|server-settings)\.[cm]?[jt]sx?$/;
9232
- function isProcessEnv(node) {
9233
- return !node.computed && node.object.type === "Identifier" && node.object.name === "process" && node.property.type === "Identifier" && node.property.name === "env";
9233
+ function isProcessEnv(node, context) {
9234
+ if (node.object.type !== "Identifier" || import_utils53.ASTUtils.getPropertyName(node) !== "env") return false;
9235
+ const binding = import_utils53.ASTUtils.findVariable(context.sourceCode.getScope(node.object), node.object.name);
9236
+ if (binding === null || binding.defs.length === 0) return node.object.name === "process";
9237
+ return binding.defs.every(
9238
+ (definition) => definition.type === "ImportBinding" && definition.parent.type === "ImportDeclaration" && definition.parent.importKind !== "type" && ["node:process", "process"].includes(definition.parent.source.value) && ["ImportDefaultSpecifier", "ImportNamespaceSpecifier"].includes(definition.node.type)
9239
+ );
9234
9240
  }
9235
9241
  function isImportMetaEnv(node) {
9236
- return !node.computed && node.property.type === "Identifier" && node.property.name === "env" && node.object.type === "MetaProperty" && node.object.meta.name === "import" && node.object.property.name === "meta";
9242
+ return import_utils53.ASTUtils.getPropertyName(node) !== null && (import_utils53.ASTUtils.getPropertyName(node) ?? "") === "env" && node.object.type === "MetaProperty" && node.object.meta.name === "import" && node.object.property.name === "meta";
9237
9243
  }
9238
9244
  var BUILD_TIME_CONSTANTS = /* @__PURE__ */ new Set([
9239
9245
  "NODE_ENV",
@@ -9250,7 +9256,7 @@ var PLATFORM_MARKERS = /* @__PURE__ */ new Set([
9250
9256
  ]);
9251
9257
  function isExemptVariableAccess(node) {
9252
9258
  const parent = node.parent;
9253
- return parent.type === "MemberExpression" && parent.object === node && !parent.computed && parent.property.type === "Identifier" && (BUILD_TIME_CONSTANTS.has(parent.property.name) || PLATFORM_MARKERS.has(parent.property.name));
9259
+ return parent.type === "MemberExpression" && parent.object === node && import_utils53.ASTUtils.getPropertyName(parent) !== null && (BUILD_TIME_CONSTANTS.has(import_utils53.ASTUtils.getPropertyName(parent) ?? "") || PLATFORM_MARKERS.has(import_utils53.ASTUtils.getPropertyName(parent) ?? ""));
9254
9260
  }
9255
9261
  function isWriteTarget(node) {
9256
9262
  const access = node.parent.type === "MemberExpression" && node.parent.object === node ? node.parent : node;
@@ -9293,14 +9299,10 @@ var no_raw_env_default = createRule({
9293
9299
  CallExpression(node) {
9294
9300
  if (!boundaryFile) return;
9295
9301
  const callee = node.callee;
9296
- if (callee.type === "Identifier" && callee.name === "createEnv" || callee.type === "MemberExpression" && !callee.computed && callee.property.type === "Identifier" && (["parse", "safeParse"].includes(callee.property.name) || callee.property.name === "object" && callee.object.type === "Identifier" && callee.object.name === "z")) hasValidationCall = true;
9302
+ if (callee.type === "Identifier" && callee.name === "createEnv" || callee.type === "MemberExpression" && import_utils53.ASTUtils.getPropertyName(callee) !== null && (["parse", "safeParse"].includes(import_utils53.ASTUtils.getPropertyName(callee) ?? "") || (import_utils53.ASTUtils.getPropertyName(callee) ?? "") === "object" && callee.object.type === "Identifier" && callee.object.name === "z")) hasValidationCall = true;
9297
9303
  },
9298
9304
  MemberExpression(node) {
9299
- if (isProcessEnv(node) && node.object.type === "Identifier") {
9300
- const binding = import_utils53.ASTUtils.findVariable(context.sourceCode.getScope(node), node.object.name);
9301
- if (binding !== null && binding.defs.length > 0 && !binding.defs.every((definition) => definition.type === "ImportBinding" && definition.parent.type === "ImportDeclaration" && ["node:process", "process"].includes(definition.parent.source.value) && ["ImportDefaultSpecifier", "ImportNamespaceSpecifier"].includes(definition.node.type))) return;
9302
- }
9303
- if ((isProcessEnv(node) || isImportMetaEnv(node)) && !isExemptVariableAccess(node) && !isWriteTarget(node) && !isWholeEnvSpread(node)) {
9305
+ if ((isProcessEnv(node, context) || isImportMetaEnv(node)) && !isExemptVariableAccess(node) && !isWriteTarget(node) && !isWholeEnvSpread(node)) {
9304
9306
  reads.push(node);
9305
9307
  }
9306
9308
  },
@@ -9734,7 +9736,7 @@ function enclosingIntervalCallback(sourceCode, node) {
9734
9736
  return null;
9735
9737
  }
9736
9738
  function isIntervalCallee(sourceCode, node) {
9737
- return node.type === import_utils56.AST_NODE_TYPES.Identifier && node.name === "setInterval" && isUnshadowedGlobal2(sourceCode, node) || node.type === import_utils56.AST_NODE_TYPES.MemberExpression && !node.computed && node.object.type === import_utils56.AST_NODE_TYPES.Identifier && (node.object.name === "window" || node.object.name === "globalThis") && isUnshadowedGlobal2(sourceCode, node.object) && node.property.type === import_utils56.AST_NODE_TYPES.Identifier && node.property.name === "setInterval";
9739
+ return node.type === import_utils56.AST_NODE_TYPES.Identifier && node.name === "setInterval" && isUnshadowedGlobal2(sourceCode, node) || node.type === import_utils56.AST_NODE_TYPES.MemberExpression && node.object.type === import_utils56.AST_NODE_TYPES.Identifier && (node.object.name === "window" || node.object.name === "globalThis") && isUnshadowedGlobal2(sourceCode, node.object) && import_utils56.ASTUtils.getPropertyName(node) !== null && (import_utils56.ASTUtils.getPropertyName(node) ?? "") === "setInterval";
9738
9740
  }
9739
9741
  function isUnshadowedGlobal2(sourceCode, node) {
9740
9742
  const variable = import_utils56.ASTUtils.findVariable(sourceCode.getScope(node), node.name);
@@ -9773,7 +9775,7 @@ var no_router_refresh_polling_default = createRule({
9773
9775
  }
9774
9776
  },
9775
9777
  CallExpression(node) {
9776
- if (node.callee.type !== import_utils56.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils56.AST_NODE_TYPES.Identifier || node.callee.property.type !== import_utils56.AST_NODE_TYPES.Identifier || node.callee.property.name !== "refresh") return;
9778
+ if (node.callee.type !== import_utils56.AST_NODE_TYPES.MemberExpression || node.callee.object.type !== import_utils56.AST_NODE_TYPES.Identifier || import_utils56.ASTUtils.getPropertyName(node.callee) === null || (import_utils56.ASTUtils.getPropertyName(node.callee) ?? "") !== "refresh") return;
9777
9779
  const router = import_utils56.ASTUtils.findVariable(
9778
9780
  context.sourceCode.getScope(node.callee.object),
9779
9781
  node.callee.object.name
@@ -10560,7 +10562,7 @@ function hasRedactionMarker(name) {
10560
10562
  }
10561
10563
  function valueName(node) {
10562
10564
  if (node.type === "Identifier") return node.name;
10563
- return node.type === "MemberExpression" && !node.computed && node.property.type === "Identifier" ? node.property.name : null;
10565
+ return node.type === "MemberExpression" && import_utils61.ASTUtils.getPropertyName(node) !== null ? import_utils61.ASTUtils.getPropertyName(node) ?? "" : null;
10564
10566
  }
10565
10567
  function isRawSecretValue(prop) {
10566
10568
  if (prop.shorthand) {
@@ -10609,11 +10611,11 @@ function rawBlobValueName(value) {
10609
10611
  if (value.type === "Identifier") {
10610
10612
  return isRawBlobName(value.name) ? value.name : null;
10611
10613
  }
10612
- if (value.type === "MemberExpression" && !value.computed && value.property.type === "Identifier") {
10613
- return isRawBlobName(value.property.name) ? value.property.name : null;
10614
+ if (value.type === "MemberExpression" && import_utils61.ASTUtils.getPropertyName(value) !== null) {
10615
+ return isRawBlobName(import_utils61.ASTUtils.getPropertyName(value) ?? "") ? import_utils61.ASTUtils.getPropertyName(value) ?? "" : null;
10614
10616
  }
10615
- if (value.type === "CallExpression" && value.arguments.length === 0 && value.callee.type === "MemberExpression" && !value.callee.computed && value.callee.object.type === "Identifier" && /^(?:res|response|\w+Response)$/.test(value.callee.object.name) && value.callee.property.type === "Identifier" && (value.callee.property.name === "json" || value.callee.property.name === "text")) {
10616
- return `${value.callee.object.name}.${value.callee.property.name}()`;
10617
+ if (value.type === "CallExpression" && value.arguments.length === 0 && value.callee.type === "MemberExpression" && value.callee.object.type === "Identifier" && /^(?:res|response|\w+Response)$/.test(value.callee.object.name) && import_utils61.ASTUtils.getPropertyName(value.callee) !== null && ((import_utils61.ASTUtils.getPropertyName(value.callee) ?? "") === "json" || (import_utils61.ASTUtils.getPropertyName(value.callee) ?? "") === "text")) {
10618
+ return `${value.callee.object.name}.${import_utils61.ASTUtils.getPropertyName(value.callee) ?? ""}()`;
10617
10619
  }
10618
10620
  return null;
10619
10621
  }
@@ -11071,8 +11073,8 @@ function argsIncludeBinding(args, caughtName) {
11071
11073
  return args.some((arg) => subtreeReadsName(arg, caughtName));
11072
11074
  }
11073
11075
  function isParseShapedNode(node) {
11074
- if (node.type === import_utils64.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils64.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils64.AST_NODE_TYPES.Identifier) {
11075
- return node.callee.property.name === "parse";
11076
+ if (node.type === import_utils64.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils64.AST_NODE_TYPES.MemberExpression && import_utils64.ASTUtils.getPropertyName(node.callee) !== null) {
11077
+ return (import_utils64.ASTUtils.getPropertyName(node.callee) ?? "") === "parse";
11076
11078
  }
11077
11079
  if (node.type === import_utils64.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils64.AST_NODE_TYPES.Identifier) {
11078
11080
  return SAFE_PARSE_CONSTRUCTORS.has(node.callee.name);
@@ -11085,21 +11087,21 @@ var SAFE_PARSE_CONSTRUCTORS = /* @__PURE__ */ new Set([
11085
11087
  "URLPattern"
11086
11088
  ]);
11087
11089
  function isBodyDecodeNode(node) {
11088
- return node.type === import_utils64.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils64.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils64.AST_NODE_TYPES.Identifier && BODY_DECODE_METHODS.has(node.callee.property.name);
11090
+ return node.type === import_utils64.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils64.AST_NODE_TYPES.MemberExpression && import_utils64.ASTUtils.getPropertyName(node.callee) !== null && BODY_DECODE_METHODS.has(import_utils64.ASTUtils.getPropertyName(node.callee) ?? "");
11089
11091
  }
11090
11092
  function isSafeParseSupportCall(node) {
11091
11093
  const callee = node.callee;
11092
- if (callee.type !== import_utils64.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils64.AST_NODE_TYPES.Identifier) {
11094
+ if (callee.type !== import_utils64.AST_NODE_TYPES.MemberExpression || import_utils64.ASTUtils.getPropertyName(callee) === null) {
11093
11095
  return false;
11094
11096
  }
11095
- if (callee.property.name === "isArray" && callee.object.type === import_utils64.AST_NODE_TYPES.Identifier && callee.object.name === "Array") {
11097
+ if ((import_utils64.ASTUtils.getPropertyName(callee) ?? "") === "isArray" && callee.object.type === import_utils64.AST_NODE_TYPES.Identifier && callee.object.name === "Array") {
11096
11098
  return true;
11097
11099
  }
11098
- if (callee.property.name !== "getItem") return false;
11100
+ if ((import_utils64.ASTUtils.getPropertyName(callee) ?? "") !== "getItem") return false;
11099
11101
  if (callee.object.type === import_utils64.AST_NODE_TYPES.Identifier && (callee.object.name === "localStorage" || callee.object.name === "sessionStorage")) {
11100
11102
  return true;
11101
11103
  }
11102
- return callee.object.type === import_utils64.AST_NODE_TYPES.MemberExpression && !callee.object.computed && callee.object.object.type === import_utils64.AST_NODE_TYPES.Identifier && (callee.object.object.name === "window" || callee.object.object.name === "globalThis") && callee.object.property.type === import_utils64.AST_NODE_TYPES.Identifier && (callee.object.property.name === "localStorage" || callee.object.property.name === "sessionStorage");
11104
+ return callee.object.type === import_utils64.AST_NODE_TYPES.MemberExpression && callee.object.object.type === import_utils64.AST_NODE_TYPES.Identifier && (callee.object.object.name === "window" || callee.object.object.name === "globalThis") && import_utils64.ASTUtils.getPropertyName(callee.object) !== null && ((import_utils64.ASTUtils.getPropertyName(callee.object) ?? "") === "localStorage" || (import_utils64.ASTUtils.getPropertyName(callee.object) ?? "") === "sessionStorage");
11103
11105
  }
11104
11106
  var BODY_DECODE_METHODS = /* @__PURE__ */ new Set([
11105
11107
  "json",
@@ -11412,7 +11414,7 @@ var ZOD_CHAIN_METHODS = /* @__PURE__ */ new Set([
11412
11414
  "transform"
11413
11415
  ]);
11414
11416
  function isBodyParseCall(node) {
11415
- return node.type === import_utils65.AST_NODE_TYPES.CallExpression && node.arguments.length === 0 && node.callee.type === import_utils65.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils65.AST_NODE_TYPES.Identifier && BODY_PARSE_METHODS.has(node.callee.property.name);
11417
+ return node.type === import_utils65.AST_NODE_TYPES.CallExpression && node.arguments.length === 0 && node.callee.type === import_utils65.AST_NODE_TYPES.MemberExpression && import_utils65.ASTUtils.getPropertyName(node.callee) !== null && BODY_PARSE_METHODS.has(import_utils65.ASTUtils.getPropertyName(node.callee) ?? "");
11416
11418
  }
11417
11419
  var TEARDOWN_METHODS = /* @__PURE__ */ new Set([
11418
11420
  "cancel",
@@ -11427,10 +11429,10 @@ var TEARDOWN_METHODS = /* @__PURE__ */ new Set([
11427
11429
  var DIRECTIVE_COMMENT_RE = /^\s*(eslint-|@ts-|prettier-ignore|biome-ignore|c8 |v8 |istanbul )/;
11428
11430
  var isExplanatory = (comment) => !DIRECTIVE_COMMENT_RE.test(comment.value);
11429
11431
  function isTeardownCall(node) {
11430
- return node.type === import_utils65.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils65.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils65.AST_NODE_TYPES.Identifier && TEARDOWN_METHODS.has(node.callee.property.name);
11432
+ return node.type === import_utils65.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils65.AST_NODE_TYPES.MemberExpression && import_utils65.ASTUtils.getPropertyName(node.callee) !== null && TEARDOWN_METHODS.has(import_utils65.ASTUtils.getPropertyName(node.callee) ?? "");
11431
11433
  }
11432
11434
  function isCancelledWebShare(node) {
11433
- return node.type === import_utils65.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils65.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.object.type === import_utils65.AST_NODE_TYPES.Identifier && node.callee.object.name === "navigator" && node.callee.property.type === import_utils65.AST_NODE_TYPES.Identifier && node.callee.property.name === "share";
11435
+ return node.type === import_utils65.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils65.AST_NODE_TYPES.MemberExpression && node.callee.object.type === import_utils65.AST_NODE_TYPES.Identifier && node.callee.object.name === "navigator" && import_utils65.ASTUtils.getPropertyName(node.callee) !== null && (import_utils65.ASTUtils.getPropertyName(node.callee) ?? "") === "share";
11434
11436
  }
11435
11437
  function isSilentHandler(handler) {
11436
11438
  const body2 = handler.body;
@@ -11493,16 +11495,17 @@ var no_silent_promise_catch_default = createRule({
11493
11495
  const [definition] = binding.defs;
11494
11496
  return binding.defs.length === 1 && definition?.node.type === import_utils65.AST_NODE_TYPES.VariableDeclarator && definition.node.init !== null && isZodSchema(definition.node.init, seen);
11495
11497
  }
11496
- if (node.type !== import_utils65.AST_NODE_TYPES.CallExpression || node.callee.type !== import_utils65.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.property.type !== import_utils65.AST_NODE_TYPES.Identifier) return false;
11497
- const { object, property } = node.callee;
11498
- if (object.type === import_utils65.AST_NODE_TYPES.Identifier && ZOD_CONSTRUCTORS.has(property.name)) {
11498
+ if (node.type !== import_utils65.AST_NODE_TYPES.CallExpression || node.callee.type !== import_utils65.AST_NODE_TYPES.MemberExpression || import_utils65.ASTUtils.getPropertyName(node.callee) === null) return false;
11499
+ const { object } = node.callee;
11500
+ const method = import_utils65.ASTUtils.getPropertyName(node.callee);
11501
+ if (object.type === import_utils65.AST_NODE_TYPES.Identifier && method !== null && ZOD_CONSTRUCTORS.has(method)) {
11499
11502
  const binding = import_utils65.ASTUtils.findVariable(context.sourceCode.getScope(object), object.name);
11500
11503
  if (binding?.defs.some((definition) => {
11501
11504
  const specifier = definition.node;
11502
11505
  return (specifier.type === import_utils65.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils65.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils65.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils65.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") && specifier.parent.type === import_utils65.AST_NODE_TYPES.ImportDeclaration && isZodModule(String(specifier.parent.source.value));
11503
11506
  })) return true;
11504
11507
  }
11505
- return ZOD_CHAIN_METHODS.has(property.name) && isZodSchema(object, seen);
11508
+ return method !== null && ZOD_CHAIN_METHODS.has(method) && isZodSchema(object, seen);
11506
11509
  }
11507
11510
  const hasExplanatoryComment = (call, handler) => {
11508
11511
  const sourceCode = context.sourceCode;
@@ -11522,10 +11525,10 @@ var no_silent_promise_catch_default = createRule({
11522
11525
  };
11523
11526
  return {
11524
11527
  CallExpression(node) {
11525
- if (node.callee.type !== import_utils65.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.property.type !== import_utils65.AST_NODE_TYPES.Identifier) {
11528
+ if (node.callee.type !== import_utils65.AST_NODE_TYPES.MemberExpression || import_utils65.ASTUtils.getPropertyName(node.callee) === null) {
11526
11529
  return;
11527
11530
  }
11528
- const method = node.callee.property.name;
11531
+ const method = import_utils65.ASTUtils.getPropertyName(node.callee) ?? "";
11529
11532
  const handlerIndex = method === "catch" ? 0 : method === "then" ? 1 : null;
11530
11533
  if (handlerIndex === null) return;
11531
11534
  if (method === "catch" && isZodSchema(node.callee.object)) return;
@@ -11538,7 +11541,7 @@ var no_silent_promise_catch_default = createRule({
11538
11541
  if (isCancelledWebShare(node.callee.object)) {
11539
11542
  return;
11540
11543
  }
11541
- if (node.parent.type === import_utils65.AST_NODE_TYPES.MemberExpression && node.parent.object === node && !node.parent.computed && node.parent.property.type === import_utils65.AST_NODE_TYPES.Identifier && node.parent.property.name === "then") {
11544
+ if (node.parent.type === import_utils65.AST_NODE_TYPES.MemberExpression && node.parent.object === node && import_utils65.ASTUtils.getPropertyName(node.parent) !== null && (import_utils65.ASTUtils.getPropertyName(node.parent) ?? "") === "then") {
11542
11545
  return;
11543
11546
  }
11544
11547
  const expectedArguments = method === "catch" ? 1 : 2;
@@ -11736,10 +11739,10 @@ var STORAGE_RECEIVER_WORDS = /* @__PURE__ */ new Set([
11736
11739
  ]);
11737
11740
  function storageMethodName(node, methods) {
11738
11741
  const callee = node.callee;
11739
- if (callee.type !== import_utils67.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils67.AST_NODE_TYPES.Identifier) {
11742
+ if (callee.type !== import_utils67.AST_NODE_TYPES.MemberExpression || import_utils67.ASTUtils.getPropertyName(callee) === null) {
11740
11743
  return null;
11741
11744
  }
11742
- const name = callee.property.name;
11745
+ const name = import_utils67.ASTUtils.getPropertyName(callee) ?? "";
11743
11746
  if (!methods.has(name)) {
11744
11747
  return null;
11745
11748
  }
@@ -11759,7 +11762,7 @@ function isStorageLikeReceiver(node) {
11759
11762
  if (node.type !== import_utils67.AST_NODE_TYPES.MemberExpression) {
11760
11763
  return false;
11761
11764
  }
11762
- if (!node.computed && node.property.type === import_utils67.AST_NODE_TYPES.Identifier && isStorageIdentifier(node.property.name)) {
11765
+ if (import_utils67.ASTUtils.getPropertyName(node) !== null && isStorageIdentifier(import_utils67.ASTUtils.getPropertyName(node) ?? "")) {
11763
11766
  return true;
11764
11767
  }
11765
11768
  return isStorageLikeReceiver(node.object);
@@ -11837,7 +11840,7 @@ function hasSqlPreparationEvidence(node, callee) {
11837
11840
  if (!/^\s*(?:SELECT|WITH|INSERT|UPDATE|DELETE|REPLACE|CREATE|ALTER|DROP|PRAGMA|EXPLAIN)\b/iu.test(stripSqlNoise(text))) return false;
11838
11841
  } else {
11839
11842
  const receiver = callee.object;
11840
- const receiverName = receiver.type === import_utils67.AST_NODE_TYPES.Identifier ? receiver.name : receiver.type === import_utils67.AST_NODE_TYPES.MemberExpression && !receiver.computed && receiver.property.type === import_utils67.AST_NODE_TYPES.Identifier ? receiver.property.name : "";
11843
+ const receiverName = receiver.type === import_utils67.AST_NODE_TYPES.Identifier ? receiver.name : receiver.type === import_utils67.AST_NODE_TYPES.MemberExpression && import_utils67.ASTUtils.getPropertyName(receiver) !== null ? import_utils67.ASTUtils.getPropertyName(receiver) ?? "" : "";
11841
11844
  if (!/^(?:db|database|connection)$/iu.test(receiverName)) return false;
11842
11845
  }
11843
11846
  return true;
@@ -12231,13 +12234,13 @@ var no_tautological_expect_default = createRule({
12231
12234
  return {
12232
12235
  CallExpression(node) {
12233
12236
  const callee = node.callee;
12234
- if (callee.type !== import_utils69.AST_NODE_TYPES.MemberExpression || callee.computed) {
12237
+ if (callee.type !== import_utils69.AST_NODE_TYPES.MemberExpression || import_utils69.ASTUtils.getPropertyName(callee) === null) {
12235
12238
  return;
12236
12239
  }
12237
- if (callee.property.type !== import_utils69.AST_NODE_TYPES.Identifier) {
12240
+ if (import_utils69.ASTUtils.getPropertyName(callee) === null) {
12238
12241
  return;
12239
12242
  }
12240
- const matcher = callee.property.name;
12243
+ const matcher = import_utils69.ASTUtils.getPropertyName(callee) ?? "";
12241
12244
  if (callee.object.type !== import_utils69.AST_NODE_TYPES.CallExpression || callee.object.callee.type !== import_utils69.AST_NODE_TYPES.Identifier) return;
12242
12245
  const expectIdentifier = callee.object.callee;
12243
12246
  const variable = import_utils69.ASTUtils.findVariable(context.sourceCode.getScope(expectIdentifier), expectIdentifier.name);
@@ -13651,7 +13654,7 @@ function containsMockFactory(node, source) {
13651
13654
  return false;
13652
13655
  }
13653
13656
  function isMockFactory(node, source) {
13654
- return node.type === import_utils78.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils78.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.object.type === import_utils78.AST_NODE_TYPES.Identifier && (importedTestMockNamespace(source, node.callee.object) !== null || isUnshadowedTestMockGlobal(source, node.callee.object)) && node.callee.property.type === import_utils78.AST_NODE_TYPES.Identifier && ["fn", "spyOn"].includes(node.callee.property.name);
13657
+ return node.type === import_utils78.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils78.AST_NODE_TYPES.MemberExpression && node.callee.object.type === import_utils78.AST_NODE_TYPES.Identifier && (importedTestMockNamespace(source, node.callee.object) !== null || isUnshadowedTestMockGlobal(source, node.callee.object)) && import_utils78.ASTUtils.getPropertyName(node.callee) !== null && ["fn", "spyOn"].includes(import_utils78.ASTUtils.getPropertyName(node.callee) ?? "");
13655
13658
  }
13656
13659
  var no_unsafe_test_double_cast_default = createRule({
13657
13660
  name: "no-unsafe-test-double-cast",
@@ -13706,7 +13709,7 @@ var no_first_party_module_mock_default = createRule({
13706
13709
  if (!isTestFile(context.filename) || isGeneratedFile(context.filename, context.sourceCode.text)) return {};
13707
13710
  return {
13708
13711
  CallExpression(node) {
13709
- if (node.callee.type !== import_utils79.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils79.AST_NODE_TYPES.Identifier || node.callee.property.type !== import_utils79.AST_NODE_TYPES.Identifier || !["mock", "doMock"].includes(node.callee.property.name)) return;
13712
+ if (node.callee.type !== import_utils79.AST_NODE_TYPES.MemberExpression || node.callee.object.type !== import_utils79.AST_NODE_TYPES.Identifier || import_utils79.ASTUtils.getPropertyName(node.callee) === null || !["mock", "doMock"].includes(import_utils79.ASTUtils.getPropertyName(node.callee) ?? "")) return;
13710
13713
  const framework = importedTestMockNamespace(context.sourceCode, node.callee.object);
13711
13714
  if (framework === null || framework === "jest" && mayBeVirtual(node.arguments[2])) return;
13712
13715
  const argument = node.arguments[0];
@@ -14781,7 +14784,7 @@ var prefer_millisecond_control_duration_schema_default = createRule({
14781
14784
  const variable2 = binding(callee);
14782
14785
  return variable2 !== null && objectFactories.has(variable2);
14783
14786
  }
14784
- if (callee.type !== import_utils88.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils88.AST_NODE_TYPES.Identifier || callee.property.type !== import_utils88.AST_NODE_TYPES.Identifier || callee.property.name !== "object" && callee.property.name !== "strictObject") {
14787
+ if (callee.type !== import_utils88.AST_NODE_TYPES.MemberExpression || callee.object.type !== import_utils88.AST_NODE_TYPES.Identifier || import_utils88.ASTUtils.getPropertyName(callee) === null || (import_utils88.ASTUtils.getPropertyName(callee) ?? "") !== "object" && (import_utils88.ASTUtils.getPropertyName(callee) ?? "") !== "strictObject") {
14785
14788
  return false;
14786
14789
  }
14787
14790
  const variable = binding(callee.object);
@@ -14794,12 +14797,12 @@ var prefer_millisecond_control_duration_schema_default = createRule({
14794
14797
  const variable = binding(callee);
14795
14798
  return variable !== null && numberFactories.has(variable);
14796
14799
  }
14797
- if (callee.type !== import_utils88.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils88.AST_NODE_TYPES.Identifier) return false;
14800
+ if (callee.type !== import_utils88.AST_NODE_TYPES.MemberExpression || import_utils88.ASTUtils.getPropertyName(callee) === null) return false;
14798
14801
  if (callee.object.type === import_utils88.AST_NODE_TYPES.Identifier) {
14799
14802
  const variable = binding(callee.object);
14800
- return callee.property.name === "number" && variable !== null && zodNamespaces.has(variable);
14803
+ return (import_utils88.ASTUtils.getPropertyName(callee) ?? "") === "number" && variable !== null && zodNamespaces.has(variable);
14801
14804
  }
14802
- return ["int", "min", "max", "positive", "nonnegative", "finite", "multipleOf", "optional", "nullable", "nullish", "default", "describe", "brand", "readonly"].includes(callee.property.name) && isNumericSchema(callee.object);
14805
+ return ["int", "min", "max", "positive", "nonnegative", "finite", "multipleOf", "optional", "nullable", "nullish", "default", "describe", "brand", "readonly"].includes(import_utils88.ASTUtils.getPropertyName(callee) ?? "") && isNumericSchema(callee.object);
14803
14806
  }
14804
14807
  return {
14805
14808
  ImportDeclaration(node) {
@@ -14840,7 +14843,8 @@ var PREFER_IMMUTABLE_MODULE_CONSTANT_DOCUMENTATION = {
14840
14843
  remediation: "Expose literals with `as const` or a readonly type, and expose Set or Map values through ReadonlySet or ReadonlyMap.",
14841
14844
  category: "correctness",
14842
14845
  limitations: [
14843
- "Generated, test and JavaScript files are skipped. Private constants with observed direct or alias mutation are excluded; exported mutable collections remain advisory candidates. Reassigned aliases are conservatively followed, not flow-proven."
14846
+ "Generated, test and JavaScript files are skipped. Private constants with observed direct or alias mutation are excluded; exported mutable collections remain advisory candidates. Reassigned aliases are conservatively followed, not flow-proven.",
14847
+ "Local type aliases are resolved before recognizing standard readonly types; imported or otherwise unknown type declarations are not inferred from their names. Readonly types have no runtime enforcement."
14844
14848
  ],
14845
14849
  examples: [
14846
14850
  {
@@ -14860,6 +14864,26 @@ var PREFER_IMMUTABLE_MODULE_CONSTANT_DOCUMENTATION = {
14860
14864
  focusPath: "src/constants.ts",
14861
14865
  expectedCount: 1,
14862
14866
  public: true
14867
+ },
14868
+ {
14869
+ id: "shadowed-readonly-alias",
14870
+ scenarioId: "type-binding",
14871
+ title: "A type named Readonly still exposes mutable properties",
14872
+ outcome: "match",
14873
+ files: [{ path: "src/constants.ts", source: "type Readonly = { voice: boolean };\nexport const TOOL_SUPPORT: Readonly = { voice: true };" }],
14874
+ focusPath: "src/constants.ts",
14875
+ expectedCount: 1,
14876
+ public: true
14877
+ },
14878
+ {
14879
+ id: "resolved-readonly-alias",
14880
+ scenarioId: "type-binding",
14881
+ title: "A local alias resolves to readonly properties",
14882
+ outcome: "no-match",
14883
+ files: [{ path: "src/constants.ts", source: "type ToolSupport = Readonly<{ voice: boolean }>;\nexport const TOOL_SUPPORT: ToolSupport = { voice: true };" }],
14884
+ focusPath: "src/constants.ts",
14885
+ expectedCount: 0,
14886
+ public: true
14863
14887
  }
14864
14888
  ]
14865
14889
  };
@@ -14914,39 +14938,84 @@ function collectionKind(node, isUnshadowedGlobal3) {
14914
14938
  }
14915
14939
  return null;
14916
14940
  }
14917
- function declaredReadonlyType(node, kind, aliases) {
14941
+ function declaredReadonlyType(node, kind, resolveLocalType, isUnshadowedType) {
14918
14942
  const annotation = node.id.type === import_utils89.AST_NODE_TYPES.Identifier ? node.id.typeAnnotation : void 0;
14919
- if (annotation !== void 0 && isReadonlyTypeResolved(annotation.typeAnnotation, kind, aliases)) {
14943
+ if (annotation !== void 0 && readonlyTypeState(annotation.typeAnnotation, kind, resolveLocalType, isUnshadowedType) === "readonly") {
14920
14944
  return true;
14921
14945
  }
14922
- return node.init?.type === import_utils89.AST_NODE_TYPES.TSAsExpression && isReadonlyTypeResolved(node.init.typeAnnotation, kind, aliases);
14946
+ return node.init?.type === import_utils89.AST_NODE_TYPES.TSAsExpression && readonlyTypeState(node.init.typeAnnotation, kind, resolveLocalType, isUnshadowedType) === "readonly";
14923
14947
  }
14924
- function isReadonlyTypeResolved(node, kind, aliases, seen = /* @__PURE__ */ new Set()) {
14925
- if (isReadonlyType(node, kind)) return true;
14926
- if (node.type !== import_utils89.AST_NODE_TYPES.TSTypeReference || node.typeName.type !== import_utils89.AST_NODE_TYPES.Identifier) return false;
14927
- const name = node.typeName.name;
14928
- const target = aliases.get(name);
14929
- if (target === void 0 || seen.has(name)) return false;
14930
- return isReadonlyTypeResolved(target, kind, aliases, /* @__PURE__ */ new Set([...seen, name]));
14948
+ function readonlyTypeState(node, kind, resolveLocalType, isUnshadowedType, arguments_ = /* @__PURE__ */ new Map(), seen = /* @__PURE__ */ new Set()) {
14949
+ if (seen.has(node)) return "unknown";
14950
+ if (node.type !== import_utils89.AST_NODE_TYPES.TSTypeReference || node.typeName.type !== import_utils89.AST_NODE_TYPES.Identifier) {
14951
+ return directReadonlyState(node, kind, isUnshadowedType);
14952
+ }
14953
+ const declaration = resolveLocalType(node.typeName);
14954
+ if (declaration === void 0) return directReadonlyState(node, kind, isUnshadowedType);
14955
+ if (declaration.type === import_utils89.AST_NODE_TYPES.TSTypeParameter) {
14956
+ const argument = arguments_.get(declaration);
14957
+ return argument === void 0 ? "unknown" : readonlyTypeState(
14958
+ argument.node,
14959
+ kind,
14960
+ resolveLocalType,
14961
+ isUnshadowedType,
14962
+ argument.arguments,
14963
+ argument.seen
14964
+ );
14965
+ }
14966
+ const expanded = /* @__PURE__ */ new Set([...seen, node]);
14967
+ return readonlyTypeState(
14968
+ declaration.typeAnnotation,
14969
+ kind,
14970
+ resolveLocalType,
14971
+ isUnshadowedType,
14972
+ bindTypeArguments(declaration, node, arguments_, expanded),
14973
+ expanded
14974
+ );
14975
+ }
14976
+ function bindTypeArguments(declaration, reference, arguments_, seen) {
14977
+ const bindings = new Map(arguments_);
14978
+ for (const [index, parameter] of (declaration.typeParameters?.params ?? []).entries()) {
14979
+ const argument = reference.typeArguments?.params[index];
14980
+ const node = argument ?? parameter.default;
14981
+ if (node !== void 0) {
14982
+ bindings.set(parameter, { node, arguments: argument === void 0 ? new Map(bindings) : arguments_, seen });
14983
+ }
14984
+ }
14985
+ return bindings;
14931
14986
  }
14932
- function isReadonlyType(node, kind) {
14987
+ function directReadonlyState(node, kind, isUnshadowedType) {
14933
14988
  if (node.type === import_utils89.AST_NODE_TYPES.TSTypeOperator && node.operator === "readonly") {
14934
- return true;
14989
+ return "readonly";
14935
14990
  }
14936
- if (node.type !== import_utils89.AST_NODE_TYPES.TSTypeReference || node.typeName.type !== import_utils89.AST_NODE_TYPES.Identifier) {
14937
- return false;
14991
+ if (node.type === import_utils89.AST_NODE_TYPES.TSTypeLiteral) {
14992
+ if (node.members.length === 0) return "unknown";
14993
+ const readonly2 = kind === "literal" && node.members.length > 0 && node.members.every(
14994
+ (member) => (member.type === import_utils89.AST_NODE_TYPES.TSPropertySignature || member.type === import_utils89.AST_NODE_TYPES.TSIndexSignature) && member.readonly
14995
+ );
14996
+ return readonly2 ? "readonly" : "mutable";
14997
+ }
14998
+ if (node.type === import_utils89.AST_NODE_TYPES.TSArrayType || node.type === import_utils89.AST_NODE_TYPES.TSTupleType) return "mutable";
14999
+ if (node.type !== import_utils89.AST_NODE_TYPES.TSTypeReference || node.typeName.type !== import_utils89.AST_NODE_TYPES.Identifier || !isUnshadowedType(node.typeName)) {
15000
+ return "unknown";
14938
15001
  }
14939
15002
  if (node.typeName.name === "Readonly") {
14940
- return kind === "literal";
15003
+ return kind === "literal" ? "readonly" : "mutable";
14941
15004
  }
14942
- return kind === "literal" ? node.typeName.name === "ReadonlyArray" : node.typeName.name === `Readonly${kind}`;
15005
+ if (["Array", "Map", "Set"].includes(node.typeName.name)) return "mutable";
15006
+ if (!["ReadonlyArray", "ReadonlyMap", "ReadonlySet"].includes(node.typeName.name)) return "unknown";
15007
+ const readonly = kind === "literal" ? node.typeName.name === "ReadonlyArray" : node.typeName.name === `Readonly${kind}`;
15008
+ return readonly ? "readonly" : "mutable";
14943
15009
  }
14944
- function hasUnknownExplicitType(node, aliases) {
14945
- const annotation = node.id.type === import_utils89.AST_NODE_TYPES.Identifier ? node.id.typeAnnotation?.typeAnnotation : void 0;
15010
+ function hasUnknownExplicitType(node, kind, resolveLocalType, isUnshadowedType) {
15011
+ const annotation = (node.id.type === import_utils89.AST_NODE_TYPES.Identifier ? node.id.typeAnnotation?.typeAnnotation : void 0) ?? (node.init?.type === import_utils89.AST_NODE_TYPES.TSAsExpression ? node.init.typeAnnotation : void 0);
14946
15012
  if (annotation === void 0) return false;
14947
15013
  if (annotation.type === import_utils89.AST_NODE_TYPES.TSArrayType || annotation.type === import_utils89.AST_NODE_TYPES.TSTypeOperator) return false;
14948
15014
  if (annotation.type !== import_utils89.AST_NODE_TYPES.TSTypeReference || annotation.typeName.type !== import_utils89.AST_NODE_TYPES.Identifier) return true;
14949
- return !aliases.has(annotation.typeName.name) && !["Array", "Map", "Readonly", "ReadonlyArray", "ReadonlyMap", "ReadonlySet", "Set"].includes(annotation.typeName.name);
15015
+ if (resolveLocalType(annotation.typeName) !== void 0) {
15016
+ return readonlyTypeState(annotation, kind, resolveLocalType, isUnshadowedType) === "unknown";
15017
+ }
15018
+ return resolveLocalType(annotation.typeName) === void 0 && (!isUnshadowedType(annotation.typeName) || !["Array", "Map", "Readonly", "ReadonlyArray", "ReadonlyMap", "ReadonlySet", "Set"].includes(annotation.typeName.name));
14950
15019
  }
14951
15020
  function referenceMutates(identifier, isUnshadowedGlobal3) {
14952
15021
  let member = identifier.parent;
@@ -14989,11 +15058,20 @@ var prefer_immutable_module_constant_default = createRule({
14989
15058
  const variable = import_utils89.ASTUtils.findVariable(sourceCode.getScope(identifier), identifier.name);
14990
15059
  return variable === null || variable.defs.length === 0;
14991
15060
  };
15061
+ const isUnshadowedType = (identifier) => {
15062
+ const variable = import_utils89.ASTUtils.findVariable(sourceCode.getScope(identifier), identifier.name);
15063
+ return variable === null || !variable.defs.some((definition) => definition.isTypeDefinition);
15064
+ };
15065
+ const resolveLocalType = (identifier) => {
15066
+ const variable = import_utils89.ASTUtils.findVariable(sourceCode.getScope(identifier), identifier.name);
15067
+ const definitions = variable?.defs.filter((definition) => definition.isTypeDefinition) ?? [];
15068
+ const declaration = definitions.length === 1 ? definitions[0]?.node : void 0;
15069
+ return declaration?.type === import_utils89.AST_NODE_TYPES.TSTypeAliasDeclaration || declaration?.type === import_utils89.AST_NODE_TYPES.TSTypeParameter ? declaration : void 0;
15070
+ };
14992
15071
  if (JAVASCRIPT_FILE_RE.test(context.filename) || isTestFile(context.filename) || isGeneratedFile(context.filename, sourceCode.getText())) {
14993
15072
  return {};
14994
15073
  }
14995
15074
  const exportedNames2 = /* @__PURE__ */ new Set();
14996
- const typeAliases2 = /* @__PURE__ */ new Map();
14997
15075
  const mutatesThroughAlias = (root) => {
14998
15076
  const pending = [root];
14999
15077
  const seen = /* @__PURE__ */ new Set();
@@ -15018,10 +15096,6 @@ var prefer_immutable_module_constant_default = createRule({
15018
15096
  return {
15019
15097
  Program(node) {
15020
15098
  function collectModuleBindings(statement) {
15021
- const declaration = statement.type === import_utils89.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
15022
- if (declaration?.type === import_utils89.AST_NODE_TYPES.TSTypeAliasDeclaration) {
15023
- typeAliases2.set(declaration.id.name, declaration.typeAnnotation);
15024
- }
15025
15099
  if (statement.type === import_utils89.AST_NODE_TYPES.ExportNamedDeclaration) {
15026
15100
  if (statement.source !== null || statement.exportKind === "type") return;
15027
15101
  for (const specifier of statement.specifiers) {
@@ -15054,7 +15128,7 @@ var prefer_immutable_module_constant_default = createRule({
15054
15128
  return;
15055
15129
  }
15056
15130
  const kind = collectionKind(node.init, isUnshadowedGlobal3);
15057
- if (kind === null || declaredReadonlyType(node, kind, typeAliases2) || hasUnknownExplicitType(node, typeAliases2)) {
15131
+ if (kind === null || declaredReadonlyType(node, kind, resolveLocalType, isUnshadowedType) || hasUnknownExplicitType(node, kind, resolveLocalType, isUnshadowedType)) {
15058
15132
  return;
15059
15133
  }
15060
15134
  const variable = sourceCode.getDeclaredVariables(node)[0];
@@ -15913,7 +15987,7 @@ function schemaExpression(node) {
15913
15987
  if (parent === void 0) {
15914
15988
  return current;
15915
15989
  }
15916
- if (parent.type === import_utils92.AST_NODE_TYPES.MemberExpression && parent.object === current && !parent.computed && parent.property.type === import_utils92.AST_NODE_TYPES.Identifier && TERMINAL_METHODS.has(parent.property.name)) {
15990
+ if (parent.type === import_utils92.AST_NODE_TYPES.MemberExpression && parent.object === current && import_utils92.ASTUtils.getPropertyName(parent) !== null && TERMINAL_METHODS.has(import_utils92.ASTUtils.getPropertyName(parent) ?? "")) {
15917
15991
  return current;
15918
15992
  }
15919
15993
  if (parent.type === import_utils92.AST_NODE_TYPES.MemberExpression && parent.object === current || parent.type === import_utils92.AST_NODE_TYPES.CallExpression && parent.callee === current || parent.type === import_utils92.AST_NODE_TYPES.TSAsExpression && parent.expression === current || parent.type === import_utils92.AST_NODE_TYPES.TSNonNullExpression && parent.expression === current) {
@@ -15983,7 +16057,7 @@ function buildsLocalizedText(node) {
15983
16057
  if (callee.type === import_utils92.AST_NODE_TYPES.Identifier) {
15984
16058
  return I18N_CALLEE_NAMES.has(callee.name);
15985
16059
  }
15986
- return callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils92.AST_NODE_TYPES.Identifier && I18N_RECEIVER_NAMES.has(callee.object.name);
16060
+ return callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && callee.object.type === import_utils92.AST_NODE_TYPES.Identifier && I18N_RECEIVER_NAMES.has(callee.object.name);
15987
16061
  });
15988
16062
  }
15989
16063
  function collectReferences(scope, out) {
@@ -16047,13 +16121,13 @@ var prefer_module_level_schema_default = createRule({
16047
16121
  }
16048
16122
  const zodNamespaces = /* @__PURE__ */ new Set();
16049
16123
  function isZodCall(node) {
16050
- return node.type === import_utils92.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.object.type === import_utils92.AST_NODE_TYPES.Identifier && zodNamespaces.has(node.callee.object.name);
16124
+ return node.type === import_utils92.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && import_utils92.ASTUtils.getPropertyName(node.callee) !== null && node.callee.object.type === import_utils92.AST_NODE_TYPES.Identifier && zodNamespaces.has(node.callee.object.name);
16051
16125
  }
16052
16126
  function isSchemaConstruction(node) {
16053
16127
  const callee = node.callee;
16054
- if (callee.type !== import_utils92.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils92.AST_NODE_TYPES.Identifier || TERMINAL_METHODS.has(callee.property.name)) return false;
16128
+ if (callee.type !== import_utils92.AST_NODE_TYPES.MemberExpression || import_utils92.ASTUtils.getPropertyName(callee) === null || TERMINAL_METHODS.has(import_utils92.ASTUtils.getPropertyName(callee) ?? "")) return false;
16055
16129
  if (callee.object.type === import_utils92.AST_NODE_TYPES.CallExpression) return isSchemaConstruction(callee.object);
16056
- return isZodCall(node) && CONSTRUCTION_FACTORIES.has(callee.property.name);
16130
+ return isZodCall(node) && CONSTRUCTION_FACTORIES.has(import_utils92.ASTUtils.getPropertyName(callee) ?? "");
16057
16131
  }
16058
16132
  function hasEagerComputation(node) {
16059
16133
  return subtreeSome(node, (inner) => inner.type === import_utils92.AST_NODE_TYPES.NewExpression || inner.type === import_utils92.AST_NODE_TYPES.TaggedTemplateExpression || inner.type === import_utils92.AST_NODE_TYPES.CallExpression && !isSchemaConstruction(inner), true);
@@ -16061,10 +16135,10 @@ var prefer_module_level_schema_default = createRule({
16061
16135
  function isCovered(node) {
16062
16136
  let current = node.parent ?? void 0;
16063
16137
  while (current !== void 0) {
16064
- if (current !== node && isZodCall(current) && current.callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && current.callee.property.type === import_utils92.AST_NODE_TYPES.Identifier && factories.has(current.callee.property.name)) {
16138
+ if (current !== node && isZodCall(current) && current.callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && import_utils92.ASTUtils.getPropertyName(current.callee) !== null && factories.has(import_utils92.ASTUtils.getPropertyName(current.callee) ?? "")) {
16065
16139
  return true;
16066
16140
  }
16067
- if (current.type === import_utils92.AST_NODE_TYPES.CallExpression && (current.callee.type === import_utils92.AST_NODE_TYPES.Identifier && memoCallees.has(current.callee.name) || current.callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && !current.callee.computed && current.callee.property.type === import_utils92.AST_NODE_TYPES.Identifier && memoCallees.has(current.callee.property.name))) {
16141
+ if (current.type === import_utils92.AST_NODE_TYPES.CallExpression && (current.callee.type === import_utils92.AST_NODE_TYPES.Identifier && memoCallees.has(current.callee.name) || current.callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && import_utils92.ASTUtils.getPropertyName(current.callee) !== null && memoCallees.has(import_utils92.ASTUtils.getPropertyName(current.callee) ?? ""))) {
16068
16142
  return true;
16069
16143
  }
16070
16144
  current = current.parent ?? void 0;
@@ -16093,7 +16167,7 @@ var prefer_module_level_schema_default = createRule({
16093
16167
  }
16094
16168
  function isSchemaComposition(node) {
16095
16169
  const { callee } = node;
16096
- const isCombinator = callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils92.AST_NODE_TYPES.Identifier && ZOD_COMBINATOR_METHODS.has(callee.property.name);
16170
+ const isCombinator = callee.type === import_utils92.AST_NODE_TYPES.MemberExpression && import_utils92.ASTUtils.getPropertyName(callee) !== null && ZOD_COMBINATOR_METHODS.has(import_utils92.ASTUtils.getPropertyName(callee) ?? "");
16097
16171
  return isCombinator || isZodCall(node);
16098
16172
  }
16099
16173
  function closesOverNothing(node, enclosing) {
@@ -16165,10 +16239,10 @@ var prefer_module_level_schema_default = createRule({
16165
16239
  return;
16166
16240
  }
16167
16241
  const callee = node.callee;
16168
- if (callee.property.type !== import_utils92.AST_NODE_TYPES.Identifier) {
16242
+ if (import_utils92.ASTUtils.getPropertyName(callee) === null) {
16169
16243
  return;
16170
16244
  }
16171
- const factory = callee.property.name;
16245
+ const factory = import_utils92.ASTUtils.getPropertyName(callee) ?? "";
16172
16246
  if (!factories.has(factory)) {
16173
16247
  return;
16174
16248
  }
@@ -16409,7 +16483,7 @@ function buildsLocalizedText2(node) {
16409
16483
  const { callee } = inner;
16410
16484
  if (callee.type === import_utils93.AST_NODE_TYPES.Identifier)
16411
16485
  return I18N_CALLEE_NAMES2.has(callee.name);
16412
- return callee.type === import_utils93.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils93.AST_NODE_TYPES.Identifier && I18N_RECEIVER_NAMES2.has(callee.object.name);
16486
+ return callee.type === import_utils93.AST_NODE_TYPES.MemberExpression && callee.object.type === import_utils93.AST_NODE_TYPES.Identifier && I18N_RECEIVER_NAMES2.has(callee.object.name);
16413
16487
  });
16414
16488
  }
16415
16489
  function calleeChainRoot(node) {
@@ -16432,9 +16506,9 @@ function chainMemberNames(node) {
16432
16506
  let current = node;
16433
16507
  for (; ; ) {
16434
16508
  if (current.type === import_utils93.AST_NODE_TYPES.MemberExpression) {
16435
- if (current.computed || current.property.type !== import_utils93.AST_NODE_TYPES.Identifier)
16509
+ if (import_utils93.ASTUtils.getPropertyName(current) === null)
16436
16510
  return [];
16437
- names.push(current.property.name);
16511
+ names.push(import_utils93.ASTUtils.getPropertyName(current) ?? "");
16438
16512
  current = current.object;
16439
16513
  continue;
16440
16514
  }
@@ -16451,8 +16525,8 @@ function schemaExpression2(node) {
16451
16525
  let current = node;
16452
16526
  for (; ; ) {
16453
16527
  const parent = current.parent ?? void 0;
16454
- if (parent?.type === import_utils93.AST_NODE_TYPES.MemberExpression && parent.object === current && !parent.computed && parent.property.type === import_utils93.AST_NODE_TYPES.Identifier && parent.parent?.type === import_utils93.AST_NODE_TYPES.CallExpression && parent.parent.callee === parent) {
16455
- if (NON_SCHEMA_TERMINALS.has(parent.property.name)) return current;
16528
+ if (parent?.type === import_utils93.AST_NODE_TYPES.MemberExpression && parent.object === current && import_utils93.ASTUtils.getPropertyName(parent) !== null && parent.parent?.type === import_utils93.AST_NODE_TYPES.CallExpression && parent.parent.callee === parent) {
16529
+ if (NON_SCHEMA_TERMINALS.has(import_utils93.ASTUtils.getPropertyName(parent) ?? "")) return current;
16456
16530
  current = parent.parent;
16457
16531
  continue;
16458
16532
  }
@@ -16506,7 +16580,7 @@ var prefer_module_level_refined_schema_default = createRule({
16506
16580
  }
16507
16581
  function isSchemaConstruction(node) {
16508
16582
  const callee = node.callee;
16509
- if (callee.type !== import_utils93.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils93.AST_NODE_TYPES.Identifier || NON_SCHEMA_TERMINALS.has(callee.property.name)) return false;
16583
+ if (callee.type !== import_utils93.AST_NODE_TYPES.MemberExpression || import_utils93.ASTUtils.getPropertyName(callee) === null || NON_SCHEMA_TERMINALS.has(import_utils93.ASTUtils.getPropertyName(callee) ?? "")) return false;
16510
16584
  if (callee.object.type === import_utils93.AST_NODE_TYPES.CallExpression) return isSchemaConstruction(callee.object);
16511
16585
  return factoryName(node, FACTORIES) !== null || factoryName(node, COMPOSITE_FACTORIES) !== null;
16512
16586
  }
@@ -16533,7 +16607,7 @@ var prefer_module_level_refined_schema_default = createRule({
16533
16607
  function isMemoized(node) {
16534
16608
  let current = node.parent ?? void 0;
16535
16609
  while (current !== void 0) {
16536
- if (current.type === import_utils93.AST_NODE_TYPES.CallExpression && (current.callee.type === import_utils93.AST_NODE_TYPES.Identifier && MEMO_CALLEES2.has(current.callee.name) || current.callee.type === import_utils93.AST_NODE_TYPES.MemberExpression && !current.callee.computed && current.callee.property.type === import_utils93.AST_NODE_TYPES.Identifier && MEMO_CALLEES2.has(current.callee.property.name)))
16610
+ if (current.type === import_utils93.AST_NODE_TYPES.CallExpression && (current.callee.type === import_utils93.AST_NODE_TYPES.Identifier && MEMO_CALLEES2.has(current.callee.name) || current.callee.type === import_utils93.AST_NODE_TYPES.MemberExpression && import_utils93.ASTUtils.getPropertyName(current.callee) !== null && MEMO_CALLEES2.has(import_utils93.ASTUtils.getPropertyName(current.callee) ?? "")))
16537
16611
  return true;
16538
16612
  current = current.parent ?? void 0;
16539
16613
  }
@@ -16684,7 +16758,7 @@ var prefer_multi_value_zod_literal_default = createRule({
16684
16758
  );
16685
16759
  }
16686
16760
  function directMemberCall(node, binding, method) {
16687
- if (node.callee.type !== import_utils94.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils94.AST_NODE_TYPES.Identifier || node.callee.property.type !== import_utils94.AST_NODE_TYPES.Identifier || node.callee.property.name !== method)
16761
+ if (node.callee.type !== import_utils94.AST_NODE_TYPES.MemberExpression || node.callee.object.type !== import_utils94.AST_NODE_TYPES.Identifier || import_utils94.ASTUtils.getPropertyName(node.callee) === null || (import_utils94.ASTUtils.getPropertyName(node.callee) ?? "") !== method)
16688
16762
  return false;
16689
16763
  return resolvedBinding(node.callee.object) === binding;
16690
16764
  }
@@ -17709,7 +17783,7 @@ var prefer_nullish_filter_predicate_default = createRule({
17709
17783
  CallExpression(node) {
17710
17784
  const callee = node.callee;
17711
17785
  const callback = node.arguments[0];
17712
- if (node.arguments.length !== 1 || callback?.type !== import_utils102.AST_NODE_TYPES.Identifier || callback.name !== "Boolean" || callee.type !== import_utils102.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils102.AST_NODE_TYPES.Identifier || callee.property.name !== "filter" || !isUnshadowedBoolean(callback, context) || !isBuiltinArrayFilter(callee, services)) return;
17786
+ if (node.arguments.length !== 1 || callback?.type !== import_utils102.AST_NODE_TYPES.Identifier || callback.name !== "Boolean" || callee.type !== import_utils102.AST_NODE_TYPES.MemberExpression || import_utils102.ASTUtils.getPropertyName(callee) === null || (import_utils102.ASTUtils.getPropertyName(callee) ?? "") !== "filter" || !isUnshadowedBoolean(callback, context) || !isBuiltinArrayFilter(callee, services)) return;
17713
17787
  const elementType = arrayElementType(callee.object, services);
17714
17788
  const checker = services.program.getTypeChecker();
17715
17789
  if (elementType === null || !isNullishPlusTruthy(elementType, checker)) return;
@@ -17791,7 +17865,7 @@ function isRuntimeFunction(node) {
17791
17865
  }
17792
17866
  function promiseThenReceiver(node) {
17793
17867
  const callee = node.callee;
17794
- if (callee.type !== import_utils103.AST_NODE_TYPES.MemberExpression || callee.computed || callee.optional || callee.property.type !== import_utils103.AST_NODE_TYPES.Identifier || callee.property.name !== "then" || node.optional || node.arguments.length !== 1) {
17868
+ if (callee.type !== import_utils103.AST_NODE_TYPES.MemberExpression || callee.optional || import_utils103.ASTUtils.getPropertyName(callee) === null || (import_utils103.ASTUtils.getPropertyName(callee) ?? "") !== "then" || node.optional || node.arguments.length !== 1) {
17795
17869
  return null;
17796
17870
  }
17797
17871
  const callback = node.arguments[0];
@@ -17940,7 +18014,7 @@ var PROMISE_CHAIN_METHODS = /* @__PURE__ */ new Set([
17940
18014
  ]);
17941
18015
  var isSchemaParseReference = (node) => {
17942
18016
  const inner = unwrap6(node);
17943
- return inner !== null && inner.type === import_utils104.AST_NODE_TYPES.MemberExpression && !inner.computed && inner.property.type === import_utils104.AST_NODE_TYPES.Identifier && (inner.property.name === "parse" || inner.property.name === "safeParse");
18017
+ return inner !== null && inner.type === import_utils104.AST_NODE_TYPES.MemberExpression && import_utils104.ASTUtils.getPropertyName(inner) !== null && ((import_utils104.ASTUtils.getPropertyName(inner) ?? "") === "parse" || (import_utils104.ASTUtils.getPropertyName(inner) ?? "") === "safeParse");
17944
18018
  };
17945
18019
  var isRawPayloadSource = (node, context, isKnownLocalText) => {
17946
18020
  let current = unwrap6(node);
@@ -17955,20 +18029,20 @@ var isRawPayloadSource = (node, context, isKnownLocalText) => {
17955
18029
  if (callee === null || callee.type !== import_utils104.AST_NODE_TYPES.MemberExpression) {
17956
18030
  return false;
17957
18031
  }
17958
- const property = unwrap6(callee.property);
17959
- if (property === null || property.type !== import_utils104.AST_NODE_TYPES.Identifier) {
18032
+ const property = import_utils104.ASTUtils.getPropertyName(callee);
18033
+ if (property === null) {
17960
18034
  return false;
17961
18035
  }
17962
- if (property.name === "json") {
17963
- return !callee.computed && current.arguments.length === 0 && isResponseSource(callee.object, context);
18036
+ if (property === "json") {
18037
+ return current.arguments.length === 0 && isResponseSource(callee.object, context);
17964
18038
  }
17965
- if (PROMISE_CHAIN_METHODS.has(property.name)) {
18039
+ if (PROMISE_CHAIN_METHODS.has(property)) {
17966
18040
  return !current.arguments.some(isSchemaParseReference) && isRawPayloadSource(callee.object, context, isKnownLocalText);
17967
18041
  }
17968
18042
  const object = unwrap6(callee.object);
17969
18043
  const input = unwrap6(current.arguments[0]);
17970
- if (input?.type === import_utils104.AST_NODE_TYPES.CallExpression && input.arguments.length === 1 && input.callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && !input.callee.computed && input.callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && input.callee.object.name === "JSON" && input.callee.property.type === import_utils104.AST_NODE_TYPES.Identifier && input.callee.property.name === "stringify" && (import_utils104.ASTUtils.findVariable(context.sourceCode.getScope(input.callee.object), "JSON")?.defs.length ?? 0) === 0) return false;
17971
- return property.name === "parse" && object !== null && object.type === import_utils104.AST_NODE_TYPES.Identifier && object.name === "JSON" && (import_utils104.ASTUtils.findVariable(context.sourceCode.getScope(object), "JSON")?.defs.length ?? 0) === 0 && !isLocalFileRead(current.arguments[0]) && isKnownLocalText?.(current.arguments[0]) !== true;
18044
+ if (input?.type === import_utils104.AST_NODE_TYPES.CallExpression && input.arguments.length === 1 && input.callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && input.callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && input.callee.object.name === "JSON" && import_utils104.ASTUtils.getPropertyName(input.callee) !== null && (import_utils104.ASTUtils.getPropertyName(input.callee) ?? "") === "stringify" && (import_utils104.ASTUtils.findVariable(context.sourceCode.getScope(input.callee.object), "JSON")?.defs.length ?? 0) === 0) return false;
18045
+ return property === "parse" && object !== null && object.type === import_utils104.AST_NODE_TYPES.Identifier && object.name === "JSON" && (import_utils104.ASTUtils.findVariable(context.sourceCode.getScope(object), "JSON")?.defs.length ?? 0) === 0 && !isLocalFileRead(current.arguments[0]) && isKnownLocalText?.(current.arguments[0]) !== true;
17972
18046
  };
17973
18047
  var isResponseSource = (node, context, seen = /* @__PURE__ */ new Set()) => {
17974
18048
  let current = unwrap6(node);
@@ -17994,7 +18068,7 @@ var isDirectLocalFileRead = (node) => {
17994
18068
  }
17995
18069
  if (current?.type !== import_utils104.AST_NODE_TYPES.CallExpression) return false;
17996
18070
  const callee = unwrap6(current.callee);
17997
- const name = callee?.type === import_utils104.AST_NODE_TYPES.Identifier ? callee.name : callee?.type === import_utils104.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils104.AST_NODE_TYPES.Identifier ? callee.property.name : null;
18071
+ const name = callee?.type === import_utils104.AST_NODE_TYPES.Identifier ? callee.name : callee?.type === import_utils104.AST_NODE_TYPES.MemberExpression && import_utils104.ASTUtils.getPropertyName(callee) !== null ? import_utils104.ASTUtils.getPropertyName(callee) ?? "" : null;
17998
18072
  return name !== null && FILE_READ_RE.test(name);
17999
18073
  };
18000
18074
  var isLocalFileRead = (node) => {
@@ -18055,7 +18129,7 @@ var isValidationRead = (node) => {
18055
18129
  return false;
18056
18130
  }
18057
18131
  const callee = parent.callee;
18058
- if (callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && callee.object.name === "Array" && callee.property.type === import_utils104.AST_NODE_TYPES.Identifier && callee.property.name === "isArray") {
18132
+ if (callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && callee.object.name === "Array" && import_utils104.ASTUtils.getPropertyName(callee) !== null && (import_utils104.ASTUtils.getPropertyName(callee) ?? "") === "isArray") {
18059
18133
  return parent.arguments.length === 1;
18060
18134
  }
18061
18135
  return callee.type === import_utils104.AST_NODE_TYPES.Identifier && GUARD_NAME_RE.test(callee.name);
@@ -18083,9 +18157,9 @@ var bindingValidationPolarity = (test, bindingName) => {
18083
18157
  }
18084
18158
  return test.operator === "!==" || test.operator === "!=" ? "valid-when-false" : null;
18085
18159
  }
18086
- return test.type === import_utils104.AST_NODE_TYPES.CallExpression && test.arguments.length === 1 && test.arguments[0]?.type === import_utils104.AST_NODE_TYPES.Identifier && test.arguments[0].name === bindingName && test.callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && !test.callee.computed && test.callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && test.callee.object.name === "Array" && test.callee.property.type === import_utils104.AST_NODE_TYPES.Identifier && test.callee.property.name === "isArray" ? "valid-when-true" : null;
18160
+ return test.type === import_utils104.AST_NODE_TYPES.CallExpression && test.arguments.length === 1 && test.arguments[0]?.type === import_utils104.AST_NODE_TYPES.Identifier && test.arguments[0].name === bindingName && test.callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && test.callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && test.callee.object.name === "Array" && import_utils104.ASTUtils.getPropertyName(test.callee) !== null && (import_utils104.ASTUtils.getPropertyName(test.callee) ?? "") === "isArray" ? "valid-when-true" : null;
18087
18161
  };
18088
- var plainMemberAccess = (node) => node.type === import_utils104.AST_NODE_TYPES.MemberExpression && !node.computed && node.object.type === import_utils104.AST_NODE_TYPES.Identifier && node.property.type === import_utils104.AST_NODE_TYPES.Identifier ? { object: node.object.name, property: node.property.name } : null;
18162
+ var plainMemberAccess = (node) => node.type === import_utils104.AST_NODE_TYPES.MemberExpression && node.object.type === import_utils104.AST_NODE_TYPES.Identifier && import_utils104.ASTUtils.getPropertyName(node) !== null ? { object: node.object.name, property: import_utils104.ASTUtils.getPropertyName(node) ?? "" } : null;
18089
18163
  var isSamePlainMember = (node, access) => {
18090
18164
  const candidate2 = plainMemberAccess(node);
18091
18165
  return candidate2 !== null && candidate2.object === access.object && candidate2.property === access.property;
@@ -18147,7 +18221,7 @@ var memberValidationPolarity = (test, access) => {
18147
18221
  }
18148
18222
  return test.operator === "!==" || test.operator === "!=" ? "valid-when-false" : null;
18149
18223
  }
18150
- return test.type === import_utils104.AST_NODE_TYPES.CallExpression && test.arguments.length === 1 && test.arguments[0] !== void 0 && test.arguments[0].type !== import_utils104.AST_NODE_TYPES.SpreadElement && isSamePlainMember(test.arguments[0], access) && test.callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && !test.callee.computed && test.callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && test.callee.object.name === "Array" && test.callee.property.type === import_utils104.AST_NODE_TYPES.Identifier && test.callee.property.name === "isArray" ? "valid-when-true" : null;
18224
+ return test.type === import_utils104.AST_NODE_TYPES.CallExpression && test.arguments.length === 1 && test.arguments[0] !== void 0 && test.arguments[0].type !== import_utils104.AST_NODE_TYPES.SpreadElement && isSamePlainMember(test.arguments[0], access) && test.callee.type === import_utils104.AST_NODE_TYPES.MemberExpression && test.callee.object.type === import_utils104.AST_NODE_TYPES.Identifier && test.callee.object.name === "Array" && import_utils104.ASTUtils.getPropertyName(test.callee) !== null && (import_utils104.ASTUtils.getPropertyName(test.callee) ?? "") === "isArray" ? "valid-when-true" : null;
18151
18225
  };
18152
18226
  var isFullyValidatedExtractedBinding = (member, source, context) => {
18153
18227
  const isValidationReference = (identifier) => {
@@ -18430,7 +18504,7 @@ var prefer_schema_for_api_payload_default = createRule({
18430
18504
  (candidate2) => localFileTextRef(candidate2, scope) !== null
18431
18505
  )) {
18432
18506
  const parent = node.parent;
18433
- if (parent.type === import_utils104.AST_NODE_TYPES.CallExpression && parent.callee === node && node.property.type === import_utils104.AST_NODE_TYPES.Identifier && (node.property.name === "parse" || node.property.name === "safeParse" || PROMISE_CHAIN_METHODS.has(node.property.name))) {
18507
+ if (parent.type === import_utils104.AST_NODE_TYPES.CallExpression && parent.callee === node && import_utils104.ASTUtils.getPropertyName(node) !== null && ((import_utils104.ASTUtils.getPropertyName(node) ?? "") === "parse" || (import_utils104.ASTUtils.getPropertyName(node) ?? "") === "safeParse" || PROMISE_CHAIN_METHODS.has(import_utils104.ASTUtils.getPropertyName(node) ?? ""))) {
18434
18508
  return;
18435
18509
  }
18436
18510
  context.report({ node, messageId: "unparsedJsonAccess" });
@@ -18545,7 +18619,7 @@ var prefer_shared_zod_enum_default = createRule({
18545
18619
  }
18546
18620
  },
18547
18621
  CallExpression(node) {
18548
- if (node.callee.type !== import_utils105.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils105.AST_NODE_TYPES.Identifier || node.callee.property.type !== import_utils105.AST_NODE_TYPES.Identifier || node.callee.property.name !== "enum") return;
18622
+ if (node.callee.type !== import_utils105.AST_NODE_TYPES.MemberExpression || node.callee.object.type !== import_utils105.AST_NODE_TYPES.Identifier || import_utils105.ASTUtils.getPropertyName(node.callee) === null || (import_utils105.ASTUtils.getPropertyName(node.callee) ?? "") !== "enum") return;
18549
18623
  const binding = bindingOf(node.callee.object);
18550
18624
  if (binding === null || !zodBindings.has(binding)) return;
18551
18625
  const domain = literalDomain(node);
@@ -19422,8 +19496,7 @@ var prefer_server_actions_default = createRule({
19422
19496
  var import_utils109 = require("@typescript-eslint/utils");
19423
19497
  var MERGEABLE_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
19424
19498
  var SYNTHETIC_LITERAL_MATCHERS = /* @__PURE__ */ new Map([
19425
- ["toBeNull", "null"],
19426
- ["toBeUndefined", "undefined"]
19499
+ ["toBeNull", "null"]
19427
19500
  ]);
19428
19501
  var ARRAY_MATCHERS = /* @__PURE__ */ new Set(["toEqual", "toStrictEqual"]);
19429
19502
  var COLLECTION_PROPERTIES = /* @__PURE__ */ new Set(["length", "size"]);
@@ -19438,7 +19511,7 @@ var PREFER_WHOLE_OBJECT_ASSERTION_DOCUMENTATION = {
19438
19511
  category: "testing",
19439
19512
  aliases: ["strict-test-assertions"],
19440
19513
  autofix: "none",
19441
- limitations: ["No automatic rewrite: whole-object matching can require previously absent properties and change observable getter or proxy reads."],
19514
+ limitations: ["Undefined-property assertions are excluded because whole-object matching can require previously absent properties. No automatic rewrite: grouping can change observable getter or proxy reads."],
19442
19515
  examples: [
19443
19516
  { id: "whole-object", title: "Assert the object once", outcome: "no-match", files: [{ path: "src/user.test.ts", source: "expect(user).toMatchObject({ id: 1, name: 'Ada' });" }], focusPath: "src/user.test.ts", expectedCount: 0, public: true },
19444
19517
  { id: "member-run", title: "Consider grouping related data properties", outcome: "match", files: [{ path: "src/user.test.ts", source: "expect(user.id).toBe(1);\nexpect(user.name).toBe('Ada');" }], focusPath: "src/user.test.ts", expectedCount: 1, public: true }
@@ -19482,9 +19555,9 @@ function literalIndex(node) {
19482
19555
  function propertyAccess(node) {
19483
19556
  const path = [];
19484
19557
  let current = node;
19485
- while (current.type === import_utils109.AST_NODE_TYPES.MemberExpression && !current.computed && !current.optional) {
19486
- if (current.property.type !== import_utils109.AST_NODE_TYPES.Identifier || COLLECTION_PROPERTIES.has(current.property.name) || LITERAL_KEY_HAZARDS.has(current.property.name)) return null;
19487
- path.unshift(current.property.name);
19558
+ while (current.type === import_utils109.AST_NODE_TYPES.MemberExpression && !current.optional) {
19559
+ if (import_utils109.ASTUtils.getPropertyName(current) === null || COLLECTION_PROPERTIES.has(import_utils109.ASTUtils.getPropertyName(current) ?? "") || LITERAL_KEY_HAZARDS.has(import_utils109.ASTUtils.getPropertyName(current) ?? "")) return null;
19560
+ path.unshift(import_utils109.ASTUtils.getPropertyName(current) ?? "");
19488
19561
  current = current.object;
19489
19562
  }
19490
19563
  return path.length > 0 && isPureReceiver(current) ? { receiver: current, path } : null;
@@ -19558,7 +19631,7 @@ var prefer_whole_object_assertion_default = createRule({
19558
19631
  if (first === void 0) {
19559
19632
  return;
19560
19633
  }
19561
- const receiverText = `${sourceCode.getText(first.receiver)}${commonPrefix.map((name) => `.${name}`).join("")}`;
19634
+ const receiverText = `${sourceCode.getText(first.receiver)}${commonPrefix.map((name) => /^[A-Za-z_$][\w$]*$/u.test(name) ? `.${name}` : `[${JSON.stringify(name)}]`).join("")}`;
19562
19635
  context.report({
19563
19636
  node: first.statement,
19564
19637
  messageId: "combineAssertions",
@@ -19627,10 +19700,10 @@ var prefer_whole_object_assertion_default = createRule({
19627
19700
  return null;
19628
19701
  }
19629
19702
  const callee = call.callee;
19630
- if (callee.type !== import_utils109.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils109.AST_NODE_TYPES.Identifier) {
19703
+ if (callee.type !== import_utils109.AST_NODE_TYPES.MemberExpression || import_utils109.ASTUtils.getPropertyName(callee) === null) {
19631
19704
  return null;
19632
19705
  }
19633
- const matcher = callee.property.name;
19706
+ const matcher = import_utils109.ASTUtils.getPropertyName(callee) ?? "";
19634
19707
  const expectCall = callee.object;
19635
19708
  if (expectCall.type !== import_utils109.AST_NODE_TYPES.CallExpression || expectCall.callee.type !== import_utils109.AST_NODE_TYPES.Identifier || expectCall.callee.name !== "expect" || expectCall.arguments.length !== 1) {
19636
19709
  return null;
@@ -19645,11 +19718,8 @@ var prefer_whole_object_assertion_default = createRule({
19645
19718
  }
19646
19719
  let key;
19647
19720
  let receiver;
19648
- if (actual.computed) {
19649
- const index = literalIndex(actual.property);
19650
- if (index === null) {
19651
- return null;
19652
- }
19721
+ const index = actual.computed ? literalIndex(actual.property) : null;
19722
+ if (index !== null) {
19653
19723
  key = { kind: "index", index };
19654
19724
  receiver = actual.object;
19655
19725
  } else {
@@ -19725,7 +19795,7 @@ var EXPECT_MODIFIERS = /* @__PURE__ */ new Set(["not", "rejects", "resolves"]);
19725
19795
  var SNAPSHOT_MATCHERS = /snapshot/iu;
19726
19796
  var MIN_CASES2 = 3;
19727
19797
  function staticMemberName7(node) {
19728
- if (!node.computed && node.property.type === import_utils110.AST_NODE_TYPES.Identifier) return node.property.name;
19798
+ if (import_utils110.ASTUtils.getPropertyName(node) !== null) return import_utils110.ASTUtils.getPropertyName(node) ?? "";
19729
19799
  if (node.computed && node.property.type === import_utils110.AST_NODE_TYPES.Literal && typeof node.property.value === "string") return node.property.value;
19730
19800
  return null;
19731
19801
  }
@@ -19795,8 +19865,8 @@ function staticShape(node) {
19795
19865
  function assertionShape(statement, context, callback) {
19796
19866
  if (statement.type !== import_utils110.AST_NODE_TYPES.ExpressionStatement || statement.expression.type !== import_utils110.AST_NODE_TYPES.CallExpression) return null;
19797
19867
  const matcherCall = statement.expression;
19798
- if (matcherCall.callee.type !== import_utils110.AST_NODE_TYPES.MemberExpression || matcherCall.callee.computed || matcherCall.callee.property.type !== import_utils110.AST_NODE_TYPES.Identifier || matcherCall.arguments.length !== 1) return null;
19799
- const matcher = matcherCall.callee.property.name;
19868
+ if (matcherCall.callee.type !== import_utils110.AST_NODE_TYPES.MemberExpression || import_utils110.ASTUtils.getPropertyName(matcherCall.callee) === null || matcherCall.arguments.length !== 1) return null;
19869
+ const matcher = import_utils110.ASTUtils.getPropertyName(matcherCall.callee) ?? "";
19800
19870
  if (SNAPSHOT_MATCHERS.test(matcher)) return null;
19801
19871
  const chain = expectCallFromMatcher(matcherCall.callee);
19802
19872
  if (chain === null || chain.call.callee.type !== import_utils110.AST_NODE_TYPES.Identifier || importedName7(chain.call.callee, context, ASSERTION_MODULES3) !== "expect" || chain.call.arguments.length !== 1) return null;
@@ -20208,7 +20278,7 @@ function twinCallChain(node, zodNamespaces) {
20208
20278
  let current = node;
20209
20279
  while (current.type === import_utils111.AST_NODE_TYPES.CallExpression) {
20210
20280
  const callee = current.callee;
20211
- if (callee.type !== import_utils111.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils111.AST_NODE_TYPES.Identifier) {
20281
+ if (callee.type !== import_utils111.AST_NODE_TYPES.MemberExpression || import_utils111.ASTUtils.getPropertyName(callee) === null) {
20212
20282
  return null;
20213
20283
  }
20214
20284
  chain.push(current);
@@ -20221,7 +20291,7 @@ function twinCallChain(node, zodNamespaces) {
20221
20291
  }
20222
20292
  function twinMethodName(call) {
20223
20293
  const callee = call.callee;
20224
- return callee.type === import_utils111.AST_NODE_TYPES.MemberExpression && callee.property.type === import_utils111.AST_NODE_TYPES.Identifier ? callee.property.name : "";
20294
+ return callee.type === import_utils111.AST_NODE_TYPES.MemberExpression && import_utils111.ASTUtils.getPropertyName(callee) !== null ? import_utils111.ASTUtils.getPropertyName(callee) ?? "" : "";
20225
20295
  }
20226
20296
  function twinSchemaFields(initializer, zodNamespaces) {
20227
20297
  const chain = twinCallChain(initializer, zodNamespaces);
@@ -20250,16 +20320,16 @@ function twinSchemaField(node, zodNamespaces) {
20250
20320
  let leafCall = null;
20251
20321
  while (current.type === import_utils111.AST_NODE_TYPES.CallExpression) {
20252
20322
  const callee = current.callee;
20253
- if (callee.type !== import_utils111.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils111.AST_NODE_TYPES.Identifier) {
20323
+ if (callee.type !== import_utils111.AST_NODE_TYPES.MemberExpression || import_utils111.ASTUtils.getPropertyName(callee) === null) {
20254
20324
  break;
20255
20325
  }
20256
20326
  const receiver = callee.object;
20257
20327
  if (receiver.type === import_utils111.AST_NODE_TYPES.Identifier && zodNamespaces.has(receiver.name)) {
20258
- leaf = callee.property.name;
20328
+ leaf = import_utils111.ASTUtils.getPropertyName(callee) ?? "";
20259
20329
  leafCall = current;
20260
20330
  break;
20261
20331
  }
20262
- modifiers.push(callee.property.name);
20332
+ modifiers.push(import_utils111.ASTUtils.getPropertyName(callee) ?? "");
20263
20333
  current = receiver;
20264
20334
  }
20265
20335
  return {
@@ -20461,8 +20531,8 @@ var prefer_zod_infer_default = createRule({
20461
20531
  }
20462
20532
  },
20463
20533
  /** Records `XSchema.transform(...)` and equivalent module-level reshaping. */
20464
- "MemberExpression[computed=false]"(node) {
20465
- if (node.object.type === import_utils111.AST_NODE_TYPES.Identifier && node.property.type === import_utils111.AST_NODE_TYPES.Identifier && isPreferZodInferModuleReshaper(node.property.name)) {
20534
+ "MemberExpression"(node) {
20535
+ if (node.object.type === import_utils111.AST_NODE_TYPES.Identifier && import_utils111.ASTUtils.getPropertyName(node) !== null && isPreferZodInferModuleReshaper(import_utils111.ASTUtils.getPropertyName(node) ?? "")) {
20466
20536
  reshapedSchemaNames.add(node.object.name);
20467
20537
  }
20468
20538
  },
@@ -20683,11 +20753,11 @@ function isLocalZodObjectSchema(node, namespaces) {
20683
20753
  let current = node;
20684
20754
  while (current.type === import_utils112.AST_NODE_TYPES.CallExpression) {
20685
20755
  const { callee } = current;
20686
- if (callee.type !== import_utils112.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils112.AST_NODE_TYPES.Identifier) {
20756
+ if (callee.type !== import_utils112.AST_NODE_TYPES.MemberExpression || import_utils112.ASTUtils.getPropertyName(callee) === null) {
20687
20757
  return false;
20688
20758
  }
20689
20759
  if (callee.object.type === import_utils112.AST_NODE_TYPES.Identifier) {
20690
- return namespaces.has(callee.object.name) && (callee.property.name === "object" || callee.property.name === "strictObject");
20760
+ return namespaces.has(callee.object.name) && ((import_utils112.ASTUtils.getPropertyName(callee) ?? "") === "object" || (import_utils112.ASTUtils.getPropertyName(callee) ?? "") === "strictObject");
20691
20761
  }
20692
20762
  current = callee.object;
20693
20763
  }
@@ -20695,12 +20765,14 @@ function isLocalZodObjectSchema(node, namespaces) {
20695
20765
  }
20696
20766
  function zodParseCall(node) {
20697
20767
  const { callee } = node;
20698
- if (callee.type !== import_utils112.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils112.AST_NODE_TYPES.Identifier || callee.property.type !== import_utils112.AST_NODE_TYPES.Identifier || callee.property.name !== "parse" && callee.property.name !== "safeParse") {
20768
+ if (callee.type !== import_utils112.AST_NODE_TYPES.MemberExpression || callee.object.type !== import_utils112.AST_NODE_TYPES.Identifier || import_utils112.ASTUtils.getPropertyName(callee) === null) {
20699
20769
  return null;
20700
20770
  }
20771
+ const method = import_utils112.ASTUtils.getPropertyName(callee);
20772
+ if (method !== "parse" && method !== "safeParse") return null;
20701
20773
  return {
20702
20774
  call: node,
20703
- method: callee.property.name,
20775
+ method,
20704
20776
  schema: callee.object
20705
20777
  };
20706
20778
  }
@@ -20738,7 +20810,7 @@ function localParseReturnCandidates(node, sourceCode) {
20738
20810
  for (const reference of variable.references) {
20739
20811
  const identifier = reference.identifier;
20740
20812
  const parent = identifier.parent;
20741
- const output = parsed.method === "parse" ? identifier : parent.type === import_utils112.AST_NODE_TYPES.MemberExpression && parent.object === identifier && !parent.computed && parent.property.type === import_utils112.AST_NODE_TYPES.Identifier && parent.property.name === "data" ? parent : null;
20813
+ const output = parsed.method === "parse" ? identifier : parent.type === import_utils112.AST_NODE_TYPES.MemberExpression && parent.object === identifier && import_utils112.ASTUtils.getPropertyName(parent) !== null && (import_utils112.ASTUtils.getPropertyName(parent) ?? "") === "data" ? parent : null;
20742
20814
  if (output === null) continue;
20743
20815
  const candidate2 = returnedOutputCandidate(parsed, output);
20744
20816
  if (candidate2 !== null) candidates.push(candidate2);
@@ -20971,7 +21043,7 @@ var prefer_zod_parse_output_type_default = createRule({
20971
21043
  const candidate2 = directParseReturnCandidate(node);
20972
21044
  if (candidate2 !== null) candidates.push(candidate2);
20973
21045
  },
20974
- "MemberExpression[computed=false]"(node) {
21046
+ "MemberExpression"(node) {
20975
21047
  if (node.object.type === import_utils112.AST_NODE_TYPES.Identifier && node.property.type === import_utils112.AST_NODE_TYPES.Identifier && isPreferZodInferModuleReshaper(node.property.name)) {
20976
21048
  reshapedSchemas.add(node.object.name);
20977
21049
  }
@@ -21895,7 +21967,7 @@ var require_use_form_default_values_default = createRule({
21895
21967
  const variable = bindingOf(node);
21896
21968
  return variable !== null && stable(variable) && uninitializedControls.has(variable);
21897
21969
  }
21898
- return node.type === import_utils118.AST_NODE_TYPES.MemberExpression && !node.computed && node.property.type === import_utils118.AST_NODE_TYPES.Identifier && node.property.name === "control" && isUninitializedForm(node.object);
21970
+ return node.type === import_utils118.AST_NODE_TYPES.MemberExpression && import_utils118.ASTUtils.getPropertyName(node) !== null && (import_utils118.ASTUtils.getPropertyName(node) ?? "") === "control" && isUninitializedForm(node.object);
21899
21971
  };
21900
21972
  const fieldOptionsNeedDefault = (node) => {
21901
21973
  if (node?.type !== import_utils118.AST_NODE_TYPES.ObjectExpression) return false;
@@ -21951,7 +22023,7 @@ var require_use_form_default_values_default = createRule({
21951
22023
  trackDestructuredControl(node.id);
21952
22024
  return;
21953
22025
  }
21954
- if (node.id.type === import_utils118.AST_NODE_TYPES.Identifier && node.init.type === import_utils118.AST_NODE_TYPES.MemberExpression && !node.init.computed && node.init.property.type === import_utils118.AST_NODE_TYPES.Identifier && node.init.property.name === "control" && isUninitializedForm(node.init.object)) {
22026
+ if (node.id.type === import_utils118.AST_NODE_TYPES.Identifier && node.init.type === import_utils118.AST_NODE_TYPES.MemberExpression && import_utils118.ASTUtils.getPropertyName(node.init) !== null && (import_utils118.ASTUtils.getPropertyName(node.init) ?? "") === "control" && isUninitializedForm(node.init.object)) {
21955
22027
  const variable = bindingOf(node.id);
21956
22028
  if (variable !== null) uninitializedControls.add(variable);
21957
22029
  }
@@ -22088,7 +22160,7 @@ var isFormDataMethodCall = (node) => {
22088
22160
  }
22089
22161
  if (current.type !== import_utils120.AST_NODE_TYPES.CallExpression) return false;
22090
22162
  const callee = current.callee;
22091
- return callee.type === import_utils120.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils120.AST_NODE_TYPES.Identifier && callee.property.name === "formData";
22163
+ return callee.type === import_utils120.AST_NODE_TYPES.MemberExpression && import_utils120.ASTUtils.getPropertyName(callee) !== null && (import_utils120.ASTUtils.getPropertyName(callee) ?? "") === "formData";
22092
22164
  };
22093
22165
  var require_zod_form_validation_default = createRule({
22094
22166
  name: "require-zod-form-validation",
@@ -22116,7 +22188,7 @@ var require_zod_form_validation_default = createRule({
22116
22188
  const isFormDataGetCall = (node) => {
22117
22189
  const callee = node.callee;
22118
22190
  if (callee.type !== import_utils120.AST_NODE_TYPES.MemberExpression) return false;
22119
- if (callee.property.type !== import_utils120.AST_NODE_TYPES.Identifier || !FORM_VALUE_METHODS.has(callee.property.name)) {
22191
+ if (import_utils120.ASTUtils.getPropertyName(callee) === null || !FORM_VALUE_METHODS.has(import_utils120.ASTUtils.getPropertyName(callee) ?? "")) {
22120
22192
  return false;
22121
22193
  }
22122
22194
  return isFormSourceIdentifier(callee.object);
@@ -22146,7 +22218,7 @@ var require_zod_form_validation_default = createRule({
22146
22218
  parent = parent.parent;
22147
22219
  continue;
22148
22220
  }
22149
- if (parent.type === import_utils120.AST_NODE_TYPES.CallExpression && parent.callee.type === import_utils120.AST_NODE_TYPES.MemberExpression && !parent.callee.computed && parent.callee.object.type === import_utils120.AST_NODE_TYPES.Identifier && parent.callee.object.name === "Object" && parent.callee.property.type === import_utils120.AST_NODE_TYPES.Identifier && parent.callee.property.name === "fromEntries" && (resolvedBinding(parent.callee.object)?.defs.length ?? 0) === 0) {
22221
+ if (parent.type === import_utils120.AST_NODE_TYPES.CallExpression && parent.callee.type === import_utils120.AST_NODE_TYPES.MemberExpression && parent.callee.object.type === import_utils120.AST_NODE_TYPES.Identifier && parent.callee.object.name === "Object" && import_utils120.ASTUtils.getPropertyName(parent.callee) !== null && (import_utils120.ASTUtils.getPropertyName(parent.callee) ?? "") === "fromEntries" && (resolvedBinding(parent.callee.object)?.defs.length ?? 0) === 0) {
22150
22222
  parent = parent.parent;
22151
22223
  continue;
22152
22224
  }
@@ -22158,7 +22230,7 @@ var require_zod_form_validation_default = createRule({
22158
22230
  const isZodParseCall = (node) => {
22159
22231
  if (node.type !== import_utils120.AST_NODE_TYPES.CallExpression) return false;
22160
22232
  const callee = node.callee;
22161
- if (callee.type !== import_utils120.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils120.AST_NODE_TYPES.Identifier || !ZOD_PARSE_METHODS.has(callee.property.name)) {
22233
+ if (callee.type !== import_utils120.AST_NODE_TYPES.MemberExpression || import_utils120.ASTUtils.getPropertyName(callee) === null || !ZOD_PARSE_METHODS.has(import_utils120.ASTUtils.getPropertyName(callee) ?? "")) {
22162
22234
  return false;
22163
22235
  }
22164
22236
  const root = zodReceiverRoot(callee.object);
@@ -22244,7 +22316,7 @@ var require_zod_form_validation_default = createRule({
22244
22316
  };
22245
22317
  const zodParseMethod = (call) => {
22246
22318
  const callee = call.callee;
22247
- return callee.type === import_utils120.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils120.AST_NODE_TYPES.Identifier ? callee.property.name : null;
22319
+ return callee.type === import_utils120.AST_NODE_TYPES.MemberExpression && import_utils120.ASTUtils.getPropertyName(callee) !== null ? import_utils120.ASTUtils.getPropertyName(callee) ?? "" : null;
22248
22320
  };
22249
22321
  const isSafePrevalidationInspection = (identifier) => {
22250
22322
  const parent = identifier.parent;
@@ -23613,7 +23685,7 @@ var SCHEMA_RETURNING_METHODS = /* @__PURE__ */ new Set([
23613
23685
  "superRefine",
23614
23686
  "transform"
23615
23687
  ]);
23616
- var terminalMethodName = (callee) => !callee.computed && callee.property.type === import_utils125.AST_NODE_TYPES.Identifier ? callee.property.name : null;
23688
+ var terminalMethodName = (callee) => import_utils125.ASTUtils.getPropertyName(callee) !== null ? import_utils125.ASTUtils.getPropertyName(callee) ?? "" : null;
23617
23689
  var calleeChainRoot2 = (node) => {
23618
23690
  let current = node;
23619
23691
  for (; ; ) {
@@ -23636,8 +23708,8 @@ var chainMemberNames2 = (node) => {
23636
23708
  let current = node;
23637
23709
  for (; ; ) {
23638
23710
  if (current.type === import_utils125.AST_NODE_TYPES.MemberExpression) {
23639
- if (current.computed || current.property.type !== import_utils125.AST_NODE_TYPES.Identifier) return [];
23640
- names.push(current.property.name);
23711
+ if (import_utils125.ASTUtils.getPropertyName(current) === null) return [];
23712
+ names.push(import_utils125.ASTUtils.getPropertyName(current) ?? "");
23641
23713
  current = current.object;
23642
23714
  continue;
23643
23715
  }
@@ -23949,7 +24021,7 @@ var RULES = {
23949
24021
  };
23950
24022
  var meta = {
23951
24023
  name: "@sarj/eslint-plugin",
23952
- version: "16.2.6"
24024
+ version: "16.3.1"
23953
24025
  };
23954
24026
  var APPLICATION_ONLY_RULES = [];
23955
24027
  var LIBRARY_IMPORT_POLICY = ["error", {