@sarj/eslint-plugin 9.13.1 → 9.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -55,9 +55,10 @@ var createRule = import_utils.ESLintUtils.RuleCreator(examplesUrl);
55
55
  var SCRIPT_FILE_RE = /([\\/]scripts[\\/])|(\.mjs$)/;
56
56
  var STORY_FILE_RE = /\.stories\.[cm]?[jt]sx?$/i;
57
57
  var STORY_TREE_RE = /(^|\/)stories(?:[_-][^/]*)?\//i;
58
- var GENERATED_FILE_RE = /([\\/](?:generated|openapi-gen|graphql[\\/]types|vendor|vendored|third[-_]?party)[\\/])|(\.gen\.[cm]?[jt]sx?$)|(\.generated\.[cm]?[jt]sx?$)|(\.d\.[cm]?ts$)|(\.types\.[cm]?ts$)/;
58
+ var GENERATED_FILE_RE = /((?:^|[\\/])(?:generated|__generated__|openapi-gen|graphql[\\/]types|vendor|vendored|third[-_]?party)[\\/])|(\.gen\.[cm]?[jt]sx?$)|(\.generated\.[cm]?[jt]sx?$)|(\.d\.[cm]?ts$)|(\.types\.[cm]?ts$)/i;
59
59
  var EXTERNAL_TREE_RE = /[\\/]external[\\/]/;
60
60
  var GENERATED_MARKER_RE = /(?:@generated\b|this file (?:is|was|has been)[\w\s,'-]{0,40}?generated|auto-?generated file\b|generated (?:with|by)|generated (?:graphql )?types|do not edit(?: directly| manually)?|do not (?:modify|change) this file)/i;
61
+ var COMMENT_LINE_RE = /^\s*(?:\/\/|\/\*+|\*|#)/;
61
62
  var TEST_BASENAME_RE = /[.\-_](test|spec|e2e)\.[cm]?[jt]sx?$/;
62
63
  var TEST_INTEGRATION_BASENAME_RE = /\.integration\.[cm]?[jt]sx?$/;
63
64
  var TEST_DIR_RE = /(^|\/)(tests?|__tests__|__mocks__|fixtures|__fixtures__|__testfixtures__|e2e|integration)\//;
@@ -88,7 +89,7 @@ function isGeneratedFile(filename, sourceText = "", gates = []) {
88
89
  if (gates.includes("externalTree") && EXTERNAL_TREE_RE.test(normalized)) {
89
90
  return true;
90
91
  }
91
- return GENERATED_MARKER_RE.test(sourceText.slice(0, 2048));
92
+ return sourceText.slice(0, 2048).split("\n").some((line) => COMMENT_LINE_RE.test(line) && GENERATED_MARKER_RE.test(line));
92
93
  }
93
94
  function isScriptFile(filename) {
94
95
  return SCRIPT_FILE_RE.test(filename);
@@ -3183,8 +3184,204 @@ var no_long_comment_default = createRule({
3183
3184
  }
3184
3185
  });
3185
3186
 
3186
- // src/rules/no-offset-pagination.ts
3187
+ // src/rules/no-generic-single-export-module.ts
3187
3188
  var import_utils20 = require("@typescript-eslint/utils");
3189
+ var GENERIC_STEMS = /* @__PURE__ */ new Set([
3190
+ "base",
3191
+ "common",
3192
+ "constant",
3193
+ "constants",
3194
+ "core",
3195
+ "enum",
3196
+ "enums",
3197
+ "helper",
3198
+ "helpers",
3199
+ "misc",
3200
+ "model",
3201
+ "models",
3202
+ "shared",
3203
+ "stuff",
3204
+ "type",
3205
+ "types",
3206
+ "util",
3207
+ "utils"
3208
+ ]);
3209
+ var CONVENTIONAL_STEMS = /* @__PURE__ */ new Set(["base", "models"]);
3210
+ var CJS_OBJECT_EXPORT_METHODS = /* @__PURE__ */ new Set(["assign", "defineProperties", "defineProperty"]);
3211
+ function fileParts(filename) {
3212
+ const base = filename.replaceAll("\\", "/").split("/").at(-1) ?? "";
3213
+ const extension = base.match(/(\.[cm]?[jt]sx?)$/u)?.[1] ?? ".ts";
3214
+ const segments = base.slice(0, -extension.length).split(".");
3215
+ return {
3216
+ extension,
3217
+ stem: segments[0]?.toLowerCase() ?? "",
3218
+ suffixes: segments.slice(1)
3219
+ };
3220
+ }
3221
+ function declaredNames(declaration) {
3222
+ if (declaration.declare === true) return [];
3223
+ if (declaration.type === import_utils20.AST_NODE_TYPES.FunctionDeclaration || declaration.type === import_utils20.AST_NODE_TYPES.ClassDeclaration || declaration.type === import_utils20.AST_NODE_TYPES.TSEnumDeclaration) {
3224
+ if (declaration.type === import_utils20.AST_NODE_TYPES.TSEnumDeclaration && declaration.const) return [];
3225
+ return declaration.id === null ? [] : [declaration.id.name];
3226
+ }
3227
+ if (declaration.type === import_utils20.AST_NODE_TYPES.TSModuleDeclaration && declaration.id.type === import_utils20.AST_NODE_TYPES.Identifier) {
3228
+ return [declaration.id.name];
3229
+ }
3230
+ if (declaration.type !== import_utils20.AST_NODE_TYPES.VariableDeclaration) return [];
3231
+ return declaration.declarations.flatMap(
3232
+ (item) => item.id.type === import_utils20.AST_NODE_TYPES.Identifier ? [item.id.name] : []
3233
+ );
3234
+ }
3235
+ function typeOnlyBindings(program) {
3236
+ const names = /* @__PURE__ */ new Set();
3237
+ const runtimeNames = /* @__PURE__ */ new Set();
3238
+ for (const statement of program.body) {
3239
+ const declaration = statement.type === import_utils20.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
3240
+ if (declaration?.type === import_utils20.AST_NODE_TYPES.TSInterfaceDeclaration || declaration?.type === import_utils20.AST_NODE_TYPES.TSTypeAliasDeclaration) {
3241
+ names.add(declaration.id.name);
3242
+ continue;
3243
+ }
3244
+ if (declaration?.type === import_utils20.AST_NODE_TYPES.TSEnumDeclaration && declaration.const) {
3245
+ names.add(declaration.id.name);
3246
+ continue;
3247
+ }
3248
+ if (statement.type === import_utils20.AST_NODE_TYPES.ImportDeclaration) {
3249
+ for (const specifier of statement.specifiers) {
3250
+ if (statement.importKind === "type" || specifier.type === import_utils20.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type") {
3251
+ names.add(specifier.local.name);
3252
+ } else {
3253
+ runtimeNames.add(specifier.local.name);
3254
+ }
3255
+ }
3256
+ continue;
3257
+ }
3258
+ if (declaration?.type === import_utils20.AST_NODE_TYPES.TSDeclareFunction && declaration.id !== null) {
3259
+ names.add(declaration.id.name);
3260
+ continue;
3261
+ }
3262
+ if (declaration !== null && declaration.declare === true) {
3263
+ if ((declaration.type === import_utils20.AST_NODE_TYPES.ClassDeclaration || declaration.type === import_utils20.AST_NODE_TYPES.FunctionDeclaration || declaration.type === import_utils20.AST_NODE_TYPES.TSEnumDeclaration || declaration.type === import_utils20.AST_NODE_TYPES.TSModuleDeclaration) && declaration.id !== null && declaration.id.type === import_utils20.AST_NODE_TYPES.Identifier) names.add(declaration.id.name);
3264
+ if (declaration.type === import_utils20.AST_NODE_TYPES.VariableDeclaration) {
3265
+ for (const item of declaration.declarations) {
3266
+ if (item.id.type === import_utils20.AST_NODE_TYPES.Identifier) names.add(item.id.name);
3267
+ }
3268
+ }
3269
+ continue;
3270
+ }
3271
+ if (declaration !== null && "type" in declaration) {
3272
+ for (const name of declaredNames(declaration)) {
3273
+ runtimeNames.add(name);
3274
+ }
3275
+ }
3276
+ }
3277
+ return new Set([...names].filter((name) => !runtimeNames.has(name)));
3278
+ }
3279
+ function runtimeExports(program) {
3280
+ const exports2 = [];
3281
+ const typeBindings = typeOnlyBindings(program);
3282
+ let ambiguous = false;
3283
+ for (const statement of program.body) {
3284
+ if (statement.type === import_utils20.AST_NODE_TYPES.ExportAllDeclaration) {
3285
+ if (statement.exportKind !== "type") ambiguous = true;
3286
+ continue;
3287
+ }
3288
+ if (statement.type === import_utils20.AST_NODE_TYPES.ExportDefaultDeclaration) {
3289
+ const declaration = statement.declaration;
3290
+ if (declaration.type === import_utils20.AST_NODE_TYPES.Identifier) {
3291
+ if (!typeBindings.has(declaration.name)) {
3292
+ exports2.push({ key: "default", name: declaration.name, node: statement });
3293
+ }
3294
+ } else if ((declaration.type === import_utils20.AST_NODE_TYPES.FunctionDeclaration || declaration.type === import_utils20.AST_NODE_TYPES.ClassDeclaration) && declaration.id !== null && declaration.declare !== true) exports2.push({ key: "default", name: declaration.id.name, node: declaration });
3295
+ else if (declaration.type !== import_utils20.AST_NODE_TYPES.TSInterfaceDeclaration && declaration.type !== import_utils20.AST_NODE_TYPES.TSTypeAliasDeclaration) ambiguous = true;
3296
+ continue;
3297
+ }
3298
+ if (statement.type !== import_utils20.AST_NODE_TYPES.ExportNamedDeclaration || statement.exportKind === "type") continue;
3299
+ if (statement.source !== null) {
3300
+ if (statement.specifiers.some((specifier) => specifier.exportKind !== "type")) ambiguous = true;
3301
+ continue;
3302
+ }
3303
+ if (statement.declaration !== null) {
3304
+ const declaration = statement.declaration;
3305
+ exports2.push(...declaredNames(declaration).map((name) => ({ key: name, name, node: declaration })));
3306
+ }
3307
+ for (const specifier of statement.specifiers) {
3308
+ if (specifier.exportKind === "type" || typeBindings.has(specifier.local.name)) continue;
3309
+ const exported = specifier.exported.type === import_utils20.AST_NODE_TYPES.Identifier ? specifier.exported.name : specifier.exported.value;
3310
+ const local = specifier.local.name;
3311
+ exports2.push({ key: exported, name: exported === "default" ? local : exported, node: specifier });
3312
+ }
3313
+ }
3314
+ const unique = new Map(exports2.map((entry) => [entry.key, entry]));
3315
+ return { exports: [...unique.values()], ambiguous };
3316
+ }
3317
+ function kebabCase(name) {
3318
+ return name.replaceAll(/oauth/giu, "Oauth").replaceAll(/graphql/giu, "Graphql").replaceAll(/grpc/giu, "Grpc").replaceAll(/([a-z\d])([A-Z])/gu, "$1-$2").replaceAll(/([A-Z]+)([A-Z][a-z])/gu, "$1-$2").replaceAll(/[_\s]+/gu, "-").replaceAll(/-+/gu, "-").replaceAll(/^-|-$/gu, "").toLowerCase();
3319
+ }
3320
+ function isGlobalIdentifier(context, node) {
3321
+ const variable = import_utils20.ASTUtils.findVariable(context.sourceCode.getScope(node), node.name);
3322
+ return variable === null || variable.defs.length === 0;
3323
+ }
3324
+ function isConventionalFrameworkUtility(filename, exported) {
3325
+ const normalized = filename.replaceAll("\\", "/");
3326
+ return exported === "cn" && /(?:^|\/)lib\/utils\.[cm]?[jt]sx?$/u.test(normalized);
3327
+ }
3328
+ function memberPropertyName(node) {
3329
+ if (!node.computed && node.property.type === import_utils20.AST_NODE_TYPES.Identifier) return node.property.name;
3330
+ return node.computed && node.property.type === import_utils20.AST_NODE_TYPES.Literal && typeof node.property.value === "string" ? node.property.value : null;
3331
+ }
3332
+ var no_generic_single_export_module_default = createRule({
3333
+ name: "no-generic-single-export-module",
3334
+ meta: {
3335
+ type: "suggestion",
3336
+ docs: { description: "Disallow generic module stems when one runtime export already names the responsibility." },
3337
+ schema: [],
3338
+ messages: {
3339
+ genericSingleExport: "Module stem `{{stem}}` is generic and its only runtime export is `{{exported}}`; rename the file to `{{expected}}`."
3340
+ }
3341
+ },
3342
+ defaultOptions: [],
3343
+ create(context) {
3344
+ const file = fileParts(context.filename);
3345
+ const { stem: stem3 } = file;
3346
+ if (!GENERIC_STEMS.has(stem3) || CONVENTIONAL_STEMS.has(stem3) || isTestFile(context.filename) || isGeneratedFile(context.filename, context.sourceCode.text)) return {};
3347
+ let hasCommonJsExport = false;
3348
+ return {
3349
+ CallExpression(node) {
3350
+ const first = node.arguments[0];
3351
+ if (first?.type === import_utils20.AST_NODE_TYPES.Identifier && first.name === "exports" && isGlobalIdentifier(context, first) && node.callee.type === import_utils20.AST_NODE_TYPES.MemberExpression && node.callee.object.type === import_utils20.AST_NODE_TYPES.Identifier && node.callee.object.name === "Object" && isGlobalIdentifier(context, node.callee.object) && memberPropertyName(node.callee) !== null && CJS_OBJECT_EXPORT_METHODS.has(memberPropertyName(node.callee))) hasCommonJsExport = true;
3352
+ },
3353
+ MemberExpression(node) {
3354
+ if (node.object.type === import_utils20.AST_NODE_TYPES.Identifier && node.object.name === "exports" && isGlobalIdentifier(context, node.object)) hasCommonJsExport = true;
3355
+ if (node.object.type === import_utils20.AST_NODE_TYPES.Identifier && node.object.name === "module" && isGlobalIdentifier(context, node.object) && memberPropertyName(node) === "exports") hasCommonJsExport = true;
3356
+ },
3357
+ "Program:exit"(program) {
3358
+ if (hasCommonJsExport) return;
3359
+ const exports2 = runtimeExports(program);
3360
+ if (exports2.ambiguous || exports2.exports.length !== 1) return;
3361
+ const onlyExport = exports2.exports[0];
3362
+ if (onlyExport === void 0) return;
3363
+ const { name: exported, node } = onlyExport;
3364
+ if (isConventionalFrameworkUtility(context.filename, exported)) return;
3365
+ const expectedStem = kebabCase(exported);
3366
+ const suffixStem = file.suffixes.map(kebabCase).join("-");
3367
+ const currentResponsibility = [stem3, suffixStem].filter(Boolean).join("-");
3368
+ if (expectedStem === currentResponsibility || GENERIC_STEMS.has(expectedStem) || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(expectedStem)) return;
3369
+ const suffixTail = suffixStem === "" ? "" : `-${suffixStem}`;
3370
+ const renameStem = suffixTail !== "" && expectedStem.endsWith(suffixTail) ? expectedStem.slice(0, -suffixTail.length) : expectedStem;
3371
+ if (renameStem === "" || GENERIC_STEMS.has(renameStem)) return;
3372
+ const suffix = file.suffixes.map((part) => `.${kebabCase(part)}`).join("");
3373
+ context.report({
3374
+ node,
3375
+ messageId: "genericSingleExport",
3376
+ data: { stem: stem3, exported, expected: `${renameStem}${suffix}${file.extension}` }
3377
+ });
3378
+ }
3379
+ };
3380
+ }
3381
+ });
3382
+
3383
+ // src/rules/no-offset-pagination.ts
3384
+ var import_utils21 = require("@typescript-eslint/utils");
3188
3385
  var OFFSET_PAGINATION = /\bOFFSET\s+(?:%s|%\(\w+\)s|\?\d*|:\w+|@\w+|\$\d+|\d+)/i;
3189
3386
  var OFFSET_GATE = /offset/i;
3190
3387
  var no_offset_pagination_default = createRule({
@@ -3214,60 +3411,57 @@ var no_offset_pagination_default = createRule({
3214
3411
  });
3215
3412
 
3216
3413
  // src/rules/no-positional-tuple-return.ts
3217
- var import_utils21 = require("@typescript-eslint/utils");
3414
+ var import_utils22 = require("@typescript-eslint/utils");
3218
3415
  var MIN_ELEMENTS = 2;
3219
- var ACCESSOR_PAIR_LENGTH = 2;
3220
- var AWAITABLE_TYPES = /* @__PURE__ */ new Set(["Promise", "PromiseLike", "Awaited"]);
3221
- function tupleReturnType(node) {
3222
- if (node.type === import_utils21.AST_NODE_TYPES.TSTupleType) {
3416
+ var AWAITABLE_TYPES = /* @__PURE__ */ new Set(["Promise", "PromiseLike", "Awaited", "Readonly"]);
3417
+ function tupleReturnType(node, aliases, resolving = /* @__PURE__ */ new Set()) {
3418
+ if (node.type === import_utils22.AST_NODE_TYPES.TSTupleType) {
3223
3419
  return node;
3224
3420
  }
3225
- if (node.type === import_utils21.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils21.AST_NODE_TYPES.Identifier && AWAITABLE_TYPES.has(node.typeName.name)) {
3226
- const argument = node.typeArguments?.params[0];
3227
- return argument === void 0 ? null : tupleReturnType(argument);
3421
+ if (node.type === import_utils22.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils22.AST_NODE_TYPES.Identifier && AWAITABLE_TYPES.has(node.typeName.name)) {
3422
+ const argument = node.typeArguments?.params.at(0);
3423
+ return argument === void 0 ? null : tupleReturnType(argument, aliases, resolving);
3228
3424
  }
3229
- return null;
3230
- }
3231
- function normalizedText(sourceCode, node) {
3232
- return sourceCode.getText(node).replaceAll(/\s+/g, " ").trim();
3233
- }
3234
- function isPermittedTuple(tuple, sourceCode) {
3235
- const elements = tuple.elementTypes;
3236
- if (elements.length < MIN_ELEMENTS) {
3237
- return true;
3425
+ if (node.type === import_utils22.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils22.AST_NODE_TYPES.Identifier && !resolving.has(node.typeName.name)) {
3426
+ const target = aliases.get(node.typeName.name);
3427
+ if (target !== void 0) return tupleReturnType(target, aliases, /* @__PURE__ */ new Set([...resolving, node.typeName.name]));
3238
3428
  }
3239
- if (elements.some((element) => element.type === import_utils21.AST_NODE_TYPES.TSRestType)) {
3240
- return true;
3429
+ if (node.type === import_utils22.AST_NODE_TYPES.TSTypeOperator && node.operator === "readonly") {
3430
+ return node.typeAnnotation === void 0 ? null : tupleReturnType(node.typeAnnotation, aliases, resolving);
3241
3431
  }
3242
- if (elements.some((element) => element.type === import_utils21.AST_NODE_TYPES.TSNamedTupleMember)) {
3243
- return true;
3244
- }
3245
- if (elements[0]?.type === import_utils21.AST_NODE_TYPES.TSLiteralType) {
3246
- return true;
3247
- }
3248
- if (elements.length === ACCESSOR_PAIR_LENGTH && elements.some((element) => element.type === import_utils21.AST_NODE_TYPES.TSFunctionType)) {
3249
- return true;
3432
+ if (node.type === import_utils22.AST_NODE_TYPES.TSUnionType || node.type === import_utils22.AST_NODE_TYPES.TSIntersectionType) {
3433
+ for (const member of node.types) {
3434
+ const tuple = tupleReturnType(member, aliases, resolving);
3435
+ if (tuple !== null) return tuple;
3436
+ }
3250
3437
  }
3251
- const texts = new Set(elements.map((element) => normalizedText(sourceCode, element)));
3252
- return texts.size === 1;
3438
+ return null;
3253
3439
  }
3254
3440
  function functionName(node) {
3255
- if (node.type === import_utils21.AST_NODE_TYPES.FunctionDeclaration) {
3256
- return node.id?.name ?? null;
3441
+ if (node.type === import_utils22.AST_NODE_TYPES.FunctionDeclaration) {
3442
+ if (node.id !== null) return node.id.name;
3443
+ return node.parent?.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration ? "default" : null;
3257
3444
  }
3258
- const parent = node.parent;
3259
- if (parent?.type === import_utils21.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils21.AST_NODE_TYPES.Identifier) {
3445
+ let wrapped = node;
3446
+ while ((wrapped.parent?.type === import_utils22.AST_NODE_TYPES.TSAsExpression || wrapped.parent?.type === import_utils22.AST_NODE_TYPES.TSSatisfiesExpression || wrapped.parent?.type === import_utils22.AST_NODE_TYPES.TSNonNullExpression) && wrapped.parent.expression === wrapped) {
3447
+ wrapped = wrapped.parent;
3448
+ }
3449
+ const parent = wrapped.parent;
3450
+ if (parent?.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration) return "default";
3451
+ if (parent?.type === import_utils22.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils22.AST_NODE_TYPES.Identifier) {
3260
3452
  return parent.id.name;
3261
3453
  }
3262
- if ((parent?.type === import_utils21.AST_NODE_TYPES.MethodDefinition || parent?.type === import_utils21.AST_NODE_TYPES.PropertyDefinition || parent?.type === import_utils21.AST_NODE_TYPES.Property) && parent.key.type === import_utils21.AST_NODE_TYPES.Identifier) {
3454
+ if ((parent?.type === import_utils22.AST_NODE_TYPES.MethodDefinition || parent?.type === import_utils22.AST_NODE_TYPES.TSAbstractMethodDefinition || parent?.type === import_utils22.AST_NODE_TYPES.PropertyDefinition || parent?.type === import_utils22.AST_NODE_TYPES.Property) && parent.key.type === import_utils22.AST_NODE_TYPES.Identifier) {
3455
+ if ((parent.type === import_utils22.AST_NODE_TYPES.MethodDefinition || parent.type === import_utils22.AST_NODE_TYPES.TSAbstractMethodDefinition || parent.type === import_utils22.AST_NODE_TYPES.PropertyDefinition) && (parent.accessibility === "private" || parent.accessibility === "protected")) return null;
3263
3456
  return parent.key.name;
3264
3457
  }
3265
3458
  return null;
3266
3459
  }
3267
3460
  function isInlineExported(node) {
3461
+ if (moduleScopeBindingName(node) === null) return false;
3268
3462
  for (let current = node; current != null; current = current.parent) {
3269
3463
  const parent = current.parent;
3270
- if (parent?.type === import_utils21.AST_NODE_TYPES.ExportNamedDeclaration || parent?.type === import_utils21.AST_NODE_TYPES.ExportDefaultDeclaration) {
3464
+ if (parent?.type === import_utils22.AST_NODE_TYPES.ExportNamedDeclaration || parent?.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration) {
3271
3465
  return true;
3272
3466
  }
3273
3467
  }
@@ -3275,46 +3469,154 @@ function isInlineExported(node) {
3275
3469
  }
3276
3470
  function moduleScopeBindingName(node) {
3277
3471
  let current = node;
3278
- let child = node;
3279
- while (current.parent != null && current.parent.type !== import_utils21.AST_NODE_TYPES.Program) {
3280
- child = current;
3472
+ while (current.parent != null && current.parent.type !== import_utils22.AST_NODE_TYPES.Program) {
3281
3473
  current = current.parent;
3282
3474
  }
3283
- if (current.parent?.type !== import_utils21.AST_NODE_TYPES.Program) {
3475
+ if (current.parent?.type !== import_utils22.AST_NODE_TYPES.Program) {
3284
3476
  return null;
3285
3477
  }
3286
- if (current.type === import_utils21.AST_NODE_TYPES.FunctionDeclaration || current.type === import_utils21.AST_NODE_TYPES.ClassDeclaration) {
3287
- return current.id?.name ?? null;
3478
+ let topLevel = current;
3479
+ if (current.type === import_utils22.AST_NODE_TYPES.ExportNamedDeclaration || current.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration) {
3480
+ topLevel = current.declaration;
3288
3481
  }
3289
- if (current.type === import_utils21.AST_NODE_TYPES.VariableDeclaration) {
3290
- if (child.type !== import_utils21.AST_NODE_TYPES.VariableDeclarator || child.id.type !== import_utils21.AST_NODE_TYPES.Identifier) {
3291
- return null;
3482
+ if (topLevel === null) return null;
3483
+ if (topLevel.type === import_utils22.AST_NODE_TYPES.FunctionDeclaration) {
3484
+ if (topLevel !== node) return null;
3485
+ return topLevel.id?.name ?? (current.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration ? "default" : null);
3486
+ }
3487
+ if ((topLevel.type === import_utils22.AST_NODE_TYPES.ArrowFunctionExpression || topLevel.type === import_utils22.AST_NODE_TYPES.FunctionExpression) && topLevel === node && current.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration) {
3488
+ return "default";
3489
+ }
3490
+ if (topLevel.type === import_utils22.AST_NODE_TYPES.ClassDeclaration) {
3491
+ let owner = node.parent;
3492
+ while (owner !== void 0 && owner.parent !== topLevel.body) owner = owner.parent;
3493
+ return (owner?.type === import_utils22.AST_NODE_TYPES.MethodDefinition || owner?.type === import_utils22.AST_NODE_TYPES.TSAbstractMethodDefinition || owner?.type === import_utils22.AST_NODE_TYPES.PropertyDefinition) && owner.value === node ? topLevel.id?.name ?? (current.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration ? "default" : null) : null;
3494
+ }
3495
+ if (topLevel.type === import_utils22.AST_NODE_TYPES.VariableDeclaration) {
3496
+ for (const declarator of topLevel.declarations) {
3497
+ let initializer = declarator.init;
3498
+ while (initializer?.type === import_utils22.AST_NODE_TYPES.TSAsExpression || initializer?.type === import_utils22.AST_NODE_TYPES.TSSatisfiesExpression || initializer?.type === import_utils22.AST_NODE_TYPES.TSNonNullExpression) initializer = initializer.expression;
3499
+ if (declarator.id.type === import_utils22.AST_NODE_TYPES.Identifier && initializer === node) return declarator.id.name;
3500
+ if (declarator.id.type === import_utils22.AST_NODE_TYPES.Identifier && (initializer?.type === import_utils22.AST_NODE_TYPES.ClassExpression || initializer?.type === import_utils22.AST_NODE_TYPES.ObjectExpression)) {
3501
+ let owner = node.parent;
3502
+ const container = initializer.type === import_utils22.AST_NODE_TYPES.ClassExpression ? initializer.body : initializer;
3503
+ while (owner !== void 0 && owner.parent !== container) owner = owner.parent;
3504
+ if ((owner?.type === import_utils22.AST_NODE_TYPES.MethodDefinition || owner?.type === import_utils22.AST_NODE_TYPES.PropertyDefinition || owner?.type === import_utils22.AST_NODE_TYPES.Property) && owner.value === node) return declarator.id.name;
3505
+ }
3292
3506
  }
3293
- return child.id.name;
3294
3507
  }
3295
3508
  return null;
3296
3509
  }
3297
3510
  function specifierExportedNames(program) {
3298
3511
  const names = /* @__PURE__ */ new Set();
3299
3512
  for (const statement of program.body) {
3300
- if (statement.type === import_utils21.AST_NODE_TYPES.ExportNamedDeclaration && statement.declaration == null && statement.source == null && statement.exportKind !== "type") {
3513
+ if (statement.type === import_utils22.AST_NODE_TYPES.ExportNamedDeclaration && statement.declaration == null && statement.source == null && statement.exportKind !== "type") {
3301
3514
  for (const specifier of statement.specifiers) {
3302
- if (specifier.exportKind !== "type" && specifier.local.type === import_utils21.AST_NODE_TYPES.Identifier) {
3515
+ if (specifier.exportKind !== "type" && specifier.local.type === import_utils22.AST_NODE_TYPES.Identifier) {
3303
3516
  names.add(specifier.local.name);
3304
3517
  }
3305
3518
  }
3306
3519
  continue;
3307
3520
  }
3308
- if (statement.type === import_utils21.AST_NODE_TYPES.ExportDefaultDeclaration && statement.declaration.type === import_utils21.AST_NODE_TYPES.Identifier) {
3521
+ if (statement.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration && statement.declaration.type === import_utils22.AST_NODE_TYPES.Identifier) {
3309
3522
  names.add(statement.declaration.name);
3310
3523
  continue;
3311
3524
  }
3312
- if (statement.type === import_utils21.AST_NODE_TYPES.TSExportAssignment && statement.expression.type === import_utils21.AST_NODE_TYPES.Identifier) {
3525
+ if (statement.type === import_utils22.AST_NODE_TYPES.TSExportAssignment && statement.expression.type === import_utils22.AST_NODE_TYPES.Identifier) {
3313
3526
  names.add(statement.expression.name);
3314
3527
  }
3315
3528
  }
3316
3529
  return names;
3317
3530
  }
3531
+ function exportedTypeNames(program) {
3532
+ const names = /* @__PURE__ */ new Set();
3533
+ for (const statement of program.body) {
3534
+ if (statement.type !== import_utils22.AST_NODE_TYPES.ExportNamedDeclaration || statement.source !== null) continue;
3535
+ if (statement.declaration?.type === import_utils22.AST_NODE_TYPES.TSInterfaceDeclaration || statement.declaration?.type === import_utils22.AST_NODE_TYPES.TSTypeAliasDeclaration) names.add(statement.declaration.id.name);
3536
+ for (const specifier of statement.specifiers) names.add(specifier.local.name);
3537
+ }
3538
+ for (const statement of program.body) {
3539
+ if (statement.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration && (statement.declaration.type === import_utils22.AST_NODE_TYPES.TSInterfaceDeclaration || statement.declaration.type === import_utils22.AST_NODE_TYPES.TSTypeAliasDeclaration)) names.add(statement.declaration.id.name);
3540
+ }
3541
+ return names;
3542
+ }
3543
+ function typeAliases(program) {
3544
+ const aliases = /* @__PURE__ */ new Map();
3545
+ for (const statement of program.body) {
3546
+ const declaration = statement.type === import_utils22.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
3547
+ if (declaration?.type === import_utils22.AST_NODE_TYPES.TSTypeAliasDeclaration) {
3548
+ aliases.set(declaration.id.name, declaration.typeAnnotation);
3549
+ }
3550
+ }
3551
+ return aliases;
3552
+ }
3553
+ function callableReturnType(node, aliases, resolving = /* @__PURE__ */ new Set()) {
3554
+ if (node.type === import_utils22.AST_NODE_TYPES.TSFunctionType) return node.returnType?.typeAnnotation ?? null;
3555
+ if (node.type === import_utils22.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils22.AST_NODE_TYPES.Identifier && !resolving.has(node.typeName.name)) {
3556
+ const target = aliases.get(node.typeName.name);
3557
+ if (target !== void 0) {
3558
+ return callableReturnType(target, aliases, /* @__PURE__ */ new Set([...resolving, node.typeName.name]));
3559
+ }
3560
+ }
3561
+ return null;
3562
+ }
3563
+ function publiclyReachableTypeNames(program, exported) {
3564
+ const names = new Set(exported);
3565
+ const interfaces = /* @__PURE__ */ new Map();
3566
+ for (const statement of program.body) {
3567
+ const declaration = statement.type === import_utils22.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
3568
+ if (declaration?.type === import_utils22.AST_NODE_TYPES.TSInterfaceDeclaration) {
3569
+ interfaces.set(declaration.id.name, declaration.extends);
3570
+ }
3571
+ }
3572
+ for (let pass = 0; pass < interfaces.size; pass += 1) {
3573
+ let changed = false;
3574
+ for (const name of [...names]) {
3575
+ for (const heritage of interfaces.get(name) ?? []) {
3576
+ if (heritage.expression.type === import_utils22.AST_NODE_TYPES.Identifier && !names.has(heritage.expression.name)) {
3577
+ names.add(heritage.expression.name);
3578
+ changed = true;
3579
+ }
3580
+ }
3581
+ }
3582
+ if (!changed) break;
3583
+ }
3584
+ return names;
3585
+ }
3586
+ function owningInterface(node) {
3587
+ for (let current = node.parent; current !== void 0; current = current.parent) {
3588
+ if (current.type === import_utils22.AST_NODE_TYPES.TSInterfaceDeclaration) return current;
3589
+ if (current.type === import_utils22.AST_NODE_TYPES.Program) return null;
3590
+ }
3591
+ return null;
3592
+ }
3593
+ function owningTypeAlias(node) {
3594
+ for (let current = node.parent; current !== void 0; current = current.parent) {
3595
+ if (current.type === import_utils22.AST_NODE_TYPES.TSTypeAliasDeclaration) return current;
3596
+ if (current.type === import_utils22.AST_NODE_TYPES.Program) return null;
3597
+ }
3598
+ return null;
3599
+ }
3600
+ function owningClass(node) {
3601
+ for (let current = node.parent; current !== void 0; current = current.parent) {
3602
+ if (current.type === import_utils22.AST_NODE_TYPES.ClassDeclaration || current.type === import_utils22.AST_NODE_TYPES.ClassExpression) {
3603
+ return current;
3604
+ }
3605
+ if (current.type === import_utils22.AST_NODE_TYPES.Program) return null;
3606
+ }
3607
+ return null;
3608
+ }
3609
+ function isExportedClass(node, specifierExports) {
3610
+ if (node.parent.type === import_utils22.AST_NODE_TYPES.ExportNamedDeclaration || node.parent.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration) return true;
3611
+ if (node.type === import_utils22.AST_NODE_TYPES.ClassDeclaration) {
3612
+ return node.id !== null && node.parent.type === import_utils22.AST_NODE_TYPES.Program && specifierExports.has(node.id.name);
3613
+ }
3614
+ if (node.parent.type === import_utils22.AST_NODE_TYPES.VariableDeclarator && node.parent.id.type === import_utils22.AST_NODE_TYPES.Identifier) return specifierExports.has(node.parent.id.name) || isInlineExported(node);
3615
+ return false;
3616
+ }
3617
+ function isExportedInterface(node, exports2) {
3618
+ return node.parent.type === import_utils22.AST_NODE_TYPES.ExportNamedDeclaration || node.parent.type === import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration || node.parent.type === import_utils22.AST_NODE_TYPES.Program && exports2.has(node.id.name);
3619
+ }
3318
3620
  function isExported(node, specifierExports) {
3319
3621
  if (isInlineExported(node)) {
3320
3622
  return true;
@@ -3330,48 +3632,97 @@ var no_positional_tuple_return_default = createRule({
3330
3632
  meta: {
3331
3633
  type: "suggestion",
3332
3634
  docs: {
3333
- description: "Disallow returning a positional tuple of distinct fields from an exported function; return a named object so call sites cannot mismatch slots."
3635
+ description: "Disallow returning a multi-field tuple from an exported function; return a named object so call sites cannot mismatch slots."
3334
3636
  },
3335
3637
  schema: [],
3336
3638
  messages: {
3337
- noPositionalTupleReturn: "Exported `{{name}}` returns a positional {{count}}-tuple, so every call site re-invents the field names and can disagree. Return a named object (or label the tuple members) instead."
3639
+ noPositionalTupleReturn: "Exported `{{name}}` returns a {{count}}-field tuple, so consumers depend on positional slots that can be reordered silently. Return a named object instead."
3338
3640
  }
3339
3641
  },
3340
3642
  defaultOptions: [],
3341
3643
  create(context) {
3644
+ if (isGeneratedFile(context.filename, context.sourceCode.text)) return {};
3342
3645
  const specifierExports = specifierExportedNames(context.sourceCode.ast);
3646
+ const typeExports = publiclyReachableTypeNames(
3647
+ context.sourceCode.ast,
3648
+ exportedTypeNames(context.sourceCode.ast)
3649
+ );
3650
+ const aliases = typeAliases(context.sourceCode.ast);
3651
+ const report = (annotation, name) => {
3652
+ const tuple = tupleReturnType(annotation, aliases);
3653
+ if (tuple === null || tuple.elementTypes.length < MIN_ELEMENTS) return;
3654
+ context.report({
3655
+ node: tuple,
3656
+ messageId: "noPositionalTupleReturn",
3657
+ data: { name, count: String(tuple.elementTypes.length) }
3658
+ });
3659
+ };
3343
3660
  const check = (node) => {
3344
3661
  const annotation = node.returnType?.typeAnnotation;
3345
3662
  if (annotation === void 0) {
3346
3663
  return;
3347
3664
  }
3348
- const tuple = tupleReturnType(annotation);
3349
- if (tuple === null || isPermittedTuple(tuple, context.sourceCode)) {
3350
- return;
3351
- }
3352
3665
  const name = functionName(node);
3353
- if (name === null || name.startsWith("_") || /^use[A-Z]/.test(name)) {
3666
+ if (name === null) {
3354
3667
  return;
3355
3668
  }
3356
3669
  if (!isExported(node, specifierExports)) {
3357
3670
  return;
3358
3671
  }
3359
- context.report({
3360
- node: tuple,
3361
- messageId: "noPositionalTupleReturn",
3362
- data: { name, count: String(tuple.elementTypes.length) }
3363
- });
3672
+ report(annotation, name);
3364
3673
  };
3365
3674
  return {
3366
3675
  FunctionDeclaration: check,
3367
3676
  FunctionExpression: check,
3368
- ArrowFunctionExpression: check
3677
+ ArrowFunctionExpression: check,
3678
+ TSEmptyBodyFunctionExpression: check,
3679
+ TSDeclareFunction(node) {
3680
+ if (node.id === null || node.returnType === void 0 || node.parent.type !== import_utils22.AST_NODE_TYPES.ExportNamedDeclaration && node.parent.type !== import_utils22.AST_NODE_TYPES.ExportDefaultDeclaration && !specifierExports.has(node.id.name)) return;
3681
+ report(node.returnType.typeAnnotation, node.id.name);
3682
+ },
3683
+ TSCallSignatureDeclaration(node) {
3684
+ const owner = owningInterface(node);
3685
+ if (owner === null || !isExportedInterface(owner, typeExports) || node.returnType === void 0) return;
3686
+ report(node.returnType.typeAnnotation, `${owner.id.name}.call`);
3687
+ },
3688
+ TSMethodSignature(node) {
3689
+ const owner = owningInterface(node);
3690
+ const alias = owningTypeAlias(node);
3691
+ if ((owner === null || !isExportedInterface(owner, typeExports)) && (alias === null || !typeExports.has(alias.id.name)) || node.returnType === void 0 || node.key.type !== import_utils22.AST_NODE_TYPES.Identifier) return;
3692
+ report(node.returnType.typeAnnotation, `${owner?.id.name ?? alias?.id.name ?? "type"}.${node.key.name}`);
3693
+ },
3694
+ TSTypeAliasDeclaration(node) {
3695
+ if (!typeExports.has(node.id.name)) return;
3696
+ const returnType = callableReturnType(node.typeAnnotation, aliases);
3697
+ if (returnType !== null) report(returnType, node.id.name);
3698
+ },
3699
+ TSPropertySignature(node) {
3700
+ const owner = owningInterface(node);
3701
+ const alias = owningTypeAlias(node);
3702
+ const annotation = node.typeAnnotation?.typeAnnotation;
3703
+ if ((owner === null || !isExportedInterface(owner, typeExports)) && (alias === null || !typeExports.has(alias.id.name)) || node.key.type !== import_utils22.AST_NODE_TYPES.Identifier || annotation === void 0) return;
3704
+ const returnType = callableReturnType(annotation, aliases);
3705
+ if (returnType !== null) {
3706
+ report(returnType, `${owner?.id.name ?? alias?.id.name ?? "type"}.${node.key.name}`);
3707
+ }
3708
+ },
3709
+ PropertyDefinition(node) {
3710
+ if (node.accessibility === "private" || node.accessibility === "protected") return;
3711
+ const owner = owningClass(node);
3712
+ const annotation = node.typeAnnotation?.typeAnnotation;
3713
+ if (owner === null || !isExportedClass(owner, specifierExports) || annotation === void 0) return;
3714
+ const returnType = callableReturnType(annotation, aliases);
3715
+ if (returnType !== null) {
3716
+ const name = node.key.type === import_utils22.AST_NODE_TYPES.Identifier ? node.key.name : "property";
3717
+ report(returnType, name);
3718
+ }
3719
+ }
3369
3720
  };
3370
3721
  }
3371
3722
  });
3372
3723
 
3373
3724
  // src/rules/no-raw-env.ts
3374
- var import_utils22 = require("@typescript-eslint/utils");
3725
+ var import_utils23 = require("@typescript-eslint/utils");
3375
3726
  var CONFIG_FILE_RE = /(^|[\\/])[\w.-]+\.config\.[cm]?[jt]sx?$/;
3376
3727
  var ENV_BOUNDARY_FILE_RE = /(^|[\\/])(?:env|client-env|server-env|client-settings|server-settings)\.[cm]?[jt]sx?$/;
3377
3728
  var ENV_VALIDATION_MARKER_RE = /\bcreateEnv\s*\(|\bz\.object\s*\(|\.(?:safeParse|parse)\s*\(/;
@@ -3448,7 +3799,7 @@ var no_raw_env_default = createRule({
3448
3799
  });
3449
3800
 
3450
3801
  // src/rules/no-raw-fetch-outside-clients.ts
3451
- var import_utils23 = require("@typescript-eslint/utils");
3802
+ var import_utils24 = require("@typescript-eslint/utils");
3452
3803
  var DEFAULT_ALLOW = [
3453
3804
  "[\\\\/]clients?[\\\\/]",
3454
3805
  "-client\\.[cm]?[jt]sx?$",
@@ -3490,7 +3841,7 @@ function identifierLikeName(node) {
3490
3841
  }
3491
3842
  function isConstructedArgumentHandoff(node) {
3492
3843
  const [first] = node.arguments;
3493
- return node.arguments.length === 1 && first !== void 0 && first.type === import_utils23.AST_NODE_TYPES.NewExpression;
3844
+ return node.arguments.length === 1 && first !== void 0 && first.type === import_utils24.AST_NODE_TYPES.NewExpression;
3494
3845
  }
3495
3846
  function isPresignedUrlTransfer(node) {
3496
3847
  const first = node.arguments[0];
@@ -3559,9 +3910,9 @@ var no_raw_fetch_outside_clients_default = createRule({
3559
3910
  });
3560
3911
 
3561
3912
  // src/rules/no-restricted-library-load.ts
3562
- var import_utils24 = require("@typescript-eslint/utils");
3913
+ var import_utils25 = require("@typescript-eslint/utils");
3563
3914
  function literalModule(node) {
3564
- return node?.type === import_utils24.AST_NODE_TYPES.Literal && typeof node.value === "string" ? node.value : null;
3915
+ return node?.type === import_utils25.AST_NODE_TYPES.Literal && typeof node.value === "string" ? node.value : null;
3565
3916
  }
3566
3917
  function matchesModule(source, module2) {
3567
3918
  return source === module2 || source.startsWith(`${module2}/`);
@@ -3620,7 +3971,7 @@ var no_restricted_library_load_default = createRule({
3620
3971
  });
3621
3972
  }
3622
3973
  function isUnshadowedRequire(node) {
3623
- const variable = import_utils24.ASTUtils.findVariable(
3974
+ const variable = import_utils25.ASTUtils.findVariable(
3624
3975
  context.sourceCode.getScope(node),
3625
3976
  node.name
3626
3977
  );
@@ -3633,9 +3984,9 @@ var no_restricted_library_load_default = createRule({
3633
3984
  },
3634
3985
  CallExpression(node) {
3635
3986
  let requireIdentifier = null;
3636
- if (node.callee.type === import_utils24.AST_NODE_TYPES.Identifier && node.callee.name === "require") {
3987
+ if (node.callee.type === import_utils25.AST_NODE_TYPES.Identifier && node.callee.name === "require") {
3637
3988
  requireIdentifier = node.callee;
3638
- } else if (node.callee.type === import_utils24.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.object.type === import_utils24.AST_NODE_TYPES.Identifier && node.callee.object.name === "require" && node.callee.property.type === import_utils24.AST_NODE_TYPES.Identifier && node.callee.property.name === "resolve") {
3989
+ } else if (node.callee.type === import_utils25.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.object.type === import_utils25.AST_NODE_TYPES.Identifier && node.callee.object.name === "require" && node.callee.property.type === import_utils25.AST_NODE_TYPES.Identifier && node.callee.property.name === "resolve") {
3639
3990
  requireIdentifier = node.callee.object;
3640
3991
  }
3641
3992
  if (requireIdentifier === null || !isUnshadowedRequire(requireIdentifier)) return;
@@ -3643,7 +3994,7 @@ var no_restricted_library_load_default = createRule({
3643
3994
  if (source !== null) report(node.arguments[0], source);
3644
3995
  },
3645
3996
  TSImportEqualsDeclaration(node) {
3646
- if (node.moduleReference.type !== import_utils24.AST_NODE_TYPES.TSExternalModuleReference) return;
3997
+ if (node.moduleReference.type !== import_utils25.AST_NODE_TYPES.TSExternalModuleReference) return;
3647
3998
  const source = literalModule(node.moduleReference.expression);
3648
3999
  if (source !== null) report(node.moduleReference.expression, source);
3649
4000
  }
@@ -3652,16 +4003,16 @@ var no_restricted_library_load_default = createRule({
3652
4003
  });
3653
4004
 
3654
4005
  // src/rules/no-repeated-string-literal.ts
3655
- var import_utils25 = require("@typescript-eslint/utils");
4006
+ var import_utils26 = require("@typescript-eslint/utils");
3656
4007
  var MIN_LENGTH = 40;
3657
4008
  var MIN_DISTINCT_SCOPES = 2;
3658
4009
  var PREVIEW_LENGTH = 40;
3659
4010
  var SQL_KEYWORD_RE = /\b(SELECT|INSERT|UPDATE|DELETE|FROM|WHERE|JOIN|VALUES|ON CONFLICT|RETURNING|GROUP BY|ORDER BY)\b/;
3660
4011
  var IDENTIFIER_RE = /^[a-z_][a-z0-9_.]*$/;
3661
4012
  var FUNCTION_TYPES3 = /* @__PURE__ */ new Set([
3662
- import_utils25.AST_NODE_TYPES.FunctionDeclaration,
3663
- import_utils25.AST_NODE_TYPES.FunctionExpression,
3664
- import_utils25.AST_NODE_TYPES.ArrowFunctionExpression
4013
+ import_utils26.AST_NODE_TYPES.FunctionDeclaration,
4014
+ import_utils26.AST_NODE_TYPES.FunctionExpression,
4015
+ import_utils26.AST_NODE_TYPES.ArrowFunctionExpression
3665
4016
  ]);
3666
4017
  function isStructured(value) {
3667
4018
  return value.includes("\n") || SQL_KEYWORD_RE.test(value) || IDENTIFIER_RE.test(value);
@@ -3683,8 +4034,8 @@ function isScaffolding(node) {
3683
4034
  if (parent === void 0) {
3684
4035
  return true;
3685
4036
  }
3686
- const isRequireSource = parent.type === import_utils25.AST_NODE_TYPES.CallExpression && parent.callee.type === import_utils25.AST_NODE_TYPES.Identifier && parent.callee.name === "require";
3687
- return parent.type === import_utils25.AST_NODE_TYPES.ImportDeclaration || parent.type === import_utils25.AST_NODE_TYPES.ImportExpression || parent.type === import_utils25.AST_NODE_TYPES.ExportNamedDeclaration || parent.type === import_utils25.AST_NODE_TYPES.ExportAllDeclaration || parent.type === import_utils25.AST_NODE_TYPES.TSImportType || parent.type === import_utils25.AST_NODE_TYPES.JSXAttribute || parent.type === import_utils25.AST_NODE_TYPES.TSLiteralType || isRequireSource;
4037
+ const isRequireSource = parent.type === import_utils26.AST_NODE_TYPES.CallExpression && parent.callee.type === import_utils26.AST_NODE_TYPES.Identifier && parent.callee.name === "require";
4038
+ return parent.type === import_utils26.AST_NODE_TYPES.ImportDeclaration || parent.type === import_utils26.AST_NODE_TYPES.ImportExpression || parent.type === import_utils26.AST_NODE_TYPES.ExportNamedDeclaration || parent.type === import_utils26.AST_NODE_TYPES.ExportAllDeclaration || parent.type === import_utils26.AST_NODE_TYPES.TSImportType || parent.type === import_utils26.AST_NODE_TYPES.JSXAttribute || parent.type === import_utils26.AST_NODE_TYPES.TSLiteralType || isRequireSource;
3688
4039
  }
3689
4040
  var no_repeated_string_literal_default = createRule({
3690
4041
  name: "no-repeated-string-literal",
@@ -3724,7 +4075,7 @@ var no_repeated_string_literal_default = createRule({
3724
4075
  }
3725
4076
  },
3726
4077
  TemplateLiteral(node) {
3727
- if (node.parent.type === import_utils25.AST_NODE_TYPES.TaggedTemplateExpression) {
4078
+ if (node.parent.type === import_utils26.AST_NODE_TYPES.TaggedTemplateExpression) {
3728
4079
  return;
3729
4080
  }
3730
4081
  const [only] = node.quasis;
@@ -3758,7 +4109,7 @@ var no_repeated_string_literal_default = createRule({
3758
4109
  });
3759
4110
 
3760
4111
  // src/rules/no-restated-comment.ts
3761
- var import_utils26 = require("@typescript-eslint/utils");
4112
+ var import_utils27 = require("@typescript-eslint/utils");
3762
4113
  var MAX_WORDS = 8;
3763
4114
  var MIN_CONTENT_TOKENS = 2;
3764
4115
  var DIRECTIVE_RE3 = /^(eslint\b|eslint-|sarj-noqa\b|@ts-|prettier-ignore|prettier\b|biome-|c8\b|v8\b|istanbul\b|@type\b|@vite|webpack|<reference|<amd|global\b|noinspection|todo\b|fixme\b|hack\b|xxx\b)/i;
@@ -3811,7 +4162,7 @@ var no_restated_comment_default = createRule({
3811
4162
  function labelsASiblingRun(comment) {
3812
4163
  const token = sourceCode.getTokenAfter(comment, { includeComments: false });
3813
4164
  if (token === null) return false;
3814
- for (let node = sourceCode.getNodeByRangeIndex(token.range[0]); node != null && node.type !== import_utils26.AST_NODE_TYPES.Program; node = node.parent) {
4165
+ for (let node = sourceCode.getNodeByRangeIndex(token.range[0]); node != null && node.type !== import_utils27.AST_NODE_TYPES.Program; node = node.parent) {
3815
4166
  if (headsSiblingRun(node)) return true;
3816
4167
  }
3817
4168
  return false;
@@ -3871,7 +4222,7 @@ var no_restated_comment_default = createRule({
3871
4222
  });
3872
4223
 
3873
4224
  // src/rules/no-restated-jsdoc.ts
3874
- var import_utils27 = require("@typescript-eslint/utils");
4225
+ var import_utils28 = require("@typescript-eslint/utils");
3875
4226
  var MODELLED_TAGS = /* @__PURE__ */ new Set([
3876
4227
  "arg",
3877
4228
  "argument",
@@ -3925,30 +4276,30 @@ function declarationNames(node) {
3925
4276
  switch (node.type) {
3926
4277
  // `export function f()` — the JSDoc sits above the `export`, so the token
3927
4278
  // after it resolves to the wrapper, not to the thing being documented.
3928
- case import_utils27.AST_NODE_TYPES.ExportNamedDeclaration:
3929
- case import_utils27.AST_NODE_TYPES.ExportDefaultDeclaration:
4279
+ case import_utils28.AST_NODE_TYPES.ExportNamedDeclaration:
4280
+ case import_utils28.AST_NODE_TYPES.ExportDefaultDeclaration:
3930
4281
  return node.declaration == null ? null : declarationNames(node.declaration);
3931
- case import_utils27.AST_NODE_TYPES.FunctionDeclaration:
3932
- case import_utils27.AST_NODE_TYPES.TSDeclareFunction:
4282
+ case import_utils28.AST_NODE_TYPES.FunctionDeclaration:
4283
+ case import_utils28.AST_NODE_TYPES.TSDeclareFunction:
3933
4284
  return node.id === null ? null : { name: node.id.name, params: paramNames(node.params) };
3934
- case import_utils27.AST_NODE_TYPES.ClassDeclaration:
3935
- case import_utils27.AST_NODE_TYPES.TSInterfaceDeclaration:
3936
- case import_utils27.AST_NODE_TYPES.TSTypeAliasDeclaration:
3937
- case import_utils27.AST_NODE_TYPES.TSEnumDeclaration:
4285
+ case import_utils28.AST_NODE_TYPES.ClassDeclaration:
4286
+ case import_utils28.AST_NODE_TYPES.TSInterfaceDeclaration:
4287
+ case import_utils28.AST_NODE_TYPES.TSTypeAliasDeclaration:
4288
+ case import_utils28.AST_NODE_TYPES.TSEnumDeclaration:
3938
4289
  return node.id === null ? null : { name: node.id.name, params: [] };
3939
- case import_utils27.AST_NODE_TYPES.VariableDeclaration: {
4290
+ case import_utils28.AST_NODE_TYPES.VariableDeclaration: {
3940
4291
  const declarator = node.declarations[0];
3941
- if (declarator === void 0 || declarator.id.type !== import_utils27.AST_NODE_TYPES.Identifier) return null;
4292
+ if (declarator === void 0 || declarator.id.type !== import_utils28.AST_NODE_TYPES.Identifier) return null;
3942
4293
  const init = declarator.init;
3943
- const params = init != null && (init.type === import_utils27.AST_NODE_TYPES.ArrowFunctionExpression || init.type === import_utils27.AST_NODE_TYPES.FunctionExpression) ? paramNames(init.params) : [];
4294
+ const params = init != null && (init.type === import_utils28.AST_NODE_TYPES.ArrowFunctionExpression || init.type === import_utils28.AST_NODE_TYPES.FunctionExpression) ? paramNames(init.params) : [];
3944
4295
  return { name: declarator.id.name, params };
3945
4296
  }
3946
- case import_utils27.AST_NODE_TYPES.MethodDefinition:
3947
- case import_utils27.AST_NODE_TYPES.PropertyDefinition:
3948
- case import_utils27.AST_NODE_TYPES.TSMethodSignature:
3949
- case import_utils27.AST_NODE_TYPES.TSPropertySignature: {
3950
- if (node.key.type !== import_utils27.AST_NODE_TYPES.Identifier) return null;
3951
- const params = node.type === import_utils27.AST_NODE_TYPES.MethodDefinition ? paramNames(node.value.params) : node.type === import_utils27.AST_NODE_TYPES.TSMethodSignature ? paramNames(node.params) : [];
4297
+ case import_utils28.AST_NODE_TYPES.MethodDefinition:
4298
+ case import_utils28.AST_NODE_TYPES.PropertyDefinition:
4299
+ case import_utils28.AST_NODE_TYPES.TSMethodSignature:
4300
+ case import_utils28.AST_NODE_TYPES.TSPropertySignature: {
4301
+ if (node.key.type !== import_utils28.AST_NODE_TYPES.Identifier) return null;
4302
+ const params = node.type === import_utils28.AST_NODE_TYPES.MethodDefinition ? paramNames(node.value.params) : node.type === import_utils28.AST_NODE_TYPES.TSMethodSignature ? paramNames(node.params) : [];
3952
4303
  return { name: node.key.name, params };
3953
4304
  }
3954
4305
  default:
@@ -3958,9 +4309,9 @@ function declarationNames(node) {
3958
4309
  function paramNames(params) {
3959
4310
  const names = [];
3960
4311
  for (const param of params) {
3961
- const target = param.type === import_utils27.AST_NODE_TYPES.AssignmentPattern ? param.left : param;
3962
- if (target.type === import_utils27.AST_NODE_TYPES.Identifier) names.push(target.name);
3963
- else if (target.type === import_utils27.AST_NODE_TYPES.TSParameterProperty) continue;
4312
+ const target = param.type === import_utils28.AST_NODE_TYPES.AssignmentPattern ? param.left : param;
4313
+ if (target.type === import_utils28.AST_NODE_TYPES.Identifier) names.push(target.name);
4314
+ else if (target.type === import_utils28.AST_NODE_TYPES.TSParameterProperty) continue;
3964
4315
  }
3965
4316
  return names;
3966
4317
  }
@@ -4002,7 +4353,7 @@ var no_restated_jsdoc_default = createRule({
4002
4353
  if (token === null || token.loc.start.line !== comment.loc.end.line + 1) continue;
4003
4354
  let node = sourceCode.getNodeByRangeIndex(token.range[0]);
4004
4355
  let declaration = null;
4005
- while (node != null && node.type !== import_utils27.AST_NODE_TYPES.Program) {
4356
+ while (node != null && node.type !== import_utils28.AST_NODE_TYPES.Program) {
4006
4357
  declaration = declarationNames(node);
4007
4358
  if (declaration !== null) break;
4008
4359
  node = node.parent ?? null;
@@ -4057,7 +4408,7 @@ var no_restated_jsdoc_default = createRule({
4057
4408
  });
4058
4409
 
4059
4410
  // src/rules/no-secret-in-log.ts
4060
- var import_utils28 = require("@typescript-eslint/utils");
4411
+ var import_utils29 = require("@typescript-eslint/utils");
4061
4412
 
4062
4413
  // src/rules/_secret-names.ts
4063
4414
  var SECRET_WORDS = /* @__PURE__ */ new Set([
@@ -4394,7 +4745,7 @@ var no_secret_in_log_default = createRule({
4394
4745
  });
4395
4746
 
4396
4747
  // src/rules/no-select-star.ts
4397
- var import_utils29 = require("@typescript-eslint/utils");
4748
+ var import_utils30 = require("@typescript-eslint/utils");
4398
4749
  var QUERY_SHAPE = /\bSELECT\b[\s\S]*?\bFROM\b/i;
4399
4750
  var SELECT_KEYWORD = /\bSELECT\b/gi;
4400
4751
  var FROM_KEYWORD = /^FROM\b/i;
@@ -4461,12 +4812,12 @@ var no_select_star_default = createRule({
4461
4812
  });
4462
4813
 
4463
4814
  // src/rules/no-sentinel-return-on-catch.ts
4464
- var import_utils30 = require("@typescript-eslint/utils");
4815
+ var import_utils31 = require("@typescript-eslint/utils");
4465
4816
  function sentinelKind(arg) {
4466
4817
  if (arg === null) {
4467
4818
  return null;
4468
4819
  }
4469
- if (arg.type === import_utils30.AST_NODE_TYPES.Literal) {
4820
+ if (arg.type === import_utils31.AST_NODE_TYPES.Literal) {
4470
4821
  if (arg.value === null) {
4471
4822
  return "nullish";
4472
4823
  }
@@ -4478,13 +4829,13 @@ function sentinelKind(arg) {
4478
4829
  }
4479
4830
  return null;
4480
4831
  }
4481
- if (arg.type === import_utils30.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
4832
+ if (arg.type === import_utils31.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
4482
4833
  return "nullish";
4483
4834
  }
4484
- if (arg.type === import_utils30.AST_NODE_TYPES.ArrayExpression) {
4835
+ if (arg.type === import_utils31.AST_NODE_TYPES.ArrayExpression) {
4485
4836
  return "array";
4486
4837
  }
4487
- if (arg.type === import_utils30.AST_NODE_TYPES.ObjectExpression) {
4838
+ if (arg.type === import_utils31.AST_NODE_TYPES.ObjectExpression) {
4488
4839
  return "object";
4489
4840
  }
4490
4841
  return null;
@@ -4493,25 +4844,25 @@ function isSentinelArgument(arg) {
4493
4844
  if (arg === null) {
4494
4845
  return false;
4495
4846
  }
4496
- if (arg.type === import_utils30.AST_NODE_TYPES.Literal && arg.value === null) {
4847
+ if (arg.type === import_utils31.AST_NODE_TYPES.Literal && arg.value === null) {
4497
4848
  return true;
4498
4849
  }
4499
- if (arg.type === import_utils30.AST_NODE_TYPES.Literal && arg.value === false) {
4850
+ if (arg.type === import_utils31.AST_NODE_TYPES.Literal && arg.value === false) {
4500
4851
  return true;
4501
4852
  }
4502
- if (arg.type === import_utils30.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
4853
+ if (arg.type === import_utils31.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
4503
4854
  return true;
4504
4855
  }
4505
- if (arg.type === import_utils30.AST_NODE_TYPES.ArrayExpression && arg.elements.length === 0) {
4856
+ if (arg.type === import_utils31.AST_NODE_TYPES.ArrayExpression && arg.elements.length === 0) {
4506
4857
  return true;
4507
4858
  }
4508
- if (arg.type === import_utils30.AST_NODE_TYPES.ObjectExpression && arg.properties.length === 0) {
4859
+ if (arg.type === import_utils31.AST_NODE_TYPES.ObjectExpression && arg.properties.length === 0) {
4509
4860
  return true;
4510
4861
  }
4511
4862
  return false;
4512
4863
  }
4513
4864
  function isFunctionNode(node) {
4514
- return node.type === import_utils30.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils30.AST_NODE_TYPES.FunctionExpression || node.type === import_utils30.AST_NODE_TYPES.ArrowFunctionExpression;
4865
+ return node.type === import_utils31.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils31.AST_NODE_TYPES.FunctionExpression || node.type === import_utils31.AST_NODE_TYPES.ArrowFunctionExpression;
4515
4866
  }
4516
4867
  function isNode3(value) {
4517
4868
  return typeof value === "object" && value !== null && typeof value.type === "string";
@@ -4551,24 +4902,24 @@ function walkWithinScope(node, visit) {
4551
4902
  function containsThrow(node) {
4552
4903
  return walkWithinScope(
4553
4904
  node,
4554
- (current) => current.type === import_utils30.AST_NODE_TYPES.ThrowStatement
4905
+ (current) => current.type === import_utils31.AST_NODE_TYPES.ThrowStatement
4555
4906
  );
4556
4907
  }
4557
4908
  function bindsName(param, name) {
4558
4909
  switch (param.type) {
4559
- case import_utils30.AST_NODE_TYPES.Identifier:
4910
+ case import_utils31.AST_NODE_TYPES.Identifier:
4560
4911
  return param.name === name;
4561
- case import_utils30.AST_NODE_TYPES.AssignmentPattern:
4912
+ case import_utils31.AST_NODE_TYPES.AssignmentPattern:
4562
4913
  return bindsName(param.left, name);
4563
- case import_utils30.AST_NODE_TYPES.RestElement:
4914
+ case import_utils31.AST_NODE_TYPES.RestElement:
4564
4915
  return bindsName(param.argument, name);
4565
- case import_utils30.AST_NODE_TYPES.ArrayPattern:
4916
+ case import_utils31.AST_NODE_TYPES.ArrayPattern:
4566
4917
  return param.elements.some(
4567
4918
  (element) => element !== null && bindsName(element, name)
4568
4919
  );
4569
- case import_utils30.AST_NODE_TYPES.ObjectPattern:
4920
+ case import_utils31.AST_NODE_TYPES.ObjectPattern:
4570
4921
  return param.properties.some(
4571
- (property) => property.type === import_utils30.AST_NODE_TYPES.RestElement ? bindsName(property.argument, name) : bindsName(property.value, name)
4922
+ (property) => property.type === import_utils31.AST_NODE_TYPES.RestElement ? bindsName(property.argument, name) : bindsName(property.value, name)
4572
4923
  );
4573
4924
  default:
4574
4925
  return false;
@@ -4583,7 +4934,7 @@ function subtreeReadsName(node, name) {
4583
4934
  if (found) {
4584
4935
  return;
4585
4936
  }
4586
- if (current.type === import_utils30.AST_NODE_TYPES.Identifier && current.name === name) {
4937
+ if (current.type === import_utils31.AST_NODE_TYPES.Identifier && current.name === name) {
4587
4938
  found = true;
4588
4939
  return;
4589
4940
  }
@@ -4594,10 +4945,10 @@ function subtreeReadsName(node, name) {
4594
4945
  if (key === "parent") {
4595
4946
  continue;
4596
4947
  }
4597
- if (key === "key" && current.type === import_utils30.AST_NODE_TYPES.Property && !current.computed) {
4948
+ if (key === "key" && current.type === import_utils31.AST_NODE_TYPES.Property && !current.computed) {
4598
4949
  continue;
4599
4950
  }
4600
- if (key === "property" && current.type === import_utils30.AST_NODE_TYPES.MemberExpression && !current.computed) {
4951
+ if (key === "property" && current.type === import_utils31.AST_NODE_TYPES.MemberExpression && !current.computed) {
4601
4952
  continue;
4602
4953
  }
4603
4954
  const value = current[key];
@@ -4630,10 +4981,10 @@ var SAFE_PARSE_CONSTRUCTORS = /* @__PURE__ */ new Set([
4630
4981
  "URLPattern"
4631
4982
  ]);
4632
4983
  function isParseShapedNode(node) {
4633
- if (node.type === import_utils30.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils30.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils30.AST_NODE_TYPES.Identifier) {
4984
+ if (node.type === import_utils31.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils31.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils31.AST_NODE_TYPES.Identifier) {
4634
4985
  return node.callee.property.name === "parse";
4635
4986
  }
4636
- if (node.type === import_utils30.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils30.AST_NODE_TYPES.Identifier) {
4987
+ if (node.type === import_utils31.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils31.AST_NODE_TYPES.Identifier) {
4637
4988
  return SAFE_PARSE_CONSTRUCTORS.has(node.callee.name);
4638
4989
  }
4639
4990
  return false;
@@ -4644,10 +4995,10 @@ var BODY_DECODE_METHODS = /* @__PURE__ */ new Set([
4644
4995
  "arrayBuffer"
4645
4996
  ]);
4646
4997
  function isBodyDecodeNode(node) {
4647
- return node.type === import_utils30.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils30.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils30.AST_NODE_TYPES.Identifier && BODY_DECODE_METHODS.has(node.callee.property.name);
4998
+ return node.type === import_utils31.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils31.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils31.AST_NODE_TYPES.Identifier && BODY_DECODE_METHODS.has(node.callee.property.name);
4648
4999
  }
4649
5000
  function returnsMatching(stmt, predicate) {
4650
- return stmt.type === import_utils30.AST_NODE_TYPES.ReturnStatement && stmt.argument !== null && walkWithinScope(stmt.argument, predicate);
5001
+ return stmt.type === import_utils31.AST_NODE_TYPES.ReturnStatement && stmt.argument !== null && walkWithinScope(stmt.argument, predicate);
4651
5002
  }
4652
5003
  function enclosingReturnTypeNode(node) {
4653
5004
  let current = node.parent;
@@ -4665,11 +5016,11 @@ function enclosingFunctionName(node) {
4665
5016
  let current = node.parent;
4666
5017
  while (current !== void 0 && current !== null) {
4667
5018
  if (isFunctionNode(current)) {
4668
- if ("id" in current && isNode3(current.id) && current.id.type === import_utils30.AST_NODE_TYPES.Identifier) {
5019
+ if ("id" in current && isNode3(current.id) && current.id.type === import_utils31.AST_NODE_TYPES.Identifier) {
4669
5020
  return current.id.name;
4670
5021
  }
4671
5022
  const parent = current.parent;
4672
- if (parent?.type === import_utils30.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils30.AST_NODE_TYPES.Identifier) {
5023
+ if (parent?.type === import_utils31.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils31.AST_NODE_TYPES.Identifier) {
4673
5024
  return parent.id.name;
4674
5025
  }
4675
5026
  return null;
@@ -4690,10 +5041,10 @@ function isDeclaredBooleanPredicate(catchNode, kind) {
4690
5041
  return false;
4691
5042
  }
4692
5043
  let declared = enclosingReturnTypeNode(catchNode);
4693
- if (declared?.type === import_utils30.AST_NODE_TYPES.TSTypeReference && declared.typeName.type === import_utils30.AST_NODE_TYPES.Identifier && declared.typeName.name === "Promise") {
5044
+ if (declared?.type === import_utils31.AST_NODE_TYPES.TSTypeReference && declared.typeName.type === import_utils31.AST_NODE_TYPES.Identifier && declared.typeName.name === "Promise") {
4694
5045
  declared = declared.typeArguments?.params[0] ?? null;
4695
5046
  }
4696
- return declared?.type === import_utils30.AST_NODE_TYPES.TSBooleanKeyword;
5047
+ return declared?.type === import_utils31.AST_NODE_TYPES.TSBooleanKeyword;
4697
5048
  }
4698
5049
  function tryReturnsSafeParse(catchNode) {
4699
5050
  const tryBlock = tryBlockOf(catchNode);
@@ -4709,7 +5060,7 @@ function tryReturnsSafeParse(catchNode) {
4709
5060
  function enclosingFunctionBody(node) {
4710
5061
  let current = node.parent;
4711
5062
  while (current !== void 0 && current !== null) {
4712
- if (isFunctionNode(current) && "body" in current && isNode3(current.body) && current.body.type === import_utils30.AST_NODE_TYPES.BlockStatement) {
5063
+ if (isFunctionNode(current) && "body" in current && isNode3(current.body) && current.body.type === import_utils31.AST_NODE_TYPES.BlockStatement) {
4713
5064
  return current.body;
4714
5065
  }
4715
5066
  current = current.parent;
@@ -4722,7 +5073,7 @@ function functionReturnsSameSentinelKindElsewhere(catchNode, kind) {
4722
5073
  return false;
4723
5074
  }
4724
5075
  return walkWithinScope(functionBody, (current) => {
4725
- if (current.type !== import_utils30.AST_NODE_TYPES.ReturnStatement) {
5076
+ if (current.type !== import_utils31.AST_NODE_TYPES.ReturnStatement) {
4726
5077
  return false;
4727
5078
  }
4728
5079
  if (isWithin(current, catchNode.body)) {
@@ -4741,13 +5092,13 @@ function returnedSentinelKinds(arg) {
4741
5092
  kinds.add(direct);
4742
5093
  return kinds;
4743
5094
  }
4744
- if (arg.type === import_utils30.AST_NODE_TYPES.ConditionalExpression) {
5095
+ if (arg.type === import_utils31.AST_NODE_TYPES.ConditionalExpression) {
4745
5096
  for (const branch of [arg.consequent, arg.alternate]) {
4746
5097
  for (const nested of returnedSentinelKinds(branch)) {
4747
5098
  kinds.add(nested);
4748
5099
  }
4749
5100
  }
4750
- } else if (arg.type === import_utils30.AST_NODE_TYPES.LogicalExpression && (arg.operator === "??" || arg.operator === "||")) {
5101
+ } else if (arg.type === import_utils31.AST_NODE_TYPES.LogicalExpression && (arg.operator === "??" || arg.operator === "||")) {
4751
5102
  for (const nested of returnedSentinelKinds(arg.right)) {
4752
5103
  kinds.add(nested);
4753
5104
  }
@@ -4790,7 +5141,7 @@ var no_sentinel_return_on_catch_default = createRule({
4790
5141
  const matcher = createLogMatcher(loggingOptions);
4791
5142
  function logsOrReportsError(catchBody, caughtName) {
4792
5143
  return walkWithinScope(catchBody, (current) => {
4793
- if (current.type !== import_utils30.AST_NODE_TYPES.CallExpression) {
5144
+ if (current.type !== import_utils31.AST_NODE_TYPES.CallExpression) {
4794
5145
  return false;
4795
5146
  }
4796
5147
  if (matcher.isLoggingCall(current)) {
@@ -4807,7 +5158,7 @@ var no_sentinel_return_on_catch_default = createRule({
4807
5158
  return;
4808
5159
  }
4809
5160
  const last = body2[body2.length - 1];
4810
- if (last === void 0 || last.type !== import_utils30.AST_NODE_TYPES.ReturnStatement) {
5161
+ if (last === void 0 || last.type !== import_utils31.AST_NODE_TYPES.ReturnStatement) {
4811
5162
  return;
4812
5163
  }
4813
5164
  if (!isSentinelArgument(last.argument)) {
@@ -4816,7 +5167,7 @@ var no_sentinel_return_on_catch_default = createRule({
4816
5167
  if (containsThrow(node.body)) {
4817
5168
  return;
4818
5169
  }
4819
- const caughtName = node.param?.type === import_utils30.AST_NODE_TYPES.Identifier ? node.param.name : null;
5170
+ const caughtName = node.param?.type === import_utils31.AST_NODE_TYPES.Identifier ? node.param.name : null;
4820
5171
  if (logsOrReportsError(node.body, caughtName)) {
4821
5172
  return;
4822
5173
  }
@@ -4843,9 +5194,9 @@ var no_sentinel_return_on_catch_default = createRule({
4843
5194
  });
4844
5195
 
4845
5196
  // src/rules/no-silent-promise-catch.ts
4846
- var import_utils31 = require("@typescript-eslint/utils");
5197
+ var import_utils32 = require("@typescript-eslint/utils");
4847
5198
  function isBodyParseCall(node) {
4848
- return node.type === import_utils31.AST_NODE_TYPES.CallExpression && node.arguments.length === 0 && node.callee.type === import_utils31.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils31.AST_NODE_TYPES.Identifier && (node.callee.property.name === "json" || node.callee.property.name === "text");
5199
+ return node.type === import_utils32.AST_NODE_TYPES.CallExpression && node.arguments.length === 0 && node.callee.type === import_utils32.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils32.AST_NODE_TYPES.Identifier && (node.callee.property.name === "json" || node.callee.property.name === "text");
4849
5200
  }
4850
5201
  var TEARDOWN_METHODS = /* @__PURE__ */ new Set([
4851
5202
  "cancel",
@@ -4860,21 +5211,21 @@ var TEARDOWN_METHODS = /* @__PURE__ */ new Set([
4860
5211
  var DIRECTIVE_COMMENT_RE = /^\s*(eslint-|@ts-|prettier-ignore|biome-ignore|c8 |v8 |istanbul )/;
4861
5212
  var isExplanatory = (comment) => !DIRECTIVE_COMMENT_RE.test(comment.value);
4862
5213
  function isTeardownCall(node) {
4863
- return node.type === import_utils31.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils31.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils31.AST_NODE_TYPES.Identifier && TEARDOWN_METHODS.has(node.callee.property.name);
5214
+ return node.type === import_utils32.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils32.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils32.AST_NODE_TYPES.Identifier && TEARDOWN_METHODS.has(node.callee.property.name);
4864
5215
  }
4865
5216
  function isSilentExpression(node) {
4866
5217
  switch (node.type) {
4867
- case import_utils31.AST_NODE_TYPES.Literal:
5218
+ case import_utils32.AST_NODE_TYPES.Literal:
4868
5219
  return !("regex" in node);
4869
- case import_utils31.AST_NODE_TYPES.Identifier:
5220
+ case import_utils32.AST_NODE_TYPES.Identifier:
4870
5221
  return node.name === "undefined";
4871
- case import_utils31.AST_NODE_TYPES.UnaryExpression:
4872
- return node.operator === "void" && node.argument.type === import_utils31.AST_NODE_TYPES.Literal;
4873
- case import_utils31.AST_NODE_TYPES.ObjectExpression:
5222
+ case import_utils32.AST_NODE_TYPES.UnaryExpression:
5223
+ return node.operator === "void" && node.argument.type === import_utils32.AST_NODE_TYPES.Literal;
5224
+ case import_utils32.AST_NODE_TYPES.ObjectExpression:
4874
5225
  return node.properties.length === 0;
4875
- case import_utils31.AST_NODE_TYPES.ArrayExpression:
5226
+ case import_utils32.AST_NODE_TYPES.ArrayExpression:
4876
5227
  return node.elements.length === 0;
4877
- case import_utils31.AST_NODE_TYPES.TSAsExpression:
5228
+ case import_utils32.AST_NODE_TYPES.TSAsExpression:
4878
5229
  return isSilentExpression(node.expression);
4879
5230
  default:
4880
5231
  return false;
@@ -4882,7 +5233,7 @@ function isSilentExpression(node) {
4882
5233
  }
4883
5234
  function isSilentHandler(handler) {
4884
5235
  const body2 = handler.body;
4885
- if (body2.type !== import_utils31.AST_NODE_TYPES.BlockStatement) {
5236
+ if (body2.type !== import_utils32.AST_NODE_TYPES.BlockStatement) {
4886
5237
  return isSilentExpression(body2);
4887
5238
  }
4888
5239
  if (body2.body.length === 0) {
@@ -4890,7 +5241,7 @@ function isSilentHandler(handler) {
4890
5241
  }
4891
5242
  if (body2.body.length === 1) {
4892
5243
  const only = body2.body[0];
4893
- if (only !== void 0 && only.type === import_utils31.AST_NODE_TYPES.ReturnStatement) {
5244
+ if (only !== void 0 && only.type === import_utils32.AST_NODE_TYPES.ReturnStatement) {
4894
5245
  return only.argument === null || isSilentExpression(only.argument);
4895
5246
  }
4896
5247
  }
@@ -4919,7 +5270,7 @@ var no_silent_promise_catch_default = createRule({
4919
5270
  return true;
4920
5271
  }
4921
5272
  let statement = call;
4922
- while (statement.parent !== void 0 && statement.parent !== null && !statement.type.endsWith("Statement") && statement.type !== import_utils31.AST_NODE_TYPES.VariableDeclaration) {
5273
+ while (statement.parent !== void 0 && statement.parent !== null && !statement.type.endsWith("Statement") && statement.type !== import_utils32.AST_NODE_TYPES.VariableDeclaration) {
4923
5274
  statement = statement.parent;
4924
5275
  }
4925
5276
  if (sourceCode.getCommentsBefore(statement).some(isExplanatory)) {
@@ -4931,7 +5282,7 @@ var no_silent_promise_catch_default = createRule({
4931
5282
  };
4932
5283
  return {
4933
5284
  CallExpression(node) {
4934
- if (node.callee.type !== import_utils31.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.property.type !== import_utils31.AST_NODE_TYPES.Identifier || node.callee.property.name !== "catch") {
5285
+ if (node.callee.type !== import_utils32.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.property.type !== import_utils32.AST_NODE_TYPES.Identifier || node.callee.property.name !== "catch") {
4935
5286
  return;
4936
5287
  }
4937
5288
  if (isBodyParseCall(node.callee.object)) {
@@ -4940,14 +5291,14 @@ var no_silent_promise_catch_default = createRule({
4940
5291
  if (isTeardownCall(node.callee.object)) {
4941
5292
  return;
4942
5293
  }
4943
- if (node.parent.type === import_utils31.AST_NODE_TYPES.MemberExpression && node.parent.object === node) {
5294
+ if (node.parent.type === import_utils32.AST_NODE_TYPES.MemberExpression && node.parent.object === node) {
4944
5295
  return;
4945
5296
  }
4946
5297
  if (node.arguments.length !== 1) {
4947
5298
  return;
4948
5299
  }
4949
5300
  const handler = node.arguments[0];
4950
- if (handler === void 0 || handler.type !== import_utils31.AST_NODE_TYPES.ArrowFunctionExpression && handler.type !== import_utils31.AST_NODE_TYPES.FunctionExpression) {
5301
+ if (handler === void 0 || handler.type !== import_utils32.AST_NODE_TYPES.ArrowFunctionExpression && handler.type !== import_utils32.AST_NODE_TYPES.FunctionExpression) {
4951
5302
  return;
4952
5303
  }
4953
5304
  if (hasExplanatoryComment(node, handler)) {
@@ -4962,7 +5313,7 @@ var no_silent_promise_catch_default = createRule({
4962
5313
  });
4963
5314
 
4964
5315
  // src/rules/no-sleep-in-test-body.ts
4965
- var import_utils32 = require("@typescript-eslint/utils");
5316
+ var import_utils33 = require("@typescript-eslint/utils");
4966
5317
  var SLEEP_HELPERS = /* @__PURE__ */ new Set(["sleep", "delay", "wait", "pause"]);
4967
5318
  var TEST_CALLERS2 = /* @__PURE__ */ new Set([
4968
5319
  "it",
@@ -4971,34 +5322,34 @@ var TEST_CALLERS2 = /* @__PURE__ */ new Set([
4971
5322
  "afterEach"
4972
5323
  ]);
4973
5324
  var FUNCTION_TYPES4 = /* @__PURE__ */ new Set([
4974
- import_utils32.AST_NODE_TYPES.FunctionDeclaration,
4975
- import_utils32.AST_NODE_TYPES.FunctionExpression,
4976
- import_utils32.AST_NODE_TYPES.ArrowFunctionExpression
5325
+ import_utils33.AST_NODE_TYPES.FunctionDeclaration,
5326
+ import_utils33.AST_NODE_TYPES.FunctionExpression,
5327
+ import_utils33.AST_NODE_TYPES.ArrowFunctionExpression
4977
5328
  ]);
4978
5329
  function isNonzeroNumericLiteral(node) {
4979
- return node?.type === import_utils32.AST_NODE_TYPES.Literal && typeof node.value === "number" && node.value !== 0;
5330
+ return node?.type === import_utils33.AST_NODE_TYPES.Literal && typeof node.value === "number" && node.value !== 0;
4980
5331
  }
4981
5332
  function isTimedSetTimeout(node) {
4982
- return node.type === import_utils32.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils32.AST_NODE_TYPES.Identifier && node.callee.name === "setTimeout" && node.arguments.length >= 2 && isNonzeroNumericLiteral(node.arguments[1]);
5333
+ return node.type === import_utils33.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils33.AST_NODE_TYPES.Identifier && node.callee.name === "setTimeout" && node.arguments.length >= 2 && isNonzeroNumericLiteral(node.arguments[1]);
4983
5334
  }
4984
5335
  function isPromiseSleep(node) {
4985
- if (node.callee.type !== import_utils32.AST_NODE_TYPES.Identifier || node.callee.name !== "Promise") {
5336
+ if (node.callee.type !== import_utils33.AST_NODE_TYPES.Identifier || node.callee.name !== "Promise") {
4986
5337
  return false;
4987
5338
  }
4988
5339
  const executor = node.arguments[0];
4989
- if (executor?.type !== import_utils32.AST_NODE_TYPES.ArrowFunctionExpression && executor?.type !== import_utils32.AST_NODE_TYPES.FunctionExpression) {
5340
+ if (executor?.type !== import_utils33.AST_NODE_TYPES.ArrowFunctionExpression && executor?.type !== import_utils33.AST_NODE_TYPES.FunctionExpression) {
4990
5341
  return false;
4991
5342
  }
4992
5343
  const body2 = executor.body;
4993
- if (body2.type !== import_utils32.AST_NODE_TYPES.BlockStatement) {
5344
+ if (body2.type !== import_utils33.AST_NODE_TYPES.BlockStatement) {
4994
5345
  return isTimedSetTimeout(body2);
4995
5346
  }
4996
5347
  return body2.body.some(
4997
- (stmt) => stmt.type === import_utils32.AST_NODE_TYPES.ExpressionStatement && isTimedSetTimeout(stmt.expression)
5348
+ (stmt) => stmt.type === import_utils33.AST_NODE_TYPES.ExpressionStatement && isTimedSetTimeout(stmt.expression)
4998
5349
  );
4999
5350
  }
5000
5351
  function isHelperSleep(node) {
5001
- return node.callee.type === import_utils32.AST_NODE_TYPES.Identifier && SLEEP_HELPERS.has(node.callee.name) && node.arguments.length >= 1 && isNonzeroNumericLiteral(node.arguments[0]);
5352
+ return node.callee.type === import_utils33.AST_NODE_TYPES.Identifier && SLEEP_HELPERS.has(node.callee.name) && node.arguments.length >= 1 && isNonzeroNumericLiteral(node.arguments[0]);
5002
5353
  }
5003
5354
  function nearestEnclosingFunction2(node) {
5004
5355
  for (let current = node.parent; current != null; current = current.parent) {
@@ -5006,7 +5357,7 @@ function nearestEnclosingFunction2(node) {
5006
5357
  continue;
5007
5358
  }
5008
5359
  const grandparent = current.parent;
5009
- const isPromiseExecutor = grandparent?.type === import_utils32.AST_NODE_TYPES.NewExpression && isPromiseSleep(grandparent);
5360
+ const isPromiseExecutor = grandparent?.type === import_utils33.AST_NODE_TYPES.NewExpression && isPromiseSleep(grandparent);
5010
5361
  if (!isPromiseExecutor) {
5011
5362
  return current;
5012
5363
  }
@@ -5014,23 +5365,23 @@ function nearestEnclosingFunction2(node) {
5014
5365
  return null;
5015
5366
  }
5016
5367
  function testCallerName2(callee) {
5017
- if (callee.type === import_utils32.AST_NODE_TYPES.Identifier) {
5368
+ if (callee.type === import_utils33.AST_NODE_TYPES.Identifier) {
5018
5369
  return callee.name;
5019
5370
  }
5020
- if (callee.type === import_utils32.AST_NODE_TYPES.MemberExpression) {
5371
+ if (callee.type === import_utils33.AST_NODE_TYPES.MemberExpression) {
5021
5372
  return testCallerName2(callee.object);
5022
5373
  }
5023
- if (callee.type === import_utils32.AST_NODE_TYPES.CallExpression) {
5374
+ if (callee.type === import_utils33.AST_NODE_TYPES.CallExpression) {
5024
5375
  return testCallerName2(callee.callee);
5025
5376
  }
5026
- if (callee.type === import_utils32.AST_NODE_TYPES.TaggedTemplateExpression) {
5377
+ if (callee.type === import_utils33.AST_NODE_TYPES.TaggedTemplateExpression) {
5027
5378
  return testCallerName2(callee.tag);
5028
5379
  }
5029
5380
  return null;
5030
5381
  }
5031
5382
  function isTestBody2(fn) {
5032
5383
  const call = fn.parent;
5033
- if (call?.type !== import_utils32.AST_NODE_TYPES.CallExpression || !call.arguments.some((argument) => argument === fn)) {
5384
+ if (call?.type !== import_utils33.AST_NODE_TYPES.CallExpression || !call.arguments.some((argument) => argument === fn)) {
5034
5385
  return false;
5035
5386
  }
5036
5387
  const name = testCallerName2(call.callee);
@@ -5076,7 +5427,7 @@ var no_sleep_in_test_body_default = createRule({
5076
5427
  });
5077
5428
 
5078
5429
  // src/rules/no-storage-in-stateless-modules.ts
5079
- var import_utils33 = require("@typescript-eslint/utils");
5430
+ var import_utils34 = require("@typescript-eslint/utils");
5080
5431
  var DEFAULT_METHODS2 = [
5081
5432
  "prepare",
5082
5433
  "put",
@@ -5095,7 +5446,7 @@ function compile2(patterns) {
5095
5446
  }
5096
5447
  function storageMethodName(node, methods) {
5097
5448
  const callee = node.callee;
5098
- if (callee.type !== import_utils33.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils33.AST_NODE_TYPES.Identifier) {
5449
+ if (callee.type !== import_utils34.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils34.AST_NODE_TYPES.Identifier) {
5099
5450
  return null;
5100
5451
  }
5101
5452
  const name = callee.property.name;
@@ -5163,7 +5514,7 @@ var no_storage_in_stateless_modules_default = createRule({
5163
5514
  });
5164
5515
 
5165
5516
  // src/rules/no-string-concat-in-loop.ts
5166
- var import_utils34 = require("@typescript-eslint/utils");
5517
+ var import_utils35 = require("@typescript-eslint/utils");
5167
5518
  var LOOP_NODE_TYPES = /* @__PURE__ */ new Set([
5168
5519
  "ForStatement",
5169
5520
  "ForOfStatement",
@@ -5309,7 +5660,7 @@ var no_string_concat_in_loop_default = createRule({
5309
5660
  });
5310
5661
 
5311
5662
  // src/rules/no-tautological-expect.ts
5312
- var import_utils35 = require("@typescript-eslint/utils");
5663
+ var import_utils36 = require("@typescript-eslint/utils");
5313
5664
  var EQUALITY_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
5314
5665
  var ZERO_ARG_MATCHERS = /* @__PURE__ */ new Set([
5315
5666
  "toBeDefined",
@@ -5323,17 +5674,17 @@ var OPERAND_PREVIEW_CHARS = 40;
5323
5674
  var NUMERIC_SIGNS = /* @__PURE__ */ new Set(["-", "+"]);
5324
5675
  function isLiteral(node) {
5325
5676
  switch (node.type) {
5326
- case import_utils35.AST_NODE_TYPES.Literal:
5677
+ case import_utils36.AST_NODE_TYPES.Literal:
5327
5678
  return true;
5328
- case import_utils35.AST_NODE_TYPES.TemplateLiteral:
5679
+ case import_utils36.AST_NODE_TYPES.TemplateLiteral:
5329
5680
  return node.expressions.length === 0;
5330
- case import_utils35.AST_NODE_TYPES.UnaryExpression:
5681
+ case import_utils36.AST_NODE_TYPES.UnaryExpression:
5331
5682
  return NUMERIC_SIGNS.has(node.operator) && isLiteral(node.argument);
5332
- case import_utils35.AST_NODE_TYPES.ArrayExpression:
5683
+ case import_utils36.AST_NODE_TYPES.ArrayExpression:
5333
5684
  return node.elements.every((element) => element !== null && isLiteral(element));
5334
- case import_utils35.AST_NODE_TYPES.ObjectExpression:
5685
+ case import_utils36.AST_NODE_TYPES.ObjectExpression:
5335
5686
  return node.properties.every(
5336
- (property) => property.type === import_utils35.AST_NODE_TYPES.Property && !property.computed && isLiteral(property.value)
5687
+ (property) => property.type === import_utils36.AST_NODE_TYPES.Property && !property.computed && isLiteral(property.value)
5337
5688
  );
5338
5689
  default:
5339
5690
  return false;
@@ -5341,7 +5692,7 @@ function isLiteral(node) {
5341
5692
  }
5342
5693
  function expectOperand(callee) {
5343
5694
  const receiver = callee.object;
5344
- if (receiver.type !== import_utils35.AST_NODE_TYPES.CallExpression || receiver.callee.type !== import_utils35.AST_NODE_TYPES.Identifier || receiver.callee.name !== "expect" || receiver.arguments.length !== 1) {
5695
+ if (receiver.type !== import_utils36.AST_NODE_TYPES.CallExpression || receiver.callee.type !== import_utils36.AST_NODE_TYPES.Identifier || receiver.callee.name !== "expect" || receiver.arguments.length !== 1) {
5345
5696
  return null;
5346
5697
  }
5347
5698
  return receiver.arguments[0] ?? null;
@@ -5371,10 +5722,10 @@ var no_tautological_expect_default = createRule({
5371
5722
  return {
5372
5723
  CallExpression(node) {
5373
5724
  const callee = node.callee;
5374
- if (callee.type !== import_utils35.AST_NODE_TYPES.MemberExpression || callee.computed) {
5725
+ if (callee.type !== import_utils36.AST_NODE_TYPES.MemberExpression || callee.computed) {
5375
5726
  return;
5376
5727
  }
5377
- if (callee.property.type !== import_utils35.AST_NODE_TYPES.Identifier) {
5728
+ if (callee.property.type !== import_utils36.AST_NODE_TYPES.Identifier) {
5378
5729
  return;
5379
5730
  }
5380
5731
  const matcher = callee.property.name;
@@ -5433,7 +5784,7 @@ var no_typed_doc_sections_default = createRule({
5433
5784
  });
5434
5785
 
5435
5786
  // src/rules/no-trailing-value-narration.ts
5436
- var import_utils36 = require("@typescript-eslint/utils");
5787
+ var import_utils37 = require("@typescript-eslint/utils");
5437
5788
  var NUMBER_RE = /(?<![\w.])(\d+(?:\.\d+)?)(?![\w.])/g;
5438
5789
  var WORD_RE3 = /[A-Za-z]+(?:'[a-z]+)?|\d+(?:\.\d+)?/g;
5439
5790
  var UNIT_WORDS = /* @__PURE__ */ new Set([
@@ -5568,10 +5919,10 @@ var no_trailing_value_narration_default = createRule({
5568
5919
  });
5569
5920
 
5570
5921
  // src/rules/no-declaration-comment-wall.ts
5571
- var import_utils38 = require("@typescript-eslint/utils");
5922
+ var import_utils39 = require("@typescript-eslint/utils");
5572
5923
 
5573
5924
  // src/rules/_comment-wall.ts
5574
- var import_utils37 = require("@typescript-eslint/utils");
5925
+ var import_utils38 = require("@typescript-eslint/utils");
5575
5926
  var WALL_DEFAULTS = {
5576
5927
  // Below three rows "a wall" is not a fair description of what the reader sees.
5577
5928
  minCommentedMembers: 3,
@@ -5675,10 +6026,10 @@ function isWall(members, commented, restated, options) {
5675
6026
  return commented >= options.minCommentedMembers && commented / members >= options.minCommentedRatio && restated / commented >= options.minRestatedRatio;
5676
6027
  }
5677
6028
  var OPAQUE_VALUE_TYPES = /* @__PURE__ */ new Set([
5678
- import_utils37.AST_NODE_TYPES.FunctionExpression,
5679
- import_utils37.AST_NODE_TYPES.ArrowFunctionExpression,
5680
- import_utils37.AST_NODE_TYPES.ObjectExpression,
5681
- import_utils37.AST_NODE_TYPES.ArrayExpression
6029
+ import_utils38.AST_NODE_TYPES.FunctionExpression,
6030
+ import_utils38.AST_NODE_TYPES.ArrowFunctionExpression,
6031
+ import_utils38.AST_NODE_TYPES.ObjectExpression,
6032
+ import_utils38.AST_NODE_TYPES.ArrayExpression
5682
6033
  ]);
5683
6034
  function declarationRange(member) {
5684
6035
  const body2 = bodyOf(member);
@@ -5686,10 +6037,10 @@ function declarationRange(member) {
5686
6037
  return [member.range[0], body2.range[0]];
5687
6038
  }
5688
6039
  function bodyOf(member) {
5689
- if (member.type === import_utils37.AST_NODE_TYPES.MethodDefinition || member.type === import_utils37.AST_NODE_TYPES.TSAbstractMethodDefinition) {
6040
+ if (member.type === import_utils38.AST_NODE_TYPES.MethodDefinition || member.type === import_utils38.AST_NODE_TYPES.TSAbstractMethodDefinition) {
5690
6041
  return member.value.body ?? void 0;
5691
6042
  }
5692
- if (member.type === import_utils37.AST_NODE_TYPES.Property || member.type === import_utils37.AST_NODE_TYPES.PropertyDefinition) {
6043
+ if (member.type === import_utils38.AST_NODE_TYPES.Property || member.type === import_utils38.AST_NODE_TYPES.PropertyDefinition) {
5693
6044
  const value = member.value;
5694
6045
  if (value !== null && OPAQUE_VALUE_TYPES.has(value.type)) return value;
5695
6046
  }
@@ -5699,12 +6050,12 @@ function bodyOf(member) {
5699
6050
  // src/rules/no-declaration-comment-wall.ts
5700
6051
  function named(node) {
5701
6052
  switch (node.type) {
5702
- case import_utils38.AST_NODE_TYPES.TSEnumMember:
6053
+ case import_utils39.AST_NODE_TYPES.TSEnumMember:
5703
6054
  return { node, key: node.id };
5704
- case import_utils38.AST_NODE_TYPES.PropertyDefinition:
5705
- case import_utils38.AST_NODE_TYPES.TSAbstractPropertyDefinition:
5706
- case import_utils38.AST_NODE_TYPES.MethodDefinition:
5707
- case import_utils38.AST_NODE_TYPES.TSAbstractMethodDefinition:
6055
+ case import_utils39.AST_NODE_TYPES.PropertyDefinition:
6056
+ case import_utils39.AST_NODE_TYPES.TSAbstractPropertyDefinition:
6057
+ case import_utils39.AST_NODE_TYPES.MethodDefinition:
6058
+ case import_utils39.AST_NODE_TYPES.TSAbstractMethodDefinition:
5708
6059
  return node.computed ? void 0 : { node, key: node.key };
5709
6060
  default:
5710
6061
  return void 0;
@@ -5804,7 +6155,7 @@ var no_declaration_comment_wall_default = createRule({
5804
6155
  });
5805
6156
 
5806
6157
  // src/rules/no-union-in-comment.ts
5807
- var import_utils39 = require("@typescript-eslint/utils");
6158
+ var import_utils40 = require("@typescript-eslint/utils");
5808
6159
  var MAX_LITERAL_LENGTH = 28;
5809
6160
  var LITERAL = String.raw`(?:'[^'\n]*'|"[^"\n]*"|\`[^\`\n]*\`)`;
5810
6161
  var LEAD_IN_RE2 = /^(?:one of|either|values?|allowed(?: values)?|options?|possible(?: values)?)\s*[:=-]?\s*/i;
@@ -5823,14 +6174,14 @@ var STRING_BUILDERS = /* @__PURE__ */ new Set([
5823
6174
  function isBareString(node) {
5824
6175
  if (node === void 0) return false;
5825
6176
  switch (node.type) {
5826
- case import_utils39.AST_NODE_TYPES.TSStringKeyword:
6177
+ case import_utils40.AST_NODE_TYPES.TSStringKeyword:
5827
6178
  return true;
5828
6179
  // `string[]` holds members of the same closed set, one element at a time.
5829
- case import_utils39.AST_NODE_TYPES.TSArrayType:
6180
+ case import_utils40.AST_NODE_TYPES.TSArrayType:
5830
6181
  return isBareString(node.elementType);
5831
6182
  // `string | null` is still an unconstrained string, and so is `string | "a"`
5832
6183
  // — the checker collapses that one to `string`.
5833
- case import_utils39.AST_NODE_TYPES.TSUnionType:
6184
+ case import_utils40.AST_NODE_TYPES.TSUnionType:
5834
6185
  return node.types.some((member) => isBareString(member));
5835
6186
  default:
5836
6187
  return false;
@@ -5840,13 +6191,13 @@ function rootCallee(node) {
5840
6191
  let current = node;
5841
6192
  for (let hops = 0; current != null && hops < 12; hops += 1) {
5842
6193
  switch (current.type) {
5843
- case import_utils39.AST_NODE_TYPES.CallExpression:
6194
+ case import_utils40.AST_NODE_TYPES.CallExpression:
5844
6195
  current = current.callee;
5845
6196
  break;
5846
- case import_utils39.AST_NODE_TYPES.MemberExpression:
6197
+ case import_utils40.AST_NODE_TYPES.MemberExpression:
5847
6198
  current = current.object;
5848
6199
  break;
5849
- case import_utils39.AST_NODE_TYPES.Identifier:
6200
+ case import_utils40.AST_NODE_TYPES.Identifier:
5850
6201
  return current.name;
5851
6202
  default:
5852
6203
  return null;
@@ -5855,26 +6206,26 @@ function rootCallee(node) {
5855
6206
  return null;
5856
6207
  }
5857
6208
  function nameOf(key) {
5858
- if (key.type === import_utils39.AST_NODE_TYPES.Identifier) return key.name;
5859
- if (key.type === import_utils39.AST_NODE_TYPES.Literal && typeof key.value === "string") return key.value;
6209
+ if (key.type === import_utils40.AST_NODE_TYPES.Identifier) return key.name;
6210
+ if (key.type === import_utils40.AST_NODE_TYPES.Literal && typeof key.value === "string") return key.value;
5860
6211
  return null;
5861
6212
  }
5862
6213
  function targetOf(node) {
5863
6214
  switch (node.type) {
5864
- case import_utils39.AST_NODE_TYPES.TSPropertySignature:
5865
- case import_utils39.AST_NODE_TYPES.PropertyDefinition: {
6215
+ case import_utils40.AST_NODE_TYPES.TSPropertySignature:
6216
+ case import_utils40.AST_NODE_TYPES.PropertyDefinition: {
5866
6217
  const name = node.computed ? null : nameOf(node.key);
5867
6218
  if (name === null || !isBareString(node.typeAnnotation?.typeAnnotation)) return null;
5868
6219
  return { node, name };
5869
6220
  }
5870
- case import_utils39.AST_NODE_TYPES.Property: {
6221
+ case import_utils40.AST_NODE_TYPES.Property: {
5871
6222
  const name = node.computed || node.shorthand ? null : nameOf(node.key);
5872
6223
  const callee = rootCallee(node.value);
5873
6224
  if (name === null || callee === null || !STRING_BUILDERS.has(callee)) return null;
5874
6225
  return { node, name };
5875
6226
  }
5876
- case import_utils39.AST_NODE_TYPES.VariableDeclarator: {
5877
- if (node.id.type !== import_utils39.AST_NODE_TYPES.Identifier) return null;
6227
+ case import_utils40.AST_NODE_TYPES.VariableDeclarator: {
6228
+ if (node.id.type !== import_utils40.AST_NODE_TYPES.Identifier) return null;
5878
6229
  if (!isBareString(node.id.typeAnnotation?.typeAnnotation)) return null;
5879
6230
  return { node, name: node.id.name };
5880
6231
  }
@@ -5923,7 +6274,7 @@ var no_union_in_comment_default = createRule({
5923
6274
  if (after === null || after.loc.start.line !== comment.loc.end.line + 1) return null;
5924
6275
  anchor = sourceCode.getNodeByRangeIndex(after.range[0]);
5925
6276
  }
5926
- for (let node = anchor; node != null && node.type !== import_utils39.AST_NODE_TYPES.Program; node = node.parent) {
6277
+ for (let node = anchor; node != null && node.type !== import_utils40.AST_NODE_TYPES.Program; node = node.parent) {
5927
6278
  const target = targetOf(node);
5928
6279
  if (target !== null) return target;
5929
6280
  }
@@ -5952,9 +6303,9 @@ var no_union_in_comment_default = createRule({
5952
6303
  });
5953
6304
 
5954
6305
  // src/rules/no-type-member-comment-wall.ts
5955
- var import_utils40 = require("@typescript-eslint/utils");
6306
+ var import_utils41 = require("@typescript-eslint/utils");
5956
6307
  function isNamedMember(node) {
5957
- return (node.type === import_utils40.AST_NODE_TYPES.TSPropertySignature || node.type === import_utils40.AST_NODE_TYPES.TSMethodSignature) && !node.computed;
6308
+ return (node.type === import_utils41.AST_NODE_TYPES.TSPropertySignature || node.type === import_utils41.AST_NODE_TYPES.TSMethodSignature) && !node.computed;
5958
6309
  }
5959
6310
  var no_type_member_comment_wall_default = createRule({
5960
6311
  name: "no-type-member-comment-wall",
@@ -6001,7 +6352,7 @@ var no_type_member_comment_wall_default = createRule({
6001
6352
  return headsRun || lineAbove !== void 0 && lineAbove.trim().length === 0;
6002
6353
  }
6003
6354
  function check(node) {
6004
- const members = node.type === import_utils40.AST_NODE_TYPES.TSInterfaceBody ? node.body : node.members;
6355
+ const members = node.type === import_utils41.AST_NODE_TYPES.TSInterfaceBody ? node.body : node.members;
6005
6356
  const named2 = members.filter(isNamedMember);
6006
6357
  if (named2.length === 0) return;
6007
6358
  const documented = named2.map((member) => ({ member, comment: documentingComment(member) }));
@@ -6041,7 +6392,7 @@ var no_type_member_comment_wall_default = createRule({
6041
6392
  });
6042
6393
 
6043
6394
  // src/rules/no-unnecessary-use-client.ts
6044
- var import_utils41 = require("@typescript-eslint/utils");
6395
+ var import_utils42 = require("@typescript-eslint/utils");
6045
6396
  var HOOK_REGEX = /^use([A-Z]|$)/;
6046
6397
  var EVENT_PROP_REGEX = /^on[A-Z]/;
6047
6398
  var ERROR_FILE_REGEX = /\b(?:global-)?error\.[jt]sx?$/;
@@ -6067,13 +6418,13 @@ var CLIENT_ONLY_PACKAGES_REGEX = /^(?:@radix-ui\/|framer-motion|react-dom|react-
6067
6418
  var isBareSpecifier = (source) => !source.startsWith(".") && !source.startsWith("/") && !source.startsWith("@/") && !source.startsWith("~");
6068
6419
  var jsxRootName = (name) => {
6069
6420
  let current = name;
6070
- while (current.type === import_utils41.AST_NODE_TYPES.JSXMemberExpression) {
6421
+ while (current.type === import_utils42.AST_NODE_TYPES.JSXMemberExpression) {
6071
6422
  current = current.object;
6072
6423
  }
6073
- return current.type === import_utils41.AST_NODE_TYPES.JSXIdentifier ? current.name : "";
6424
+ return current.type === import_utils42.AST_NODE_TYPES.JSXIdentifier ? current.name : "";
6074
6425
  };
6075
6426
  var subtreeReadsImportedBinding = (node, imported) => {
6076
- if (node.type === import_utils41.AST_NODE_TYPES.Identifier) {
6427
+ if (node.type === import_utils42.AST_NODE_TYPES.Identifier) {
6077
6428
  return imported.has(node.name);
6078
6429
  }
6079
6430
  for (const key of Object.keys(node)) {
@@ -6088,16 +6439,16 @@ var subtreeReadsImportedBinding = (node, imported) => {
6088
6439
  return false;
6089
6440
  };
6090
6441
  var isUseClientDirective = (node) => {
6091
- return node.type === import_utils41.AST_NODE_TYPES.ExpressionStatement && node.expression.type === import_utils41.AST_NODE_TYPES.Literal && node.expression.value === "use client";
6442
+ return node.type === import_utils42.AST_NODE_TYPES.ExpressionStatement && node.expression.type === import_utils42.AST_NODE_TYPES.Literal && node.expression.value === "use client";
6092
6443
  };
6093
6444
  var isGlobalReference = (node, context) => {
6094
6445
  if (!BROWSER_GLOBALS.has(node.name)) return false;
6095
6446
  const parent = node.parent;
6096
6447
  if (parent !== void 0) {
6097
- if (parent.type === import_utils41.AST_NODE_TYPES.MemberExpression && parent.property === node && !parent.computed) {
6448
+ if (parent.type === import_utils42.AST_NODE_TYPES.MemberExpression && parent.property === node && !parent.computed) {
6098
6449
  return false;
6099
6450
  }
6100
- if (parent.type === import_utils41.AST_NODE_TYPES.Property && parent.key === node && !parent.computed) {
6451
+ if (parent.type === import_utils42.AST_NODE_TYPES.Property && parent.key === node && !parent.computed) {
6101
6452
  return false;
6102
6453
  }
6103
6454
  if (parent.type.startsWith("TS")) {
@@ -6137,13 +6488,13 @@ var no_unnecessary_use_client_default = createRule({
6137
6488
  const importedLocals = /* @__PURE__ */ new Set();
6138
6489
  const externalLocals = /* @__PURE__ */ new Set();
6139
6490
  const markIfHookOrContext = (callee) => {
6140
- if (callee.type === import_utils41.AST_NODE_TYPES.Identifier) {
6491
+ if (callee.type === import_utils42.AST_NODE_TYPES.Identifier) {
6141
6492
  if (HOOK_REGEX.test(callee.name) || callee.name === "createContext") {
6142
6493
  hasClientIndicator = true;
6143
6494
  }
6144
6495
  return;
6145
6496
  }
6146
- if (callee.type === import_utils41.AST_NODE_TYPES.MemberExpression && callee.property.type === import_utils41.AST_NODE_TYPES.Identifier) {
6497
+ if (callee.type === import_utils42.AST_NODE_TYPES.MemberExpression && callee.property.type === import_utils42.AST_NODE_TYPES.Identifier) {
6147
6498
  const name = callee.property.name;
6148
6499
  if (HOOK_REGEX.test(name) || name === "createContext") {
6149
6500
  hasClientIndicator = true;
@@ -6153,7 +6504,7 @@ var no_unnecessary_use_client_default = createRule({
6153
6504
  return {
6154
6505
  Program(node) {
6155
6506
  for (const stmt of node.body) {
6156
- if (stmt.type !== import_utils41.AST_NODE_TYPES.ExpressionStatement) break;
6507
+ if (stmt.type !== import_utils42.AST_NODE_TYPES.ExpressionStatement) break;
6157
6508
  if (isUseClientDirective(stmt)) {
6158
6509
  directiveNode = stmt;
6159
6510
  break;
@@ -6166,7 +6517,7 @@ var no_unnecessary_use_client_default = createRule({
6166
6517
  },
6167
6518
  JSXAttribute(node) {
6168
6519
  if (directiveNode === null) return;
6169
- if (node.name.type === import_utils41.AST_NODE_TYPES.JSXIdentifier && EVENT_PROP_REGEX.test(node.name.name)) {
6520
+ if (node.name.type === import_utils42.AST_NODE_TYPES.JSXIdentifier && EVENT_PROP_REGEX.test(node.name.name)) {
6170
6521
  hasClientIndicator = true;
6171
6522
  }
6172
6523
  },
@@ -6233,18 +6584,18 @@ var no_unnecessary_use_client_default = createRule({
6233
6584
  });
6234
6585
 
6235
6586
  // src/rules/no-unsafe-mock-casting.ts
6236
- var import_utils42 = require("@typescript-eslint/utils");
6237
6587
  var import_utils43 = require("@typescript-eslint/utils");
6588
+ var import_utils44 = require("@typescript-eslint/utils");
6238
6589
  function isMockTypeReference(node) {
6239
- if (node.type !== import_utils43.AST_NODE_TYPES.TSTypeReference) {
6590
+ if (node.type !== import_utils44.AST_NODE_TYPES.TSTypeReference) {
6240
6591
  return false;
6241
6592
  }
6242
6593
  const typeName = node.typeName;
6243
- if (typeName.type === import_utils43.AST_NODE_TYPES.Identifier) {
6594
+ if (typeName.type === import_utils44.AST_NODE_TYPES.Identifier) {
6244
6595
  const name = typeName.name;
6245
6596
  return name === "Mock" || name === "MockInstance" || name === "SpyInstance";
6246
6597
  }
6247
- if (typeName.type === import_utils43.AST_NODE_TYPES.TSQualifiedName) {
6598
+ if (typeName.type === import_utils44.AST_NODE_TYPES.TSQualifiedName) {
6248
6599
  const rightName = typeName.right.name;
6249
6600
  return rightName === "Mock" || rightName === "MockInstance" || rightName === "SpyInstance";
6250
6601
  }
@@ -6280,7 +6631,7 @@ var no_unsafe_mock_casting_default = createRule({
6280
6631
  });
6281
6632
 
6282
6633
  // src/rules/no-zod-native-enum.ts
6283
- var import_utils44 = require("@typescript-eslint/utils");
6634
+ var import_utils45 = require("@typescript-eslint/utils");
6284
6635
  var ts = __toESM(require("typescript"), 1);
6285
6636
  var IGNORE_PATTERNS = [
6286
6637
  /[\\/]generated[\\/]/,
@@ -6298,7 +6649,7 @@ function isZodModule(source) {
6298
6649
  return /(^|[/@-])zod([/-]|$)/.test(source);
6299
6650
  }
6300
6651
  function unwrap2(node) {
6301
- if (node.type === import_utils44.AST_NODE_TYPES.TSAsExpression || node.type === import_utils44.AST_NODE_TYPES.TSSatisfiesExpression) {
6652
+ if (node.type === import_utils45.AST_NODE_TYPES.TSAsExpression || node.type === import_utils45.AST_NODE_TYPES.TSSatisfiesExpression) {
6302
6653
  return unwrap2(node.expression);
6303
6654
  }
6304
6655
  return node;
@@ -6306,14 +6657,14 @@ function unwrap2(node) {
6306
6657
  function stringValueTexts(node, sourceCode) {
6307
6658
  const texts = [];
6308
6659
  for (const prop of node.properties) {
6309
- if (prop.type !== import_utils44.AST_NODE_TYPES.Property) {
6660
+ if (prop.type !== import_utils45.AST_NODE_TYPES.Property) {
6310
6661
  return null;
6311
6662
  }
6312
6663
  if (prop.computed || prop.shorthand || prop.method || prop.kind !== "init") {
6313
6664
  return null;
6314
6665
  }
6315
6666
  const value = prop.value;
6316
- if (value.type !== import_utils44.AST_NODE_TYPES.Literal || typeof value.value !== "string") {
6667
+ if (value.type !== import_utils45.AST_NODE_TYPES.Literal || typeof value.value !== "string") {
6317
6668
  return null;
6318
6669
  }
6319
6670
  const text = sourceCode.getText(value);
@@ -6329,7 +6680,7 @@ function resolvesToLocalEnum(node, scope) {
6329
6680
  const variable = current.variables.find((v) => v.name === node.name);
6330
6681
  if (variable !== void 0) {
6331
6682
  return variable.defs.some(
6332
- (def) => def.node.type === import_utils44.AST_NODE_TYPES.TSEnumDeclaration
6683
+ (def) => def.node.type === import_utils45.AST_NODE_TYPES.TSEnumDeclaration
6333
6684
  );
6334
6685
  }
6335
6686
  current = current.upper;
@@ -6374,32 +6725,32 @@ var no_zod_native_enum_default = createRule({
6374
6725
  }
6375
6726
  let services;
6376
6727
  try {
6377
- services = import_utils44.ESLintUtils.getParserServices(context);
6728
+ services = import_utils45.ESLintUtils.getParserServices(context);
6378
6729
  } catch {
6379
6730
  services = null;
6380
6731
  }
6381
6732
  const zodImportedNames = /* @__PURE__ */ new Map();
6382
6733
  function isZodMemberCall(node, api) {
6383
6734
  const callee = node.callee;
6384
- if (callee.type === import_utils44.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils44.AST_NODE_TYPES.Identifier) {
6735
+ if (callee.type === import_utils45.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils45.AST_NODE_TYPES.Identifier) {
6385
6736
  return callee.property.name === api;
6386
6737
  }
6387
- if (callee.type === import_utils44.AST_NODE_TYPES.Identifier) {
6738
+ if (callee.type === import_utils45.AST_NODE_TYPES.Identifier) {
6388
6739
  return zodImportedNames.get(callee.name) === api;
6389
6740
  }
6390
6741
  return false;
6391
6742
  }
6392
6743
  function buildFix(node) {
6393
6744
  const callee = node.callee;
6394
- if (callee.type !== import_utils44.AST_NODE_TYPES.MemberExpression || callee.property.type !== import_utils44.AST_NODE_TYPES.Identifier) {
6745
+ if (callee.type !== import_utils45.AST_NODE_TYPES.MemberExpression || callee.property.type !== import_utils45.AST_NODE_TYPES.Identifier) {
6395
6746
  return null;
6396
6747
  }
6397
6748
  const arg = node.arguments[0];
6398
- if (arg === void 0 || node.arguments.length !== 1 || arg.type === import_utils44.AST_NODE_TYPES.SpreadElement) {
6749
+ if (arg === void 0 || node.arguments.length !== 1 || arg.type === import_utils45.AST_NODE_TYPES.SpreadElement) {
6399
6750
  return null;
6400
6751
  }
6401
6752
  const inner = unwrap2(arg);
6402
- if (inner.type !== import_utils44.AST_NODE_TYPES.ObjectExpression) {
6753
+ if (inner.type !== import_utils45.AST_NODE_TYPES.ObjectExpression) {
6403
6754
  return null;
6404
6755
  }
6405
6756
  const values = stringValueTexts(inner, sourceCode);
@@ -6419,7 +6770,7 @@ var no_zod_native_enum_default = createRule({
6419
6770
  return;
6420
6771
  }
6421
6772
  for (const spec of node.specifiers) {
6422
- if (spec.type === import_utils44.AST_NODE_TYPES.ImportSpecifier && spec.imported.type === import_utils44.AST_NODE_TYPES.Identifier) {
6773
+ if (spec.type === import_utils45.AST_NODE_TYPES.ImportSpecifier && spec.imported.type === import_utils45.AST_NODE_TYPES.Identifier) {
6423
6774
  zodImportedNames.set(spec.local.name, spec.imported.name);
6424
6775
  }
6425
6776
  }
@@ -6438,7 +6789,7 @@ var no_zod_native_enum_default = createRule({
6438
6789
  return;
6439
6790
  }
6440
6791
  const arg = node.arguments[0];
6441
- if (arg === void 0 || arg.type !== import_utils44.AST_NODE_TYPES.Identifier) {
6792
+ if (arg === void 0 || arg.type !== import_utils45.AST_NODE_TYPES.Identifier) {
6442
6793
  return;
6443
6794
  }
6444
6795
  const isEnum = resolvesToLocalEnum(arg, sourceCode.getScope(arg)) || services !== null && resolvesToImportedEnum(arg, services);
@@ -6455,7 +6806,7 @@ var no_zod_native_enum_default = createRule({
6455
6806
  });
6456
6807
 
6457
6808
  // src/rules/prefer-constant-time-secret-compare.ts
6458
- var import_utils45 = require("@typescript-eslint/utils");
6809
+ var import_utils46 = require("@typescript-eslint/utils");
6459
6810
  var EQUALITY_OPERATORS = /* @__PURE__ */ new Set(["===", "!==", "==", "!="]);
6460
6811
  var SENTINEL_IDENTIFIERS = /* @__PURE__ */ new Set(["undefined", "NaN"]);
6461
6812
  var SENTINEL_WORDS = /(^|_)(SENTINEL|EMPTY|NONE|NULL|UNSET|MISSING|PLACEHOLDER|DUMMY|FAKE|EXAMPLE)(_|$)/;
@@ -6468,36 +6819,36 @@ function isConstantReference(identifier) {
6468
6819
  }
6469
6820
  function isExcludedOperand(node) {
6470
6821
  switch (node.type) {
6471
- case import_utils45.AST_NODE_TYPES.Literal:
6822
+ case import_utils46.AST_NODE_TYPES.Literal:
6472
6823
  return true;
6473
- case import_utils45.AST_NODE_TYPES.TemplateLiteral:
6824
+ case import_utils46.AST_NODE_TYPES.TemplateLiteral:
6474
6825
  return node.expressions.length === 0;
6475
- case import_utils45.AST_NODE_TYPES.Identifier:
6826
+ case import_utils46.AST_NODE_TYPES.Identifier:
6476
6827
  return SENTINEL_IDENTIFIERS.has(node.name) || SENTINEL_PREFIX_RE.test(node.name) || isConstantReference(node.name);
6477
- case import_utils45.AST_NODE_TYPES.MemberExpression:
6478
- return !node.computed && node.property.type === import_utils45.AST_NODE_TYPES.Identifier && (SENTINEL_PREFIX_RE.test(node.property.name) || isConstantReference(node.property.name));
6828
+ case import_utils46.AST_NODE_TYPES.MemberExpression:
6829
+ return !node.computed && node.property.type === import_utils46.AST_NODE_TYPES.Identifier && (SENTINEL_PREFIX_RE.test(node.property.name) || isConstantReference(node.property.name));
6479
6830
  default:
6480
6831
  return false;
6481
6832
  }
6482
6833
  }
6483
6834
  function operandName(node) {
6484
- if (node.type === import_utils45.AST_NODE_TYPES.Identifier) {
6835
+ if (node.type === import_utils46.AST_NODE_TYPES.Identifier) {
6485
6836
  return node.name;
6486
6837
  }
6487
- if (node.type === import_utils45.AST_NODE_TYPES.MemberExpression && !node.computed && node.property.type === import_utils45.AST_NODE_TYPES.Identifier) {
6838
+ if (node.type === import_utils46.AST_NODE_TYPES.MemberExpression && !node.computed && node.property.type === import_utils46.AST_NODE_TYPES.Identifier) {
6488
6839
  return node.property.name;
6489
6840
  }
6490
6841
  return null;
6491
6842
  }
6492
6843
  function isSecretOperand(node) {
6493
- if (node.type === import_utils45.AST_NODE_TYPES.TemplateLiteral) {
6844
+ if (node.type === import_utils46.AST_NODE_TYPES.TemplateLiteral) {
6494
6845
  return node.expressions.some((expression) => isSecretOperand(expression));
6495
6846
  }
6496
6847
  const name = operandName(node);
6497
6848
  return name !== null && isAuthSecretName(name);
6498
6849
  }
6499
6850
  function secretNameOf(node) {
6500
- if (node.type === import_utils45.AST_NODE_TYPES.TemplateLiteral) {
6851
+ if (node.type === import_utils46.AST_NODE_TYPES.TemplateLiteral) {
6501
6852
  for (const expression of node.expressions) {
6502
6853
  const nested = secretNameOf(expression);
6503
6854
  if (nested !== null) {
@@ -6549,8 +6900,8 @@ var prefer_constant_time_secret_compare_default = createRule({
6549
6900
  });
6550
6901
 
6551
6902
  // src/rules/prefer-discriminated-union.ts
6552
- var import_utils46 = require("@typescript-eslint/utils");
6553
6903
  var import_utils47 = require("@typescript-eslint/utils");
6904
+ var import_utils48 = require("@typescript-eslint/utils");
6554
6905
  var STATUS_MEMBER_NAMES = /* @__PURE__ */ new Set([
6555
6906
  "success",
6556
6907
  "ok",
@@ -6560,27 +6911,27 @@ var STATUS_MEMBER_NAMES = /* @__PURE__ */ new Set([
6560
6911
  ]);
6561
6912
  var MIN_OPTIONAL_MEMBERS = 2;
6562
6913
  function getMemberName(member) {
6563
- if (member.type !== import_utils47.AST_NODE_TYPES.TSPropertySignature) {
6914
+ if (member.type !== import_utils48.AST_NODE_TYPES.TSPropertySignature) {
6564
6915
  return null;
6565
6916
  }
6566
6917
  const { key } = member;
6567
- if (key.type === import_utils47.AST_NODE_TYPES.Identifier) {
6918
+ if (key.type === import_utils48.AST_NODE_TYPES.Identifier) {
6568
6919
  return key.name;
6569
6920
  }
6570
- if (key.type === import_utils47.AST_NODE_TYPES.Literal && typeof key.value === "string") {
6921
+ if (key.type === import_utils48.AST_NODE_TYPES.Literal && typeof key.value === "string") {
6571
6922
  return key.value;
6572
6923
  }
6573
6924
  return null;
6574
6925
  }
6575
6926
  function isBooleanTyped(member) {
6576
- return member.typeAnnotation?.typeAnnotation.type === import_utils47.AST_NODE_TYPES.TSBooleanKeyword;
6927
+ return member.typeAnnotation?.typeAnnotation.type === import_utils48.AST_NODE_TYPES.TSBooleanKeyword;
6577
6928
  }
6578
6929
  function looksLikeMutuallyExclusiveState(typeLiteral) {
6579
6930
  let hasStatusBoolean = false;
6580
6931
  let optionalCount = 0;
6581
6932
  let optionalPayloadCount = 0;
6582
6933
  for (const member of typeLiteral.members) {
6583
- if (member.type !== import_utils47.AST_NODE_TYPES.TSPropertySignature) {
6934
+ if (member.type !== import_utils48.AST_NODE_TYPES.TSPropertySignature) {
6584
6935
  continue;
6585
6936
  }
6586
6937
  if (member.optional) {
@@ -6622,7 +6973,7 @@ var prefer_discriminated_union_default = createRule({
6622
6973
  TSInterfaceDeclaration(node) {
6623
6974
  const synthetic = {
6624
6975
  ...node.body,
6625
- type: import_utils47.AST_NODE_TYPES.TSTypeLiteral,
6976
+ type: import_utils48.AST_NODE_TYPES.TSTypeLiteral,
6626
6977
  members: node.body.body
6627
6978
  };
6628
6979
  checkTypeLiteral(synthetic, node);
@@ -6635,21 +6986,21 @@ var prefer_discriminated_union_default = createRule({
6635
6986
  });
6636
6987
 
6637
6988
  // src/rules/prefer-input-group-search.ts
6638
- var import_utils48 = require("@typescript-eslint/utils");
6989
+ var import_utils49 = require("@typescript-eslint/utils");
6639
6990
  var INPUT_MODULE = /(?:^|\/)components\/ui\/input$/u;
6640
6991
  var INPUT_GROUP_MODULE = /(?:^|\/)components\/ui\/input-group$/u;
6641
6992
  var MAX_JSX_DISTANCE = 2;
6642
6993
  function localNamedImports(node, importedName) {
6643
6994
  return node.specifiers.filter(
6644
- (specifier) => specifier.type === import_utils48.AST_NODE_TYPES.ImportSpecifier && (specifier.imported.type === import_utils48.AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value) === importedName
6995
+ (specifier) => specifier.type === import_utils49.AST_NODE_TYPES.ImportSpecifier && (specifier.imported.type === import_utils49.AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value) === importedName
6645
6996
  ).map((specifier) => specifier.local.name);
6646
6997
  }
6647
6998
  function elementName(node) {
6648
- return node.name.type === import_utils48.AST_NODE_TYPES.JSXIdentifier ? node.name.name : null;
6999
+ return node.name.type === import_utils49.AST_NODE_TYPES.JSXIdentifier ? node.name.name : null;
6649
7000
  }
6650
7001
  function jsxAncestors(occurrence) {
6651
7002
  return occurrence.ancestors.filter(
6652
- (ancestor) => ancestor.type === import_utils48.AST_NODE_TYPES.JSXElement
7003
+ (ancestor) => ancestor.type === import_utils49.AST_NODE_TYPES.JSXElement
6653
7004
  );
6654
7005
  }
6655
7006
  function isWithinInputGroup(occurrence, inputGroupNames) {
@@ -6748,7 +7099,7 @@ var prefer_input_group_search_default = createRule({
6748
7099
  });
6749
7100
 
6750
7101
  // src/rules/prefer-immutable-module-constant.ts
6751
- var import_utils49 = require("@typescript-eslint/utils");
7102
+ var import_utils50 = require("@typescript-eslint/utils");
6752
7103
  var CONSTANT_NAME = /^_?[A-Z][A-Z0-9_]*$/;
6753
7104
  var MUTATING_METHODS = /* @__PURE__ */ new Set([
6754
7105
  "add",
@@ -6766,43 +7117,43 @@ var MUTATING_METHODS = /* @__PURE__ */ new Set([
6766
7117
  "unshift"
6767
7118
  ]);
6768
7119
  function isAsConst(node, sourceText) {
6769
- if (node.type === import_utils49.AST_NODE_TYPES.TSSatisfiesExpression) {
7120
+ if (node.type === import_utils50.AST_NODE_TYPES.TSSatisfiesExpression) {
6770
7121
  return isAsConst(node.expression, sourceText);
6771
7122
  }
6772
- return node.type === import_utils49.AST_NODE_TYPES.TSAsExpression && sourceText(node.typeAnnotation).trim() === "const";
7123
+ return node.type === import_utils50.AST_NODE_TYPES.TSAsExpression && sourceText(node.typeAnnotation).trim() === "const";
6773
7124
  }
6774
7125
  function unwrapExpression(node) {
6775
- if (node.type === import_utils49.AST_NODE_TYPES.TSAsExpression || node.type === import_utils49.AST_NODE_TYPES.TSSatisfiesExpression || node.type === import_utils49.AST_NODE_TYPES.TSNonNullExpression) {
7126
+ if (node.type === import_utils50.AST_NODE_TYPES.TSAsExpression || node.type === import_utils50.AST_NODE_TYPES.TSSatisfiesExpression || node.type === import_utils50.AST_NODE_TYPES.TSNonNullExpression) {
6776
7127
  return unwrapExpression(node.expression);
6777
7128
  }
6778
7129
  return node;
6779
7130
  }
6780
7131
  function isObjectFreeze(node, isUnshadowedGlobal) {
6781
7132
  const inner = unwrapExpression(node);
6782
- if (inner.type === import_utils49.AST_NODE_TYPES.CallExpression && inner.callee.type === import_utils49.AST_NODE_TYPES.MemberExpression && !inner.callee.computed && inner.callee.object.type === import_utils49.AST_NODE_TYPES.Identifier && inner.callee.object.name === "Object" && isUnshadowedGlobal(inner.callee.object) && inner.callee.property.type === import_utils49.AST_NODE_TYPES.Identifier && inner.callee.property.name === "freeze" && inner.arguments.length === 1) {
7133
+ if (inner.type === import_utils50.AST_NODE_TYPES.CallExpression && inner.callee.type === import_utils50.AST_NODE_TYPES.MemberExpression && !inner.callee.computed && inner.callee.object.type === import_utils50.AST_NODE_TYPES.Identifier && inner.callee.object.name === "Object" && isUnshadowedGlobal(inner.callee.object) && inner.callee.property.type === import_utils50.AST_NODE_TYPES.Identifier && inner.callee.property.name === "freeze" && inner.arguments.length === 1) {
6783
7134
  const argument = inner.arguments[0];
6784
- return argument !== void 0 && argument.type !== import_utils49.AST_NODE_TYPES.SpreadElement && collectionKind(argument, isUnshadowedGlobal) === "literal";
7135
+ return argument !== void 0 && argument.type !== import_utils50.AST_NODE_TYPES.SpreadElement && collectionKind(argument, isUnshadowedGlobal) === "literal";
6785
7136
  }
6786
7137
  return false;
6787
7138
  }
6788
7139
  function collectionKind(node, isUnshadowedGlobal) {
6789
7140
  const inner = unwrapExpression(node);
6790
- if (inner.type === import_utils49.AST_NODE_TYPES.CallExpression && inner.callee.type === import_utils49.AST_NODE_TYPES.MemberExpression && !inner.callee.computed && inner.callee.object.type === import_utils49.AST_NODE_TYPES.Identifier && inner.callee.object.name === "Object" && isUnshadowedGlobal(inner.callee.object) && inner.callee.property.type === import_utils49.AST_NODE_TYPES.Identifier && inner.callee.property.name === "freeze" && inner.arguments.length === 1 && inner.arguments[0] !== void 0 && inner.arguments[0].type !== import_utils49.AST_NODE_TYPES.SpreadElement) {
7141
+ if (inner.type === import_utils50.AST_NODE_TYPES.CallExpression && inner.callee.type === import_utils50.AST_NODE_TYPES.MemberExpression && !inner.callee.computed && inner.callee.object.type === import_utils50.AST_NODE_TYPES.Identifier && inner.callee.object.name === "Object" && isUnshadowedGlobal(inner.callee.object) && inner.callee.property.type === import_utils50.AST_NODE_TYPES.Identifier && inner.callee.property.name === "freeze" && inner.arguments.length === 1 && inner.arguments[0] !== void 0 && inner.arguments[0].type !== import_utils50.AST_NODE_TYPES.SpreadElement) {
6791
7142
  return collectionKind(inner.arguments[0], isUnshadowedGlobal);
6792
7143
  }
6793
- if (inner.type === import_utils49.AST_NODE_TYPES.ArrayExpression || inner.type === import_utils49.AST_NODE_TYPES.ObjectExpression) {
7144
+ if (inner.type === import_utils50.AST_NODE_TYPES.ArrayExpression || inner.type === import_utils50.AST_NODE_TYPES.ObjectExpression) {
6794
7145
  return "literal";
6795
7146
  }
6796
- if (inner.type === import_utils49.AST_NODE_TYPES.NewExpression && inner.callee.type === import_utils49.AST_NODE_TYPES.Identifier && (inner.callee.name === "Set" || inner.callee.name === "Map") && isUnshadowedGlobal(inner.callee)) {
7147
+ if (inner.type === import_utils50.AST_NODE_TYPES.NewExpression && inner.callee.type === import_utils50.AST_NODE_TYPES.Identifier && (inner.callee.name === "Set" || inner.callee.name === "Map") && isUnshadowedGlobal(inner.callee)) {
6797
7148
  return inner.callee.name;
6798
7149
  }
6799
7150
  return null;
6800
7151
  }
6801
7152
  function isReadonlyType(node, kind) {
6802
- if (node.type === import_utils49.AST_NODE_TYPES.TSTypeOperator && node.operator === "readonly") {
7153
+ if (node.type === import_utils50.AST_NODE_TYPES.TSTypeOperator && node.operator === "readonly") {
6803
7154
  return true;
6804
7155
  }
6805
- if (node.type !== import_utils49.AST_NODE_TYPES.TSTypeReference || node.typeName.type !== import_utils49.AST_NODE_TYPES.Identifier) {
7156
+ if (node.type !== import_utils50.AST_NODE_TYPES.TSTypeReference || node.typeName.type !== import_utils50.AST_NODE_TYPES.Identifier) {
6806
7157
  return false;
6807
7158
  }
6808
7159
  if (node.typeName.name === "Readonly") {
@@ -6811,31 +7162,31 @@ function isReadonlyType(node, kind) {
6811
7162
  return kind === "literal" ? node.typeName.name === "ReadonlyArray" : node.typeName.name === `Readonly${kind}`;
6812
7163
  }
6813
7164
  function declaredReadonlyType(node, kind) {
6814
- const annotation = node.id.type === import_utils49.AST_NODE_TYPES.Identifier ? node.id.typeAnnotation : void 0;
7165
+ const annotation = node.id.type === import_utils50.AST_NODE_TYPES.Identifier ? node.id.typeAnnotation : void 0;
6815
7166
  if (annotation !== void 0 && isReadonlyType(annotation.typeAnnotation, kind)) {
6816
7167
  return true;
6817
7168
  }
6818
- return node.init?.type === import_utils49.AST_NODE_TYPES.TSAsExpression && isReadonlyType(node.init.typeAnnotation, kind);
7169
+ return node.init?.type === import_utils50.AST_NODE_TYPES.TSAsExpression && isReadonlyType(node.init.typeAnnotation, kind);
6819
7170
  }
6820
7171
  function referenceMutates(identifier) {
6821
7172
  let member = identifier.parent;
6822
- if (member?.type !== import_utils49.AST_NODE_TYPES.MemberExpression || member.object !== identifier) {
6823
- return member?.type === import_utils49.AST_NODE_TYPES.CallExpression && member.arguments[0] === identifier && member.callee.type === import_utils49.AST_NODE_TYPES.MemberExpression && !member.callee.computed && member.callee.object.type === import_utils49.AST_NODE_TYPES.Identifier && member.callee.object.name === "Object" && member.callee.property.type === import_utils49.AST_NODE_TYPES.Identifier && member.callee.property.name === "assign";
7173
+ if (member?.type !== import_utils50.AST_NODE_TYPES.MemberExpression || member.object !== identifier) {
7174
+ return member?.type === import_utils50.AST_NODE_TYPES.CallExpression && member.arguments[0] === identifier && member.callee.type === import_utils50.AST_NODE_TYPES.MemberExpression && !member.callee.computed && member.callee.object.type === import_utils50.AST_NODE_TYPES.Identifier && member.callee.object.name === "Object" && member.callee.property.type === import_utils50.AST_NODE_TYPES.Identifier && member.callee.property.name === "assign";
6824
7175
  }
6825
- while (member.parent.type === import_utils49.AST_NODE_TYPES.MemberExpression && member.parent.object === member) {
7176
+ while (member.parent.type === import_utils50.AST_NODE_TYPES.MemberExpression && member.parent.object === member) {
6826
7177
  member = member.parent;
6827
7178
  }
6828
7179
  const parent = member.parent;
6829
- if (parent?.type === import_utils49.AST_NODE_TYPES.AssignmentExpression && parent.left === member) {
7180
+ if (parent?.type === import_utils50.AST_NODE_TYPES.AssignmentExpression && parent.left === member) {
6830
7181
  return true;
6831
7182
  }
6832
- if (parent?.type === import_utils49.AST_NODE_TYPES.UpdateExpression && parent.argument === member) {
7183
+ if (parent?.type === import_utils50.AST_NODE_TYPES.UpdateExpression && parent.argument === member) {
6833
7184
  return true;
6834
7185
  }
6835
- if (parent?.type === import_utils49.AST_NODE_TYPES.UnaryExpression && parent.operator === "delete" && parent.argument === member) {
7186
+ if (parent?.type === import_utils50.AST_NODE_TYPES.UnaryExpression && parent.operator === "delete" && parent.argument === member) {
6836
7187
  return true;
6837
7188
  }
6838
- return parent?.type === import_utils49.AST_NODE_TYPES.CallExpression && parent.callee === member && member.property.type === import_utils49.AST_NODE_TYPES.Identifier && MUTATING_METHODS.has(member.property.name);
7189
+ return parent?.type === import_utils50.AST_NODE_TYPES.CallExpression && parent.callee === member && member.property.type === import_utils50.AST_NODE_TYPES.Identifier && MUTATING_METHODS.has(member.property.name);
6839
7190
  }
6840
7191
  var prefer_immutable_module_constant_default = createRule({
6841
7192
  name: "prefer-immutable-module-constant",
@@ -6854,7 +7205,7 @@ var prefer_immutable_module_constant_default = createRule({
6854
7205
  create(context) {
6855
7206
  const sourceCode = context.sourceCode;
6856
7207
  const isUnshadowedGlobal = (identifier) => {
6857
- const variable = import_utils49.ASTUtils.findVariable(sourceCode.getScope(identifier), identifier.name);
7208
+ const variable = import_utils50.ASTUtils.findVariable(sourceCode.getScope(identifier), identifier.name);
6858
7209
  return variable === null || variable.defs.length === 0;
6859
7210
  };
6860
7211
  if (isTestFile(context.filename) || isGeneratedFile(context.filename, sourceCode.getText())) {
@@ -6863,11 +7214,11 @@ var prefer_immutable_module_constant_default = createRule({
6863
7214
  return {
6864
7215
  VariableDeclarator(node) {
6865
7216
  const declaration = node.parent;
6866
- if (declaration.type !== import_utils49.AST_NODE_TYPES.VariableDeclaration || declaration.kind !== "const" || node.id.type !== import_utils49.AST_NODE_TYPES.Identifier || node.init === null || !CONSTANT_NAME.test(node.id.name)) {
7217
+ if (declaration.type !== import_utils50.AST_NODE_TYPES.VariableDeclaration || declaration.kind !== "const" || node.id.type !== import_utils50.AST_NODE_TYPES.Identifier || node.init === null || !CONSTANT_NAME.test(node.id.name)) {
6867
7218
  return;
6868
7219
  }
6869
7220
  const container = declaration.parent;
6870
- if (container.type !== import_utils49.AST_NODE_TYPES.Program && !(container.type === import_utils49.AST_NODE_TYPES.ExportNamedDeclaration && container.parent.type === import_utils49.AST_NODE_TYPES.Program)) {
7221
+ if (container.type !== import_utils50.AST_NODE_TYPES.Program && !(container.type === import_utils50.AST_NODE_TYPES.ExportNamedDeclaration && container.parent.type === import_utils50.AST_NODE_TYPES.Program)) {
6871
7222
  return;
6872
7223
  }
6873
7224
  if (isAsConst(node.init, (target) => sourceCode.getText(target)) || isObjectFreeze(node.init, isUnshadowedGlobal)) {
@@ -6879,7 +7230,7 @@ var prefer_immutable_module_constant_default = createRule({
6879
7230
  }
6880
7231
  const variable = sourceCode.getDeclaredVariables(node)[0];
6881
7232
  if (variable?.references.some(
6882
- (reference) => reference.identifier.type === import_utils49.AST_NODE_TYPES.Identifier && referenceMutates(reference.identifier)
7233
+ (reference) => reference.identifier.type === import_utils50.AST_NODE_TYPES.Identifier && referenceMutates(reference.identifier)
6883
7234
  ) === true) {
6884
7235
  return;
6885
7236
  }
@@ -6894,7 +7245,7 @@ var prefer_immutable_module_constant_default = createRule({
6894
7245
  });
6895
7246
 
6896
7247
  // src/rules/prefer-shadcn-primitives.ts
6897
- var import_utils50 = require("@typescript-eslint/utils");
7248
+ var import_utils51 = require("@typescript-eslint/utils");
6898
7249
  var SHADCN_PRIMITIVES = {
6899
7250
  button: "Button",
6900
7251
  dialog: "Dialog or AlertDialog family",
@@ -6915,15 +7266,15 @@ var LABELABLE_ELEMENTS = /* @__PURE__ */ new Set([
6915
7266
  "textarea"
6916
7267
  ]);
6917
7268
  function rawElementName(node) {
6918
- if (node.name.type !== import_utils50.AST_NODE_TYPES.JSXIdentifier) return null;
7269
+ if (node.name.type !== import_utils51.AST_NODE_TYPES.JSXIdentifier) return null;
6919
7270
  const name = node.name.name;
6920
7271
  return Object.hasOwn(SHADCN_PRIMITIVES, name) ? name : null;
6921
7272
  }
6922
7273
  function staticExpressionString(expression) {
6923
- if (expression.type === import_utils50.AST_NODE_TYPES.Literal) {
7274
+ if (expression.type === import_utils51.AST_NODE_TYPES.Literal) {
6924
7275
  return typeof expression.value === "string" ? expression.value : null;
6925
7276
  }
6926
- if (expression.type === import_utils50.AST_NODE_TYPES.TemplateLiteral) {
7277
+ if (expression.type === import_utils51.AST_NODE_TYPES.TemplateLiteral) {
6927
7278
  let value = expression.quasis[0]?.value.cooked ?? "";
6928
7279
  for (const [index, substitution] of expression.expressions.entries()) {
6929
7280
  const staticSubstitution = staticExpressionString(substitution);
@@ -6933,24 +7284,24 @@ function staticExpressionString(expression) {
6933
7284
  }
6934
7285
  return value;
6935
7286
  }
6936
- if (expression.type === import_utils50.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils50.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils50.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils50.AST_NODE_TYPES.TSTypeAssertion) {
7287
+ if (expression.type === import_utils51.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils51.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils51.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils51.AST_NODE_TYPES.TSTypeAssertion) {
6937
7288
  return staticExpressionString(expression.expression);
6938
7289
  }
6939
7290
  return null;
6940
7291
  }
6941
7292
  function staticString(value) {
6942
- if (value?.type === import_utils50.AST_NODE_TYPES.Literal) {
7293
+ if (value?.type === import_utils51.AST_NODE_TYPES.Literal) {
6943
7294
  return typeof value.value === "string" ? value.value : null;
6944
7295
  }
6945
- if (value?.type !== import_utils50.AST_NODE_TYPES.JSXExpressionContainer) return null;
7296
+ if (value?.type !== import_utils51.AST_NODE_TYPES.JSXExpressionContainer) return null;
6946
7297
  return staticExpressionString(value.expression);
6947
7298
  }
6948
7299
  function effectiveAttribute(node, attributeName) {
6949
7300
  for (const attribute of node.attributes.toReversed()) {
6950
- if (attribute.type === import_utils50.AST_NODE_TYPES.JSXSpreadAttribute) {
7301
+ if (attribute.type === import_utils51.AST_NODE_TYPES.JSXSpreadAttribute) {
6951
7302
  return { kind: "unknown" };
6952
7303
  }
6953
- if (attribute.name.type !== import_utils50.AST_NODE_TYPES.JSXIdentifier || attribute.name.name !== attributeName) {
7304
+ if (attribute.name.type !== import_utils51.AST_NODE_TYPES.JSXIdentifier || attribute.name.name !== attributeName) {
6954
7305
  continue;
6955
7306
  }
6956
7307
  const value = staticString(attribute.value);
@@ -6959,7 +7310,7 @@ function effectiveAttribute(node, attributeName) {
6959
7310
  return { kind: "missing" };
6960
7311
  }
6961
7312
  function isLabelableElement(node) {
6962
- if (node.openingElement.name.type !== import_utils50.AST_NODE_TYPES.JSXIdentifier) {
7313
+ if (node.openingElement.name.type !== import_utils51.AST_NODE_TYPES.JSXIdentifier) {
6963
7314
  return false;
6964
7315
  }
6965
7316
  const name = node.openingElement.name.name;
@@ -6971,10 +7322,10 @@ function isLabelableElement(node) {
6971
7322
  }
6972
7323
  function containsLabelableElement(node) {
6973
7324
  return node.children.some((child) => {
6974
- if (child.type === import_utils50.AST_NODE_TYPES.JSXElement) {
7325
+ if (child.type === import_utils51.AST_NODE_TYPES.JSXElement) {
6975
7326
  return isLabelableElement(child) || containsLabelableElement(child);
6976
7327
  }
6977
- if (child.type === import_utils50.AST_NODE_TYPES.JSXFragment) {
7328
+ if (child.type === import_utils51.AST_NODE_TYPES.JSXFragment) {
6978
7329
  return containsLabelableElement(child);
6979
7330
  }
6980
7331
  return false;
@@ -6983,7 +7334,7 @@ function containsLabelableElement(node) {
6983
7334
  function isStaticallyAssociatedLabel(node) {
6984
7335
  const htmlFor = effectiveAttribute(node, "htmlFor");
6985
7336
  if (htmlFor.kind === "known" && htmlFor.value.trim().length > 0) return true;
6986
- return node.parent.type === import_utils50.AST_NODE_TYPES.JSXElement && containsLabelableElement(node.parent);
7337
+ return node.parent.type === import_utils51.AST_NODE_TYPES.JSXElement && containsLabelableElement(node.parent);
6987
7338
  }
6988
7339
  function replacementFor(node, element) {
6989
7340
  if (element !== "input") return SHADCN_PRIMITIVES[element];
@@ -7027,7 +7378,7 @@ var prefer_shadcn_primitives_default = createRule({
7027
7378
  });
7028
7379
 
7029
7380
  // src/rules/prefer-module-level-constant.ts
7030
- var import_utils51 = require("@typescript-eslint/utils");
7381
+ var import_utils52 = require("@typescript-eslint/utils");
7031
7382
  var DEFAULT_MIN_ELEMENTS = 3;
7032
7383
  var MAX_LITERAL_DEPTH = 4;
7033
7384
  var IGNORE_PATTERNS2 = [
@@ -7056,9 +7407,9 @@ var MUTATING_METHODS2 = /* @__PURE__ */ new Set([
7056
7407
  "assign"
7057
7408
  ]);
7058
7409
  var FUNCTION_TYPES5 = /* @__PURE__ */ new Set([
7059
- import_utils51.AST_NODE_TYPES.FunctionDeclaration,
7060
- import_utils51.AST_NODE_TYPES.FunctionExpression,
7061
- import_utils51.AST_NODE_TYPES.ArrowFunctionExpression
7410
+ import_utils52.AST_NODE_TYPES.FunctionDeclaration,
7411
+ import_utils52.AST_NODE_TYPES.FunctionExpression,
7412
+ import_utils52.AST_NODE_TYPES.ArrowFunctionExpression
7062
7413
  ]);
7063
7414
  var COLLECTION_CONSTRUCTORS = /* @__PURE__ */ new Set(["Set", "Map"]);
7064
7415
  function isIgnoredFile2(filename, sourceText) {
@@ -7071,14 +7422,14 @@ function isLocalFixtureFile(filename) {
7071
7422
  return isTestFile(filename) || isStoryFile(filename);
7072
7423
  }
7073
7424
  function unwrap3(node) {
7074
- if (node.type === import_utils51.AST_NODE_TYPES.TSAsExpression || node.type === import_utils51.AST_NODE_TYPES.TSSatisfiesExpression || node.type === import_utils51.AST_NODE_TYPES.TSNonNullExpression) {
7425
+ if (node.type === import_utils52.AST_NODE_TYPES.TSAsExpression || node.type === import_utils52.AST_NODE_TYPES.TSSatisfiesExpression || node.type === import_utils52.AST_NODE_TYPES.TSNonNullExpression) {
7075
7426
  return unwrap3(node.expression);
7076
7427
  }
7077
7428
  return node;
7078
7429
  }
7079
7430
  var HAS_STATEFUL_FLAG_RE = /[gy]/;
7080
7431
  function isRegexLiteral(node) {
7081
- return node.type === import_utils51.AST_NODE_TYPES.Literal && "regex" in node && node.regex !== void 0;
7432
+ return node.type === import_utils52.AST_NODE_TYPES.Literal && "regex" in node && node.regex !== void 0;
7082
7433
  }
7083
7434
  function isLiteralOnly(node, depth) {
7084
7435
  if (depth > MAX_LITERAL_DEPTH) {
@@ -7086,29 +7437,29 @@ function isLiteralOnly(node, depth) {
7086
7437
  }
7087
7438
  const inner = unwrap3(node);
7088
7439
  switch (inner.type) {
7089
- case import_utils51.AST_NODE_TYPES.Literal: {
7440
+ case import_utils52.AST_NODE_TYPES.Literal: {
7090
7441
  return !(isRegexLiteral(inner) && HAS_STATEFUL_FLAG_RE.test(inner.regex.flags));
7091
7442
  }
7092
- case import_utils51.AST_NODE_TYPES.TemplateLiteral: {
7443
+ case import_utils52.AST_NODE_TYPES.TemplateLiteral: {
7093
7444
  return inner.expressions.length === 0;
7094
7445
  }
7095
- case import_utils51.AST_NODE_TYPES.UnaryExpression: {
7096
- return (inner.operator === "-" || inner.operator === "+") && inner.argument.type === import_utils51.AST_NODE_TYPES.Literal && typeof inner.argument.value === "number";
7446
+ case import_utils52.AST_NODE_TYPES.UnaryExpression: {
7447
+ return (inner.operator === "-" || inner.operator === "+") && inner.argument.type === import_utils52.AST_NODE_TYPES.Literal && typeof inner.argument.value === "number";
7097
7448
  }
7098
- case import_utils51.AST_NODE_TYPES.ArrayExpression: {
7449
+ case import_utils52.AST_NODE_TYPES.ArrayExpression: {
7099
7450
  return inner.elements.every(
7100
- (el) => el !== null && el.type !== import_utils51.AST_NODE_TYPES.SpreadElement && isLiteralOnly(el, depth + 1)
7451
+ (el) => el !== null && el.type !== import_utils52.AST_NODE_TYPES.SpreadElement && isLiteralOnly(el, depth + 1)
7101
7452
  );
7102
7453
  }
7103
- case import_utils51.AST_NODE_TYPES.ObjectExpression: {
7454
+ case import_utils52.AST_NODE_TYPES.ObjectExpression: {
7104
7455
  return inner.properties.every((prop) => {
7105
- if (prop.type !== import_utils51.AST_NODE_TYPES.Property) {
7456
+ if (prop.type !== import_utils52.AST_NODE_TYPES.Property) {
7106
7457
  return false;
7107
7458
  }
7108
7459
  if (prop.shorthand || prop.method || prop.kind !== "init") {
7109
7460
  return false;
7110
7461
  }
7111
- if (prop.computed && prop.key.type !== import_utils51.AST_NODE_TYPES.Literal) {
7462
+ if (prop.computed && prop.key.type !== import_utils52.AST_NODE_TYPES.Literal) {
7112
7463
  return false;
7113
7464
  }
7114
7465
  return isLiteralOnly(prop.value, depth + 1);
@@ -7121,7 +7472,7 @@ function isLiteralOnly(node, depth) {
7121
7472
  }
7122
7473
  function unwrapObjectFreeze(node) {
7123
7474
  const inner = unwrap3(node);
7124
- if (inner.type === import_utils51.AST_NODE_TYPES.CallExpression && inner.callee.type === import_utils51.AST_NODE_TYPES.MemberExpression && !inner.callee.computed && inner.callee.object.type === import_utils51.AST_NODE_TYPES.Identifier && inner.callee.object.name === "Object" && inner.callee.property.type === import_utils51.AST_NODE_TYPES.Identifier && inner.callee.property.name === "freeze" && inner.arguments.length === 1 && inner.arguments[0] !== void 0 && inner.arguments[0].type !== import_utils51.AST_NODE_TYPES.SpreadElement) {
7475
+ if (inner.type === import_utils52.AST_NODE_TYPES.CallExpression && inner.callee.type === import_utils52.AST_NODE_TYPES.MemberExpression && !inner.callee.computed && inner.callee.object.type === import_utils52.AST_NODE_TYPES.Identifier && inner.callee.object.name === "Object" && inner.callee.property.type === import_utils52.AST_NODE_TYPES.Identifier && inner.callee.property.name === "freeze" && inner.arguments.length === 1 && inner.arguments[0] !== void 0 && inner.arguments[0].type !== import_utils52.AST_NODE_TYPES.SpreadElement) {
7125
7476
  return unwrap3(inner.arguments[0]);
7126
7477
  }
7127
7478
  return inner;
@@ -7137,19 +7488,19 @@ function classify(init, checkRegex) {
7137
7488
  }
7138
7489
  return { kind: "regex", size: 1 };
7139
7490
  }
7140
- if (node.type === import_utils51.AST_NODE_TYPES.ArrayExpression) {
7491
+ if (node.type === import_utils52.AST_NODE_TYPES.ArrayExpression) {
7141
7492
  return isLiteralOnly(node, 0) ? { kind: "array", size: node.elements.length } : null;
7142
7493
  }
7143
- if (node.type === import_utils51.AST_NODE_TYPES.ObjectExpression) {
7494
+ if (node.type === import_utils52.AST_NODE_TYPES.ObjectExpression) {
7144
7495
  return isLiteralOnly(node, 0) ? { kind: "object", size: node.properties.length } : null;
7145
7496
  }
7146
- if (node.type === import_utils51.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils51.AST_NODE_TYPES.Identifier && COLLECTION_CONSTRUCTORS.has(node.callee.name)) {
7497
+ if (node.type === import_utils52.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils52.AST_NODE_TYPES.Identifier && COLLECTION_CONSTRUCTORS.has(node.callee.name)) {
7147
7498
  const arg = node.arguments[0];
7148
- if (node.arguments.length !== 1 || arg === void 0 || arg.type === import_utils51.AST_NODE_TYPES.SpreadElement) {
7499
+ if (node.arguments.length !== 1 || arg === void 0 || arg.type === import_utils52.AST_NODE_TYPES.SpreadElement) {
7149
7500
  return null;
7150
7501
  }
7151
7502
  const entries = unwrap3(arg);
7152
- if (entries.type !== import_utils51.AST_NODE_TYPES.ArrayExpression) {
7503
+ if (entries.type !== import_utils52.AST_NODE_TYPES.ArrayExpression) {
7153
7504
  return null;
7154
7505
  }
7155
7506
  return isLiteralOnly(entries, 0) ? { kind: node.callee.name === "Set" ? "Set" : "Map", size: entries.elements.length } : null;
@@ -7178,10 +7529,10 @@ var NON_RETAINING_BUILTINS = /* @__PURE__ */ new Map(
7178
7529
  );
7179
7530
  function isNonRetainingBuiltinCall(node, argument) {
7180
7531
  const callee = node.callee;
7181
- if (callee.type === import_utils51.AST_NODE_TYPES.Identifier && callee.name === "structuredClone") {
7532
+ if (callee.type === import_utils52.AST_NODE_TYPES.Identifier && callee.name === "structuredClone") {
7182
7533
  return true;
7183
7534
  }
7184
- if (callee.type !== import_utils51.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils51.AST_NODE_TYPES.Identifier || callee.property.type !== import_utils51.AST_NODE_TYPES.Identifier) {
7535
+ if (callee.type !== import_utils52.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils52.AST_NODE_TYPES.Identifier || callee.property.type !== import_utils52.AST_NODE_TYPES.Identifier) {
7185
7536
  return false;
7186
7537
  }
7187
7538
  const members = NON_RETAINING_BUILTINS.get(callee.object.name);
@@ -7195,38 +7546,38 @@ function isNonRetainingBuiltinCall(node, argument) {
7195
7546
  }
7196
7547
  function isSafeRead(identifier) {
7197
7548
  const parent = identifier.parent;
7198
- if (parent.type === import_utils51.AST_NODE_TYPES.MemberExpression) {
7549
+ if (parent.type === import_utils52.AST_NODE_TYPES.MemberExpression) {
7199
7550
  if (parent.object !== identifier) {
7200
7551
  return true;
7201
7552
  }
7202
7553
  const grandparent = parent.parent;
7203
- if (grandparent.type === import_utils51.AST_NODE_TYPES.AssignmentExpression && grandparent.left === parent) {
7554
+ if (grandparent.type === import_utils52.AST_NODE_TYPES.AssignmentExpression && grandparent.left === parent) {
7204
7555
  return false;
7205
7556
  }
7206
- if (grandparent.type === import_utils51.AST_NODE_TYPES.UpdateExpression) {
7557
+ if (grandparent.type === import_utils52.AST_NODE_TYPES.UpdateExpression) {
7207
7558
  return false;
7208
7559
  }
7209
- if (grandparent.type === import_utils51.AST_NODE_TYPES.UnaryExpression && grandparent.operator === "delete") {
7560
+ if (grandparent.type === import_utils52.AST_NODE_TYPES.UnaryExpression && grandparent.operator === "delete") {
7210
7561
  return false;
7211
7562
  }
7212
- if (!parent.computed && parent.property.type === import_utils51.AST_NODE_TYPES.Identifier && MUTATING_METHODS2.has(parent.property.name) && grandparent.type === import_utils51.AST_NODE_TYPES.CallExpression && grandparent.callee === parent) {
7563
+ if (!parent.computed && parent.property.type === import_utils52.AST_NODE_TYPES.Identifier && MUTATING_METHODS2.has(parent.property.name) && grandparent.type === import_utils52.AST_NODE_TYPES.CallExpression && grandparent.callee === parent) {
7213
7564
  return false;
7214
7565
  }
7215
7566
  return true;
7216
7567
  }
7217
- if (parent.type === import_utils51.AST_NODE_TYPES.ForOfStatement && parent.right === identifier) {
7568
+ if (parent.type === import_utils52.AST_NODE_TYPES.ForOfStatement && parent.right === identifier) {
7218
7569
  return true;
7219
7570
  }
7220
- if (parent.type === import_utils51.AST_NODE_TYPES.SpreadElement) {
7571
+ if (parent.type === import_utils52.AST_NODE_TYPES.SpreadElement) {
7221
7572
  return true;
7222
7573
  }
7223
- if (parent.type === import_utils51.AST_NODE_TYPES.BinaryExpression) {
7574
+ if (parent.type === import_utils52.AST_NODE_TYPES.BinaryExpression) {
7224
7575
  return true;
7225
7576
  }
7226
- if (parent.type === import_utils51.AST_NODE_TYPES.CallExpression && parent.arguments.includes(identifier) && isNonRetainingBuiltinCall(parent, identifier)) {
7577
+ if (parent.type === import_utils52.AST_NODE_TYPES.CallExpression && parent.arguments.includes(identifier) && isNonRetainingBuiltinCall(parent, identifier)) {
7227
7578
  return true;
7228
7579
  }
7229
- if (parent.type === import_utils51.AST_NODE_TYPES.UnaryExpression && parent.operator !== "delete") {
7580
+ if (parent.type === import_utils52.AST_NODE_TYPES.UnaryExpression && parent.operator !== "delete") {
7230
7581
  return true;
7231
7582
  }
7232
7583
  return false;
@@ -7281,7 +7632,7 @@ var prefer_module_level_constant_default = createRule({
7281
7632
  if (reference.isWrite()) {
7282
7633
  return false;
7283
7634
  }
7284
- if (reference.identifier.type !== import_utils51.AST_NODE_TYPES.Identifier) {
7635
+ if (reference.identifier.type !== import_utils52.AST_NODE_TYPES.Identifier) {
7285
7636
  return false;
7286
7637
  }
7287
7638
  if (!isSafeRead(reference.identifier)) {
@@ -7293,10 +7644,10 @@ var prefer_module_level_constant_default = createRule({
7293
7644
  return {
7294
7645
  VariableDeclarator(node) {
7295
7646
  const declaration = node.parent;
7296
- if (declaration.type !== import_utils51.AST_NODE_TYPES.VariableDeclaration || declaration.kind !== "const" || declaration.declare === true) {
7647
+ if (declaration.type !== import_utils52.AST_NODE_TYPES.VariableDeclaration || declaration.kind !== "const" || declaration.declare === true) {
7297
7648
  return;
7298
7649
  }
7299
- if (node.id.type !== import_utils51.AST_NODE_TYPES.Identifier || node.init === null) {
7650
+ if (node.id.type !== import_utils52.AST_NODE_TYPES.Identifier || node.init === null) {
7300
7651
  return;
7301
7652
  }
7302
7653
  if (enclosingFunction2(node) === null) {
@@ -7323,7 +7674,7 @@ var prefer_module_level_constant_default = createRule({
7323
7674
  });
7324
7675
 
7325
7676
  // src/rules/prefer-module-level-schema.ts
7326
- var import_utils52 = require("@typescript-eslint/utils");
7677
+ var import_utils53 = require("@typescript-eslint/utils");
7327
7678
 
7328
7679
  // src/rules/_zod.ts
7329
7680
  var ZOD_PREFIX_RE = /^Z[A-Z]/;
@@ -7389,9 +7740,9 @@ var I18N_RECEIVER_NAMES = /* @__PURE__ */ new Set([
7389
7740
  "intl"
7390
7741
  ]);
7391
7742
  var FUNCTION_TYPES6 = /* @__PURE__ */ new Set([
7392
- import_utils52.AST_NODE_TYPES.ArrowFunctionExpression,
7393
- import_utils52.AST_NODE_TYPES.FunctionDeclaration,
7394
- import_utils52.AST_NODE_TYPES.FunctionExpression
7743
+ import_utils53.AST_NODE_TYPES.ArrowFunctionExpression,
7744
+ import_utils53.AST_NODE_TYPES.FunctionDeclaration,
7745
+ import_utils53.AST_NODE_TYPES.FunctionExpression
7395
7746
  ]);
7396
7747
  function schemaExpression(node) {
7397
7748
  let current = node;
@@ -7400,10 +7751,10 @@ function schemaExpression(node) {
7400
7751
  if (parent === void 0) {
7401
7752
  return current;
7402
7753
  }
7403
- if (parent.type === import_utils52.AST_NODE_TYPES.MemberExpression && parent.object === current && !parent.computed && parent.property.type === import_utils52.AST_NODE_TYPES.Identifier && TERMINAL_METHODS.has(parent.property.name)) {
7754
+ if (parent.type === import_utils53.AST_NODE_TYPES.MemberExpression && parent.object === current && !parent.computed && parent.property.type === import_utils53.AST_NODE_TYPES.Identifier && TERMINAL_METHODS.has(parent.property.name)) {
7404
7755
  return current;
7405
7756
  }
7406
- if (parent.type === import_utils52.AST_NODE_TYPES.MemberExpression && parent.object === current || parent.type === import_utils52.AST_NODE_TYPES.CallExpression && parent.callee === current || parent.type === import_utils52.AST_NODE_TYPES.TSAsExpression && parent.expression === current || parent.type === import_utils52.AST_NODE_TYPES.TSNonNullExpression && parent.expression === current) {
7757
+ if (parent.type === import_utils53.AST_NODE_TYPES.MemberExpression && parent.object === current || parent.type === import_utils53.AST_NODE_TYPES.CallExpression && parent.callee === current || parent.type === import_utils53.AST_NODE_TYPES.TSAsExpression && parent.expression === current || parent.type === import_utils53.AST_NODE_TYPES.TSNonNullExpression && parent.expression === current) {
7407
7758
  current = parent;
7408
7759
  continue;
7409
7760
  }
@@ -7454,22 +7805,22 @@ function subtreeSome(root, predicate) {
7454
7805
  function readsReceiver(node) {
7455
7806
  return subtreeSome(
7456
7807
  node,
7457
- (inner) => inner.type === import_utils52.AST_NODE_TYPES.ThisExpression || inner.type === import_utils52.AST_NODE_TYPES.Super || inner.type === import_utils52.AST_NODE_TYPES.Identifier && inner.name === "arguments"
7808
+ (inner) => inner.type === import_utils53.AST_NODE_TYPES.ThisExpression || inner.type === import_utils53.AST_NODE_TYPES.Super || inner.type === import_utils53.AST_NODE_TYPES.Identifier && inner.name === "arguments"
7458
7809
  );
7459
7810
  }
7460
7811
  function buildsLocalizedText(node) {
7461
7812
  return subtreeSome(node, (inner) => {
7462
- if (inner.type === import_utils52.AST_NODE_TYPES.TaggedTemplateExpression) {
7813
+ if (inner.type === import_utils53.AST_NODE_TYPES.TaggedTemplateExpression) {
7463
7814
  return true;
7464
7815
  }
7465
- if (inner.type !== import_utils52.AST_NODE_TYPES.CallExpression) {
7816
+ if (inner.type !== import_utils53.AST_NODE_TYPES.CallExpression) {
7466
7817
  return false;
7467
7818
  }
7468
7819
  const { callee } = inner;
7469
- if (callee.type === import_utils52.AST_NODE_TYPES.Identifier) {
7820
+ if (callee.type === import_utils53.AST_NODE_TYPES.Identifier) {
7470
7821
  return I18N_CALLEE_NAMES.has(callee.name);
7471
7822
  }
7472
- return callee.type === import_utils52.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils52.AST_NODE_TYPES.Identifier && I18N_RECEIVER_NAMES.has(callee.object.name);
7823
+ return callee.type === import_utils53.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils53.AST_NODE_TYPES.Identifier && I18N_RECEIVER_NAMES.has(callee.object.name);
7473
7824
  });
7474
7825
  }
7475
7826
  function collectReferences(scope, out) {
@@ -7526,15 +7877,15 @@ var prefer_module_level_schema_default = createRule({
7526
7877
  }
7527
7878
  const zodNamespaces = /* @__PURE__ */ new Set();
7528
7879
  function isZodCall(node) {
7529
- return node.type === import_utils52.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils52.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.object.type === import_utils52.AST_NODE_TYPES.Identifier && zodNamespaces.has(node.callee.object.name);
7880
+ return node.type === import_utils53.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils53.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.object.type === import_utils53.AST_NODE_TYPES.Identifier && zodNamespaces.has(node.callee.object.name);
7530
7881
  }
7531
7882
  function isCovered(node) {
7532
7883
  let current = node.parent ?? void 0;
7533
7884
  while (current !== void 0) {
7534
- if (current !== node && isZodCall(current) && current.callee.type === import_utils52.AST_NODE_TYPES.MemberExpression && current.callee.property.type === import_utils52.AST_NODE_TYPES.Identifier && factories.has(current.callee.property.name)) {
7885
+ if (current !== node && isZodCall(current) && current.callee.type === import_utils53.AST_NODE_TYPES.MemberExpression && current.callee.property.type === import_utils53.AST_NODE_TYPES.Identifier && factories.has(current.callee.property.name)) {
7535
7886
  return true;
7536
7887
  }
7537
- if (current.type === import_utils52.AST_NODE_TYPES.CallExpression && (current.callee.type === import_utils52.AST_NODE_TYPES.Identifier && MEMO_CALLEES.has(current.callee.name) || current.callee.type === import_utils52.AST_NODE_TYPES.MemberExpression && !current.callee.computed && current.callee.property.type === import_utils52.AST_NODE_TYPES.Identifier && MEMO_CALLEES.has(current.callee.property.name))) {
7888
+ if (current.type === import_utils53.AST_NODE_TYPES.CallExpression && (current.callee.type === import_utils53.AST_NODE_TYPES.Identifier && MEMO_CALLEES.has(current.callee.name) || current.callee.type === import_utils53.AST_NODE_TYPES.MemberExpression && !current.callee.computed && current.callee.property.type === import_utils53.AST_NODE_TYPES.Identifier && MEMO_CALLEES.has(current.callee.property.name))) {
7538
7889
  return true;
7539
7890
  }
7540
7891
  current = current.parent ?? void 0;
@@ -7549,11 +7900,11 @@ var prefer_module_level_schema_default = createRule({
7549
7900
  if (parent === void 0) {
7550
7901
  return confirmed;
7551
7902
  }
7552
- if (parent.type === import_utils52.AST_NODE_TYPES.Property && parent.value === current || parent.type === import_utils52.AST_NODE_TYPES.ObjectExpression || parent.type === import_utils52.AST_NODE_TYPES.ArrayExpression) {
7903
+ if (parent.type === import_utils53.AST_NODE_TYPES.Property && parent.value === current || parent.type === import_utils53.AST_NODE_TYPES.ObjectExpression || parent.type === import_utils53.AST_NODE_TYPES.ArrayExpression) {
7553
7904
  current = parent;
7554
7905
  continue;
7555
7906
  }
7556
- if (parent.type === import_utils52.AST_NODE_TYPES.CallExpression && parent.arguments.includes(current) && isSchemaComposition(parent)) {
7907
+ if (parent.type === import_utils53.AST_NODE_TYPES.CallExpression && parent.arguments.includes(current) && isSchemaComposition(parent)) {
7557
7908
  current = schemaExpression(parent);
7558
7909
  confirmed = current;
7559
7910
  continue;
@@ -7563,7 +7914,7 @@ var prefer_module_level_schema_default = createRule({
7563
7914
  }
7564
7915
  function isSchemaComposition(node) {
7565
7916
  const { callee } = node;
7566
- const isCombinator = callee.type === import_utils52.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils52.AST_NODE_TYPES.Identifier && ZOD_COMBINATOR_METHODS.has(callee.property.name);
7917
+ const isCombinator = callee.type === import_utils53.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils53.AST_NODE_TYPES.Identifier && ZOD_COMBINATOR_METHODS.has(callee.property.name);
7567
7918
  return isCombinator || isZodCall(node);
7568
7919
  }
7569
7920
  function closesOverNothing(node, enclosing) {
@@ -7597,13 +7948,13 @@ var prefer_module_level_schema_default = createRule({
7597
7948
  }
7598
7949
  function ownerName(enclosing) {
7599
7950
  const parent = enclosing.parent ?? void 0;
7600
- if (enclosing.type === import_utils52.AST_NODE_TYPES.FunctionDeclaration && enclosing.id !== null) {
7951
+ if (enclosing.type === import_utils53.AST_NODE_TYPES.FunctionDeclaration && enclosing.id !== null) {
7601
7952
  return enclosing.id.name;
7602
7953
  }
7603
- if (parent !== void 0 && parent.type === import_utils52.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils52.AST_NODE_TYPES.Identifier) {
7954
+ if (parent !== void 0 && parent.type === import_utils53.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils53.AST_NODE_TYPES.Identifier) {
7604
7955
  return parent.id.name;
7605
7956
  }
7606
- if (parent !== void 0 && (parent.type === import_utils52.AST_NODE_TYPES.MethodDefinition || parent.type === import_utils52.AST_NODE_TYPES.Property) && parent.key.type === import_utils52.AST_NODE_TYPES.Identifier) {
7957
+ if (parent !== void 0 && (parent.type === import_utils53.AST_NODE_TYPES.MethodDefinition || parent.type === import_utils53.AST_NODE_TYPES.Property) && parent.key.type === import_utils53.AST_NODE_TYPES.Identifier) {
7607
7958
  return parent.key.name;
7608
7959
  }
7609
7960
  return "this function";
@@ -7614,7 +7965,7 @@ var prefer_module_level_schema_default = createRule({
7614
7965
  return;
7615
7966
  }
7616
7967
  for (const specifier of node.specifiers) {
7617
- if (specifier.type === import_utils52.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils52.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils52.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils52.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") {
7968
+ if (specifier.type === import_utils53.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils53.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils53.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils53.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") {
7618
7969
  zodNamespaces.add(specifier.local.name);
7619
7970
  }
7620
7971
  }
@@ -7624,7 +7975,7 @@ var prefer_module_level_schema_default = createRule({
7624
7975
  return;
7625
7976
  }
7626
7977
  const callee = node.callee;
7627
- if (callee.property.type !== import_utils52.AST_NODE_TYPES.Identifier) {
7978
+ if (callee.property.type !== import_utils53.AST_NODE_TYPES.Identifier) {
7628
7979
  return;
7629
7980
  }
7630
7981
  const factory = callee.property.name;
@@ -7639,7 +7990,7 @@ var prefer_module_level_schema_default = createRule({
7639
7990
  return;
7640
7991
  }
7641
7992
  const shape = node.arguments[0];
7642
- if (shape !== void 0 && shape.type === import_utils52.AST_NODE_TYPES.ObjectExpression && shape.properties.length < minProperties) {
7993
+ if (shape !== void 0 && shape.type === import_utils53.AST_NODE_TYPES.ObjectExpression && shape.properties.length < minProperties) {
7643
7994
  return;
7644
7995
  }
7645
7996
  const expression = schemaExpression(node);
@@ -7667,9 +8018,9 @@ var prefer_module_level_schema_default = createRule({
7667
8018
  });
7668
8019
 
7669
8020
  // src/rules/prefer-native-random-uuid.ts
7670
- var import_utils53 = require("@typescript-eslint/utils");
8021
+ var import_utils54 = require("@typescript-eslint/utils");
7671
8022
  function requireUuid(node) {
7672
- return node?.type === import_utils53.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils53.AST_NODE_TYPES.Identifier && node.callee.name === "require" && node.arguments.length === 1 && node.arguments[0]?.type === import_utils53.AST_NODE_TYPES.Literal && node.arguments[0].value === "uuid";
8023
+ return node?.type === import_utils54.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils54.AST_NODE_TYPES.Identifier && node.callee.name === "require" && node.arguments.length === 1 && node.arguments[0]?.type === import_utils54.AST_NODE_TYPES.Literal && node.arguments[0].value === "uuid";
7673
8024
  }
7674
8025
  var prefer_native_random_uuid_default = createRule({
7675
8026
  name: "prefer-native-random-uuid",
@@ -7690,7 +8041,7 @@ var prefer_native_random_uuid_default = createRule({
7690
8041
  const directBindings = /* @__PURE__ */ new Set();
7691
8042
  const namespaceBindings = /* @__PURE__ */ new Set();
7692
8043
  function resolve(identifier) {
7693
- return import_utils53.ASTUtils.findVariable(context.sourceCode.getScope(identifier), identifier.name);
8044
+ return import_utils54.ASTUtils.findVariable(context.sourceCode.getScope(identifier), identifier.name);
7694
8045
  }
7695
8046
  function record(identifier, destination) {
7696
8047
  const variable = resolve(identifier);
@@ -7712,37 +8063,37 @@ var prefer_native_random_uuid_default = createRule({
7712
8063
  ImportDeclaration(node) {
7713
8064
  if (node.source.value !== "uuid") return;
7714
8065
  for (const specifier of node.specifiers) {
7715
- if (specifier.type === import_utils53.AST_NODE_TYPES.ImportSpecifier && (specifier.imported.type === import_utils53.AST_NODE_TYPES.Identifier ? specifier.imported.name === "v4" : specifier.imported.value === "v4")) {
8066
+ if (specifier.type === import_utils54.AST_NODE_TYPES.ImportSpecifier && (specifier.imported.type === import_utils54.AST_NODE_TYPES.Identifier ? specifier.imported.name === "v4" : specifier.imported.value === "v4")) {
7716
8067
  record(specifier.local, directBindings);
7717
- } else if (specifier.type === import_utils53.AST_NODE_TYPES.ImportNamespaceSpecifier) {
8068
+ } else if (specifier.type === import_utils54.AST_NODE_TYPES.ImportNamespaceSpecifier) {
7718
8069
  record(specifier.local, namespaceBindings);
7719
8070
  }
7720
8071
  }
7721
8072
  },
7722
8073
  VariableDeclarator(node) {
7723
8074
  if (node.parent.kind !== "const" || !requireUuid(node.init)) return;
7724
- if (node.init?.type !== import_utils53.AST_NODE_TYPES.CallExpression || node.init.callee.type !== import_utils53.AST_NODE_TYPES.Identifier || (resolve(node.init.callee)?.defs.length ?? 0) > 0) {
8075
+ if (node.init?.type !== import_utils54.AST_NODE_TYPES.CallExpression || node.init.callee.type !== import_utils54.AST_NODE_TYPES.Identifier || (resolve(node.init.callee)?.defs.length ?? 0) > 0) {
7725
8076
  return;
7726
8077
  }
7727
- if (node.id.type === import_utils53.AST_NODE_TYPES.Identifier) {
8078
+ if (node.id.type === import_utils54.AST_NODE_TYPES.Identifier) {
7728
8079
  record(node.id, namespaceBindings);
7729
8080
  return;
7730
8081
  }
7731
- if (node.id.type !== import_utils53.AST_NODE_TYPES.ObjectPattern) return;
8082
+ if (node.id.type !== import_utils54.AST_NODE_TYPES.ObjectPattern) return;
7732
8083
  for (const property of node.id.properties) {
7733
- if (property.type === import_utils53.AST_NODE_TYPES.Property && !property.computed && (property.key.type === import_utils53.AST_NODE_TYPES.Identifier && property.key.name === "v4" || property.key.type === import_utils53.AST_NODE_TYPES.Literal && property.key.value === "v4") && property.value.type === import_utils53.AST_NODE_TYPES.Identifier) {
8084
+ if (property.type === import_utils54.AST_NODE_TYPES.Property && !property.computed && (property.key.type === import_utils54.AST_NODE_TYPES.Identifier && property.key.name === "v4" || property.key.type === import_utils54.AST_NODE_TYPES.Literal && property.key.value === "v4") && property.value.type === import_utils54.AST_NODE_TYPES.Identifier) {
7734
8085
  record(property.value, directBindings);
7735
8086
  }
7736
8087
  }
7737
8088
  },
7738
8089
  "CallExpression:exit"(node) {
7739
8090
  if (node.arguments.length !== 0) return;
7740
- if (node.callee.type === import_utils53.AST_NODE_TYPES.Identifier) {
8091
+ if (node.callee.type === import_utils54.AST_NODE_TYPES.Identifier) {
7741
8092
  const variable2 = resolve(node.callee);
7742
8093
  if (variable2 !== null && directBindings.has(variable2)) report(node);
7743
8094
  return;
7744
8095
  }
7745
- if (node.callee.type !== import_utils53.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils53.AST_NODE_TYPES.Identifier || node.callee.property.type !== import_utils53.AST_NODE_TYPES.Identifier || node.callee.property.name !== "v4") {
8096
+ if (node.callee.type !== import_utils54.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.object.type !== import_utils54.AST_NODE_TYPES.Identifier || node.callee.property.type !== import_utils54.AST_NODE_TYPES.Identifier || node.callee.property.name !== "v4") {
7746
8097
  return;
7747
8098
  }
7748
8099
  const variable = resolve(node.callee.object);
@@ -7753,20 +8104,20 @@ var prefer_native_random_uuid_default = createRule({
7753
8104
  });
7754
8105
 
7755
8106
  // src/rules/prefer-non-nullable-collection.ts
7756
- var import_utils54 = require("@typescript-eslint/utils");
8107
+ var import_utils55 = require("@typescript-eslint/utils");
7757
8108
  var ARRAY_TYPE_NAMES = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
7758
8109
  function propertyName(node) {
7759
8110
  const key = node.key;
7760
- if (key.type === import_utils54.AST_NODE_TYPES.Identifier) return key.name;
7761
- if (key.type === import_utils54.AST_NODE_TYPES.Literal) return String(key.value);
8111
+ if (key.type === import_utils55.AST_NODE_TYPES.Identifier) return key.name;
8112
+ if (key.type === import_utils55.AST_NODE_TYPES.Literal) return String(key.value);
7762
8113
  return "collection";
7763
8114
  }
7764
8115
  function isArrayType(node) {
7765
- if (node.type === import_utils54.AST_NODE_TYPES.TSArrayType) return true;
7766
- return node.type === import_utils54.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils54.AST_NODE_TYPES.Identifier && ARRAY_TYPE_NAMES.has(node.typeName.name);
8116
+ if (node.type === import_utils55.AST_NODE_TYPES.TSArrayType) return true;
8117
+ return node.type === import_utils55.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils55.AST_NODE_TYPES.Identifier && ARRAY_TYPE_NAMES.has(node.typeName.name);
7767
8118
  }
7768
8119
  function isNullishType(node) {
7769
- return node.type === import_utils54.AST_NODE_TYPES.TSNullKeyword || node.type === import_utils54.AST_NODE_TYPES.TSUndefinedKeyword;
8120
+ return node.type === import_utils55.AST_NODE_TYPES.TSNullKeyword || node.type === import_utils55.AST_NODE_TYPES.TSUndefinedKeyword;
7770
8121
  }
7771
8122
  function isNullableArrayOnly(node) {
7772
8123
  const values = node.types.filter((member) => !isNullishType(member));
@@ -7794,7 +8145,7 @@ var prefer_non_nullable_collection_default = createRule({
7794
8145
  if (node.optional) return;
7795
8146
  const annotation = node.typeAnnotation?.typeAnnotation;
7796
8147
  if (annotation === void 0) return;
7797
- if (annotation.type !== import_utils54.AST_NODE_TYPES.TSUnionType || !isNullableArrayOnly(annotation)) {
8148
+ if (annotation.type !== import_utils55.AST_NODE_TYPES.TSUnionType || !isNullableArrayOnly(annotation)) {
7798
8149
  return;
7799
8150
  }
7800
8151
  context.report({
@@ -7807,7 +8158,7 @@ var prefer_non_nullable_collection_default = createRule({
7807
8158
  TSPropertySignature: checkOptionalProperty,
7808
8159
  PropertyDefinition: checkOptionalProperty,
7809
8160
  TSTypeAliasDeclaration(node) {
7810
- if (node.typeAnnotation.type !== import_utils54.AST_NODE_TYPES.TSUnionType) return;
8161
+ if (node.typeAnnotation.type !== import_utils55.AST_NODE_TYPES.TSUnionType) return;
7811
8162
  if (!isNullableArrayOnly(node.typeAnnotation)) return;
7812
8163
  context.report({
7813
8164
  node,
@@ -7820,13 +8171,13 @@ var prefer_non_nullable_collection_default = createRule({
7820
8171
  });
7821
8172
 
7822
8173
  // src/rules/prefer-schema-for-api-payload.ts
7823
- var import_utils55 = require("@typescript-eslint/utils");
8174
+ var import_utils56 = require("@typescript-eslint/utils");
7824
8175
  var unwrap4 = (node) => {
7825
8176
  let current = node;
7826
8177
  while (current !== null && current !== void 0) {
7827
- if (current.type === import_utils55.AST_NODE_TYPES.TSAsExpression || current.type === import_utils55.AST_NODE_TYPES.TSTypeAssertion || current.type === import_utils55.AST_NODE_TYPES.TSNonNullExpression || current.type === import_utils55.AST_NODE_TYPES.TSSatisfiesExpression) {
8178
+ if (current.type === import_utils56.AST_NODE_TYPES.TSAsExpression || current.type === import_utils56.AST_NODE_TYPES.TSTypeAssertion || current.type === import_utils56.AST_NODE_TYPES.TSNonNullExpression || current.type === import_utils56.AST_NODE_TYPES.TSSatisfiesExpression) {
7828
8179
  current = current.expression;
7829
- } else if (current.type === import_utils55.AST_NODE_TYPES.ChainExpression) {
8180
+ } else if (current.type === import_utils56.AST_NODE_TYPES.ChainExpression) {
7830
8181
  current = current.expression;
7831
8182
  } else {
7832
8183
  break;
@@ -7841,23 +8192,23 @@ var PROMISE_CHAIN_METHODS = /* @__PURE__ */ new Set([
7841
8192
  ]);
7842
8193
  var isSchemaParseReference = (node) => {
7843
8194
  const inner = unwrap4(node);
7844
- return inner !== null && inner.type === import_utils55.AST_NODE_TYPES.MemberExpression && !inner.computed && inner.property.type === import_utils55.AST_NODE_TYPES.Identifier && (inner.property.name === "parse" || inner.property.name === "safeParse");
8195
+ return inner !== null && inner.type === import_utils56.AST_NODE_TYPES.MemberExpression && !inner.computed && inner.property.type === import_utils56.AST_NODE_TYPES.Identifier && (inner.property.name === "parse" || inner.property.name === "safeParse");
7845
8196
  };
7846
8197
  var isRawPayloadSource = (node) => {
7847
8198
  let current = unwrap4(node);
7848
8199
  if (current === null) return false;
7849
- if (current.type === import_utils55.AST_NODE_TYPES.AwaitExpression) {
8200
+ if (current.type === import_utils56.AST_NODE_TYPES.AwaitExpression) {
7850
8201
  current = unwrap4(current.argument);
7851
8202
  }
7852
- if (current === null || current.type !== import_utils55.AST_NODE_TYPES.CallExpression) {
8203
+ if (current === null || current.type !== import_utils56.AST_NODE_TYPES.CallExpression) {
7853
8204
  return false;
7854
8205
  }
7855
8206
  const callee = unwrap4(current.callee);
7856
- if (callee === null || callee.type !== import_utils55.AST_NODE_TYPES.MemberExpression) {
8207
+ if (callee === null || callee.type !== import_utils56.AST_NODE_TYPES.MemberExpression) {
7857
8208
  return false;
7858
8209
  }
7859
8210
  const property = unwrap4(callee.property);
7860
- if (property === null || property.type !== import_utils55.AST_NODE_TYPES.Identifier) {
8211
+ if (property === null || property.type !== import_utils56.AST_NODE_TYPES.Identifier) {
7861
8212
  return false;
7862
8213
  }
7863
8214
  if (property.name === "json") {
@@ -7867,16 +8218,16 @@ var isRawPayloadSource = (node) => {
7867
8218
  return !current.arguments.some(isSchemaParseReference) && isRawPayloadSource(callee.object);
7868
8219
  }
7869
8220
  const object = unwrap4(callee.object);
7870
- return property.name === "parse" && object !== null && object.type === import_utils55.AST_NODE_TYPES.Identifier && object.name === "JSON" && !isLocalFileRead(current.arguments[0]);
8221
+ return property.name === "parse" && object !== null && object.type === import_utils56.AST_NODE_TYPES.Identifier && object.name === "JSON" && !isLocalFileRead(current.arguments[0]);
7871
8222
  };
7872
8223
  var FILE_READ_RE = /^(readFile|readFileSync|readJson|readJsonSync|readJSON)$/;
7873
8224
  var isLocalFileRead = (node) => {
7874
8225
  let found = false;
7875
8226
  const visit = (current) => {
7876
8227
  if (found || current === null || current === void 0) return;
7877
- if (current.type === import_utils55.AST_NODE_TYPES.CallExpression) {
8228
+ if (current.type === import_utils56.AST_NODE_TYPES.CallExpression) {
7878
8229
  const callee = unwrap4(current.callee);
7879
- const name = callee?.type === import_utils55.AST_NODE_TYPES.Identifier ? callee.name : callee?.type === import_utils55.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils55.AST_NODE_TYPES.Identifier ? callee.property.name : null;
8230
+ const name = callee?.type === import_utils56.AST_NODE_TYPES.Identifier ? callee.name : callee?.type === import_utils56.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils56.AST_NODE_TYPES.Identifier ? callee.property.name : null;
7880
8231
  if (name !== null && FILE_READ_RE.test(name)) {
7881
8232
  found = true;
7882
8233
  return;
@@ -7898,15 +8249,15 @@ var isLocalFileRead = (node) => {
7898
8249
  var ASSERTION_CALLEE_RE = /^(expect|assert|should|invariant)$/;
7899
8250
  var isInsideAssertion = (node) => {
7900
8251
  for (let current = node.parent; current !== void 0 && current !== null; current = current.parent) {
7901
- if (current.type !== import_utils55.AST_NODE_TYPES.CallExpression) continue;
8252
+ if (current.type !== import_utils56.AST_NODE_TYPES.CallExpression) continue;
7902
8253
  let callee = current.callee;
7903
- while (callee.type === import_utils55.AST_NODE_TYPES.MemberExpression) {
8254
+ while (callee.type === import_utils56.AST_NODE_TYPES.MemberExpression) {
7904
8255
  callee = callee.object;
7905
8256
  }
7906
- if (callee.type === import_utils55.AST_NODE_TYPES.CallExpression) {
8257
+ if (callee.type === import_utils56.AST_NODE_TYPES.CallExpression) {
7907
8258
  callee = callee.callee;
7908
8259
  }
7909
- if (callee.type === import_utils55.AST_NODE_TYPES.Identifier && ASSERTION_CALLEE_RE.test(callee.name)) {
8260
+ if (callee.type === import_utils56.AST_NODE_TYPES.Identifier && ASSERTION_CALLEE_RE.test(callee.name)) {
7910
8261
  return true;
7911
8262
  }
7912
8263
  }
@@ -7925,39 +8276,39 @@ var GUARD_NAME_RE = /^(?:is|validate|parse|assert|decode|coerce)[A-Z]/;
7925
8276
  var isValidationRead = (node) => {
7926
8277
  let current = node;
7927
8278
  let parent = current.parent;
7928
- while (parent !== null && parent !== void 0 && (parent.type === import_utils55.AST_NODE_TYPES.TSAsExpression || parent.type === import_utils55.AST_NODE_TYPES.TSTypeAssertion || parent.type === import_utils55.AST_NODE_TYPES.TSNonNullExpression || parent.type === import_utils55.AST_NODE_TYPES.TSSatisfiesExpression || parent.type === import_utils55.AST_NODE_TYPES.ChainExpression)) {
8279
+ while (parent !== null && parent !== void 0 && (parent.type === import_utils56.AST_NODE_TYPES.TSAsExpression || parent.type === import_utils56.AST_NODE_TYPES.TSTypeAssertion || parent.type === import_utils56.AST_NODE_TYPES.TSNonNullExpression || parent.type === import_utils56.AST_NODE_TYPES.TSSatisfiesExpression || parent.type === import_utils56.AST_NODE_TYPES.ChainExpression)) {
7929
8280
  current = parent;
7930
8281
  parent = parent.parent;
7931
8282
  }
7932
8283
  if (parent === null || parent === void 0) return false;
7933
- if (parent.type === import_utils55.AST_NODE_TYPES.UnaryExpression && parent.operator === "typeof" && parent.argument === current) {
8284
+ if (parent.type === import_utils56.AST_NODE_TYPES.UnaryExpression && parent.operator === "typeof" && parent.argument === current) {
7934
8285
  return true;
7935
8286
  }
7936
- if (parent.type !== import_utils55.AST_NODE_TYPES.CallExpression || !parent.arguments.some((arg) => arg === current)) {
8287
+ if (parent.type !== import_utils56.AST_NODE_TYPES.CallExpression || !parent.arguments.some((arg) => arg === current)) {
7937
8288
  return false;
7938
8289
  }
7939
8290
  const callee = parent.callee;
7940
- if (callee.type === import_utils55.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils55.AST_NODE_TYPES.Identifier && callee.object.name === "Array" && callee.property.type === import_utils55.AST_NODE_TYPES.Identifier && callee.property.name === "isArray") {
8291
+ if (callee.type === import_utils56.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils56.AST_NODE_TYPES.Identifier && callee.object.name === "Array" && callee.property.type === import_utils56.AST_NODE_TYPES.Identifier && callee.property.name === "isArray") {
7941
8292
  return parent.arguments.length === 1;
7942
8293
  }
7943
- return callee.type === import_utils55.AST_NODE_TYPES.Identifier && GUARD_NAME_RE.test(callee.name);
8294
+ return callee.type === import_utils56.AST_NODE_TYPES.Identifier && GUARD_NAME_RE.test(callee.name);
7944
8295
  };
7945
8296
  var isGuardTestPosition = (node) => {
7946
8297
  let current = node;
7947
8298
  let parent = current.parent;
7948
8299
  while (parent !== void 0 && parent !== null) {
7949
8300
  switch (parent.type) {
7950
- case import_utils55.AST_NODE_TYPES.UnaryExpression:
7951
- case import_utils55.AST_NODE_TYPES.LogicalExpression:
7952
- case import_utils55.AST_NODE_TYPES.ChainExpression:
8301
+ case import_utils56.AST_NODE_TYPES.UnaryExpression:
8302
+ case import_utils56.AST_NODE_TYPES.LogicalExpression:
8303
+ case import_utils56.AST_NODE_TYPES.ChainExpression:
7953
8304
  current = parent;
7954
8305
  parent = parent.parent;
7955
8306
  continue;
7956
- case import_utils55.AST_NODE_TYPES.IfStatement:
7957
- case import_utils55.AST_NODE_TYPES.ConditionalExpression:
7958
- case import_utils55.AST_NODE_TYPES.WhileStatement:
7959
- case import_utils55.AST_NODE_TYPES.DoWhileStatement:
7960
- case import_utils55.AST_NODE_TYPES.ForStatement:
8307
+ case import_utils56.AST_NODE_TYPES.IfStatement:
8308
+ case import_utils56.AST_NODE_TYPES.ConditionalExpression:
8309
+ case import_utils56.AST_NODE_TYPES.WhileStatement:
8310
+ case import_utils56.AST_NODE_TYPES.DoWhileStatement:
8311
+ case import_utils56.AST_NODE_TYPES.ForStatement:
7961
8312
  return parent.test === current;
7962
8313
  default:
7963
8314
  return false;
@@ -7967,7 +8318,7 @@ var isGuardTestPosition = (node) => {
7967
8318
  };
7968
8319
  var isUnvalidatedVariableRef = (node, scope, tracked) => {
7969
8320
  const unwrapped = unwrap4(node);
7970
- if (unwrapped === null || unwrapped.type !== import_utils55.AST_NODE_TYPES.Identifier) {
8321
+ if (unwrapped === null || unwrapped.type !== import_utils56.AST_NODE_TYPES.Identifier) {
7971
8322
  return false;
7972
8323
  }
7973
8324
  const variable = findVariable2(scope, unwrapped.name);
@@ -8010,11 +8361,11 @@ var prefer_schema_for_api_payload_default = createRule({
8010
8361
  return {
8011
8362
  VariableDeclarator(node) {
8012
8363
  const scope = context.sourceCode.getScope(node);
8013
- if (node.id.type === import_utils55.AST_NODE_TYPES.Identifier) {
8364
+ if (node.id.type === import_utils56.AST_NODE_TYPES.Identifier) {
8014
8365
  trackInitializer(node);
8015
8366
  return;
8016
8367
  }
8017
- if (node.id.type === import_utils55.AST_NODE_TYPES.ObjectPattern || node.id.type === import_utils55.AST_NODE_TYPES.ArrayPattern) {
8368
+ if (node.id.type === import_utils56.AST_NODE_TYPES.ObjectPattern || node.id.type === import_utils56.AST_NODE_TYPES.ArrayPattern) {
8018
8369
  if (isRawPayloadSource(node.init)) {
8019
8370
  if (!isFullyNarrowedPattern(node)) {
8020
8371
  context.report({ node: node.id, messageId: "unparsedJsonAccess" });
@@ -8028,7 +8379,7 @@ var prefer_schema_for_api_payload_default = createRule({
8028
8379
  },
8029
8380
  AssignmentExpression(node) {
8030
8381
  const scope = context.sourceCode.getScope(node);
8031
- if (node.left.type === import_utils55.AST_NODE_TYPES.Identifier) {
8382
+ if (node.left.type === import_utils56.AST_NODE_TYPES.Identifier) {
8032
8383
  const variable = findVariable2(scope, node.left.name);
8033
8384
  if (variable === null) return;
8034
8385
  if (isRawPayloadSource(node.right)) {
@@ -8038,7 +8389,7 @@ var prefer_schema_for_api_payload_default = createRule({
8038
8389
  }
8039
8390
  return;
8040
8391
  }
8041
- if (node.left.type === import_utils55.AST_NODE_TYPES.ObjectPattern || node.left.type === import_utils55.AST_NODE_TYPES.ArrayPattern) {
8392
+ if (node.left.type === import_utils56.AST_NODE_TYPES.ObjectPattern || node.left.type === import_utils56.AST_NODE_TYPES.ArrayPattern) {
8042
8393
  if (isRawPayloadSource(node.right)) {
8043
8394
  context.report({
8044
8395
  node: node.left,
@@ -8055,15 +8406,15 @@ var prefer_schema_for_api_payload_default = createRule({
8055
8406
  }
8056
8407
  },
8057
8408
  CallExpression(node) {
8058
- if (node.callee.type !== import_utils55.AST_NODE_TYPES.Identifier) return;
8409
+ if (node.callee.type !== import_utils56.AST_NODE_TYPES.Identifier) return;
8059
8410
  if (!GUARD_NAME_RE.test(node.callee.name) && !isGuardTestPosition(node)) {
8060
8411
  return;
8061
8412
  }
8062
8413
  const scope = context.sourceCode.getScope(node);
8063
8414
  for (const arg of node.arguments) {
8064
- if (arg.type === import_utils55.AST_NODE_TYPES.SpreadElement) continue;
8415
+ if (arg.type === import_utils56.AST_NODE_TYPES.SpreadElement) continue;
8065
8416
  const unwrapped = unwrap4(arg);
8066
- if (unwrapped === null || unwrapped.type !== import_utils55.AST_NODE_TYPES.Identifier) {
8417
+ if (unwrapped === null || unwrapped.type !== import_utils56.AST_NODE_TYPES.Identifier) {
8067
8418
  continue;
8068
8419
  }
8069
8420
  const variable = findVariable2(scope, unwrapped.name);
@@ -8077,13 +8428,13 @@ var prefer_schema_for_api_payload_default = createRule({
8077
8428
  const obj = unwrap4(node.object);
8078
8429
  if (isRawPayloadSource(obj)) {
8079
8430
  const parent = node.parent;
8080
- if (parent.type === import_utils55.AST_NODE_TYPES.CallExpression && parent.callee === node && node.property.type === import_utils55.AST_NODE_TYPES.Identifier && (node.property.name === "parse" || node.property.name === "safeParse" || PROMISE_CHAIN_METHODS.has(node.property.name))) {
8431
+ if (parent.type === import_utils56.AST_NODE_TYPES.CallExpression && parent.callee === node && node.property.type === import_utils56.AST_NODE_TYPES.Identifier && (node.property.name === "parse" || node.property.name === "safeParse" || PROMISE_CHAIN_METHODS.has(node.property.name))) {
8081
8432
  return;
8082
8433
  }
8083
8434
  context.report({ node, messageId: "unparsedJsonAccess" });
8084
8435
  return;
8085
8436
  }
8086
- if (obj !== null && obj.type === import_utils55.AST_NODE_TYPES.Identifier && isUnvalidatedVariableRef(obj, scope, unvalidatedVariables)) {
8437
+ if (obj !== null && obj.type === import_utils56.AST_NODE_TYPES.Identifier && isUnvalidatedVariableRef(obj, scope, unvalidatedVariables)) {
8087
8438
  context.report({ node, messageId: "unparsedJsonAccess" });
8088
8439
  const variable = findVariable2(scope, obj.name);
8089
8440
  if (variable !== null) {
@@ -8096,7 +8447,7 @@ var prefer_schema_for_api_payload_default = createRule({
8096
8447
  });
8097
8448
 
8098
8449
  // src/rules/prefer-semantic-colors.ts
8099
- var import_utils56 = require("@typescript-eslint/utils");
8450
+ var import_utils57 = require("@typescript-eslint/utils");
8100
8451
  var import_fs = require("fs");
8101
8452
  var import_path = require("path");
8102
8453
 
@@ -8196,8 +8547,8 @@ var SVG_EXEMPT_COLOR_VALUES = /* @__PURE__ */ new Set([
8196
8547
  ]);
8197
8548
  function jsxElementName(node) {
8198
8549
  const name = node.openingElement.name;
8199
- if (name.type === import_utils56.AST_NODE_TYPES.JSXIdentifier) return name.name;
8200
- if (name.type === import_utils56.AST_NODE_TYPES.JSXMemberExpression && name.property.type === import_utils56.AST_NODE_TYPES.JSXIdentifier) {
8550
+ if (name.type === import_utils57.AST_NODE_TYPES.JSXIdentifier) return name.name;
8551
+ if (name.type === import_utils57.AST_NODE_TYPES.JSXMemberExpression && name.property.type === import_utils57.AST_NODE_TYPES.JSXIdentifier) {
8201
8552
  return name.property.name;
8202
8553
  }
8203
8554
  return null;
@@ -8223,7 +8574,7 @@ var EMAIL_OR_PDF_MODULE_RE = /^@react-(?:email|pdf)\//;
8223
8574
  var isInsideSvg = (node) => {
8224
8575
  let current = node.parent;
8225
8576
  while (current !== void 0 && current !== null) {
8226
- if (current.type === import_utils56.AST_NODE_TYPES.JSXElement) {
8577
+ if (current.type === import_utils57.AST_NODE_TYPES.JSXElement) {
8227
8578
  const name = jsxElementName(current);
8228
8579
  if (name !== null && isSvgLikeElementName(name)) return true;
8229
8580
  }
@@ -8234,7 +8585,7 @@ var isInsideSvg = (node) => {
8234
8585
  var isInsideIconFactoryPath = (node) => {
8235
8586
  let current = node.parent;
8236
8587
  while (current !== void 0 && current !== null) {
8237
- if (current.type === import_utils56.AST_NODE_TYPES.Property && propName(current.key) === "path" && current.parent.type === import_utils56.AST_NODE_TYPES.ObjectExpression && current.parent.parent.type === import_utils56.AST_NODE_TYPES.CallExpression && current.parent.parent.callee.type === import_utils56.AST_NODE_TYPES.Identifier && current.parent.parent.callee.name === "createIcon") {
8588
+ if (current.type === import_utils57.AST_NODE_TYPES.Property && propName(current.key) === "path" && current.parent.type === import_utils57.AST_NODE_TYPES.ObjectExpression && current.parent.parent.type === import_utils57.AST_NODE_TYPES.CallExpression && current.parent.parent.callee.type === import_utils57.AST_NODE_TYPES.Identifier && current.parent.parent.callee.name === "createIcon") {
8238
8589
  return true;
8239
8590
  }
8240
8591
  current = current.parent;
@@ -8371,12 +8722,12 @@ var hasSemanticTokenSystem = (filename) => {
8371
8722
  return root !== null && workspaceHasMarker(root);
8372
8723
  };
8373
8724
  var propName = (key) => {
8374
- if (key.type === import_utils56.AST_NODE_TYPES.Identifier) return key.name;
8375
- if (key.type === import_utils56.AST_NODE_TYPES.Literal && typeof key.value === "string") return key.value;
8725
+ if (key.type === import_utils57.AST_NODE_TYPES.Identifier) return key.name;
8726
+ if (key.type === import_utils57.AST_NODE_TYPES.Literal && typeof key.value === "string") return key.value;
8376
8727
  return null;
8377
8728
  };
8378
8729
  var staticallyImportsEmailOrPdfRenderer = (program) => program.body.some((statement) => {
8379
- if (statement.type !== import_utils56.AST_NODE_TYPES.ImportDeclaration && statement.type !== import_utils56.AST_NODE_TYPES.ExportNamedDeclaration && statement.type !== import_utils56.AST_NODE_TYPES.ExportAllDeclaration) {
8730
+ if (statement.type !== import_utils57.AST_NODE_TYPES.ImportDeclaration && statement.type !== import_utils57.AST_NODE_TYPES.ExportNamedDeclaration && statement.type !== import_utils57.AST_NODE_TYPES.ExportAllDeclaration) {
8380
8731
  return false;
8381
8732
  }
8382
8733
  return statement.source !== null && typeof statement.source.value === "string" && EMAIL_OR_PDF_MODULE_RE.test(statement.source.value);
@@ -8428,27 +8779,27 @@ var prefer_semantic_colors_default = createRule({
8428
8779
  const checkClassNode = (node) => {
8429
8780
  if (node === null) return;
8430
8781
  switch (node.type) {
8431
- case import_utils56.AST_NODE_TYPES.Literal:
8782
+ case import_utils57.AST_NODE_TYPES.Literal:
8432
8783
  if (typeof node.value === "string") reportClasses(node.value, node);
8433
8784
  break;
8434
- case import_utils56.AST_NODE_TYPES.TemplateLiteral:
8785
+ case import_utils57.AST_NODE_TYPES.TemplateLiteral:
8435
8786
  for (const quasi of node.quasis) reportClasses(quasi.value.cooked ?? "", quasi);
8436
8787
  break;
8437
- case import_utils56.AST_NODE_TYPES.ArrayExpression:
8788
+ case import_utils57.AST_NODE_TYPES.ArrayExpression:
8438
8789
  for (const element of node.elements) {
8439
- if (element !== null && element.type !== import_utils56.AST_NODE_TYPES.SpreadElement) checkClassNode(element);
8790
+ if (element !== null && element.type !== import_utils57.AST_NODE_TYPES.SpreadElement) checkClassNode(element);
8440
8791
  }
8441
8792
  break;
8442
- case import_utils56.AST_NODE_TYPES.ObjectExpression:
8793
+ case import_utils57.AST_NODE_TYPES.ObjectExpression:
8443
8794
  for (const property of node.properties) {
8444
- if (property.type === import_utils56.AST_NODE_TYPES.Property) checkClassNode(property.value);
8795
+ if (property.type === import_utils57.AST_NODE_TYPES.Property) checkClassNode(property.value);
8445
8796
  }
8446
8797
  break;
8447
- case import_utils56.AST_NODE_TYPES.ConditionalExpression:
8798
+ case import_utils57.AST_NODE_TYPES.ConditionalExpression:
8448
8799
  checkClassNode(node.consequent);
8449
8800
  checkClassNode(node.alternate);
8450
8801
  break;
8451
- case import_utils56.AST_NODE_TYPES.LogicalExpression:
8802
+ case import_utils57.AST_NODE_TYPES.LogicalExpression:
8452
8803
  checkClassNode(node.right);
8453
8804
  break;
8454
8805
  default:
@@ -8456,32 +8807,32 @@ var prefer_semantic_colors_default = createRule({
8456
8807
  }
8457
8808
  };
8458
8809
  const checkColorValueNode = (node) => {
8459
- if (node.type === import_utils56.AST_NODE_TYPES.Literal && typeof node.value === "string" && RAW_COLOR_VALUE_RE.test(node.value) && !CSS_VAR_REFERENCE_RE.test(node.value)) {
8810
+ if (node.type === import_utils57.AST_NODE_TYPES.Literal && typeof node.value === "string" && RAW_COLOR_VALUE_RE.test(node.value) && !CSS_VAR_REFERENCE_RE.test(node.value)) {
8460
8811
  report(node, "inlineColor", { value: node.value });
8461
8812
  }
8462
8813
  };
8463
8814
  return {
8464
8815
  "JSXAttribute[name.name='className']"(node) {
8465
8816
  if (node.value === null) return;
8466
- if (node.value.type === import_utils56.AST_NODE_TYPES.Literal) checkClassNode(node.value);
8467
- else if (node.value.type === import_utils56.AST_NODE_TYPES.JSXExpressionContainer) {
8468
- if (node.value.expression.type !== import_utils56.AST_NODE_TYPES.JSXEmptyExpression) {
8817
+ if (node.value.type === import_utils57.AST_NODE_TYPES.Literal) checkClassNode(node.value);
8818
+ else if (node.value.type === import_utils57.AST_NODE_TYPES.JSXExpressionContainer) {
8819
+ if (node.value.expression.type !== import_utils57.AST_NODE_TYPES.JSXEmptyExpression) {
8469
8820
  checkClassNode(node.value.expression);
8470
8821
  }
8471
8822
  }
8472
8823
  },
8473
8824
  CallExpression(node) {
8474
- if (node.callee.type === import_utils56.AST_NODE_TYPES.Identifier && node.callee.name === "require" && node.arguments[0]?.type === import_utils56.AST_NODE_TYPES.Literal && typeof node.arguments[0].value === "string" && EMAIL_OR_PDF_MODULE_RE.test(node.arguments[0].value)) {
8825
+ if (node.callee.type === import_utils57.AST_NODE_TYPES.Identifier && node.callee.name === "require" && node.arguments[0]?.type === import_utils57.AST_NODE_TYPES.Literal && typeof node.arguments[0].value === "string" && EMAIL_OR_PDF_MODULE_RE.test(node.arguments[0].value)) {
8475
8826
  importsEmailOrPdfRenderer = true;
8476
8827
  }
8477
- if (node.callee.type === import_utils56.AST_NODE_TYPES.Identifier && CLASS_FNS.has(node.callee.name)) {
8828
+ if (node.callee.type === import_utils57.AST_NODE_TYPES.Identifier && CLASS_FNS.has(node.callee.name)) {
8478
8829
  for (const arg of node.arguments) {
8479
- if (arg.type !== import_utils56.AST_NODE_TYPES.SpreadElement) checkClassNode(arg);
8830
+ if (arg.type !== import_utils57.AST_NODE_TYPES.SpreadElement) checkClassNode(arg);
8480
8831
  }
8481
8832
  }
8482
8833
  },
8483
8834
  VariableDeclarator(node) {
8484
- if (node.id.type === import_utils56.AST_NODE_TYPES.Identifier && CLASS_NAME_RE.test(node.id.name)) {
8835
+ if (node.id.type === import_utils57.AST_NODE_TYPES.Identifier && CLASS_NAME_RE.test(node.id.name)) {
8485
8836
  checkClassNode(node.init);
8486
8837
  }
8487
8838
  },
@@ -8491,9 +8842,9 @@ var prefer_semantic_colors_default = createRule({
8491
8842
  },
8492
8843
  // SVG artwork colors are exempt; component presentation colors still report.
8493
8844
  "JSXAttribute[name.name=/^(fill|stroke|color)$/]"(node) {
8494
- if (node.value?.type !== import_utils56.AST_NODE_TYPES.Literal) return;
8845
+ if (node.value?.type !== import_utils57.AST_NODE_TYPES.Literal) return;
8495
8846
  const owner = node.parent.name;
8496
- if (owner.type === import_utils56.AST_NODE_TYPES.JSXIdentifier && SVG_SHAPE_PRIMITIVES.has(owner.name)) {
8847
+ if (owner.type === import_utils57.AST_NODE_TYPES.JSXIdentifier && SVG_SHAPE_PRIMITIVES.has(owner.name)) {
8497
8848
  return;
8498
8849
  }
8499
8850
  if (typeof node.value.value === "string" && SVG_EXEMPT_COLOR_VALUES.has(node.value.value.toLowerCase())) {
@@ -8507,7 +8858,7 @@ var prefer_semantic_colors_default = createRule({
8507
8858
  if (name !== null && STYLE_COLOR_PROPS.has(name)) checkColorValueNode(node.value);
8508
8859
  },
8509
8860
  ImportExpression(node) {
8510
- if (node.source.type === import_utils56.AST_NODE_TYPES.Literal && typeof node.source.value === "string" && EMAIL_OR_PDF_MODULE_RE.test(node.source.value)) {
8861
+ if (node.source.type === import_utils57.AST_NODE_TYPES.Literal && typeof node.source.value === "string" && EMAIL_OR_PDF_MODULE_RE.test(node.source.value)) {
8511
8862
  importsEmailOrPdfRenderer = true;
8512
8863
  }
8513
8864
  },
@@ -8520,7 +8871,7 @@ var prefer_semantic_colors_default = createRule({
8520
8871
  });
8521
8872
 
8522
8873
  // src/rules/prefer-server-actions.ts
8523
- var import_utils57 = require("@typescript-eslint/utils");
8874
+ var import_utils58 = require("@typescript-eslint/utils");
8524
8875
  var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "DELETE", "PATCH"]);
8525
8876
  var AXIOS_MUTATION_METHODS = /* @__PURE__ */ new Set(["post", "put", "delete", "patch"]);
8526
8877
  var SKIP_FILE_REGEX = /(?:\.test\.[jt]sx?$|\.spec\.[jt]sx?$|-(?:test|spec)\.[jt]sx?$|\/tests?\/|\/__tests__\/|\/__testfixtures__\/|\/scripts?\/|\/app\/api\/.*\/route\.[jt]sx?$|\/pages\/api\/)/;
@@ -8654,8 +9005,8 @@ var prefer_server_actions_default = createRule({
8654
9005
  }
8655
9006
  }
8656
9007
  } else if (node.callee.type === "MemberExpression" && node.callee.property.type === "Identifier" && !node.callee.computed) {
8657
- const methodName = node.callee.property.name.toLowerCase();
8658
- if (AXIOS_MUTATION_METHODS.has(methodName)) {
9008
+ const methodName2 = node.callee.property.name.toLowerCase();
9009
+ if (AXIOS_MUTATION_METHODS.has(methodName2)) {
8659
9010
  const urlArg = node.arguments[0];
8660
9011
  const hasHandlerArg = node.arguments.some(
8661
9012
  (arg) => arg.type !== "SpreadElement" && isFunctionArgument(arg, context)
@@ -8711,7 +9062,7 @@ var prefer_single_sentence_comment_default = createRule({
8711
9062
  });
8712
9063
 
8713
9064
  // src/rules/prefer-string-literal-union.ts
8714
- var import_utils58 = require("@typescript-eslint/utils");
9065
+ var import_utils59 = require("@typescript-eslint/utils");
8715
9066
  var ts2 = __toESM(require("typescript"), 1);
8716
9067
  var CHOICE_TOKENS = /* @__PURE__ */ new Set([
8717
9068
  "status",
@@ -8754,19 +9105,19 @@ function isChoiceLikeName(name) {
8754
9105
  return CHOICE_TOKENS.has(lastWord(name));
8755
9106
  }
8756
9107
  function keyName(key) {
8757
- if (key.type === import_utils58.AST_NODE_TYPES.Identifier) {
9108
+ if (key.type === import_utils59.AST_NODE_TYPES.Identifier) {
8758
9109
  return key.name;
8759
9110
  }
8760
- if (key.type === import_utils58.AST_NODE_TYPES.Literal && typeof key.value === "string") {
9111
+ if (key.type === import_utils59.AST_NODE_TYPES.Literal && typeof key.value === "string") {
8761
9112
  return key.value;
8762
9113
  }
8763
9114
  return null;
8764
9115
  }
8765
9116
  function isStringLiteralMember(t) {
8766
- return t.type === import_utils58.AST_NODE_TYPES.TSLiteralType && t.literal.type === import_utils58.AST_NODE_TYPES.Literal && typeof t.literal.value === "string";
9117
+ return t.type === import_utils59.AST_NODE_TYPES.TSLiteralType && t.literal.type === import_utils59.AST_NODE_TYPES.Literal && typeof t.literal.value === "string";
8767
9118
  }
8768
9119
  function isStringLiteralUnion(node) {
8769
- if (node?.type !== import_utils58.AST_NODE_TYPES.TSUnionType) {
9120
+ if (node?.type !== import_utils59.AST_NODE_TYPES.TSUnionType) {
8770
9121
  return false;
8771
9122
  }
8772
9123
  return node.types.filter(isStringLiteralMember).length >= MIN_CLUSTER_SIZE;
@@ -8795,12 +9146,12 @@ function bindingSourceExpression(decl) {
8795
9146
  return ts2.isForOfStatement(node) ? node.expression : node.initializer;
8796
9147
  }
8797
9148
  function refKey(node) {
8798
- if (node.type === import_utils58.AST_NODE_TYPES.Identifier) {
9149
+ if (node.type === import_utils59.AST_NODE_TYPES.Identifier) {
8799
9150
  return node.name;
8800
9151
  }
8801
- if (node.type === import_utils58.AST_NODE_TYPES.MemberExpression && !node.computed) {
9152
+ if (node.type === import_utils59.AST_NODE_TYPES.MemberExpression && !node.computed) {
8802
9153
  const inner = refKey(node.object);
8803
- if (inner === null || node.property.type !== import_utils58.AST_NODE_TYPES.Identifier) {
9154
+ if (inner === null || node.property.type !== import_utils59.AST_NODE_TYPES.Identifier) {
8804
9155
  return null;
8805
9156
  }
8806
9157
  return `${inner}.${node.property.name}`;
@@ -8808,7 +9159,7 @@ function refKey(node) {
8808
9159
  return null;
8809
9160
  }
8810
9161
  function strLiteral(node) {
8811
- if (node.type === import_utils58.AST_NODE_TYPES.Literal && typeof node.value === "string") {
9162
+ if (node.type === import_utils59.AST_NODE_TYPES.Literal && typeof node.value === "string") {
8812
9163
  return node.value;
8813
9164
  }
8814
9165
  return null;
@@ -8849,7 +9200,7 @@ var prefer_string_literal_union_default = createRule({
8849
9200
  );
8850
9201
  let services;
8851
9202
  try {
8852
- services = import_utils58.ESLintUtils.getParserServices(context);
9203
+ services = import_utils59.ESLintUtils.getParserServices(context);
8853
9204
  } catch {
8854
9205
  services = null;
8855
9206
  }
@@ -8961,7 +9312,7 @@ var prefer_string_literal_union_default = createRule({
8961
9312
  containersWithUnion.add(container);
8962
9313
  return;
8963
9314
  }
8964
- if (typeNode?.type !== import_utils58.AST_NODE_TYPES.TSStringKeyword) {
9315
+ if (typeNode?.type !== import_utils59.AST_NODE_TYPES.TSStringKeyword) {
8965
9316
  return;
8966
9317
  }
8967
9318
  const name = keyName(key);
@@ -9049,10 +9400,10 @@ var prefer_string_literal_union_default = createRule({
9049
9400
  }
9050
9401
  };
9051
9402
  function refKeyText(node) {
9052
- if (node.type === import_utils58.AST_NODE_TYPES.BinaryExpression) {
9403
+ if (node.type === import_utils59.AST_NODE_TYPES.BinaryExpression) {
9053
9404
  return refKey(node.left) ?? refKey(node.right) ?? "value";
9054
9405
  }
9055
- if (node.type === import_utils58.AST_NODE_TYPES.SwitchStatement) {
9406
+ if (node.type === import_utils59.AST_NODE_TYPES.SwitchStatement) {
9056
9407
  return refKey(node.discriminant) ?? "value";
9057
9408
  }
9058
9409
  return "value";
@@ -9061,7 +9412,7 @@ var prefer_string_literal_union_default = createRule({
9061
9412
  });
9062
9413
 
9063
9414
  // src/rules/prefer-whole-object-assertion.ts
9064
- var import_utils59 = require("@typescript-eslint/utils");
9415
+ var import_utils60 = require("@typescript-eslint/utils");
9065
9416
  var MERGEABLE_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
9066
9417
  var ARRAY_MATCHERS = /* @__PURE__ */ new Set(["toEqual", "toStrictEqual"]);
9067
9418
  var COLLECTION_PROPERTIES = /* @__PURE__ */ new Set(["length", "size"]);
@@ -9070,11 +9421,11 @@ var NUMERIC_SIGNS2 = /* @__PURE__ */ new Set(["-", "+"]);
9070
9421
  var MIN_RUN_LENGTH = 2;
9071
9422
  function literalText(node, getText) {
9072
9423
  switch (node.type) {
9073
- case import_utils59.AST_NODE_TYPES.Literal:
9424
+ case import_utils60.AST_NODE_TYPES.Literal:
9074
9425
  return "regex" in node ? null : getText(node);
9075
- case import_utils59.AST_NODE_TYPES.TemplateLiteral:
9426
+ case import_utils60.AST_NODE_TYPES.TemplateLiteral:
9076
9427
  return node.expressions.length === 0 ? getText(node) : null;
9077
- case import_utils59.AST_NODE_TYPES.UnaryExpression:
9428
+ case import_utils60.AST_NODE_TYPES.UnaryExpression:
9078
9429
  return NUMERIC_SIGNS2.has(node.operator) && literalText(node.argument, getText) !== null ? getText(node) : null;
9079
9430
  default:
9080
9431
  return null;
@@ -9082,15 +9433,15 @@ function literalText(node, getText) {
9082
9433
  }
9083
9434
  function isPureReceiver(node) {
9084
9435
  switch (node.type) {
9085
- case import_utils59.AST_NODE_TYPES.Identifier:
9086
- case import_utils59.AST_NODE_TYPES.ThisExpression:
9436
+ case import_utils60.AST_NODE_TYPES.Identifier:
9437
+ case import_utils60.AST_NODE_TYPES.ThisExpression:
9087
9438
  return true;
9088
- case import_utils59.AST_NODE_TYPES.MemberExpression:
9439
+ case import_utils60.AST_NODE_TYPES.MemberExpression:
9089
9440
  if (node.optional) {
9090
9441
  return false;
9091
9442
  }
9092
9443
  if (node.computed) {
9093
- return node.property.type === import_utils59.AST_NODE_TYPES.Literal && isPureReceiver(node.object);
9444
+ return node.property.type === import_utils60.AST_NODE_TYPES.Literal && isPureReceiver(node.object);
9094
9445
  }
9095
9446
  return isPureReceiver(node.object);
9096
9447
  default:
@@ -9098,7 +9449,7 @@ function isPureReceiver(node) {
9098
9449
  }
9099
9450
  }
9100
9451
  function literalIndex(node) {
9101
- if (node.type !== import_utils59.AST_NODE_TYPES.Literal || typeof node.value !== "number") {
9452
+ if (node.type !== import_utils60.AST_NODE_TYPES.Literal || typeof node.value !== "number") {
9102
9453
  return null;
9103
9454
  }
9104
9455
  return Number.isInteger(node.value) && node.value >= 0 ? node.value : null;
@@ -9124,24 +9475,24 @@ var prefer_whole_object_assertion_default = createRule({
9124
9475
  }
9125
9476
  const { sourceCode } = context;
9126
9477
  function parseAssertion(statement) {
9127
- if (statement.type !== import_utils59.AST_NODE_TYPES.ExpressionStatement) {
9478
+ if (statement.type !== import_utils60.AST_NODE_TYPES.ExpressionStatement) {
9128
9479
  return null;
9129
9480
  }
9130
9481
  const call = statement.expression;
9131
- if (call.type !== import_utils59.AST_NODE_TYPES.CallExpression) {
9482
+ if (call.type !== import_utils60.AST_NODE_TYPES.CallExpression) {
9132
9483
  return null;
9133
9484
  }
9134
9485
  const callee = call.callee;
9135
- if (callee.type !== import_utils59.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils59.AST_NODE_TYPES.Identifier) {
9486
+ if (callee.type !== import_utils60.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils60.AST_NODE_TYPES.Identifier) {
9136
9487
  return null;
9137
9488
  }
9138
9489
  const matcher = callee.property.name;
9139
9490
  const expectCall = callee.object;
9140
- if (expectCall.type !== import_utils59.AST_NODE_TYPES.CallExpression || expectCall.callee.type !== import_utils59.AST_NODE_TYPES.Identifier || expectCall.callee.name !== "expect" || expectCall.arguments.length !== 1) {
9491
+ if (expectCall.type !== import_utils60.AST_NODE_TYPES.CallExpression || expectCall.callee.type !== import_utils60.AST_NODE_TYPES.Identifier || expectCall.callee.name !== "expect" || expectCall.arguments.length !== 1) {
9141
9492
  return null;
9142
9493
  }
9143
9494
  const actual = expectCall.arguments[0];
9144
- if (actual === void 0 || actual.type !== import_utils59.AST_NODE_TYPES.MemberExpression || actual.optional) {
9495
+ if (actual === void 0 || actual.type !== import_utils60.AST_NODE_TYPES.MemberExpression || actual.optional) {
9145
9496
  return null;
9146
9497
  }
9147
9498
  if (!isPureReceiver(actual.object)) {
@@ -9155,7 +9506,7 @@ var prefer_whole_object_assertion_default = createRule({
9155
9506
  }
9156
9507
  key = { kind: "index", index };
9157
9508
  } else {
9158
- if (actual.property.type !== import_utils59.AST_NODE_TYPES.Identifier || COLLECTION_PROPERTIES.has(actual.property.name) || LITERAL_KEY_HAZARDS.has(actual.property.name)) {
9509
+ if (actual.property.type !== import_utils60.AST_NODE_TYPES.Identifier || COLLECTION_PROPERTIES.has(actual.property.name) || LITERAL_KEY_HAZARDS.has(actual.property.name)) {
9159
9510
  return null;
9160
9511
  }
9161
9512
  key = { kind: "property", name: actual.property.name };
@@ -9167,7 +9518,7 @@ var prefer_whole_object_assertion_default = createRule({
9167
9518
  return null;
9168
9519
  }
9169
9520
  const expected = call.arguments[0];
9170
- if (call.arguments.length !== 1 || expected === void 0 || expected.type === import_utils59.AST_NODE_TYPES.SpreadElement) {
9521
+ if (call.arguments.length !== 1 || expected === void 0 || expected.type === import_utils60.AST_NODE_TYPES.SpreadElement) {
9171
9522
  return null;
9172
9523
  }
9173
9524
  const literal = literalText(expected, (node) => sourceCode.getText(node));
@@ -9282,7 +9633,7 @@ var prefer_whole_object_assertion_default = createRule({
9282
9633
  });
9283
9634
 
9284
9635
  // src/rules/prefer-zod-enum.ts
9285
- var import_utils60 = require("@typescript-eslint/utils");
9636
+ var import_utils61 = require("@typescript-eslint/utils");
9286
9637
  var prefer_zod_enum_default = createRule({
9287
9638
  name: "prefer-zod-enum",
9288
9639
  meta: {
@@ -9302,25 +9653,25 @@ var prefer_zod_enum_default = createRule({
9302
9653
  const zodNamespaces = /* @__PURE__ */ new Set();
9303
9654
  function enumValues(node) {
9304
9655
  const callee = node.callee;
9305
- if (callee.type !== import_utils60.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils60.AST_NODE_TYPES.Identifier || !zodNamespaces.has(callee.object.name) || callee.property.type !== import_utils60.AST_NODE_TYPES.Identifier || callee.property.name !== "union" || node.arguments.length !== 1) {
9656
+ if (callee.type !== import_utils61.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils61.AST_NODE_TYPES.Identifier || !zodNamespaces.has(callee.object.name) || callee.property.type !== import_utils61.AST_NODE_TYPES.Identifier || callee.property.name !== "union" || node.arguments.length !== 1) {
9306
9657
  return null;
9307
9658
  }
9308
9659
  const argument = node.arguments[0];
9309
- if (argument === void 0 || argument.type !== import_utils60.AST_NODE_TYPES.ArrayExpression || argument.elements.length === 0) {
9660
+ if (argument === void 0 || argument.type !== import_utils61.AST_NODE_TYPES.ArrayExpression || argument.elements.length === 0) {
9310
9661
  return null;
9311
9662
  }
9312
9663
  const values = [];
9313
9664
  let canFix = true;
9314
9665
  for (const element of argument.elements) {
9315
- if (element?.type === import_utils60.AST_NODE_TYPES.SpreadElement) {
9666
+ if (element?.type === import_utils61.AST_NODE_TYPES.SpreadElement) {
9316
9667
  canFix = false;
9317
9668
  continue;
9318
9669
  }
9319
- if (element === null || element.type !== import_utils60.AST_NODE_TYPES.CallExpression || element.callee.type !== import_utils60.AST_NODE_TYPES.MemberExpression || element.callee.computed || element.callee.object.type !== import_utils60.AST_NODE_TYPES.Identifier || !zodNamespaces.has(element.callee.object.name) || element.callee.property.type !== import_utils60.AST_NODE_TYPES.Identifier || element.callee.property.name !== "literal") {
9670
+ if (element === null || element.type !== import_utils61.AST_NODE_TYPES.CallExpression || element.callee.type !== import_utils61.AST_NODE_TYPES.MemberExpression || element.callee.computed || element.callee.object.type !== import_utils61.AST_NODE_TYPES.Identifier || !zodNamespaces.has(element.callee.object.name) || element.callee.property.type !== import_utils61.AST_NODE_TYPES.Identifier || element.callee.property.name !== "literal") {
9320
9671
  return null;
9321
9672
  }
9322
9673
  const value = element.arguments[0];
9323
- if (element.arguments.length !== 1 || value === void 0 || value.type !== import_utils60.AST_NODE_TYPES.Literal || typeof value.value !== "string") {
9674
+ if (element.arguments.length !== 1 || value === void 0 || value.type !== import_utils61.AST_NODE_TYPES.Literal || typeof value.value !== "string") {
9324
9675
  canFix = false;
9325
9676
  continue;
9326
9677
  }
@@ -9330,11 +9681,11 @@ var prefer_zod_enum_default = createRule({
9330
9681
  }
9331
9682
  function buildFix(node, values) {
9332
9683
  const argument = node.arguments[0];
9333
- if (argument === void 0 || argument.type !== import_utils60.AST_NODE_TYPES.ArrayExpression || sourceCode.getCommentsInside(argument).length > 0) {
9684
+ if (argument === void 0 || argument.type !== import_utils61.AST_NODE_TYPES.ArrayExpression || sourceCode.getCommentsInside(argument).length > 0) {
9334
9685
  return void 0;
9335
9686
  }
9336
9687
  const callee = node.callee;
9337
- if (callee.type !== import_utils60.AST_NODE_TYPES.MemberExpression || callee.property.type !== import_utils60.AST_NODE_TYPES.Identifier) {
9688
+ if (callee.type !== import_utils61.AST_NODE_TYPES.MemberExpression || callee.property.type !== import_utils61.AST_NODE_TYPES.Identifier) {
9338
9689
  return void 0;
9339
9690
  }
9340
9691
  return (fixer) => [
@@ -9351,7 +9702,7 @@ var prefer_zod_enum_default = createRule({
9351
9702
  return;
9352
9703
  }
9353
9704
  for (const specifier of node.specifiers) {
9354
- if (specifier.type === import_utils60.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils60.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils60.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils60.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") {
9705
+ if (specifier.type === import_utils61.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils61.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils61.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils61.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") {
9355
9706
  zodNamespaces.add(specifier.local.name);
9356
9707
  }
9357
9708
  }
@@ -9373,7 +9724,7 @@ var prefer_zod_enum_default = createRule({
9373
9724
  });
9374
9725
 
9375
9726
  // src/rules/prefer-zod-infer.ts
9376
- var import_utils61 = require("@typescript-eslint/utils");
9727
+ var import_utils62 = require("@typescript-eslint/utils");
9377
9728
  var SHAPE_PRESERVING_METHODS = /* @__PURE__ */ new Set([
9378
9729
  "describe",
9379
9730
  "refine",
@@ -9410,44 +9761,44 @@ var ZOD_TYPE_CONSTRAINTS = /* @__PURE__ */ new Set([
9410
9761
  "Schema"
9411
9762
  ]);
9412
9763
  var LEAF_NODE_TYPES = {
9413
- string: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9414
- email: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9415
- url: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9416
- uuid: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9417
- ulid: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9418
- cuid: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9419
- cuid2: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9420
- nanoid: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9421
- iso: [import_utils61.AST_NODE_TYPES.TSStringKeyword],
9422
- number: [import_utils61.AST_NODE_TYPES.TSNumberKeyword],
9423
- int: [import_utils61.AST_NODE_TYPES.TSNumberKeyword],
9424
- float32: [import_utils61.AST_NODE_TYPES.TSNumberKeyword],
9425
- float64: [import_utils61.AST_NODE_TYPES.TSNumberKeyword],
9426
- boolean: [import_utils61.AST_NODE_TYPES.TSBooleanKeyword],
9427
- bigint: [import_utils61.AST_NODE_TYPES.TSBigIntKeyword],
9428
- symbol: [import_utils61.AST_NODE_TYPES.TSSymbolKeyword],
9429
- any: [import_utils61.AST_NODE_TYPES.TSAnyKeyword],
9430
- unknown: [import_utils61.AST_NODE_TYPES.TSUnknownKeyword],
9431
- never: [import_utils61.AST_NODE_TYPES.TSNeverKeyword],
9432
- void: [import_utils61.AST_NODE_TYPES.TSVoidKeyword],
9433
- null: [import_utils61.AST_NODE_TYPES.TSNullKeyword],
9434
- undefined: [import_utils61.AST_NODE_TYPES.TSUndefinedKeyword],
9435
- literal: [import_utils61.AST_NODE_TYPES.TSLiteralType],
9436
- date: [import_utils61.AST_NODE_TYPES.TSTypeReference],
9437
- array: [import_utils61.AST_NODE_TYPES.TSArrayType, import_utils61.AST_NODE_TYPES.TSTypeReference],
9438
- tuple: [import_utils61.AST_NODE_TYPES.TSTupleType],
9439
- object: [import_utils61.AST_NODE_TYPES.TSTypeLiteral, import_utils61.AST_NODE_TYPES.TSTypeReference],
9440
- strictObject: [import_utils61.AST_NODE_TYPES.TSTypeLiteral, import_utils61.AST_NODE_TYPES.TSTypeReference],
9441
- looseObject: [import_utils61.AST_NODE_TYPES.TSTypeLiteral, import_utils61.AST_NODE_TYPES.TSTypeReference],
9442
- record: [import_utils61.AST_NODE_TYPES.TSTypeReference, import_utils61.AST_NODE_TYPES.TSTypeLiteral],
9443
- map: [import_utils61.AST_NODE_TYPES.TSTypeReference],
9444
- set: [import_utils61.AST_NODE_TYPES.TSTypeReference],
9445
- promise: [import_utils61.AST_NODE_TYPES.TSTypeReference],
9446
- enum: [import_utils61.AST_NODE_TYPES.TSUnionType, import_utils61.AST_NODE_TYPES.TSTypeReference, import_utils61.AST_NODE_TYPES.TSLiteralType],
9447
- nativeEnum: [import_utils61.AST_NODE_TYPES.TSUnionType, import_utils61.AST_NODE_TYPES.TSTypeReference, import_utils61.AST_NODE_TYPES.TSLiteralType],
9448
- union: [import_utils61.AST_NODE_TYPES.TSUnionType, import_utils61.AST_NODE_TYPES.TSTypeReference],
9449
- discriminatedUnion: [import_utils61.AST_NODE_TYPES.TSUnionType, import_utils61.AST_NODE_TYPES.TSTypeReference],
9450
- intersection: [import_utils61.AST_NODE_TYPES.TSIntersectionType, import_utils61.AST_NODE_TYPES.TSTypeReference]
9764
+ string: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9765
+ email: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9766
+ url: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9767
+ uuid: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9768
+ ulid: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9769
+ cuid: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9770
+ cuid2: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9771
+ nanoid: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9772
+ iso: [import_utils62.AST_NODE_TYPES.TSStringKeyword],
9773
+ number: [import_utils62.AST_NODE_TYPES.TSNumberKeyword],
9774
+ int: [import_utils62.AST_NODE_TYPES.TSNumberKeyword],
9775
+ float32: [import_utils62.AST_NODE_TYPES.TSNumberKeyword],
9776
+ float64: [import_utils62.AST_NODE_TYPES.TSNumberKeyword],
9777
+ boolean: [import_utils62.AST_NODE_TYPES.TSBooleanKeyword],
9778
+ bigint: [import_utils62.AST_NODE_TYPES.TSBigIntKeyword],
9779
+ symbol: [import_utils62.AST_NODE_TYPES.TSSymbolKeyword],
9780
+ any: [import_utils62.AST_NODE_TYPES.TSAnyKeyword],
9781
+ unknown: [import_utils62.AST_NODE_TYPES.TSUnknownKeyword],
9782
+ never: [import_utils62.AST_NODE_TYPES.TSNeverKeyword],
9783
+ void: [import_utils62.AST_NODE_TYPES.TSVoidKeyword],
9784
+ null: [import_utils62.AST_NODE_TYPES.TSNullKeyword],
9785
+ undefined: [import_utils62.AST_NODE_TYPES.TSUndefinedKeyword],
9786
+ literal: [import_utils62.AST_NODE_TYPES.TSLiteralType],
9787
+ date: [import_utils62.AST_NODE_TYPES.TSTypeReference],
9788
+ array: [import_utils62.AST_NODE_TYPES.TSArrayType, import_utils62.AST_NODE_TYPES.TSTypeReference],
9789
+ tuple: [import_utils62.AST_NODE_TYPES.TSTupleType],
9790
+ object: [import_utils62.AST_NODE_TYPES.TSTypeLiteral, import_utils62.AST_NODE_TYPES.TSTypeReference],
9791
+ strictObject: [import_utils62.AST_NODE_TYPES.TSTypeLiteral, import_utils62.AST_NODE_TYPES.TSTypeReference],
9792
+ looseObject: [import_utils62.AST_NODE_TYPES.TSTypeLiteral, import_utils62.AST_NODE_TYPES.TSTypeReference],
9793
+ record: [import_utils62.AST_NODE_TYPES.TSTypeReference, import_utils62.AST_NODE_TYPES.TSTypeLiteral],
9794
+ map: [import_utils62.AST_NODE_TYPES.TSTypeReference],
9795
+ set: [import_utils62.AST_NODE_TYPES.TSTypeReference],
9796
+ promise: [import_utils62.AST_NODE_TYPES.TSTypeReference],
9797
+ enum: [import_utils62.AST_NODE_TYPES.TSUnionType, import_utils62.AST_NODE_TYPES.TSTypeReference, import_utils62.AST_NODE_TYPES.TSLiteralType],
9798
+ nativeEnum: [import_utils62.AST_NODE_TYPES.TSUnionType, import_utils62.AST_NODE_TYPES.TSTypeReference, import_utils62.AST_NODE_TYPES.TSLiteralType],
9799
+ union: [import_utils62.AST_NODE_TYPES.TSUnionType, import_utils62.AST_NODE_TYPES.TSTypeReference],
9800
+ discriminatedUnion: [import_utils62.AST_NODE_TYPES.TSUnionType, import_utils62.AST_NODE_TYPES.TSTypeReference],
9801
+ intersection: [import_utils62.AST_NODE_TYPES.TSIntersectionType, import_utils62.AST_NODE_TYPES.TSTypeReference]
9451
9802
  };
9452
9803
  function normalizeSchemaName(name) {
9453
9804
  return name.replace(/Schema$/i, "").replace(/^Z(?=[A-Z])/, "").toLowerCase();
@@ -9456,20 +9807,20 @@ function normalizeTypeName(name) {
9456
9807
  return name.replace(/Type$/, "").toLowerCase();
9457
9808
  }
9458
9809
  function unwrapNullish(annotation) {
9459
- if (annotation.type !== import_utils61.AST_NODE_TYPES.TSUnionType) {
9810
+ if (annotation.type !== import_utils62.AST_NODE_TYPES.TSUnionType) {
9460
9811
  return {
9461
9812
  core: annotation,
9462
- nullable: annotation.type === import_utils61.AST_NODE_TYPES.TSNullKeyword
9813
+ nullable: annotation.type === import_utils62.AST_NODE_TYPES.TSNullKeyword
9463
9814
  };
9464
9815
  }
9465
9816
  const rest = [];
9466
9817
  let nullable = false;
9467
9818
  for (const member of annotation.types) {
9468
- if (member.type === import_utils61.AST_NODE_TYPES.TSNullKeyword) {
9819
+ if (member.type === import_utils62.AST_NODE_TYPES.TSNullKeyword) {
9469
9820
  nullable = true;
9470
9821
  continue;
9471
9822
  }
9472
- if (member.type === import_utils61.AST_NODE_TYPES.TSUndefinedKeyword) {
9823
+ if (member.type === import_utils62.AST_NODE_TYPES.TSUndefinedKeyword) {
9473
9824
  continue;
9474
9825
  }
9475
9826
  rest.push(member);
@@ -9534,35 +9885,35 @@ var prefer_zod_infer_default = createRule({
9534
9885
  function zodCallChain(node) {
9535
9886
  const chain = [];
9536
9887
  let current = node;
9537
- while (current.type === import_utils61.AST_NODE_TYPES.CallExpression) {
9888
+ while (current.type === import_utils62.AST_NODE_TYPES.CallExpression) {
9538
9889
  const callee = current.callee;
9539
- if (callee.type !== import_utils61.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils61.AST_NODE_TYPES.Identifier) {
9890
+ if (callee.type !== import_utils62.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils62.AST_NODE_TYPES.Identifier) {
9540
9891
  return null;
9541
9892
  }
9542
9893
  chain.push(current);
9543
9894
  const receiver = callee.object;
9544
- if (receiver.type === import_utils61.AST_NODE_TYPES.Identifier) {
9895
+ if (receiver.type === import_utils62.AST_NODE_TYPES.Identifier) {
9545
9896
  return zodNamespaces.has(receiver.name) ? chain.reverse() : null;
9546
9897
  }
9547
9898
  current = receiver;
9548
9899
  }
9549
9900
  return null;
9550
9901
  }
9551
- function methodName(call) {
9902
+ function methodName2(call) {
9552
9903
  const callee = call.callee;
9553
- return callee.type === import_utils61.AST_NODE_TYPES.MemberExpression && callee.property.type === import_utils61.AST_NODE_TYPES.Identifier ? callee.property.name : "";
9904
+ return callee.type === import_utils62.AST_NODE_TYPES.MemberExpression && callee.property.type === import_utils62.AST_NODE_TYPES.Identifier ? callee.property.name : "";
9554
9905
  }
9555
9906
  function schemaField(node) {
9556
9907
  const modifiers = [];
9557
9908
  let current = node;
9558
9909
  let leaf = null;
9559
- while (current.type === import_utils61.AST_NODE_TYPES.CallExpression) {
9910
+ while (current.type === import_utils62.AST_NODE_TYPES.CallExpression) {
9560
9911
  const callee = current.callee;
9561
- if (callee.type !== import_utils61.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils61.AST_NODE_TYPES.Identifier) {
9912
+ if (callee.type !== import_utils62.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils62.AST_NODE_TYPES.Identifier) {
9562
9913
  break;
9563
9914
  }
9564
9915
  const receiver = callee.object;
9565
- if (receiver.type === import_utils61.AST_NODE_TYPES.Identifier && zodNamespaces.has(receiver.name)) {
9916
+ if (receiver.type === import_utils62.AST_NODE_TYPES.Identifier && zodNamespaces.has(receiver.name)) {
9566
9917
  leaf = callee.property.name;
9567
9918
  break;
9568
9919
  }
@@ -9585,24 +9936,24 @@ var prefer_zod_infer_default = createRule({
9585
9936
  if (base === void 0) {
9586
9937
  return null;
9587
9938
  }
9588
- const baseMethod = methodName(base);
9939
+ const baseMethod = methodName2(base);
9589
9940
  if (baseMethod !== "object" && baseMethod !== "strictObject") {
9590
9941
  return null;
9591
9942
  }
9592
- if (rest.some((call) => !SHAPE_PRESERVING_METHODS.has(methodName(call)))) {
9943
+ if (rest.some((call) => !SHAPE_PRESERVING_METHODS.has(methodName2(call)))) {
9593
9944
  return null;
9594
9945
  }
9595
9946
  const shape = base.arguments[0];
9596
- if (shape === void 0 || shape.type !== import_utils61.AST_NODE_TYPES.ObjectExpression) {
9947
+ if (shape === void 0 || shape.type !== import_utils62.AST_NODE_TYPES.ObjectExpression) {
9597
9948
  return null;
9598
9949
  }
9599
9950
  const fields = /* @__PURE__ */ new Map();
9600
9951
  for (const property of shape.properties) {
9601
- if (property.type !== import_utils61.AST_NODE_TYPES.Property || property.computed) {
9952
+ if (property.type !== import_utils62.AST_NODE_TYPES.Property || property.computed) {
9602
9953
  return null;
9603
9954
  }
9604
9955
  const { key } = property;
9605
- const name = key.type === import_utils61.AST_NODE_TYPES.Identifier ? key.name : key.type === import_utils61.AST_NODE_TYPES.Literal && typeof key.value === "string" ? key.value : null;
9956
+ const name = key.type === import_utils62.AST_NODE_TYPES.Identifier ? key.name : key.type === import_utils62.AST_NODE_TYPES.Literal && typeof key.value === "string" ? key.value : null;
9606
9957
  if (name === null) {
9607
9958
  return null;
9608
9959
  }
@@ -9613,11 +9964,11 @@ var prefer_zod_infer_default = createRule({
9613
9964
  function typeMembers(members) {
9614
9965
  const result = /* @__PURE__ */ new Map();
9615
9966
  for (const member of members) {
9616
- if (member.type !== import_utils61.AST_NODE_TYPES.TSPropertySignature || member.computed) {
9967
+ if (member.type !== import_utils62.AST_NODE_TYPES.TSPropertySignature || member.computed) {
9617
9968
  return null;
9618
9969
  }
9619
9970
  const { key } = member;
9620
- const name = key.type === import_utils61.AST_NODE_TYPES.Identifier ? key.name : key.type === import_utils61.AST_NODE_TYPES.Literal && typeof key.value === "string" ? key.value : null;
9971
+ const name = key.type === import_utils62.AST_NODE_TYPES.Identifier ? key.name : key.type === import_utils62.AST_NODE_TYPES.Literal && typeof key.value === "string" ? key.value : null;
9621
9972
  if (name === null) {
9622
9973
  return null;
9623
9974
  }
@@ -9631,8 +9982,8 @@ var prefer_zod_infer_default = createRule({
9631
9982
  return result.size === 0 ? null : result;
9632
9983
  }
9633
9984
  function collectConstrainedNames(node) {
9634
- if (node.type === import_utils61.AST_NODE_TYPES.TSTypeReference) {
9635
- if (node.typeName.type === import_utils61.AST_NODE_TYPES.Identifier) {
9985
+ if (node.type === import_utils62.AST_NODE_TYPES.TSTypeReference) {
9986
+ if (node.typeName.type === import_utils62.AST_NODE_TYPES.Identifier) {
9636
9987
  constrainedTypeNames.add(node.typeName.name);
9637
9988
  }
9638
9989
  for (const argument of node.typeArguments?.params ?? []) {
@@ -9640,11 +9991,11 @@ var prefer_zod_infer_default = createRule({
9640
9991
  }
9641
9992
  return;
9642
9993
  }
9643
- if (node.type === import_utils61.AST_NODE_TYPES.TSArrayType) {
9994
+ if (node.type === import_utils62.AST_NODE_TYPES.TSArrayType) {
9644
9995
  collectConstrainedNames(node.elementType);
9645
9996
  return;
9646
9997
  }
9647
- if (node.type === import_utils61.AST_NODE_TYPES.TSUnionType || node.type === import_utils61.AST_NODE_TYPES.TSIntersectionType) {
9998
+ if (node.type === import_utils62.AST_NODE_TYPES.TSUnionType || node.type === import_utils62.AST_NODE_TYPES.TSIntersectionType) {
9648
9999
  for (const member of node.types) {
9649
10000
  collectConstrainedNames(member);
9650
10001
  }
@@ -9688,13 +10039,13 @@ var prefer_zod_infer_default = createRule({
9688
10039
  return;
9689
10040
  }
9690
10041
  for (const specifier of node.specifiers) {
9691
- if (specifier.type === import_utils61.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils61.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils61.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils61.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") {
10042
+ if (specifier.type === import_utils62.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils62.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils62.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils62.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") {
9692
10043
  zodNamespaces.add(specifier.local.name);
9693
10044
  }
9694
10045
  }
9695
10046
  },
9696
10047
  VariableDeclarator(node) {
9697
- if (node.id.type !== import_utils61.AST_NODE_TYPES.Identifier || node.init == null) {
10048
+ if (node.id.type !== import_utils62.AST_NODE_TYPES.Identifier || node.init == null) {
9698
10049
  return;
9699
10050
  }
9700
10051
  const fields = schemaFields(node.init);
@@ -9704,14 +10055,14 @@ var prefer_zod_infer_default = createRule({
9704
10055
  },
9705
10056
  /** Records `XSchema.transform(...)` and equivalent module-level reshaping. */
9706
10057
  "MemberExpression[computed=false]"(node) {
9707
- if (node.object.type === import_utils61.AST_NODE_TYPES.Identifier && node.property.type === import_utils61.AST_NODE_TYPES.Identifier && MODULE_LEVEL_RESHAPERS.has(node.property.name)) {
10058
+ if (node.object.type === import_utils62.AST_NODE_TYPES.Identifier && node.property.type === import_utils62.AST_NODE_TYPES.Identifier && MODULE_LEVEL_RESHAPERS.has(node.property.name)) {
9708
10059
  reshapedSchemaNames.add(node.object.name);
9709
10060
  }
9710
10061
  },
9711
10062
  /** Records every type argument carried by a Zod constraint. */
9712
10063
  TSTypeReference(node) {
9713
10064
  const { typeName } = node;
9714
- const referenced = typeName.type === import_utils61.AST_NODE_TYPES.Identifier ? typeName.name : typeName.type === import_utils61.AST_NODE_TYPES.TSQualifiedName && typeName.right.type === import_utils61.AST_NODE_TYPES.Identifier ? typeName.right.name : null;
10065
+ const referenced = typeName.type === import_utils62.AST_NODE_TYPES.Identifier ? typeName.name : typeName.type === import_utils62.AST_NODE_TYPES.TSQualifiedName && typeName.right.type === import_utils62.AST_NODE_TYPES.Identifier ? typeName.right.name : null;
9715
10066
  if (referenced === null || !ZOD_TYPE_CONSTRAINTS.has(referenced)) {
9716
10067
  return;
9717
10068
  }
@@ -9729,7 +10080,7 @@ var prefer_zod_infer_default = createRule({
9729
10080
  }
9730
10081
  },
9731
10082
  TSTypeAliasDeclaration(node) {
9732
- if (node.typeParameters !== void 0 || node.typeAnnotation.type !== import_utils61.AST_NODE_TYPES.TSTypeLiteral) {
10083
+ if (node.typeParameters !== void 0 || node.typeAnnotation.type !== import_utils62.AST_NODE_TYPES.TSTypeLiteral) {
9733
10084
  return;
9734
10085
  }
9735
10086
  const members = typeMembers(node.typeAnnotation.members);
@@ -9774,10 +10125,10 @@ var prefer_zod_infer_default = createRule({
9774
10125
  });
9775
10126
 
9776
10127
  // src/rules/require-assert-never.ts
9777
- var import_utils62 = require("@typescript-eslint/utils");
10128
+ var import_utils63 = require("@typescript-eslint/utils");
9778
10129
  var isRuntimeHandlingStatement = (statement) => {
9779
- if (statement.type === import_utils62.AST_NODE_TYPES.EmptyStatement) return false;
9780
- if (statement.type === import_utils62.AST_NODE_TYPES.BlockStatement) {
10130
+ if (statement.type === import_utils63.AST_NODE_TYPES.EmptyStatement) return false;
10131
+ if (statement.type === import_utils63.AST_NODE_TYPES.BlockStatement) {
9781
10132
  return statement.body.some(isRuntimeHandlingStatement);
9782
10133
  }
9783
10134
  return true;
@@ -9793,7 +10144,7 @@ var isCommentOnlyNoopDefault = (defaultCase, sourceCode) => {
9793
10144
  return colonToken !== null && sourceCode.getCommentsAfter(colonToken).length > 0;
9794
10145
  }
9795
10146
  const only = defaultCase.consequent[0];
9796
- if (only !== void 0 && defaultCase.consequent.length === 1 && only.type === import_utils62.AST_NODE_TYPES.BlockStatement && only.body.length === 0) {
10147
+ if (only !== void 0 && defaultCase.consequent.length === 1 && only.type === import_utils63.AST_NODE_TYPES.BlockStatement && only.body.length === 0) {
9797
10148
  return sourceCode.getCommentsInside(only).length > 0;
9798
10149
  }
9799
10150
  return false;
@@ -9833,7 +10184,7 @@ var require_assert_never_default = createRule({
9833
10184
  });
9834
10185
 
9835
10186
  // src/rules/require-fetch-timeout.ts
9836
- var import_utils63 = require("@typescript-eslint/utils");
10187
+ var import_utils64 = require("@typescript-eslint/utils");
9837
10188
  var GLOBAL_OBJECTS2 = /* @__PURE__ */ new Set([
9838
10189
  "globalThis",
9839
10190
  "window",
@@ -9849,14 +10200,14 @@ function matchesAnyPattern3(filename, patterns) {
9849
10200
  return false;
9850
10201
  }
9851
10202
  function initProvablyLacksSignal(init) {
9852
- if (init.type !== import_utils63.AST_NODE_TYPES.ObjectExpression) {
10203
+ if (init.type !== import_utils64.AST_NODE_TYPES.ObjectExpression) {
9853
10204
  return false;
9854
10205
  }
9855
10206
  for (const prop of init.properties) {
9856
- if (prop.type === import_utils63.AST_NODE_TYPES.SpreadElement) {
10207
+ if (prop.type === import_utils64.AST_NODE_TYPES.SpreadElement) {
9857
10208
  return false;
9858
10209
  }
9859
- if (prop.key.type === import_utils63.AST_NODE_TYPES.Identifier && prop.key.name === "signal" || prop.key.type === import_utils63.AST_NODE_TYPES.Literal && prop.key.value === "signal") {
10210
+ if (prop.key.type === import_utils64.AST_NODE_TYPES.Identifier && prop.key.name === "signal" || prop.key.type === import_utils64.AST_NODE_TYPES.Literal && prop.key.value === "signal") {
9860
10211
  return false;
9861
10212
  }
9862
10213
  if (prop.computed) {
@@ -9866,7 +10217,7 @@ function initProvablyLacksSignal(init) {
9866
10217
  return true;
9867
10218
  }
9868
10219
  function isStringish(node) {
9869
- return node.type === import_utils63.AST_NODE_TYPES.Literal && typeof node.value === "string" || node.type === import_utils63.AST_NODE_TYPES.TemplateLiteral;
10220
+ return node.type === import_utils64.AST_NODE_TYPES.Literal && typeof node.value === "string" || node.type === import_utils64.AST_NODE_TYPES.TemplateLiteral;
9870
10221
  }
9871
10222
  var require_fetch_timeout_default = createRule({
9872
10223
  name: "require-fetch-timeout",
@@ -9903,14 +10254,14 @@ var require_fetch_timeout_default = createRule({
9903
10254
  }
9904
10255
  function resolvesToGlobal(identifier) {
9905
10256
  const scope = context.sourceCode.getScope(identifier);
9906
- const variable = import_utils63.ASTUtils.findVariable(scope, identifier.name);
10257
+ const variable = import_utils64.ASTUtils.findVariable(scope, identifier.name);
9907
10258
  return variable === null || variable.defs.length === 0;
9908
10259
  }
9909
10260
  function isGlobalFetchCall2(callee) {
9910
- if (callee.type === import_utils63.AST_NODE_TYPES.Identifier) {
10261
+ if (callee.type === import_utils64.AST_NODE_TYPES.Identifier) {
9911
10262
  return callee.name === "fetch" && resolvesToGlobal(callee);
9912
10263
  }
9913
- return callee.type === import_utils63.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils63.AST_NODE_TYPES.Identifier && callee.property.name === "fetch" && callee.object.type === import_utils63.AST_NODE_TYPES.Identifier && GLOBAL_OBJECTS2.has(callee.object.name) && resolvesToGlobal(callee.object);
10264
+ return callee.type === import_utils64.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils64.AST_NODE_TYPES.Identifier && callee.property.name === "fetch" && callee.object.type === import_utils64.AST_NODE_TYPES.Identifier && GLOBAL_OBJECTS2.has(callee.object.name) && resolvesToGlobal(callee.object);
9914
10265
  }
9915
10266
  return {
9916
10267
  CallExpression(node) {
@@ -9930,28 +10281,51 @@ var require_fetch_timeout_default = createRule({
9930
10281
  });
9931
10282
 
9932
10283
  // src/rules/require-interface-for-injected-service.ts
9933
- var import_utils64 = require("@typescript-eslint/utils");
10284
+ var import_utils65 = require("@typescript-eslint/utils");
9934
10285
  var CONFIGISH_TYPE_RE = /(?:Options|Opts|Config|Configuration|Settings|Params|Props|Args|Env|Environment|Callbacks|Flags)$/;
9935
10286
  var CONFIGISH_NAME_RE = /^(?:options|opts|config|configuration|settings|params|props|args|env|environment|callbacks|flags|logger|log|clock)$/i;
9936
10287
  var HTTP_TRANSPORT_TYPE_RE = /^(?:KyInstance|AxiosInstance|Session)$/;
9937
10288
  var BUILTIN_CONTAINER_TYPE_RE = /^(?:Record|Map|WeakMap|Set|WeakSet|Array|ReadonlyArray|ReadonlyMap|ReadonlySet|Promise|Partial|Required|Readonly|Pick|Omit|Exclude|Extract|NonNullable|Awaited|Parameters|ReturnType|InstanceType)$/;
10289
+ var VALUE_TYPE_RE = /^(?:ArrayBuffer|Blob|Buffer|Date|RegExp|URL|URLSearchParams)$/;
9938
10290
  var TRANSPORT_WRAPPER_NAME_RE = /Client$/;
9939
10291
  var ROUTER_FACTORY_NAME = "Router";
9940
10292
  var FRAMEWORK_HTTP_TYPES = /* @__PURE__ */ new Set(["Request", "Response", "NextFunction"]);
9941
- var isExportedClass = (node) => node.parent.type === import_utils64.AST_NODE_TYPES.ExportNamedDeclaration || node.parent.type === import_utils64.AST_NODE_TYPES.ExportDefaultDeclaration;
9942
- var qualifiedName = (name) => name.type === import_utils64.AST_NODE_TYPES.Identifier ? name.name : name.type === import_utils64.AST_NODE_TYPES.TSQualifiedName ? `${qualifiedName(name.left)}.${name.right.name}` : "";
10293
+ var STORAGE_ASSIGNMENT_OPERATORS = /* @__PURE__ */ new Set(["=", "&&=", "??=", "||="]);
10294
+ var detachedValueExports = (program) => {
10295
+ const names = /* @__PURE__ */ new Set();
10296
+ for (const statement of program.body) {
10297
+ if (statement.type === import_utils65.AST_NODE_TYPES.ExportNamedDeclaration && statement.declaration === null && statement.source === null && statement.exportKind !== "type") {
10298
+ for (const specifier of statement.specifiers) {
10299
+ if (specifier.exportKind !== "type") names.add(specifier.local.name);
10300
+ }
10301
+ } else if (statement.type === import_utils65.AST_NODE_TYPES.ExportDefaultDeclaration && statement.declaration.type === import_utils65.AST_NODE_TYPES.Identifier) {
10302
+ names.add(statement.declaration.name);
10303
+ } else if (statement.type === import_utils65.AST_NODE_TYPES.TSExportAssignment && statement.expression.type === import_utils65.AST_NODE_TYPES.Identifier) {
10304
+ names.add(statement.expression.name);
10305
+ }
10306
+ }
10307
+ return names;
10308
+ };
10309
+ var isExportedClass2 = (node, detached) => node.parent.type === import_utils65.AST_NODE_TYPES.ExportNamedDeclaration || node.parent.type === import_utils65.AST_NODE_TYPES.ExportDefaultDeclaration || node.id !== null && detached.has(node.id.name);
10310
+ var qualifiedName = (name) => name.type === import_utils65.AST_NODE_TYPES.Identifier ? name.name : name.type === import_utils65.AST_NODE_TYPES.TSQualifiedName ? `${qualifiedName(name.left)}.${name.right.name}` : "";
9943
10311
  var readTypeReference = (annotation) => {
9944
- if (annotation === void 0 || annotation.type !== import_utils64.AST_NODE_TYPES.TSTypeReference) return null;
10312
+ if (annotation?.type === import_utils65.AST_NODE_TYPES.TSUnionType) {
10313
+ const members = annotation.types.filter(
10314
+ (member) => member.type !== import_utils65.AST_NODE_TYPES.TSUndefinedKeyword && member.type !== import_utils65.AST_NODE_TYPES.TSNullKeyword
10315
+ );
10316
+ annotation = members.length === 1 ? members[0] : void 0;
10317
+ }
10318
+ if (annotation === void 0 || annotation.type !== import_utils65.AST_NODE_TYPES.TSTypeReference) return null;
9945
10319
  const { typeName } = annotation;
9946
- const rightmost = typeName.type === import_utils64.AST_NODE_TYPES.Identifier ? typeName.name : typeName.type === import_utils64.AST_NODE_TYPES.TSQualifiedName ? typeName.right.name : null;
10320
+ const rightmost = typeName.type === import_utils65.AST_NODE_TYPES.Identifier ? typeName.name : typeName.type === import_utils65.AST_NODE_TYPES.TSQualifiedName ? typeName.right.name : null;
9947
10321
  if (rightmost === null) return null;
9948
10322
  return { typeName: rightmost, display: qualifiedName(typeName) };
9949
10323
  };
9950
10324
  var namedParameterCollaborator = (annotated) => {
9951
10325
  let target = annotated;
9952
- if (target.type === import_utils64.AST_NODE_TYPES.TSParameterProperty) target = target.parameter;
9953
- if (target.type === import_utils64.AST_NODE_TYPES.AssignmentPattern) target = target.left;
9954
- if (target.type !== import_utils64.AST_NODE_TYPES.Identifier) return null;
10326
+ if (target.type === import_utils65.AST_NODE_TYPES.TSParameterProperty) target = target.parameter;
10327
+ if (target.type === import_utils65.AST_NODE_TYPES.AssignmentPattern) target = target.left;
10328
+ if (target.type !== import_utils65.AST_NODE_TYPES.Identifier) return null;
9955
10329
  const reference = readTypeReference(target.typeAnnotation?.typeAnnotation);
9956
10330
  if (reference === null) return null;
9957
10331
  return { name: target.name, ...reference };
@@ -9959,8 +10333,8 @@ var namedParameterCollaborator = (annotated) => {
9959
10333
  var propertySignatureTypes = (members) => {
9960
10334
  const types = /* @__PURE__ */ new Map();
9961
10335
  for (const member of members) {
9962
- if (member.type !== import_utils64.AST_NODE_TYPES.TSPropertySignature) continue;
9963
- if (member.computed || member.key.type !== import_utils64.AST_NODE_TYPES.Identifier) continue;
10336
+ if (member.type !== import_utils65.AST_NODE_TYPES.TSPropertySignature) continue;
10337
+ if (member.computed || member.key.type !== import_utils65.AST_NODE_TYPES.Identifier) continue;
9964
10338
  const reference = readTypeReference(member.typeAnnotation?.typeAnnotation);
9965
10339
  if (reference === null) continue;
9966
10340
  types.set(member.key.name, reference);
@@ -9971,18 +10345,18 @@ var fileTypeIndex = (program) => {
9971
10345
  const objects = /* @__PURE__ */ new Map();
9972
10346
  const functionAliases = /* @__PURE__ */ new Set();
9973
10347
  for (const statement of program.body) {
9974
- const declaration = statement.type === import_utils64.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
9975
- if (declaration?.type === import_utils64.AST_NODE_TYPES.TSInterfaceDeclaration) {
10348
+ const declaration = statement.type === import_utils65.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
10349
+ if (declaration?.type === import_utils65.AST_NODE_TYPES.TSInterfaceDeclaration) {
9976
10350
  objects.set(declaration.id.name, propertySignatureTypes(declaration.body.body));
9977
10351
  continue;
9978
10352
  }
9979
- if (declaration?.type !== import_utils64.AST_NODE_TYPES.TSTypeAliasDeclaration) continue;
10353
+ if (declaration?.type !== import_utils65.AST_NODE_TYPES.TSTypeAliasDeclaration) continue;
9980
10354
  const aliased = declaration.typeAnnotation;
9981
- if (aliased.type === import_utils64.AST_NODE_TYPES.TSFunctionType || aliased.type === import_utils64.AST_NODE_TYPES.TSConstructorType) {
10355
+ if (aliased.type === import_utils65.AST_NODE_TYPES.TSFunctionType || aliased.type === import_utils65.AST_NODE_TYPES.TSConstructorType) {
9982
10356
  functionAliases.add(declaration.id.name);
9983
10357
  continue;
9984
10358
  }
9985
- const literals = aliased.type === import_utils64.AST_NODE_TYPES.TSTypeLiteral ? [aliased] : aliased.type === import_utils64.AST_NODE_TYPES.TSIntersectionType ? aliased.types.filter((part) => part.type === import_utils64.AST_NODE_TYPES.TSTypeLiteral) : [];
10359
+ const literals = aliased.type === import_utils65.AST_NODE_TYPES.TSTypeLiteral ? [aliased] : aliased.type === import_utils65.AST_NODE_TYPES.TSIntersectionType ? aliased.types.filter((part) => part.type === import_utils65.AST_NODE_TYPES.TSTypeLiteral) : [];
9986
10360
  if (literals.length === 0) continue;
9987
10361
  const merged = /* @__PURE__ */ new Map();
9988
10362
  for (const literal of literals) {
@@ -9995,10 +10369,10 @@ var fileTypeIndex = (program) => {
9995
10369
  return { objects, functionAliases };
9996
10370
  };
9997
10371
  var bagMemberTypes = (annotation, declared) => {
9998
- if (annotation.type === import_utils64.AST_NODE_TYPES.TSTypeLiteral) {
10372
+ if (annotation.type === import_utils65.AST_NODE_TYPES.TSTypeLiteral) {
9999
10373
  return propertySignatureTypes(annotation.members);
10000
10374
  }
10001
- if (annotation.type !== import_utils64.AST_NODE_TYPES.TSTypeReference || annotation.typeName.type !== import_utils64.AST_NODE_TYPES.Identifier) {
10375
+ if (annotation.type !== import_utils65.AST_NODE_TYPES.TSTypeReference || annotation.typeName.type !== import_utils65.AST_NODE_TYPES.Identifier) {
10002
10376
  return null;
10003
10377
  }
10004
10378
  return declared().objects.get(annotation.typeName.name) ?? null;
@@ -10010,11 +10384,11 @@ var objectPatternCollaborators = (pattern, declared) => {
10010
10384
  if (members === null) return [];
10011
10385
  const collaborators = [];
10012
10386
  for (const property of pattern.properties) {
10013
- if (property.type !== import_utils64.AST_NODE_TYPES.Property || property.computed) continue;
10014
- if (property.key.type !== import_utils64.AST_NODE_TYPES.Identifier) continue;
10387
+ if (property.type !== import_utils65.AST_NODE_TYPES.Property || property.computed) continue;
10388
+ if (property.key.type !== import_utils65.AST_NODE_TYPES.Identifier) continue;
10015
10389
  const key = property.key.name;
10016
- const bound = property.value.type === import_utils64.AST_NODE_TYPES.AssignmentPattern ? property.value.left : property.value;
10017
- if (bound.type !== import_utils64.AST_NODE_TYPES.Identifier) continue;
10390
+ const bound = property.value.type === import_utils65.AST_NODE_TYPES.AssignmentPattern ? property.value.left : property.value;
10391
+ if (bound.type !== import_utils65.AST_NODE_TYPES.Identifier) continue;
10018
10392
  if (CONFIGISH_NAME_RE.test(key)) continue;
10019
10393
  const reference = members.get(key);
10020
10394
  if (reference === void 0) continue;
@@ -10024,8 +10398,8 @@ var objectPatternCollaborators = (pattern, declared) => {
10024
10398
  };
10025
10399
  var parameterCollaborators = (parameter, declared) => {
10026
10400
  let target = parameter;
10027
- if (target.type === import_utils64.AST_NODE_TYPES.AssignmentPattern) target = target.left;
10028
- if (target.type === import_utils64.AST_NODE_TYPES.ObjectPattern) {
10401
+ if (target.type === import_utils65.AST_NODE_TYPES.AssignmentPattern) target = target.left;
10402
+ if (target.type === import_utils65.AST_NODE_TYPES.ObjectPattern) {
10029
10403
  return objectPatternCollaborators(target, declared);
10030
10404
  }
10031
10405
  const named2 = namedParameterCollaborator(parameter);
@@ -10043,18 +10417,31 @@ var readConstructor = (ctor, declared, typeParameters) => {
10043
10417
  const storedFrom = /* @__PURE__ */ new Set();
10044
10418
  let constructedFields = 0;
10045
10419
  if (body2 !== null && body2 !== void 0) {
10046
- for (const statement of body2.body) {
10047
- if (statement.type !== import_utils64.AST_NODE_TYPES.ExpressionStatement) continue;
10048
- const expression = statement.expression;
10049
- if (expression.type !== import_utils64.AST_NODE_TYPES.AssignmentExpression || expression.operator !== "=" || expression.left.type !== import_utils64.AST_NODE_TYPES.MemberExpression || expression.left.object.type !== import_utils64.AST_NODE_TYPES.ThisExpression) {
10420
+ const pending = [...body2.body];
10421
+ while (pending.length > 0) {
10422
+ const current = pending.pop();
10423
+ if (current === void 0) break;
10424
+ if (current.type === import_utils65.AST_NODE_TYPES.ArrowFunctionExpression || current.type === import_utils65.AST_NODE_TYPES.FunctionExpression || current.type === import_utils65.AST_NODE_TYPES.FunctionDeclaration || current.type === import_utils65.AST_NODE_TYPES.ClassExpression || current.type === import_utils65.AST_NODE_TYPES.ClassDeclaration) continue;
10425
+ const expression = current.type === import_utils65.AST_NODE_TYPES.ExpressionStatement ? current.expression : null;
10426
+ if (expression?.type !== import_utils65.AST_NODE_TYPES.AssignmentExpression || !STORAGE_ASSIGNMENT_OPERATORS.has(expression.operator) || expression.left.type !== import_utils65.AST_NODE_TYPES.MemberExpression || expression.left.object.type !== import_utils65.AST_NODE_TYPES.ThisExpression) {
10427
+ for (const key of Object.keys(current)) {
10428
+ if (key === "parent") continue;
10429
+ const value = current[key];
10430
+ for (const child of Array.isArray(value) ? value : [value]) {
10431
+ if (child !== null && typeof child === "object" && typeof child.type === "string") {
10432
+ pending.push(child);
10433
+ }
10434
+ }
10435
+ }
10050
10436
  continue;
10051
10437
  }
10052
- const source = expression.right;
10053
- if (source.type === import_utils64.AST_NODE_TYPES.NewExpression) {
10438
+ let source = expression.right;
10439
+ while (source.type === import_utils65.AST_NODE_TYPES.TSNonNullExpression || source.type === import_utils65.AST_NODE_TYPES.TSAsExpression || source.type === import_utils65.AST_NODE_TYPES.TSSatisfiesExpression || source.type === import_utils65.AST_NODE_TYPES.TSTypeAssertion) source = source.expression;
10440
+ if (source.type === import_utils65.AST_NODE_TYPES.NewExpression) {
10054
10441
  constructedFields += 1;
10055
- } else if (source.type === import_utils64.AST_NODE_TYPES.Identifier) {
10442
+ } else if (source.type === import_utils65.AST_NODE_TYPES.Identifier) {
10056
10443
  storedFrom.add(source.name);
10057
- } else if (source.type === import_utils64.AST_NODE_TYPES.MemberExpression && source.object.type === import_utils64.AST_NODE_TYPES.Identifier) {
10444
+ } else if (source.type === import_utils65.AST_NODE_TYPES.MemberExpression && source.object.type === import_utils65.AST_NODE_TYPES.Identifier) {
10058
10445
  storedFrom.add(source.object.name);
10059
10446
  }
10060
10447
  }
@@ -10062,12 +10449,13 @@ var readConstructor = (ctor, declared, typeParameters) => {
10062
10449
  const collaborators = [];
10063
10450
  for (const parameter of ctor.value.params) {
10064
10451
  for (const reference of parameterCollaborators(parameter, declared)) {
10065
- const stored = parameter.type === import_utils64.AST_NODE_TYPES.TSParameterProperty || storedFrom.has(reference.name);
10452
+ const stored = parameter.type === import_utils65.AST_NODE_TYPES.TSParameterProperty || storedFrom.has(reference.name);
10066
10453
  if (!stored) continue;
10067
10454
  if (CONFIGISH_TYPE_RE.test(reference.typeName)) continue;
10068
10455
  if (CONFIGISH_NAME_RE.test(reference.name)) continue;
10069
10456
  if (typeParameters.has(reference.typeName)) continue;
10070
10457
  if (BUILTIN_CONTAINER_TYPE_RE.test(reference.typeName)) continue;
10458
+ if (VALUE_TYPE_RE.test(reference.typeName)) continue;
10071
10459
  if (declared().functionAliases.has(reference.typeName)) continue;
10072
10460
  collaborators.push(reference);
10073
10461
  }
@@ -10096,19 +10484,19 @@ var subtreeHas = (root, found) => {
10096
10484
  return hit;
10097
10485
  };
10098
10486
  var isFrameworkWiring = (body2) => subtreeHas(body2, (node) => {
10099
- if (node.type === import_utils64.AST_NODE_TYPES.CallExpression) {
10487
+ if (node.type === import_utils65.AST_NODE_TYPES.CallExpression) {
10100
10488
  const { callee } = node;
10101
- if (callee.type === import_utils64.AST_NODE_TYPES.Identifier) return callee.name === ROUTER_FACTORY_NAME;
10102
- return callee.type === import_utils64.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils64.AST_NODE_TYPES.Identifier && callee.property.name === ROUTER_FACTORY_NAME;
10489
+ if (callee.type === import_utils65.AST_NODE_TYPES.Identifier) return callee.name === ROUTER_FACTORY_NAME;
10490
+ return callee.type === import_utils65.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils65.AST_NODE_TYPES.Identifier && callee.property.name === ROUTER_FACTORY_NAME;
10103
10491
  }
10104
- return node.type === import_utils64.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils64.AST_NODE_TYPES.TSQualifiedName && FRAMEWORK_HTTP_TYPES.has(node.typeName.right.name);
10492
+ return node.type === import_utils65.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils65.AST_NODE_TYPES.TSQualifiedName && FRAMEWORK_HTTP_TYPES.has(node.typeName.right.name);
10105
10493
  });
10106
10494
  var stem2 = (name) => name.replace(/^I(?=[A-Z])/, "").replace(/Impl$/, "");
10107
10495
  var fileInterfaceNames = (program) => {
10108
10496
  const names = [];
10109
10497
  for (const statement of program.body) {
10110
- const declaration = statement.type === import_utils64.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
10111
- if (declaration?.type === import_utils64.AST_NODE_TYPES.TSInterfaceDeclaration) names.push(declaration.id.name);
10498
+ const declaration = statement.type === import_utils65.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
10499
+ if (declaration?.type === import_utils65.AST_NODE_TYPES.TSInterfaceDeclaration) names.push(declaration.id.name);
10112
10500
  }
10113
10501
  return names;
10114
10502
  };
@@ -10123,28 +10511,153 @@ var isTransportWrapper = (className, collaborators, program) => {
10123
10511
  return target.endsWith(other) || other.endsWith(target);
10124
10512
  });
10125
10513
  };
10126
- var publicMethodNames = (body2) => {
10514
+ var publicMethodNames = (body2, functionAliases) => {
10127
10515
  const names = [];
10128
10516
  for (const member of body2.body) {
10129
- if (member.type !== import_utils64.AST_NODE_TYPES.MethodDefinition) continue;
10517
+ if (member.type === import_utils65.AST_NODE_TYPES.PropertyDefinition) {
10518
+ if (member.static || member.accessibility === "private" || member.accessibility === "protected") continue;
10519
+ if (member.value?.type !== import_utils65.AST_NODE_TYPES.ArrowFunctionExpression && member.value?.type !== import_utils65.AST_NODE_TYPES.FunctionExpression && member.typeAnnotation?.typeAnnotation.type !== import_utils65.AST_NODE_TYPES.TSFunctionType && !(member.typeAnnotation?.typeAnnotation.type === import_utils65.AST_NODE_TYPES.TSTypeReference && member.typeAnnotation.typeAnnotation.typeName.type === import_utils65.AST_NODE_TYPES.Identifier && functionAliases.has(member.typeAnnotation.typeAnnotation.typeName.name))) continue;
10520
+ names.push(member.key.type === import_utils65.AST_NODE_TYPES.Identifier ? member.key.name : "\u2026");
10521
+ continue;
10522
+ }
10523
+ if (member.type !== import_utils65.AST_NODE_TYPES.MethodDefinition) continue;
10130
10524
  if (member.kind !== "method" || member.static) continue;
10131
10525
  if (member.accessibility === "private" || member.accessibility === "protected") continue;
10132
- if (member.key.type === import_utils64.AST_NODE_TYPES.PrivateIdentifier) continue;
10133
- if (member.key.type === import_utils64.AST_NODE_TYPES.Identifier) names.push(member.key.name);
10526
+ if (member.key.type === import_utils65.AST_NODE_TYPES.PrivateIdentifier) continue;
10527
+ if (member.key.type === import_utils65.AST_NODE_TYPES.Identifier) names.push(member.key.name);
10134
10528
  else names.push("\u2026");
10135
10529
  }
10136
10530
  return names;
10137
10531
  };
10532
+ function localClassAbstractness(program) {
10533
+ const classes = /* @__PURE__ */ new Map();
10534
+ const parents = /* @__PURE__ */ new Map();
10535
+ for (const statement of program.body) {
10536
+ const declaration = statement.type === import_utils65.AST_NODE_TYPES.ExportNamedDeclaration || statement.type === import_utils65.AST_NODE_TYPES.ExportDefaultDeclaration ? statement.declaration : statement;
10537
+ if (declaration?.type === import_utils65.AST_NODE_TYPES.ClassDeclaration && declaration.id !== null) {
10538
+ classes.set(declaration.id.name, declaration.abstract === true);
10539
+ if (declaration.superClass?.type === import_utils65.AST_NODE_TYPES.Identifier) {
10540
+ parents.set(declaration.id.name, declaration.superClass.name);
10541
+ }
10542
+ }
10543
+ }
10544
+ for (let pass = 0; pass < classes.size; pass += 1) {
10545
+ let changed = false;
10546
+ for (const [name, parent] of parents) {
10547
+ if (classes.get(name) !== true && classes.get(parent) === true) {
10548
+ classes.set(name, true);
10549
+ changed = true;
10550
+ }
10551
+ }
10552
+ if (!changed) break;
10553
+ }
10554
+ return classes;
10555
+ }
10556
+ function localInterfaceSurfaces(program) {
10557
+ const interfaces = /* @__PURE__ */ new Map();
10558
+ const parents = /* @__PURE__ */ new Map();
10559
+ const functionAliases = /* @__PURE__ */ new Set();
10560
+ for (const statement of program.body) {
10561
+ const declaration = statement.type === import_utils65.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
10562
+ if (declaration?.type === import_utils65.AST_NODE_TYPES.TSTypeAliasDeclaration && (declaration.typeAnnotation.type === import_utils65.AST_NODE_TYPES.TSFunctionType || declaration.typeAnnotation.type === import_utils65.AST_NODE_TYPES.TSConstructorType)) functionAliases.add(declaration.id.name);
10563
+ }
10564
+ for (const statement of program.body) {
10565
+ const declaration = statement.type === import_utils65.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
10566
+ if (declaration?.type === import_utils65.AST_NODE_TYPES.TSTypeAliasDeclaration) {
10567
+ const callables2 = interfaces.get(declaration.id.name) ?? /* @__PURE__ */ new Set();
10568
+ const parts = declaration.typeAnnotation.type === import_utils65.AST_NODE_TYPES.TSIntersectionType ? declaration.typeAnnotation.types : [declaration.typeAnnotation];
10569
+ const inherited = parents.get(declaration.id.name) ?? [];
10570
+ for (const part of parts) {
10571
+ if (part.type === import_utils65.AST_NODE_TYPES.TSTypeReference && part.typeName.type === import_utils65.AST_NODE_TYPES.Identifier) {
10572
+ inherited.push(part.typeName.name);
10573
+ continue;
10574
+ }
10575
+ if (part.type !== import_utils65.AST_NODE_TYPES.TSTypeLiteral) continue;
10576
+ for (const member of part.members) {
10577
+ if (member.type !== import_utils65.AST_NODE_TYPES.TSMethodSignature && member.type !== import_utils65.AST_NODE_TYPES.TSPropertySignature) continue;
10578
+ if (member.computed || member.key.type !== import_utils65.AST_NODE_TYPES.Identifier) continue;
10579
+ if (member.type === import_utils65.AST_NODE_TYPES.TSMethodSignature) {
10580
+ callables2.add(member.key.name);
10581
+ continue;
10582
+ }
10583
+ if (member.type !== import_utils65.AST_NODE_TYPES.TSPropertySignature) continue;
10584
+ const annotation = member.typeAnnotation?.typeAnnotation;
10585
+ if (annotation?.type === import_utils65.AST_NODE_TYPES.TSFunctionType || annotation?.type === import_utils65.AST_NODE_TYPES.TSTypeReference && annotation.typeName.type === import_utils65.AST_NODE_TYPES.Identifier && functionAliases.has(annotation.typeName.name)) callables2.add(member.key.name);
10586
+ }
10587
+ }
10588
+ interfaces.set(declaration.id.name, callables2);
10589
+ parents.set(declaration.id.name, inherited);
10590
+ continue;
10591
+ }
10592
+ if (declaration?.type !== import_utils65.AST_NODE_TYPES.TSInterfaceDeclaration) continue;
10593
+ const callables = interfaces.get(declaration.id.name) ?? /* @__PURE__ */ new Set();
10594
+ for (const member of declaration.body.body) {
10595
+ if (member.type !== import_utils65.AST_NODE_TYPES.TSMethodSignature && member.type !== import_utils65.AST_NODE_TYPES.TSPropertySignature) continue;
10596
+ if (member.computed || member.key.type !== import_utils65.AST_NODE_TYPES.Identifier) continue;
10597
+ if (member.type === import_utils65.AST_NODE_TYPES.TSMethodSignature || member.typeAnnotation?.typeAnnotation.type === import_utils65.AST_NODE_TYPES.TSFunctionType || member.typeAnnotation?.typeAnnotation.type === import_utils65.AST_NODE_TYPES.TSTypeReference && member.typeAnnotation.typeAnnotation.typeName.type === import_utils65.AST_NODE_TYPES.Identifier && functionAliases.has(member.typeAnnotation.typeAnnotation.typeName.name)) callables.add(member.key.name);
10598
+ }
10599
+ interfaces.set(declaration.id.name, callables);
10600
+ parents.set(
10601
+ declaration.id.name,
10602
+ [
10603
+ ...parents.get(declaration.id.name) ?? [],
10604
+ ...declaration.extends.flatMap(
10605
+ (heritage) => heritage.expression.type === import_utils65.AST_NODE_TYPES.Identifier ? [heritage.expression.name] : ["*"]
10606
+ )
10607
+ ]
10608
+ );
10609
+ }
10610
+ for (let pass = 0; pass <= interfaces.size; pass += 1) {
10611
+ let changed = false;
10612
+ for (const [name, inherited] of parents) {
10613
+ const surface = interfaces.get(name);
10614
+ if (surface === void 0) continue;
10615
+ for (const parent of inherited) {
10616
+ const parentSurface = interfaces.get(parent);
10617
+ const additions = parentSurface ?? /* @__PURE__ */ new Set(["*"]);
10618
+ for (const method of additions) {
10619
+ if (!surface.has(method)) {
10620
+ surface.add(method);
10621
+ changed = true;
10622
+ }
10623
+ }
10624
+ }
10625
+ }
10626
+ if (!changed) break;
10627
+ }
10628
+ return interfaces;
10629
+ }
10630
+ function hasServicePort(node, methods, classes, interfaces) {
10631
+ if (node.superClass !== null) {
10632
+ if (node.superClass.type !== import_utils65.AST_NODE_TYPES.Identifier) return true;
10633
+ const localAbstract = classes.get(node.superClass.name);
10634
+ if (localAbstract === void 0 || localAbstract) return true;
10635
+ }
10636
+ if (node.implements.length === 0) return false;
10637
+ const combined = /* @__PURE__ */ new Set();
10638
+ for (const implementation of node.implements) {
10639
+ if (implementation.expression.type !== import_utils65.AST_NODE_TYPES.Identifier) return true;
10640
+ const name = implementation.expression.name;
10641
+ const localAbstract = classes.get(name);
10642
+ if (localAbstract === true) return true;
10643
+ const surface = interfaces.get(name);
10644
+ if (surface === void 0 && localAbstract === void 0) return true;
10645
+ if (surface === void 0) continue;
10646
+ if (surface.has("*")) return true;
10647
+ for (const method of surface) combined.add(method);
10648
+ }
10649
+ return methods.every((method) => combined.has(method));
10650
+ }
10138
10651
  var require_interface_for_injected_service_default = createRule({
10139
10652
  name: "require-interface-for-injected-service",
10140
10653
  meta: {
10141
10654
  type: "suggestion",
10142
10655
  docs: {
10143
- description: "An exported service class with constructor-injected collaborators must implement an interface, so consumers depend on a port they can substitute instead of mocking the class."
10656
+ description: "An exported service class with constructor-injected collaborators should declare the interface its public callable surface implements."
10144
10657
  },
10145
10658
  schema: [],
10146
10659
  messages: {
10147
- requireInterface: "`{{name}}` stores injected collaborator(s) ({{deps}}) but implements no interface, so every consumer depends on this concrete class and can only be tested by mocking it. Declare an interface with its public method signature(s) ({{methods}}) and `class {{name}} implements <Interface>`."
10660
+ requireInterface: "`{{name}}` stores injected collaborator(s) ({{deps}}) but declares no service interface. Extract its public callable surface ({{methods}}) into a port and declare `class {{name}} implements <Interface>` so consumers can inject that port."
10148
10661
  }
10149
10662
  },
10150
10663
  defaultOptions: [],
@@ -10153,17 +10666,18 @@ var require_interface_for_injected_service_default = createRule({
10153
10666
  if (isTestFile(filename) || isStoryFile(filename) || isScriptFile(filename)) return {};
10154
10667
  if (isGeneratedFile(filename, context.sourceCode.getText())) return {};
10155
10668
  let declaredTypes = null;
10669
+ const detachedExports = detachedValueExports(context.sourceCode.ast);
10670
+ const localClasses = localClassAbstractness(context.sourceCode.ast);
10671
+ const localInterfaces = localInterfaceSurfaces(context.sourceCode.ast);
10156
10672
  const objectTypes = () => declaredTypes ??= fileTypeIndex(context.sourceCode.ast);
10157
10673
  return {
10158
10674
  ClassDeclaration(node) {
10159
10675
  if (node.id === null) return;
10160
- if (!isExportedClass(node)) return;
10676
+ if (!isExportedClass2(node, detachedExports)) return;
10161
10677
  if (node.abstract === true) return;
10162
- if (node.superClass !== null) return;
10163
- if (node.implements.length > 0) return;
10164
10678
  if (node.decorators.length > 0) return;
10165
10679
  const ctor = node.body.body.find(
10166
- (member) => member.type === import_utils64.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
10680
+ (member) => member.type === import_utils65.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
10167
10681
  );
10168
10682
  if (ctor === void 0) return;
10169
10683
  const { collaborators, constructedFields } = readConstructor(
@@ -10175,8 +10689,9 @@ var require_interface_for_injected_service_default = createRule({
10175
10689
  if (constructedFields > collaborators.length) return;
10176
10690
  if (isFrameworkWiring(node.body)) return;
10177
10691
  if (isTransportWrapper(node.id.name, collaborators, context.sourceCode.ast)) return;
10178
- const methods = publicMethodNames(node.body);
10692
+ const methods = publicMethodNames(node.body, objectTypes().functionAliases);
10179
10693
  if (methods.length === 0) return;
10694
+ if (hasServicePort(node, methods, localClasses, localInterfaces)) return;
10180
10695
  context.report({
10181
10696
  node: node.id,
10182
10697
  messageId: "requireInterface",
@@ -10192,37 +10707,37 @@ var require_interface_for_injected_service_default = createRule({
10192
10707
  });
10193
10708
 
10194
10709
  // src/rules/require-static-next-matcher.ts
10195
- var import_utils65 = require("@typescript-eslint/utils");
10710
+ var import_utils66 = require("@typescript-eslint/utils");
10196
10711
  var NEXT_ENTRY_FILE = /(?:^|[/\\])(?:middleware|proxy)\.[cm]?[jt]sx?$/u;
10197
10712
  function unwrapExpression2(node) {
10198
- if (node.type === import_utils65.AST_NODE_TYPES.TSAsExpression || node.type === import_utils65.AST_NODE_TYPES.TSSatisfiesExpression || node.type === import_utils65.AST_NODE_TYPES.TSNonNullExpression || node.type === import_utils65.AST_NODE_TYPES.TSTypeAssertion) {
10713
+ if (node.type === import_utils66.AST_NODE_TYPES.TSAsExpression || node.type === import_utils66.AST_NODE_TYPES.TSSatisfiesExpression || node.type === import_utils66.AST_NODE_TYPES.TSNonNullExpression || node.type === import_utils66.AST_NODE_TYPES.TSTypeAssertion) {
10199
10714
  return unwrapExpression2(node.expression);
10200
10715
  }
10201
10716
  return node;
10202
10717
  }
10203
10718
  function isStaticValue(node) {
10204
10719
  const value = unwrapExpression2(node);
10205
- if (value.type === import_utils65.AST_NODE_TYPES.Literal) {
10720
+ if (value.type === import_utils66.AST_NODE_TYPES.Literal) {
10206
10721
  return true;
10207
10722
  }
10208
- if (value.type === import_utils65.AST_NODE_TYPES.TemplateLiteral) {
10723
+ if (value.type === import_utils66.AST_NODE_TYPES.TemplateLiteral) {
10209
10724
  return value.expressions.length === 0;
10210
10725
  }
10211
- if (value.type === import_utils65.AST_NODE_TYPES.ArrayExpression) {
10726
+ if (value.type === import_utils66.AST_NODE_TYPES.ArrayExpression) {
10212
10727
  return value.elements.every(
10213
- (element) => element !== null && element.type !== import_utils65.AST_NODE_TYPES.SpreadElement && isStaticValue(element)
10728
+ (element) => element !== null && element.type !== import_utils66.AST_NODE_TYPES.SpreadElement && isStaticValue(element)
10214
10729
  );
10215
10730
  }
10216
- if (value.type === import_utils65.AST_NODE_TYPES.ObjectExpression) {
10731
+ if (value.type === import_utils66.AST_NODE_TYPES.ObjectExpression) {
10217
10732
  return value.properties.every(
10218
- (property) => property.type === import_utils65.AST_NODE_TYPES.Property && property.kind === "init" && !property.computed && property.value.type !== import_utils65.AST_NODE_TYPES.AssignmentPattern && isStaticValue(property.value)
10733
+ (property) => property.type === import_utils66.AST_NODE_TYPES.Property && property.kind === "init" && !property.computed && property.value.type !== import_utils66.AST_NODE_TYPES.AssignmentPattern && isStaticValue(property.value)
10219
10734
  );
10220
10735
  }
10221
10736
  return false;
10222
10737
  }
10223
10738
  function propertyName2(property) {
10224
10739
  if (property.computed) return null;
10225
- if (property.key.type === import_utils65.AST_NODE_TYPES.Identifier) return property.key.name;
10740
+ if (property.key.type === import_utils66.AST_NODE_TYPES.Identifier) return property.key.name;
10226
10741
  return typeof property.key.value === "string" ? property.key.value : null;
10227
10742
  }
10228
10743
  var require_static_next_matcher_default = createRule({
@@ -10244,19 +10759,19 @@ var require_static_next_matcher_default = createRule({
10244
10759
  }
10245
10760
  return {
10246
10761
  ExportNamedDeclaration(node) {
10247
- if (node.declaration?.type !== import_utils65.AST_NODE_TYPES.VariableDeclaration) {
10762
+ if (node.declaration?.type !== import_utils66.AST_NODE_TYPES.VariableDeclaration) {
10248
10763
  return;
10249
10764
  }
10250
10765
  for (const declaration of node.declaration.declarations) {
10251
- if (declaration.id.type !== import_utils65.AST_NODE_TYPES.Identifier || declaration.id.name !== "config" || declaration.init === null) {
10766
+ if (declaration.id.type !== import_utils66.AST_NODE_TYPES.Identifier || declaration.id.name !== "config" || declaration.init === null) {
10252
10767
  continue;
10253
10768
  }
10254
10769
  const config = unwrapExpression2(declaration.init);
10255
- if (config.type !== import_utils65.AST_NODE_TYPES.ObjectExpression) {
10770
+ if (config.type !== import_utils66.AST_NODE_TYPES.ObjectExpression) {
10256
10771
  continue;
10257
10772
  }
10258
10773
  for (const property of config.properties) {
10259
- if (property.type !== import_utils65.AST_NODE_TYPES.Property || propertyName2(property) !== "matcher" || property.value.type === import_utils65.AST_NODE_TYPES.AssignmentPattern) {
10774
+ if (property.type !== import_utils66.AST_NODE_TYPES.Property || propertyName2(property) !== "matcher" || property.value.type === import_utils66.AST_NODE_TYPES.AssignmentPattern) {
10260
10775
  continue;
10261
10776
  }
10262
10777
  if (!isStaticValue(property.value)) {
@@ -10270,18 +10785,18 @@ var require_static_next_matcher_default = createRule({
10270
10785
  });
10271
10786
 
10272
10787
  // src/rules/require-zod-form-validation.ts
10273
- var import_utils66 = require("@typescript-eslint/utils");
10788
+ var import_utils67 = require("@typescript-eslint/utils");
10274
10789
  var looksLikeZodSchema = (node) => {
10275
10790
  let current = node;
10276
10791
  while (true) {
10277
- if (current.type === import_utils66.AST_NODE_TYPES.Identifier) {
10792
+ if (current.type === import_utils67.AST_NODE_TYPES.Identifier) {
10278
10793
  return current.name === "z" || ZOD_SCHEMA_NAME_RE.test(current.name);
10279
10794
  }
10280
- if (current.type === import_utils66.AST_NODE_TYPES.CallExpression) {
10795
+ if (current.type === import_utils67.AST_NODE_TYPES.CallExpression) {
10281
10796
  current = current.callee;
10282
10797
  continue;
10283
10798
  }
10284
- if (current.type === import_utils66.AST_NODE_TYPES.MemberExpression) {
10799
+ if (current.type === import_utils67.AST_NODE_TYPES.MemberExpression) {
10285
10800
  current = current.object;
10286
10801
  continue;
10287
10802
  }
@@ -10289,23 +10804,23 @@ var looksLikeZodSchema = (node) => {
10289
10804
  }
10290
10805
  };
10291
10806
  var isZodParseCall = (node) => {
10292
- if (node.type !== import_utils66.AST_NODE_TYPES.CallExpression) return false;
10807
+ if (node.type !== import_utils67.AST_NODE_TYPES.CallExpression) return false;
10293
10808
  const callee = node.callee;
10294
- if (callee.type !== import_utils66.AST_NODE_TYPES.MemberExpression) return false;
10809
+ if (callee.type !== import_utils67.AST_NODE_TYPES.MemberExpression) return false;
10295
10810
  if (callee.computed) return false;
10296
- if (callee.property.type !== import_utils66.AST_NODE_TYPES.Identifier) return false;
10811
+ if (callee.property.type !== import_utils67.AST_NODE_TYPES.Identifier) return false;
10297
10812
  const method = callee.property.name;
10298
10813
  if (method !== "parse" && method !== "safeParse") return false;
10299
10814
  return looksLikeZodSchema(callee.object);
10300
10815
  };
10301
10816
  var isFormDataMethodCall = (node) => {
10302
10817
  let current = node;
10303
- if (current.type === import_utils66.AST_NODE_TYPES.AwaitExpression) {
10818
+ if (current.type === import_utils67.AST_NODE_TYPES.AwaitExpression) {
10304
10819
  current = current.argument;
10305
10820
  }
10306
- if (current.type !== import_utils66.AST_NODE_TYPES.CallExpression) return false;
10821
+ if (current.type !== import_utils67.AST_NODE_TYPES.CallExpression) return false;
10307
10822
  const callee = current.callee;
10308
- return callee.type === import_utils66.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils66.AST_NODE_TYPES.Identifier && callee.property.name === "formData";
10823
+ return callee.type === import_utils67.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils67.AST_NODE_TYPES.Identifier && callee.property.name === "formData";
10309
10824
  };
10310
10825
  var require_zod_form_validation_default = createRule({
10311
10826
  name: "require-zod-form-validation",
@@ -10325,14 +10840,14 @@ var require_zod_form_validation_default = createRule({
10325
10840
  return {};
10326
10841
  }
10327
10842
  const isFormSourceIdentifier = (node) => {
10328
- if (node.type !== import_utils66.AST_NODE_TYPES.Identifier) return false;
10843
+ if (node.type !== import_utils67.AST_NODE_TYPES.Identifier) return false;
10329
10844
  if (/formdata/i.test(node.name)) return true;
10330
10845
  let scope = context.sourceCode.getScope(node);
10331
10846
  while (scope !== null) {
10332
10847
  const variable = scope.set.get(node.name);
10333
10848
  if (variable !== void 0 && variable.defs.length === 1) {
10334
10849
  const def = variable.defs[0];
10335
- if (def !== void 0 && def.type === "Variable" && def.node.type === import_utils66.AST_NODE_TYPES.VariableDeclarator && def.node.init !== null) {
10850
+ if (def !== void 0 && def.type === "Variable" && def.node.type === import_utils67.AST_NODE_TYPES.VariableDeclarator && def.node.init !== null) {
10336
10851
  return isFormDataMethodCall(def.node.init);
10337
10852
  }
10338
10853
  return false;
@@ -10343,8 +10858,8 @@ var require_zod_form_validation_default = createRule({
10343
10858
  };
10344
10859
  const isFormDataGetCall = (node) => {
10345
10860
  const callee = node.callee;
10346
- if (callee.type !== import_utils66.AST_NODE_TYPES.MemberExpression) return false;
10347
- if (callee.property.type !== import_utils66.AST_NODE_TYPES.Identifier || callee.property.name !== "get") {
10861
+ if (callee.type !== import_utils67.AST_NODE_TYPES.MemberExpression) return false;
10862
+ if (callee.property.type !== import_utils67.AST_NODE_TYPES.Identifier || callee.property.name !== "get") {
10348
10863
  return false;
10349
10864
  }
10350
10865
  return isFormSourceIdentifier(callee.object);
@@ -10359,11 +10874,11 @@ var require_zod_form_validation_default = createRule({
10359
10874
  };
10360
10875
  const isInstanceofNarrowing = (node) => {
10361
10876
  const parent = node.parent;
10362
- return parent !== null && parent !== void 0 && parent.type === import_utils66.AST_NODE_TYPES.BinaryExpression && parent.operator === "instanceof" && parent.left === node && parent.right.type === import_utils66.AST_NODE_TYPES.Identifier && (parent.right.name === "File" || parent.right.name === "Blob");
10877
+ return parent !== null && parent !== void 0 && parent.type === import_utils67.AST_NODE_TYPES.BinaryExpression && parent.operator === "instanceof" && parent.left === node && parent.right.type === import_utils67.AST_NODE_TYPES.Identifier && (parent.right.name === "File" || parent.right.name === "Blob");
10363
10878
  };
10364
10879
  const boundDeclarator = (node) => {
10365
10880
  const parent = node.parent;
10366
- if (parent.type === import_utils66.AST_NODE_TYPES.VariableDeclarator && parent.init === node && parent.id.type === import_utils66.AST_NODE_TYPES.Identifier) {
10881
+ if (parent.type === import_utils67.AST_NODE_TYPES.VariableDeclarator && parent.init === node && parent.id.type === import_utils67.AST_NODE_TYPES.Identifier) {
10367
10882
  return parent;
10368
10883
  }
10369
10884
  return null;
@@ -10391,7 +10906,7 @@ var require_zod_form_validation_default = createRule({
10391
10906
  });
10392
10907
 
10393
10908
  // src/rules/store-insert-requires-on-conflict.ts
10394
- var import_utils67 = require("@typescript-eslint/utils");
10909
+ var import_utils68 = require("@typescript-eslint/utils");
10395
10910
  var INSERT_WRITE = /\bINSERT\s+(?:OR\s+\w+\s+)?INTO\s+[\w."'`?$:@-]+\s*(?:\([^)]*\)\s*)?(?:VALUES|SELECT|DEFAULT\s+VALUES)\b/i;
10396
10911
  var CONFLICT_HANDLED = /\bON\s+CONFLICT\b|\bON\s+DUPLICATE\s+KEY\b|\bINSERT\s+OR\s+(?:IGNORE|REPLACE)\b/i;
10397
10912
  var INSERT_GATE = /insert/i;
@@ -10421,8 +10936,395 @@ var store_insert_requires_on_conflict_default = createRule({
10421
10936
  }
10422
10937
  });
10423
10938
 
10939
+ // src/rules/stepdown.ts
10940
+ var import_utils69 = require("@typescript-eslint/utils");
10941
+ function isFunction(node) {
10942
+ return node.type === import_utils69.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils69.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils69.AST_NODE_TYPES.FunctionExpression;
10943
+ }
10944
+ function cycleComponents(graph) {
10945
+ const nodes = /* @__PURE__ */ new Set();
10946
+ const reverse = /* @__PURE__ */ new Map();
10947
+ for (const [caller, callees] of graph) {
10948
+ nodes.add(caller);
10949
+ for (const callee of callees) {
10950
+ nodes.add(callee);
10951
+ const incoming = reverse.get(callee) ?? /* @__PURE__ */ new Set();
10952
+ incoming.add(caller);
10953
+ reverse.set(callee, incoming);
10954
+ }
10955
+ }
10956
+ const seen = /* @__PURE__ */ new Set();
10957
+ const finishOrder = [];
10958
+ for (const root of nodes) {
10959
+ if (seen.has(root)) continue;
10960
+ const pending = [
10961
+ { name: root, exiting: false }
10962
+ ];
10963
+ while (pending.length > 0) {
10964
+ const current = pending.pop();
10965
+ if (current === void 0) break;
10966
+ if (current.exiting) {
10967
+ finishOrder.push(current.name);
10968
+ continue;
10969
+ }
10970
+ if (seen.has(current.name)) continue;
10971
+ seen.add(current.name);
10972
+ pending.push({ name: current.name, exiting: true });
10973
+ for (const callee of graph.get(current.name) ?? []) {
10974
+ if (!seen.has(callee)) pending.push({ name: callee, exiting: false });
10975
+ }
10976
+ }
10977
+ }
10978
+ const components = /* @__PURE__ */ new Map();
10979
+ let nextComponent = 0;
10980
+ const assigned = /* @__PURE__ */ new Set();
10981
+ for (let index = finishOrder.length - 1; index >= 0; index -= 1) {
10982
+ const root = finishOrder[index];
10983
+ if (root === void 0 || assigned.has(root)) continue;
10984
+ const members = [];
10985
+ const pending = [root];
10986
+ assigned.add(root);
10987
+ while (pending.length > 0) {
10988
+ const member = pending.pop();
10989
+ if (member === void 0) break;
10990
+ members.push(member);
10991
+ for (const caller of reverse.get(member) ?? []) {
10992
+ if (!assigned.has(caller)) {
10993
+ assigned.add(caller);
10994
+ pending.push(caller);
10995
+ }
10996
+ }
10997
+ }
10998
+ if (members.length > 1) {
10999
+ for (const cyclicName of members) components.set(cyclicName, nextComponent);
11000
+ nextComponent += 1;
11001
+ }
11002
+ }
11003
+ return components;
11004
+ }
11005
+ function reportMisordered(context, candidates, scopeDefinitions, calls, pinned) {
11006
+ const byName = new Map(scopeDefinitions.map((definition) => [definition.name, definition]));
11007
+ const cycles = cycleComponents(calls);
11008
+ const callers = /* @__PURE__ */ new Map();
11009
+ for (const [caller, callees] of calls) {
11010
+ for (const callee of callees) {
11011
+ if (caller === callee) continue;
11012
+ const names = callers.get(callee) ?? /* @__PURE__ */ new Set();
11013
+ names.add(caller);
11014
+ callers.set(callee, names);
11015
+ }
11016
+ }
11017
+ for (const helper of candidates) {
11018
+ const helperCallers = [...callers.get(helper.name) ?? []];
11019
+ if (pinned.has(helper.name) || helperCallers.length !== 1) continue;
11020
+ const callerName = helperCallers[0];
11021
+ if (callerName === void 0 || cycles.has(helper.name) && cycles.get(helper.name) === cycles.get(callerName)) continue;
11022
+ const caller = byName.get(callerName);
11023
+ if (caller === void 0 || helper.node.range[0] >= caller.node.range[0]) continue;
11024
+ context.report({
11025
+ node: helper.node,
11026
+ messageId: "helperAboveOnlyCaller",
11027
+ data: { helper: helper.name, caller: callerName }
11028
+ });
11029
+ }
11030
+ }
11031
+ function exportedNames(program) {
11032
+ const names = /* @__PURE__ */ new Set();
11033
+ for (const statement of program.body) {
11034
+ if (statement.type !== import_utils69.AST_NODE_TYPES.ExportNamedDeclaration || statement.exportKind === "type" || statement.source !== null) continue;
11035
+ if (statement.declaration?.type === import_utils69.AST_NODE_TYPES.FunctionDeclaration && statement.declaration.id !== null) {
11036
+ names.add(statement.declaration.id.name);
11037
+ }
11038
+ if (statement.declaration?.type === import_utils69.AST_NODE_TYPES.VariableDeclaration) {
11039
+ for (const declarator of statement.declaration.declarations) {
11040
+ if (declarator.id.type === import_utils69.AST_NODE_TYPES.Identifier) names.add(declarator.id.name);
11041
+ }
11042
+ }
11043
+ for (const specifier of statement.specifiers) {
11044
+ if (specifier.exportKind !== "type" && specifier.local.type === import_utils69.AST_NODE_TYPES.Identifier) {
11045
+ names.add(specifier.local.name);
11046
+ }
11047
+ }
11048
+ }
11049
+ for (const statement of program.body) {
11050
+ if (statement.type === import_utils69.AST_NODE_TYPES.ExportDefaultDeclaration && statement.declaration.type === import_utils69.AST_NODE_TYPES.Identifier) names.add(statement.declaration.name);
11051
+ if (statement.type === import_utils69.AST_NODE_TYPES.ExportDefaultDeclaration && statement.declaration.type === import_utils69.AST_NODE_TYPES.FunctionDeclaration && statement.declaration.id !== null) names.add(statement.declaration.id.name);
11052
+ }
11053
+ return names;
11054
+ }
11055
+ function moduleDefinitions(program) {
11056
+ const definitions = [];
11057
+ for (const statement of program.body) {
11058
+ const node = statement.type === import_utils69.AST_NODE_TYPES.ExportNamedDeclaration || statement.type === import_utils69.AST_NODE_TYPES.ExportDefaultDeclaration ? statement.declaration : statement;
11059
+ if (node?.type === import_utils69.AST_NODE_TYPES.FunctionDeclaration && node.id !== null && node.body !== null) {
11060
+ definitions.push({ name: node.id.name, node, functionNode: node, bindingNode: node });
11061
+ continue;
11062
+ }
11063
+ if (node?.type !== import_utils69.AST_NODE_TYPES.VariableDeclaration || node.kind !== "const") continue;
11064
+ for (const declarator of node.declarations) {
11065
+ if (declarator.id.type === import_utils69.AST_NODE_TYPES.Identifier && declarator.init !== null && isFunction(declarator.init)) {
11066
+ definitions.push({
11067
+ name: declarator.id.name,
11068
+ node: declarator,
11069
+ functionNode: declarator.init,
11070
+ bindingNode: declarator
11071
+ });
11072
+ }
11073
+ }
11074
+ }
11075
+ return definitions;
11076
+ }
11077
+ function moduleScope(context, program) {
11078
+ const declarations = moduleDefinitions(program);
11079
+ const counts = /* @__PURE__ */ new Map();
11080
+ for (const node of declarations) counts.set(node.name, (counts.get(node.name) ?? 0) + 1);
11081
+ const overloadNames = new Set(
11082
+ program.body.flatMap((statement) => {
11083
+ const node = statement.type === import_utils69.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
11084
+ return node?.type === import_utils69.AST_NODE_TYPES.TSDeclareFunction && node.id !== null ? [node.id.name] : [];
11085
+ })
11086
+ );
11087
+ const exported = exportedNames(program);
11088
+ const scopeDefinitions = declarations.filter((node) => counts.get(node.name) === 1 && !overloadNames.has(node.name));
11089
+ const definitions = scopeDefinitions.filter((definition) => !exported.has(definition.name));
11090
+ const byFunction = new Map(scopeDefinitions.map((definition) => [definition.functionNode, definition]));
11091
+ const calls = /* @__PURE__ */ new Map();
11092
+ const pinned = /* @__PURE__ */ new Set();
11093
+ for (const definition of scopeDefinitions) {
11094
+ const variable = context.sourceCode.getDeclaredVariables(definition.bindingNode)[0];
11095
+ for (const reference of variable?.references ?? []) {
11096
+ if (reference.isWrite() && reference.init !== true) {
11097
+ pinned.add(definition.name);
11098
+ continue;
11099
+ }
11100
+ if (!reference.isRead()) continue;
11101
+ const identifier = reference.identifier;
11102
+ const ancestors = context.sourceCode.getAncestors(identifier);
11103
+ const nearestFunction = [...ancestors].reverse().find(isFunction);
11104
+ const parent = identifier.parent;
11105
+ const callerDefinition = nearestFunction === void 0 ? void 0 : byFunction.get(nearestFunction);
11106
+ if (callerDefinition === void 0 || parent.type !== import_utils69.AST_NODE_TYPES.CallExpression || parent.callee !== identifier) {
11107
+ pinned.add(definition.name);
11108
+ continue;
11109
+ }
11110
+ const caller = callerDefinition.name;
11111
+ const callees = calls.get(caller) ?? /* @__PURE__ */ new Set();
11112
+ callees.add(definition.name);
11113
+ calls.set(caller, callees);
11114
+ }
11115
+ }
11116
+ reportMisordered(context, definitions, scopeDefinitions, calls, pinned);
11117
+ }
11118
+ function methodName(node) {
11119
+ if (node.key.type === import_utils69.AST_NODE_TYPES.PrivateIdentifier) return `#${node.key.name}`;
11120
+ return !node.computed && node.key.type === import_utils69.AST_NODE_TYPES.Identifier ? node.key.name : null;
11121
+ }
11122
+ function referencedMethod(context, node, classVariables) {
11123
+ const objectVariable = node.object.type === import_utils69.AST_NODE_TYPES.Identifier ? import_utils69.ASTUtils.findVariable(context.sourceCode.getScope(node.object), node.object.name) : null;
11124
+ const isClassReference = objectVariable !== null && classVariables.has(objectVariable);
11125
+ if (node.object.type !== import_utils69.AST_NODE_TYPES.ThisExpression && !isClassReference) return null;
11126
+ if (node.property.type === import_utils69.AST_NODE_TYPES.PrivateIdentifier) return `#${node.property.name}`;
11127
+ if (!node.computed && node.property.type === import_utils69.AST_NODE_TYPES.Identifier) return node.property.name;
11128
+ return node.computed && node.property.type === import_utils69.AST_NODE_TYPES.Literal && typeof node.property.value === "string" ? node.property.value : null;
11129
+ }
11130
+ function referencedPropertyName(node) {
11131
+ if (node.property.type === import_utils69.AST_NODE_TYPES.PrivateIdentifier) return `#${node.property.name}`;
11132
+ if (!node.computed && node.property.type === import_utils69.AST_NODE_TYPES.Identifier) return node.property.name;
11133
+ return node.computed && node.property.type === import_utils69.AST_NODE_TYPES.Literal && typeof node.property.value === "string" ? node.property.value : null;
11134
+ }
11135
+ function walk(node, visitorKeys, visit, nestedFunction = false) {
11136
+ visit(node, nestedFunction);
11137
+ const nested = nestedFunction || isFunction(node);
11138
+ for (const key of visitorKeys[node.type] ?? []) {
11139
+ const child = node[key];
11140
+ if (Array.isArray(child)) {
11141
+ for (const item of child) if (typeof item === "object" && item !== null && "type" in item) walk(item, visitorKeys, visit, nested);
11142
+ } else if (typeof child === "object" && child !== null && "type" in child) {
11143
+ walk(child, visitorKeys, visit, nested);
11144
+ }
11145
+ }
11146
+ }
11147
+ function classScope(context, node, computedReferenceNames) {
11148
+ const methods = node.body.body.filter(
11149
+ (member) => member.type === import_utils69.AST_NODE_TYPES.MethodDefinition
11150
+ );
11151
+ const counts = /* @__PURE__ */ new Map();
11152
+ for (const method of methods) {
11153
+ const name = methodName(method);
11154
+ if (name !== null) counts.set(name, (counts.get(name) ?? 0) + 1);
11155
+ }
11156
+ for (const member of node.body.body) {
11157
+ if (member.type !== import_utils69.AST_NODE_TYPES.TSAbstractMethodDefinition) continue;
11158
+ const name = !member.computed && member.key.type === import_utils69.AST_NODE_TYPES.Identifier ? member.key.name : null;
11159
+ if (name !== null) counts.set(name, (counts.get(name) ?? 0) + 1);
11160
+ }
11161
+ const scopeDefinitions = methods.flatMap((method) => {
11162
+ const name = methodName(method);
11163
+ return name !== null && counts.get(name) === 1 ? [{ name, node: method }] : [];
11164
+ });
11165
+ const definitions = methods.flatMap((method) => {
11166
+ const name = methodName(method);
11167
+ const isPrivate = method.accessibility === "private" || method.key.type === import_utils69.AST_NODE_TYPES.PrivateIdentifier;
11168
+ return name !== null && isPrivate && counts.get(name) === 1 && method.decorators.length === 0 ? [{ name, node: method }] : [];
11169
+ });
11170
+ if (definitions.length === 0) return;
11171
+ const privateNames = new Set(definitions.map((definition) => definition.name));
11172
+ const calls = /* @__PURE__ */ new Map();
11173
+ const pinned = /* @__PURE__ */ new Set();
11174
+ const classVariables = /* @__PURE__ */ new Set();
11175
+ if (node.id !== null) {
11176
+ const internal = import_utils69.ASTUtils.findVariable(context.sourceCode.getScope(node), node.id.name);
11177
+ if (internal !== null) classVariables.add(internal);
11178
+ }
11179
+ if (node.type === import_utils69.AST_NODE_TYPES.ClassExpression && node.parent.type === import_utils69.AST_NODE_TYPES.VariableDeclarator && node.parent.id.type === import_utils69.AST_NODE_TYPES.Identifier) {
11180
+ const outer = import_utils69.ASTUtils.findVariable(context.sourceCode.getScope(node.parent), node.parent.id.name);
11181
+ if (outer !== null) classVariables.add(outer);
11182
+ }
11183
+ for (const method of methods) {
11184
+ const caller = methodName(method);
11185
+ if (caller === null || method.value.body === null) continue;
11186
+ const methodClassVariables = new Set(classVariables);
11187
+ const methodAliases = /* @__PURE__ */ new Set();
11188
+ const parameterDecoratorNodes = /* @__PURE__ */ new Set();
11189
+ for (const parameter of method.value.params) {
11190
+ for (const decorator of parameter.decorators) {
11191
+ walk(decorator, context.sourceCode.visitorKeys, (current) => parameterDecoratorNodes.add(current));
11192
+ }
11193
+ }
11194
+ const thisValue = (value) => {
11195
+ let current = value;
11196
+ while (current?.type === import_utils69.AST_NODE_TYPES.TSAsExpression || current?.type === import_utils69.AST_NODE_TYPES.TSSatisfiesExpression || current?.type === import_utils69.AST_NODE_TYPES.TSNonNullExpression) current = current.expression;
11197
+ return current?.type === import_utils69.AST_NODE_TYPES.ThisExpression;
11198
+ };
11199
+ const collectAlias = (current, nestedFunction) => {
11200
+ if (nestedFunction || current.type !== import_utils69.AST_NODE_TYPES.VariableDeclarator && current.type !== import_utils69.AST_NODE_TYPES.AssignmentPattern) return;
11201
+ if (current.type === import_utils69.AST_NODE_TYPES.VariableDeclarator && (current.parent.type !== import_utils69.AST_NODE_TYPES.VariableDeclaration || current.parent.kind !== "const")) return;
11202
+ const binding = current.type === import_utils69.AST_NODE_TYPES.VariableDeclarator ? current.id : current.left;
11203
+ const value = current.type === import_utils69.AST_NODE_TYPES.VariableDeclarator ? current.init : current.right;
11204
+ if (!thisValue(value)) return;
11205
+ if (binding.type === import_utils69.AST_NODE_TYPES.ObjectPattern) {
11206
+ for (const property of binding.properties) {
11207
+ if (property.type === import_utils69.AST_NODE_TYPES.RestElement) {
11208
+ for (const name of privateNames) pinned.add(name);
11209
+ } else if (property.key.type === import_utils69.AST_NODE_TYPES.Identifier && privateNames.has(property.key.name)) {
11210
+ pinned.add(property.key.name);
11211
+ }
11212
+ }
11213
+ return;
11214
+ }
11215
+ if (binding.type !== import_utils69.AST_NODE_TYPES.Identifier) return;
11216
+ const variable = import_utils69.ASTUtils.findVariable(context.sourceCode.getScope(binding), binding.name);
11217
+ if (variable !== null) {
11218
+ methodClassVariables.add(variable);
11219
+ methodAliases.add(variable);
11220
+ }
11221
+ };
11222
+ for (const parameter of method.value.params) {
11223
+ walk(parameter, context.sourceCode.visitorKeys, collectAlias);
11224
+ }
11225
+ for (const statement of method.value.body.body) {
11226
+ walk(statement, context.sourceCode.visitorKeys, collectAlias);
11227
+ }
11228
+ const visitCall = (current, nestedFunction) => {
11229
+ if (current.type === import_utils69.AST_NODE_TYPES.VariableDeclarator && current.id.type === import_utils69.AST_NODE_TYPES.ObjectPattern && thisValue(current.init)) {
11230
+ for (const property of current.id.properties) {
11231
+ if (property.type === import_utils69.AST_NODE_TYPES.RestElement) {
11232
+ for (const name of privateNames) pinned.add(name);
11233
+ continue;
11234
+ }
11235
+ if (property.type === import_utils69.AST_NODE_TYPES.Property && property.key.type === import_utils69.AST_NODE_TYPES.Identifier && privateNames.has(property.key.name)) pinned.add(property.key.name);
11236
+ }
11237
+ }
11238
+ if (current.type !== import_utils69.AST_NODE_TYPES.MemberExpression) return;
11239
+ const target = referencedMethod(context, current, methodClassVariables);
11240
+ if (target === null) {
11241
+ const possibleTarget = referencedPropertyName(current);
11242
+ if (possibleTarget !== null && privateNames.has(possibleTarget)) pinned.add(possibleTarget);
11243
+ return;
11244
+ }
11245
+ if (!privateNames.has(target)) return;
11246
+ const objectVariable = current.object.type === import_utils69.AST_NODE_TYPES.Identifier ? import_utils69.ASTUtils.findVariable(context.sourceCode.getScope(current.object), current.object.name) : null;
11247
+ if (objectVariable !== null && methodAliases.has(objectVariable)) {
11248
+ pinned.add(target);
11249
+ return;
11250
+ }
11251
+ if (current.computed || nestedFunction || parameterDecoratorNodes.has(current) || current.parent.type !== import_utils69.AST_NODE_TYPES.CallExpression || current.parent.callee !== current) {
11252
+ pinned.add(target);
11253
+ return;
11254
+ }
11255
+ const callees = calls.get(caller) ?? /* @__PURE__ */ new Set();
11256
+ callees.add(target);
11257
+ calls.set(caller, callees);
11258
+ };
11259
+ for (const decorator of method.decorators) {
11260
+ walk(decorator, context.sourceCode.visitorKeys, visitCall, true);
11261
+ }
11262
+ if (method.computed) walk(method.key, context.sourceCode.visitorKeys, visitCall, true);
11263
+ for (const parameter of method.value.params) {
11264
+ walk(parameter, context.sourceCode.visitorKeys, visitCall);
11265
+ }
11266
+ for (const statement of method.value.body.body) {
11267
+ walk(statement, context.sourceCode.visitorKeys, visitCall);
11268
+ }
11269
+ }
11270
+ for (const member of node.body.body) {
11271
+ if (member.type === import_utils69.AST_NODE_TYPES.MethodDefinition || member.type === import_utils69.AST_NODE_TYPES.TSAbstractMethodDefinition) continue;
11272
+ walk(member, context.sourceCode.visitorKeys, (current) => {
11273
+ if (current.type !== import_utils69.AST_NODE_TYPES.MemberExpression) return;
11274
+ const target = referencedMethod(context, current, classVariables);
11275
+ const possibleTarget = target ?? referencedPropertyName(current);
11276
+ if (possibleTarget !== null && privateNames.has(possibleTarget)) pinned.add(possibleTarget);
11277
+ });
11278
+ }
11279
+ for (const name of privateNames) if (computedReferenceNames.has(name)) pinned.add(name);
11280
+ const accessibility = new Map(
11281
+ scopeDefinitions.map((definition) => {
11282
+ const method = definition.node;
11283
+ const accessibility2 = method.key.type === import_utils69.AST_NODE_TYPES.PrivateIdentifier ? "private" : method.accessibility ?? "public";
11284
+ return [definition.name, accessibility2];
11285
+ })
11286
+ );
11287
+ for (const [caller, callees] of calls) {
11288
+ if (accessibility.get(caller) === "private") continue;
11289
+ for (const callee of callees) pinned.add(callee);
11290
+ }
11291
+ reportMisordered(context, definitions, scopeDefinitions, calls, pinned);
11292
+ }
11293
+ var stepdown_default = createRule({
11294
+ name: "stepdown",
11295
+ meta: {
11296
+ type: "suggestion",
11297
+ docs: { description: "Place a private helper below its sole direct same-scope caller." },
11298
+ schema: [],
11299
+ messages: {
11300
+ helperAboveOnlyCaller: "Private helper `{{helper}}` is defined above its only caller `{{caller}}`; move it below the caller."
11301
+ }
11302
+ },
11303
+ defaultOptions: [],
11304
+ create(context) {
11305
+ if (isTestFile(context.filename) || isGeneratedFile(context.filename, context.sourceCode.text)) return {};
11306
+ const classes = [];
11307
+ return {
11308
+ ClassDeclaration: (node) => {
11309
+ classes.push(node);
11310
+ },
11311
+ ClassExpression: (node) => {
11312
+ classes.push(node);
11313
+ },
11314
+ "Program:exit": (program) => {
11315
+ moduleScope(context, program);
11316
+ const computedReferenceNames = /* @__PURE__ */ new Set();
11317
+ walk(program, context.sourceCode.visitorKeys, (node) => {
11318
+ if (node.type === import_utils69.AST_NODE_TYPES.MemberExpression && node.computed && node.property.type === import_utils69.AST_NODE_TYPES.Literal && typeof node.property.value === "string") computedReferenceNames.add(node.property.value);
11319
+ });
11320
+ for (const node of classes) classScope(context, node, computedReferenceNames);
11321
+ }
11322
+ };
11323
+ }
11324
+ });
11325
+
10424
11326
  // src/rules/zod-naming-convention.ts
10425
- var import_utils68 = require("@typescript-eslint/utils");
11327
+ var import_utils70 = require("@typescript-eslint/utils");
10426
11328
  var CONVENTIONS = {
10427
11329
  prefix: { test: ZOD_PREFIX_RE, messageId: "zPrefix" },
10428
11330
  suffix: { test: ZOD_SUFFIX_RE, messageId: "schemaSuffix" },
@@ -10447,15 +11349,15 @@ var NON_SCHEMA_TERMINALS = /* @__PURE__ */ new Set([
10447
11349
  "registry",
10448
11350
  "implement"
10449
11351
  ]);
10450
- var terminalMethodName = (callee) => !callee.computed && callee.property.type === import_utils68.AST_NODE_TYPES.Identifier ? callee.property.name : null;
11352
+ var terminalMethodName = (callee) => !callee.computed && callee.property.type === import_utils70.AST_NODE_TYPES.Identifier ? callee.property.name : null;
10451
11353
  var calleeChainStartsWithZ = (node) => {
10452
11354
  let current = node;
10453
- while (current.type === import_utils68.AST_NODE_TYPES.MemberExpression) {
11355
+ while (current.type === import_utils70.AST_NODE_TYPES.MemberExpression) {
10454
11356
  const receiver = current.object;
10455
- if (receiver.type === import_utils68.AST_NODE_TYPES.Identifier && receiver.name === "z") {
11357
+ if (receiver.type === import_utils70.AST_NODE_TYPES.Identifier && receiver.name === "z") {
10456
11358
  return true;
10457
11359
  }
10458
- if (receiver.type === import_utils68.AST_NODE_TYPES.CallExpression) {
11360
+ if (receiver.type === import_utils70.AST_NODE_TYPES.CallExpression) {
10459
11361
  current = receiver.callee;
10460
11362
  continue;
10461
11363
  }
@@ -10500,13 +11402,13 @@ var zod_naming_convention_default = createRule({
10500
11402
  VariableDeclarator(node) {
10501
11403
  const init = node.init;
10502
11404
  if (init === null || init === void 0) return;
10503
- if (init.type !== import_utils68.AST_NODE_TYPES.CallExpression) return;
11405
+ if (init.type !== import_utils70.AST_NODE_TYPES.CallExpression) return;
10504
11406
  const callee = init.callee;
10505
- if (callee.type !== import_utils68.AST_NODE_TYPES.MemberExpression) return;
11407
+ if (callee.type !== import_utils70.AST_NODE_TYPES.MemberExpression) return;
10506
11408
  if (!calleeChainStartsWithZ(callee)) return;
10507
11409
  const terminal = terminalMethodName(callee);
10508
11410
  if (terminal !== null && NON_SCHEMA_TERMINALS.has(terminal)) return;
10509
- if (node.id.type !== import_utils68.AST_NODE_TYPES.Identifier) return;
11411
+ if (node.id.type !== import_utils70.AST_NODE_TYPES.Identifier) return;
10510
11412
  if (test.test(node.id.name)) return;
10511
11413
  if (acceptsSchemaWord && CONTAINS_SCHEMA_RE.test(node.id.name)) return;
10512
11414
  context.report({
@@ -10591,6 +11493,7 @@ var rules = {
10591
11493
  "no-json-stringify-error": no_json_stringify_error_default,
10592
11494
  "no-log-only-catch": no_log_only_catch_default,
10593
11495
  "no-long-comment": no_long_comment_default,
11496
+ "no-generic-single-export-module": no_generic_single_export_module_default,
10594
11497
  "no-offset-pagination": no_offset_pagination_default,
10595
11498
  "no-positional-tuple-return": no_positional_tuple_return_default,
10596
11499
  "no-raw-env": no_raw_env_default,
@@ -10638,11 +11541,12 @@ var rules = {
10638
11541
  "require-static-next-matcher": require_static_next_matcher_default,
10639
11542
  "require-zod-form-validation": require_zod_form_validation_default,
10640
11543
  "store-insert-requires-on-conflict": store_insert_requires_on_conflict_default,
11544
+ "stepdown": stepdown_default,
10641
11545
  "zod-naming-convention": zod_naming_convention_default
10642
11546
  };
10643
11547
  var meta = {
10644
11548
  name: "@sarj/eslint-plugin",
10645
- version: "9.13.1"
11549
+ version: "9.14.0"
10646
11550
  };
10647
11551
  var applicationOnlyRules = [
10648
11552
  "no-restricted-library-load",
@@ -10664,6 +11568,7 @@ var recommendedRules = {
10664
11568
  "@sarj/no-json-stringify-error": "warn",
10665
11569
  "@sarj/no-log-only-catch": "warn",
10666
11570
  "@sarj/no-long-comment": "warn",
11571
+ "@sarj/no-generic-single-export-module": "warn",
10667
11572
  "@sarj/no-offset-pagination": "warn",
10668
11573
  "@sarj/no-positional-tuple-return": "warn",
10669
11574
  "@sarj/no-repeated-string-literal": "warn",
@@ -10705,6 +11610,7 @@ var recommendedRules = {
10705
11610
  "@sarj/require-static-next-matcher": "error",
10706
11611
  "@sarj/require-zod-form-validation": "error",
10707
11612
  "@sarj/store-insert-requires-on-conflict": "warn",
11613
+ "@sarj/stepdown": "warn",
10708
11614
  "@sarj/zod-naming-convention": "warn"
10709
11615
  };
10710
11616
  var strictRules = {
@@ -10723,6 +11629,7 @@ var strictRules = {
10723
11629
  "@sarj/no-json-stringify-error": "error",
10724
11630
  "@sarj/no-log-only-catch": "error",
10725
11631
  "@sarj/no-long-comment": "error",
11632
+ "@sarj/no-generic-single-export-module": "warn",
10726
11633
  "@sarj/no-offset-pagination": "error",
10727
11634
  "@sarj/no-positional-tuple-return": "error",
10728
11635
  "@sarj/no-raw-env": "error",
@@ -10767,6 +11674,7 @@ var strictRules = {
10767
11674
  "@sarj/require-static-next-matcher": "error",
10768
11675
  "@sarj/require-zod-form-validation": "error",
10769
11676
  "@sarj/store-insert-requires-on-conflict": "error",
11677
+ "@sarj/stepdown": "warn",
10770
11678
  "@sarj/zod-naming-convention": "error"
10771
11679
  };
10772
11680
  var plugin = {