@sarj/eslint-plugin 2.16.0 → 2.17.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
@@ -35,7 +35,7 @@ __export(index_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(index_exports);
37
37
 
38
- // src/rules/enforce-file-structure.ts
38
+ // src/rules/ban-loose-type-guards-in-tests.ts
39
39
  var import_utils = require("@typescript-eslint/utils");
40
40
 
41
41
  // src/rules/_paths.ts
@@ -61,27 +61,63 @@ function isScriptFile(filename) {
61
61
  return SCRIPT_FILE_RE.test(filename);
62
62
  }
63
63
 
64
+ // src/rules/ban-loose-type-guards-in-tests.ts
65
+ var ban_loose_type_guards_in_tests_default = import_utils.ESLintUtils.RuleCreator(
66
+ (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
67
+ )({
68
+ name: "ban-loose-type-guards-in-tests",
69
+ meta: {
70
+ type: "problem",
71
+ docs: {
72
+ description: "Disallow loose type guards (`typeof` and `in`) in test files. Enforce Zod schemas or strict matchers for type validation."
73
+ },
74
+ schema: [],
75
+ messages: {
76
+ banLooseTypeGuardsInTests: "Do not use `typeof` or `in` for type validation in tests. Use Zod schemas or strict assertion matchers instead."
77
+ }
78
+ },
79
+ defaultOptions: [],
80
+ create(context) {
81
+ if (!isTestFile(context.filename)) {
82
+ return {};
83
+ }
84
+ return {
85
+ UnaryExpression(node) {
86
+ if (node.operator === "typeof") {
87
+ context.report({ node, messageId: "banLooseTypeGuardsInTests" });
88
+ }
89
+ },
90
+ BinaryExpression(node) {
91
+ if (node.operator === "in") {
92
+ context.report({ node, messageId: "banLooseTypeGuardsInTests" });
93
+ }
94
+ }
95
+ };
96
+ }
97
+ });
98
+
64
99
  // src/rules/enforce-file-structure.ts
100
+ var import_utils2 = require("@typescript-eslint/utils");
65
101
  var classifyStatement = (statement) => {
66
102
  switch (statement.type) {
67
- case import_utils.AST_NODE_TYPES.ImportDeclaration:
103
+ case import_utils2.AST_NODE_TYPES.ImportDeclaration:
68
104
  return "import";
69
- case import_utils.AST_NODE_TYPES.ExportAllDeclaration:
105
+ case import_utils2.AST_NODE_TYPES.ExportAllDeclaration:
70
106
  return "reexport";
71
- case import_utils.AST_NODE_TYPES.ExportNamedDeclaration:
107
+ case import_utils2.AST_NODE_TYPES.ExportNamedDeclaration:
72
108
  return statement.declaration === null ? "reexport" : "body";
73
109
  default:
74
110
  return "body";
75
111
  }
76
112
  };
77
- var isStringDirective = (statement) => statement.type === import_utils.AST_NODE_TYPES.ExpressionStatement && statement.expression.type === import_utils.AST_NODE_TYPES.Literal && typeof statement.expression.value === "string" && statement.expression.value.startsWith("use ");
113
+ var isStringDirective = (statement) => statement.type === import_utils2.AST_NODE_TYPES.ExpressionStatement && statement.expression.type === import_utils2.AST_NODE_TYPES.Literal && typeof statement.expression.value === "string" && statement.expression.value.startsWith("use ");
78
114
  var isUseServerDirective = (statement) => {
79
- if (statement.type !== import_utils.AST_NODE_TYPES.ExpressionStatement) return false;
115
+ if (statement.type !== import_utils2.AST_NODE_TYPES.ExpressionStatement) return false;
80
116
  const expr = statement.expression;
81
- if (expr.type !== import_utils.AST_NODE_TYPES.Literal) return false;
117
+ if (expr.type !== import_utils2.AST_NODE_TYPES.Literal) return false;
82
118
  return expr.value === "use server";
83
119
  };
84
- var enforce_file_structure_default = import_utils.ESLintUtils.RuleCreator(
120
+ var enforce_file_structure_default = import_utils2.ESLintUtils.RuleCreator(
85
121
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
86
122
  )({
87
123
  name: "enforce-file-structure",
@@ -141,7 +177,7 @@ var enforce_file_structure_default = import_utils.ESLintUtils.RuleCreator(
141
177
  });
142
178
 
143
179
  // src/rules/no-client-side-data-fetching.ts
144
- var import_utils2 = require("@typescript-eslint/utils");
180
+ var import_utils3 = require("@typescript-eslint/utils");
145
181
  var FETCH_LIBS = /* @__PURE__ */ new Set(["axios", "ky", "superagent"]);
146
182
  var HTTP_METHOD_NAMES = /* @__PURE__ */ new Set([
147
183
  "get",
@@ -165,25 +201,25 @@ var ANALYTICS_SEGMENTS = /* @__PURE__ */ new Set([
165
201
  ]);
166
202
  function isEffectHookCall(node) {
167
203
  const callee = node.callee;
168
- if (callee.type === import_utils2.AST_NODE_TYPES.Identifier) {
204
+ if (callee.type === import_utils3.AST_NODE_TYPES.Identifier) {
169
205
  return callee.name === "useEffect" || callee.name === "useLayoutEffect";
170
206
  }
171
- if (callee.type === import_utils2.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils2.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === import_utils2.AST_NODE_TYPES.Identifier) {
207
+ if (callee.type === import_utils3.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils3.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === import_utils3.AST_NODE_TYPES.Identifier) {
172
208
  return callee.property.name === "useEffect" || callee.property.name === "useLayoutEffect";
173
209
  }
174
210
  return false;
175
211
  }
176
212
  function readMethodProperty(optionsArg) {
177
- if (!optionsArg || optionsArg.type !== import_utils2.AST_NODE_TYPES.ObjectExpression) {
213
+ if (!optionsArg || optionsArg.type !== import_utils3.AST_NODE_TYPES.ObjectExpression) {
178
214
  return null;
179
215
  }
180
216
  for (const prop of optionsArg.properties) {
181
- if (prop.type !== import_utils2.AST_NODE_TYPES.Property) continue;
217
+ if (prop.type !== import_utils3.AST_NODE_TYPES.Property) continue;
182
218
  if (prop.computed) continue;
183
219
  const key = prop.key;
184
- const matchesMethodKey = key.type === import_utils2.AST_NODE_TYPES.Identifier && key.name === "method" || key.type === import_utils2.AST_NODE_TYPES.Literal && key.value === "method";
220
+ const matchesMethodKey = key.type === import_utils3.AST_NODE_TYPES.Identifier && key.name === "method" || key.type === import_utils3.AST_NODE_TYPES.Literal && key.value === "method";
185
221
  if (!matchesMethodKey) continue;
186
- if (prop.value.type === import_utils2.AST_NODE_TYPES.Literal && typeof prop.value.value === "string") {
222
+ if (prop.value.type === import_utils3.AST_NODE_TYPES.Literal && typeof prop.value.value === "string") {
187
223
  return prop.value.value.toUpperCase();
188
224
  }
189
225
  return null;
@@ -192,23 +228,23 @@ function readMethodProperty(optionsArg) {
192
228
  }
193
229
  function isFetchCall(node) {
194
230
  const callee = node.callee;
195
- if (callee.type === import_utils2.AST_NODE_TYPES.Identifier && callee.name === "fetch") {
231
+ if (callee.type === import_utils3.AST_NODE_TYPES.Identifier && callee.name === "fetch") {
196
232
  const method = readMethodProperty(node.arguments[1]);
197
233
  if (method !== null && method !== "GET") {
198
234
  return false;
199
235
  }
200
236
  return true;
201
237
  }
202
- if (callee.type === import_utils2.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils2.AST_NODE_TYPES.Identifier && FETCH_LIBS.has(callee.object.name) && callee.property.type === import_utils2.AST_NODE_TYPES.Identifier) {
238
+ if (callee.type === import_utils3.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === import_utils3.AST_NODE_TYPES.Identifier && FETCH_LIBS.has(callee.object.name) && callee.property.type === import_utils3.AST_NODE_TYPES.Identifier) {
203
239
  return HTTP_METHOD_NAMES.has(callee.property.name);
204
240
  }
205
- if (callee.type === import_utils2.AST_NODE_TYPES.Identifier && (callee.name === "axios" || callee.name === "ky")) {
241
+ if (callee.type === import_utils3.AST_NODE_TYPES.Identifier && (callee.name === "axios" || callee.name === "ky")) {
206
242
  const firstArg = node.arguments[0];
207
243
  const secondArg = node.arguments[1];
208
244
  let configArg;
209
- if (firstArg?.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
245
+ if (firstArg?.type === import_utils3.AST_NODE_TYPES.ObjectExpression) {
210
246
  configArg = firstArg;
211
- } else if (secondArg?.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
247
+ } else if (secondArg?.type === import_utils3.AST_NODE_TYPES.ObjectExpression) {
212
248
  configArg = secondArg;
213
249
  }
214
250
  const method = readMethodProperty(configArg);
@@ -222,13 +258,13 @@ function isFetchCall(node) {
222
258
  function extractUrlString(node) {
223
259
  const firstArg = node.arguments[0];
224
260
  if (!firstArg) return "";
225
- if (firstArg.type === import_utils2.AST_NODE_TYPES.Literal && typeof firstArg.value === "string") {
261
+ if (firstArg.type === import_utils3.AST_NODE_TYPES.Literal && typeof firstArg.value === "string") {
226
262
  return firstArg.value;
227
263
  }
228
- if (firstArg.type === import_utils2.AST_NODE_TYPES.TemplateLiteral) {
264
+ if (firstArg.type === import_utils3.AST_NODE_TYPES.TemplateLiteral) {
229
265
  return firstArg.quasis.map((q) => q.value.cooked).join("");
230
266
  }
231
- if (firstArg.type === import_utils2.AST_NODE_TYPES.Identifier) {
267
+ if (firstArg.type === import_utils3.AST_NODE_TYPES.Identifier) {
232
268
  return firstArg.name;
233
269
  }
234
270
  return "";
@@ -238,7 +274,7 @@ function isAnalyticsCall(node) {
238
274
  if (url === "") return false;
239
275
  return url.split(/[/.]/).some((segment) => ANALYTICS_SEGMENTS.has(segment));
240
276
  }
241
- var no_client_side_data_fetching_default = import_utils2.ESLintUtils.RuleCreator(
277
+ var no_client_side_data_fetching_default = import_utils3.ESLintUtils.RuleCreator(
242
278
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
243
279
  )({
244
280
  name: "no-client-side-data-fetching",
@@ -276,10 +312,10 @@ var no_client_side_data_fetching_default = import_utils2.ESLintUtils.RuleCreator
276
312
  });
277
313
 
278
314
  // src/rules/no-comment-cruft.ts
279
- var import_utils4 = require("@typescript-eslint/utils");
315
+ var import_utils5 = require("@typescript-eslint/utils");
280
316
 
281
317
  // src/rules/_comments.ts
282
- var import_utils3 = require("@typescript-eslint/utils");
318
+ var import_utils4 = require("@typescript-eslint/utils");
283
319
  var REF_RE = /https?:\/\/|\bRFC[- ]?\d+|\bPEP[- ]?\d+|\bCVE-\d{4}|\b(?!UTF-|SHA-|ISO-|AES-|CRC-|MD-|PCM-|EOF-|API-|BASE-)[A-Z][A-Z0-9]{1,9}-\d[A-Z0-9]{0,5}\b|(?<![&\w])#\d{2,6}\b|@[a-z][\w.-]*\.(?:us|com|ai|io|net|org|dev)\b/;
284
320
  var VERSION_RE = /(?:>=|<=|==|<|>)\s*v?\d+\.\d+|\bv\d+\.\d+|\b(?:since|until|as of)\s+(?:v?\d+\.\d+|Python\s*\d)/i;
285
321
  var UNITS_RE = /[~<>]?\d+(?:\.\d+)?\s?(?:ms|s\b|sec\b|seconds?\b|min\b|minutes?\b|hours?\b|days?\b|KB|MB|MiB|GiB|kHz|Hz|bytes?\b|bit\b|-bit\b|%|px\b|rps\b|qps\b)|\b[1-5]xx\b|\b(?:301|302|304|307|308|400|401|403|404|405|409|410|412|422|425|429|500|501|502|503|504)\b/;
@@ -365,10 +401,10 @@ var NARRATION_MAX_WORDS = 6;
365
401
  var NARRATION_MIN_CONTENT = 1;
366
402
  var TOKEN_PLURAL_MIN = 4;
367
403
  var RESTATABLE_STATEMENTS = /* @__PURE__ */ new Set([
368
- import_utils3.AST_NODE_TYPES.ExpressionStatement,
369
- import_utils3.AST_NODE_TYPES.ReturnStatement,
370
- import_utils3.AST_NODE_TYPES.ThrowStatement,
371
- import_utils3.AST_NODE_TYPES.VariableDeclaration
404
+ import_utils4.AST_NODE_TYPES.ExpressionStatement,
405
+ import_utils4.AST_NODE_TYPES.ReturnStatement,
406
+ import_utils4.AST_NODE_TYPES.ThrowStatement,
407
+ import_utils4.AST_NODE_TYPES.VariableDeclaration
372
408
  ]);
373
409
  var NARRATION_VERB_RE = /^(?:add|append|assign|build|calculate|call|check|clear|close|compute|convert|copy|count|create|declare|decrement|define|delete|extract|fetch|filter|find|format|generate|get|handle|increment|init|initialise|initialize|insert|iterate|join|load|log|loop|make|map|merge|open|parse|print|process|push|read|remove|render|reset|return|save|send|set|setup|sort|split|start|stop|store|update|validate|wrap|write)(?:s|es|d|ed|ing)?$/i;
374
410
  var NARRATION_STOPWORDS = /* @__PURE__ */ new Set([
@@ -433,19 +469,19 @@ function headTokens(source) {
433
469
  function isTrivialInitializer(node) {
434
470
  return node.declarations.every((declarator) => {
435
471
  const init = declarator.init;
436
- if (init == null || init.type === import_utils3.AST_NODE_TYPES.Literal) return true;
437
- return init.type === import_utils3.AST_NODE_TYPES.ArrayExpression && init.elements.length === 0 || init.type === import_utils3.AST_NODE_TYPES.ObjectExpression && init.properties.length === 0;
472
+ if (init == null || init.type === import_utils4.AST_NODE_TYPES.Literal) return true;
473
+ return init.type === import_utils4.AST_NODE_TYPES.ArrayExpression && init.elements.length === 0 || init.type === import_utils4.AST_NODE_TYPES.ObjectExpression && init.properties.length === 0;
438
474
  });
439
475
  }
440
476
  function restatableStatementBelow(comment, sourceCode) {
441
477
  const token = sourceCode.getTokenAfter(comment, { includeComments: false });
442
478
  if (token === null || token.loc.start.line !== comment.loc.end.line + 1) return null;
443
- for (let node = sourceCode.getNodeByRangeIndex(token.range[0]); node != null && node.type !== import_utils3.AST_NODE_TYPES.Program; node = node.parent) {
479
+ for (let node = sourceCode.getNodeByRangeIndex(token.range[0]); node != null && node.type !== import_utils4.AST_NODE_TYPES.Program; node = node.parent) {
444
480
  if (!RESTATABLE_STATEMENTS.has(node.type)) continue;
445
481
  if (node.loc.start.line !== token.loc.start.line || node.loc.end.line !== node.loc.start.line) {
446
482
  return null;
447
483
  }
448
- if (node.type === import_utils3.AST_NODE_TYPES.VariableDeclaration && isTrivialInitializer(node)) {
484
+ if (node.type === import_utils4.AST_NODE_TYPES.VariableDeclaration && isTrivialInitializer(node)) {
449
485
  return null;
450
486
  }
451
487
  return sourceCode.getText(node);
@@ -598,13 +634,13 @@ function isRedundantNarration(body, statementBelow, standalone, isolatedEnumerat
598
634
  return restatesStatementHead(t, statementBelow);
599
635
  }
600
636
  var STATEMENT_CONTAINERS = /* @__PURE__ */ new Set([
601
- import_utils4.AST_NODE_TYPES.Program,
602
- import_utils4.AST_NODE_TYPES.BlockStatement,
603
- import_utils4.AST_NODE_TYPES.ClassBody,
604
- import_utils4.AST_NODE_TYPES.StaticBlock,
605
- import_utils4.AST_NODE_TYPES.SwitchCase,
606
- import_utils4.AST_NODE_TYPES.TSModuleBlock,
607
- import_utils4.AST_NODE_TYPES.TSInterfaceBody
637
+ import_utils5.AST_NODE_TYPES.Program,
638
+ import_utils5.AST_NODE_TYPES.BlockStatement,
639
+ import_utils5.AST_NODE_TYPES.ClassBody,
640
+ import_utils5.AST_NODE_TYPES.StaticBlock,
641
+ import_utils5.AST_NODE_TYPES.SwitchCase,
642
+ import_utils5.AST_NODE_TYPES.TSModuleBlock,
643
+ import_utils5.AST_NODE_TYPES.TSInterfaceBody
608
644
  ]);
609
645
  function runCitesAReference(comments, index) {
610
646
  for (let i = index; i >= 0; i--) {
@@ -645,7 +681,7 @@ function hasCommentedOutCode(texts, precedingProse) {
645
681
  }
646
682
  return false;
647
683
  }
648
- var no_comment_cruft_default = import_utils4.ESLintUtils.RuleCreator(
684
+ var no_comment_cruft_default = import_utils5.ESLintUtils.RuleCreator(
649
685
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
650
686
  )({
651
687
  name: "no-comment-cruft",
@@ -752,7 +788,7 @@ var no_comment_cruft_default = import_utils4.ESLintUtils.RuleCreator(
752
788
  });
753
789
 
754
790
  // src/rules/no-enum.ts
755
- var import_utils5 = require("@typescript-eslint/utils");
791
+ var import_utils6 = require("@typescript-eslint/utils");
756
792
  var DEFAULT_IGNORE_PATTERNS = [
757
793
  /[\\/]generated[\\/]/,
758
794
  /[\\/]openapi-gen[\\/]/,
@@ -772,7 +808,7 @@ function hasGeneratedMarker(sourceText) {
772
808
  const head = sourceText.slice(0, 1024);
773
809
  return /@generated\b/.test(head);
774
810
  }
775
- var no_enum_default = import_utils5.ESLintUtils.RuleCreator(
811
+ var no_enum_default = import_utils6.ESLintUtils.RuleCreator(
776
812
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
777
813
  )({
778
814
  name: "no-enum",
@@ -823,7 +859,7 @@ var no_enum_default = import_utils5.ESLintUtils.RuleCreator(
823
859
  });
824
860
 
825
861
  // src/rules/no-insecure-random-id.ts
826
- var import_utils6 = require("@typescript-eslint/utils");
862
+ var import_utils7 = require("@typescript-eslint/utils");
827
863
  var STRONG_SECURITY_PATTERN = /token|secret|csrf|password|passwd|apikey|api[-_]?key|nonce|salt|uuid|authid/i;
828
864
  var NON_SECURITY_ID_PATTERN = /temp|tmp|cache|correlation|request|req|trace|execution|dev|hmr|mock|test|perf|marker/i;
829
865
  var PATH_OR_DOM_MARKER = /[\\/#]|\.[A-Za-z0-9]/;
@@ -964,7 +1000,7 @@ function isConcatenatedIntoPathOrDomId(node) {
964
1000
  collectStaticStringParts(top, parts);
965
1001
  return parts.some((part) => PATH_OR_DOM_MARKER.test(part));
966
1002
  }
967
- var no_insecure_random_id_default = import_utils6.ESLintUtils.RuleCreator(
1003
+ var no_insecure_random_id_default = import_utils7.ESLintUtils.RuleCreator(
968
1004
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
969
1005
  )({
970
1006
  name: "no-insecure-random-id",
@@ -1008,7 +1044,7 @@ var no_insecure_random_id_default = import_utils6.ESLintUtils.RuleCreator(
1008
1044
  });
1009
1045
 
1010
1046
  // src/rules/no-json-stringify-error.ts
1011
- var import_utils7 = require("@typescript-eslint/utils");
1047
+ var import_utils8 = require("@typescript-eslint/utils");
1012
1048
  var ERROR_NAME_PATTERN = /^(e|err|error|ex|exc)$/i;
1013
1049
  var ERROR_PROP_PATTERN = /^(cause|lastError|error|err|exception|originalError|innerError)$/i;
1014
1050
  var SAFE_STRING_PROPS = /* @__PURE__ */ new Set(["message", "stack", "name"]);
@@ -1142,7 +1178,7 @@ function isGuardedByInstanceofError(node, argExpr, sourceCode) {
1142
1178
  function isJsonStringify(callee) {
1143
1179
  return callee.type === "MemberExpression" && !callee.computed && callee.object.type === "Identifier" && callee.object.name === "JSON" && callee.property.type === "Identifier" && callee.property.name === "stringify";
1144
1180
  }
1145
- var no_json_stringify_error_default = import_utils7.ESLintUtils.RuleCreator(
1181
+ var no_json_stringify_error_default = import_utils8.ESLintUtils.RuleCreator(
1146
1182
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
1147
1183
  )({
1148
1184
  name: "no-json-stringify-error",
@@ -1192,10 +1228,10 @@ var no_json_stringify_error_default = import_utils7.ESLintUtils.RuleCreator(
1192
1228
  });
1193
1229
 
1194
1230
  // src/rules/no-log-only-catch.ts
1195
- var import_utils9 = require("@typescript-eslint/utils");
1231
+ var import_utils10 = require("@typescript-eslint/utils");
1196
1232
 
1197
1233
  // src/rules/_logging.ts
1198
- var import_utils8 = require("@typescript-eslint/utils");
1234
+ var import_utils9 = require("@typescript-eslint/utils");
1199
1235
  var LOG_METHODS = /* @__PURE__ */ new Set([
1200
1236
  "debug",
1201
1237
  "info",
@@ -1302,7 +1338,7 @@ var DEFAULT_IGNORE_PATTERNS2 = [
1302
1338
  /\.spec\./,
1303
1339
  /[\\/]__tests__[\\/]/
1304
1340
  ];
1305
- var no_log_only_catch_default = import_utils9.ESLintUtils.RuleCreator(
1341
+ var no_log_only_catch_default = import_utils10.ESLintUtils.RuleCreator(
1306
1342
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
1307
1343
  )({
1308
1344
  name: "no-log-only-catch",
@@ -1365,7 +1401,7 @@ var no_log_only_catch_default = import_utils9.ESLintUtils.RuleCreator(
1365
1401
  });
1366
1402
 
1367
1403
  // src/rules/no-raw-env.ts
1368
- var import_utils10 = require("@typescript-eslint/utils");
1404
+ var import_utils11 = require("@typescript-eslint/utils");
1369
1405
  var CONFIG_FILE_RE = /(^|[\\/])[\w.-]+\.config\.[cm]?[jt]sx?$/;
1370
1406
  var ENV_BOUNDARY_FILE_RE = /(^|[\\/])(?:env|client-env|server-env|client-settings|server-settings)\.[cm]?[jt]sx?$/;
1371
1407
  function isValidatedEnvBoundary(filename, sourceText) {
@@ -1403,7 +1439,7 @@ function isWholeEnvSpread(node) {
1403
1439
  const parent = node.parent;
1404
1440
  return parent.type === "SpreadElement" && parent.argument === node;
1405
1441
  }
1406
- var no_raw_env_default = import_utils10.ESLintUtils.RuleCreator(
1442
+ var no_raw_env_default = import_utils11.ESLintUtils.RuleCreator(
1407
1443
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
1408
1444
  )({
1409
1445
  name: "no-raw-env",
@@ -1437,12 +1473,12 @@ var no_raw_env_default = import_utils10.ESLintUtils.RuleCreator(
1437
1473
  });
1438
1474
 
1439
1475
  // src/rules/no-sentinel-return-on-catch.ts
1440
- var import_utils11 = require("@typescript-eslint/utils");
1476
+ var import_utils12 = require("@typescript-eslint/utils");
1441
1477
  function sentinelKind(arg) {
1442
1478
  if (arg === null) {
1443
1479
  return null;
1444
1480
  }
1445
- if (arg.type === import_utils11.AST_NODE_TYPES.Literal) {
1481
+ if (arg.type === import_utils12.AST_NODE_TYPES.Literal) {
1446
1482
  if (arg.value === null) {
1447
1483
  return "nullish";
1448
1484
  }
@@ -1454,13 +1490,13 @@ function sentinelKind(arg) {
1454
1490
  }
1455
1491
  return null;
1456
1492
  }
1457
- if (arg.type === import_utils11.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
1493
+ if (arg.type === import_utils12.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
1458
1494
  return "nullish";
1459
1495
  }
1460
- if (arg.type === import_utils11.AST_NODE_TYPES.ArrayExpression) {
1496
+ if (arg.type === import_utils12.AST_NODE_TYPES.ArrayExpression) {
1461
1497
  return "array";
1462
1498
  }
1463
- if (arg.type === import_utils11.AST_NODE_TYPES.ObjectExpression) {
1499
+ if (arg.type === import_utils12.AST_NODE_TYPES.ObjectExpression) {
1464
1500
  return "object";
1465
1501
  }
1466
1502
  return null;
@@ -1469,25 +1505,25 @@ function isSentinelArgument(arg) {
1469
1505
  if (arg === null) {
1470
1506
  return false;
1471
1507
  }
1472
- if (arg.type === import_utils11.AST_NODE_TYPES.Literal && arg.value === null) {
1508
+ if (arg.type === import_utils12.AST_NODE_TYPES.Literal && arg.value === null) {
1473
1509
  return true;
1474
1510
  }
1475
- if (arg.type === import_utils11.AST_NODE_TYPES.Literal && arg.value === false) {
1511
+ if (arg.type === import_utils12.AST_NODE_TYPES.Literal && arg.value === false) {
1476
1512
  return true;
1477
1513
  }
1478
- if (arg.type === import_utils11.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
1514
+ if (arg.type === import_utils12.AST_NODE_TYPES.Identifier && arg.name === "undefined") {
1479
1515
  return true;
1480
1516
  }
1481
- if (arg.type === import_utils11.AST_NODE_TYPES.ArrayExpression && arg.elements.length === 0) {
1517
+ if (arg.type === import_utils12.AST_NODE_TYPES.ArrayExpression && arg.elements.length === 0) {
1482
1518
  return true;
1483
1519
  }
1484
- if (arg.type === import_utils11.AST_NODE_TYPES.ObjectExpression && arg.properties.length === 0) {
1520
+ if (arg.type === import_utils12.AST_NODE_TYPES.ObjectExpression && arg.properties.length === 0) {
1485
1521
  return true;
1486
1522
  }
1487
1523
  return false;
1488
1524
  }
1489
1525
  function isFunctionNode(node) {
1490
- return node.type === import_utils11.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils11.AST_NODE_TYPES.FunctionExpression || node.type === import_utils11.AST_NODE_TYPES.ArrowFunctionExpression;
1526
+ return node.type === import_utils12.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils12.AST_NODE_TYPES.FunctionExpression || node.type === import_utils12.AST_NODE_TYPES.ArrowFunctionExpression;
1491
1527
  }
1492
1528
  function isNode(value) {
1493
1529
  return typeof value === "object" && value !== null && typeof value.type === "string";
@@ -1527,24 +1563,24 @@ function walkWithinScope(node, visit) {
1527
1563
  function containsThrow(node) {
1528
1564
  return walkWithinScope(
1529
1565
  node,
1530
- (current) => current.type === import_utils11.AST_NODE_TYPES.ThrowStatement
1566
+ (current) => current.type === import_utils12.AST_NODE_TYPES.ThrowStatement
1531
1567
  );
1532
1568
  }
1533
1569
  function bindsName(param, name) {
1534
1570
  switch (param.type) {
1535
- case import_utils11.AST_NODE_TYPES.Identifier:
1571
+ case import_utils12.AST_NODE_TYPES.Identifier:
1536
1572
  return param.name === name;
1537
- case import_utils11.AST_NODE_TYPES.AssignmentPattern:
1573
+ case import_utils12.AST_NODE_TYPES.AssignmentPattern:
1538
1574
  return bindsName(param.left, name);
1539
- case import_utils11.AST_NODE_TYPES.RestElement:
1575
+ case import_utils12.AST_NODE_TYPES.RestElement:
1540
1576
  return bindsName(param.argument, name);
1541
- case import_utils11.AST_NODE_TYPES.ArrayPattern:
1577
+ case import_utils12.AST_NODE_TYPES.ArrayPattern:
1542
1578
  return param.elements.some(
1543
1579
  (element) => element !== null && bindsName(element, name)
1544
1580
  );
1545
- case import_utils11.AST_NODE_TYPES.ObjectPattern:
1581
+ case import_utils12.AST_NODE_TYPES.ObjectPattern:
1546
1582
  return param.properties.some(
1547
- (property) => property.type === import_utils11.AST_NODE_TYPES.RestElement ? bindsName(property.argument, name) : bindsName(property.value, name)
1583
+ (property) => property.type === import_utils12.AST_NODE_TYPES.RestElement ? bindsName(property.argument, name) : bindsName(property.value, name)
1548
1584
  );
1549
1585
  default:
1550
1586
  return false;
@@ -1559,7 +1595,7 @@ function subtreeReadsName(node, name) {
1559
1595
  if (found) {
1560
1596
  return;
1561
1597
  }
1562
- if (current.type === import_utils11.AST_NODE_TYPES.Identifier && current.name === name) {
1598
+ if (current.type === import_utils12.AST_NODE_TYPES.Identifier && current.name === name) {
1563
1599
  found = true;
1564
1600
  return;
1565
1601
  }
@@ -1570,10 +1606,10 @@ function subtreeReadsName(node, name) {
1570
1606
  if (key === "parent") {
1571
1607
  continue;
1572
1608
  }
1573
- if (key === "key" && current.type === import_utils11.AST_NODE_TYPES.Property && !current.computed) {
1609
+ if (key === "key" && current.type === import_utils12.AST_NODE_TYPES.Property && !current.computed) {
1574
1610
  continue;
1575
1611
  }
1576
- if (key === "property" && current.type === import_utils11.AST_NODE_TYPES.MemberExpression && !current.computed) {
1612
+ if (key === "property" && current.type === import_utils12.AST_NODE_TYPES.MemberExpression && !current.computed) {
1577
1613
  continue;
1578
1614
  }
1579
1615
  const value = current[key];
@@ -1606,10 +1642,10 @@ var SAFE_PARSE_CONSTRUCTORS = /* @__PURE__ */ new Set([
1606
1642
  "URLPattern"
1607
1643
  ]);
1608
1644
  function isParseShapedNode(node) {
1609
- if (node.type === import_utils11.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils11.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils11.AST_NODE_TYPES.Identifier) {
1645
+ if (node.type === import_utils12.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils12.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils12.AST_NODE_TYPES.Identifier) {
1610
1646
  return node.callee.property.name === "parse";
1611
1647
  }
1612
- if (node.type === import_utils11.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils11.AST_NODE_TYPES.Identifier) {
1648
+ if (node.type === import_utils12.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils12.AST_NODE_TYPES.Identifier) {
1613
1649
  return SAFE_PARSE_CONSTRUCTORS.has(node.callee.name);
1614
1650
  }
1615
1651
  return false;
@@ -1620,10 +1656,10 @@ var BODY_DECODE_METHODS = /* @__PURE__ */ new Set([
1620
1656
  "arrayBuffer"
1621
1657
  ]);
1622
1658
  function isBodyDecodeNode(node) {
1623
- return node.type === import_utils11.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils11.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils11.AST_NODE_TYPES.Identifier && BODY_DECODE_METHODS.has(node.callee.property.name);
1659
+ return node.type === import_utils12.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils12.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils12.AST_NODE_TYPES.Identifier && BODY_DECODE_METHODS.has(node.callee.property.name);
1624
1660
  }
1625
1661
  function returnsMatching(stmt, predicate) {
1626
- return stmt.type === import_utils11.AST_NODE_TYPES.ReturnStatement && stmt.argument !== null && walkWithinScope(stmt.argument, predicate);
1662
+ return stmt.type === import_utils12.AST_NODE_TYPES.ReturnStatement && stmt.argument !== null && walkWithinScope(stmt.argument, predicate);
1627
1663
  }
1628
1664
  function enclosingReturnTypeNode(node) {
1629
1665
  let current = node.parent;
@@ -1641,11 +1677,11 @@ function enclosingFunctionName(node) {
1641
1677
  let current = node.parent;
1642
1678
  while (current !== void 0 && current !== null) {
1643
1679
  if (isFunctionNode(current)) {
1644
- if ("id" in current && isNode(current.id) && current.id.type === import_utils11.AST_NODE_TYPES.Identifier) {
1680
+ if ("id" in current && isNode(current.id) && current.id.type === import_utils12.AST_NODE_TYPES.Identifier) {
1645
1681
  return current.id.name;
1646
1682
  }
1647
1683
  const parent = current.parent;
1648
- if (parent?.type === import_utils11.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils11.AST_NODE_TYPES.Identifier) {
1684
+ if (parent?.type === import_utils12.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils12.AST_NODE_TYPES.Identifier) {
1649
1685
  return parent.id.name;
1650
1686
  }
1651
1687
  return null;
@@ -1666,10 +1702,10 @@ function isDeclaredBooleanPredicate(catchNode, kind) {
1666
1702
  return false;
1667
1703
  }
1668
1704
  let declared = enclosingReturnTypeNode(catchNode);
1669
- if (declared?.type === import_utils11.AST_NODE_TYPES.TSTypeReference && declared.typeName.type === import_utils11.AST_NODE_TYPES.Identifier && declared.typeName.name === "Promise") {
1705
+ if (declared?.type === import_utils12.AST_NODE_TYPES.TSTypeReference && declared.typeName.type === import_utils12.AST_NODE_TYPES.Identifier && declared.typeName.name === "Promise") {
1670
1706
  declared = declared.typeArguments?.params[0] ?? null;
1671
1707
  }
1672
- return declared?.type === import_utils11.AST_NODE_TYPES.TSBooleanKeyword;
1708
+ return declared?.type === import_utils12.AST_NODE_TYPES.TSBooleanKeyword;
1673
1709
  }
1674
1710
  function tryReturnsSafeParse(catchNode) {
1675
1711
  const tryBlock = tryBlockOf(catchNode);
@@ -1685,7 +1721,7 @@ function tryReturnsSafeParse(catchNode) {
1685
1721
  function enclosingFunctionBody(node) {
1686
1722
  let current = node.parent;
1687
1723
  while (current !== void 0 && current !== null) {
1688
- if (isFunctionNode(current) && "body" in current && isNode(current.body) && current.body.type === import_utils11.AST_NODE_TYPES.BlockStatement) {
1724
+ if (isFunctionNode(current) && "body" in current && isNode(current.body) && current.body.type === import_utils12.AST_NODE_TYPES.BlockStatement) {
1689
1725
  return current.body;
1690
1726
  }
1691
1727
  current = current.parent;
@@ -1698,7 +1734,7 @@ function functionReturnsSameSentinelKindElsewhere(catchNode, kind) {
1698
1734
  return false;
1699
1735
  }
1700
1736
  return walkWithinScope(functionBody, (current) => {
1701
- if (current.type !== import_utils11.AST_NODE_TYPES.ReturnStatement) {
1737
+ if (current.type !== import_utils12.AST_NODE_TYPES.ReturnStatement) {
1702
1738
  return false;
1703
1739
  }
1704
1740
  if (isWithin(current, catchNode.body)) {
@@ -1717,13 +1753,13 @@ function returnedSentinelKinds(arg) {
1717
1753
  kinds.add(direct);
1718
1754
  return kinds;
1719
1755
  }
1720
- if (arg.type === import_utils11.AST_NODE_TYPES.ConditionalExpression) {
1756
+ if (arg.type === import_utils12.AST_NODE_TYPES.ConditionalExpression) {
1721
1757
  for (const branch of [arg.consequent, arg.alternate]) {
1722
1758
  for (const nested of returnedSentinelKinds(branch)) {
1723
1759
  kinds.add(nested);
1724
1760
  }
1725
1761
  }
1726
- } else if (arg.type === import_utils11.AST_NODE_TYPES.LogicalExpression && (arg.operator === "??" || arg.operator === "||")) {
1762
+ } else if (arg.type === import_utils12.AST_NODE_TYPES.LogicalExpression && (arg.operator === "??" || arg.operator === "||")) {
1727
1763
  for (const nested of returnedSentinelKinds(arg.right)) {
1728
1764
  kinds.add(nested);
1729
1765
  }
@@ -1740,7 +1776,7 @@ function isWithin(node, ancestor) {
1740
1776
  }
1741
1777
  return false;
1742
1778
  }
1743
- var no_sentinel_return_on_catch_default = import_utils11.ESLintUtils.RuleCreator(
1779
+ var no_sentinel_return_on_catch_default = import_utils12.ESLintUtils.RuleCreator(
1744
1780
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
1745
1781
  )({
1746
1782
  name: "no-sentinel-return-on-catch",
@@ -1768,7 +1804,7 @@ var no_sentinel_return_on_catch_default = import_utils11.ESLintUtils.RuleCreator
1768
1804
  const matcher = createLogMatcher(loggingOptions);
1769
1805
  function logsOrReportsError(catchBody, caughtName) {
1770
1806
  return walkWithinScope(catchBody, (current) => {
1771
- if (current.type !== import_utils11.AST_NODE_TYPES.CallExpression) {
1807
+ if (current.type !== import_utils12.AST_NODE_TYPES.CallExpression) {
1772
1808
  return false;
1773
1809
  }
1774
1810
  if (matcher.isLoggingCall(current)) {
@@ -1785,7 +1821,7 @@ var no_sentinel_return_on_catch_default = import_utils11.ESLintUtils.RuleCreator
1785
1821
  return;
1786
1822
  }
1787
1823
  const last = body[body.length - 1];
1788
- if (last === void 0 || last.type !== import_utils11.AST_NODE_TYPES.ReturnStatement) {
1824
+ if (last === void 0 || last.type !== import_utils12.AST_NODE_TYPES.ReturnStatement) {
1789
1825
  return;
1790
1826
  }
1791
1827
  if (!isSentinelArgument(last.argument)) {
@@ -1794,7 +1830,7 @@ var no_sentinel_return_on_catch_default = import_utils11.ESLintUtils.RuleCreator
1794
1830
  if (containsThrow(node.body)) {
1795
1831
  return;
1796
1832
  }
1797
- const caughtName = node.param?.type === import_utils11.AST_NODE_TYPES.Identifier ? node.param.name : null;
1833
+ const caughtName = node.param?.type === import_utils12.AST_NODE_TYPES.Identifier ? node.param.name : null;
1798
1834
  if (logsOrReportsError(node.body, caughtName)) {
1799
1835
  return;
1800
1836
  }
@@ -1821,7 +1857,7 @@ var no_sentinel_return_on_catch_default = import_utils11.ESLintUtils.RuleCreator
1821
1857
  });
1822
1858
 
1823
1859
  // src/rules/no-sequential-await.ts
1824
- var import_utils12 = require("@typescript-eslint/utils");
1860
+ var import_utils13 = require("@typescript-eslint/utils");
1825
1861
  var ARRAY_ITERATION_METHODS = /* @__PURE__ */ new Set(["forEach", "map", "filter"]);
1826
1862
  var SEQUENTIAL_ITERABLE_HINT = /sort|reverse|ordered|sequence|hook|middleware|pipeline|preset|plugin|extension|\bstage|\bstep|\bphase|migration|chain|buffer|stream|teleport|chunk|\bqueue|drain/i;
1827
1863
  var BENCH_FILE_RE = /(^|[\\/])bench(marks?)?[\\/]|\.bench\.[cm]?[jt]sx?$/i;
@@ -1975,7 +2011,7 @@ function shouldReport(awaits, earlyExit, iterableText, asserts = false) {
1975
2011
  (node) => !isTimerYield(node) && !isThreadedAccumulator(node) && !isQueueDrain(node)
1976
2012
  );
1977
2013
  }
1978
- var no_sequential_await_default = import_utils12.ESLintUtils.RuleCreator(
2014
+ var no_sequential_await_default = import_utils13.ESLintUtils.RuleCreator(
1979
2015
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
1980
2016
  )({
1981
2017
  name: "no-sequential-await",
@@ -2070,7 +2106,7 @@ var no_sequential_await_default = import_utils12.ESLintUtils.RuleCreator(
2070
2106
  });
2071
2107
 
2072
2108
  // src/rules/no-string-concat-in-loop.ts
2073
- var import_utils13 = require("@typescript-eslint/utils");
2109
+ var import_utils14 = require("@typescript-eslint/utils");
2074
2110
  var LOOP_NODE_TYPES = /* @__PURE__ */ new Set([
2075
2111
  "ForStatement",
2076
2112
  "ForOfStatement",
@@ -2155,7 +2191,7 @@ function enclosingLoop(node) {
2155
2191
  }
2156
2192
  return null;
2157
2193
  }
2158
- var no_string_concat_in_loop_default = import_utils13.ESLintUtils.RuleCreator(
2194
+ var no_string_concat_in_loop_default = import_utils14.ESLintUtils.RuleCreator(
2159
2195
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
2160
2196
  )({
2161
2197
  name: "no-string-concat-in-loop",
@@ -2218,7 +2254,7 @@ var no_string_concat_in_loop_default = import_utils13.ESLintUtils.RuleCreator(
2218
2254
  });
2219
2255
 
2220
2256
  // src/rules/no-unnecessary-use-client.ts
2221
- var import_utils14 = require("@typescript-eslint/utils");
2257
+ var import_utils15 = require("@typescript-eslint/utils");
2222
2258
  var HOOK_REGEX = /^use([A-Z]|$)/;
2223
2259
  var EVENT_PROP_REGEX = /^on[A-Z]/;
2224
2260
  var ERROR_FILE_REGEX = /\b(?:global-)?error\.[jt]sx?$/;
@@ -2244,13 +2280,13 @@ var CLIENT_ONLY_PACKAGES_REGEX = /^(?:@radix-ui\/|framer-motion|react-dom|react-
2244
2280
  var isBareSpecifier = (source) => !source.startsWith(".") && !source.startsWith("/") && !source.startsWith("@/") && !source.startsWith("~");
2245
2281
  var jsxRootName = (name) => {
2246
2282
  let current = name;
2247
- while (current.type === import_utils14.AST_NODE_TYPES.JSXMemberExpression) {
2283
+ while (current.type === import_utils15.AST_NODE_TYPES.JSXMemberExpression) {
2248
2284
  current = current.object;
2249
2285
  }
2250
- return current.type === import_utils14.AST_NODE_TYPES.JSXIdentifier ? current.name : "";
2286
+ return current.type === import_utils15.AST_NODE_TYPES.JSXIdentifier ? current.name : "";
2251
2287
  };
2252
2288
  var subtreeReadsImportedBinding = (node, imported) => {
2253
- if (node.type === import_utils14.AST_NODE_TYPES.Identifier) {
2289
+ if (node.type === import_utils15.AST_NODE_TYPES.Identifier) {
2254
2290
  return imported.has(node.name);
2255
2291
  }
2256
2292
  for (const key of Object.keys(node)) {
@@ -2265,16 +2301,16 @@ var subtreeReadsImportedBinding = (node, imported) => {
2265
2301
  return false;
2266
2302
  };
2267
2303
  var isUseClientDirective = (node) => {
2268
- return node.type === import_utils14.AST_NODE_TYPES.ExpressionStatement && node.expression.type === import_utils14.AST_NODE_TYPES.Literal && node.expression.value === "use client";
2304
+ return node.type === import_utils15.AST_NODE_TYPES.ExpressionStatement && node.expression.type === import_utils15.AST_NODE_TYPES.Literal && node.expression.value === "use client";
2269
2305
  };
2270
2306
  var isGlobalReference = (node, context) => {
2271
2307
  if (!BROWSER_GLOBALS.has(node.name)) return false;
2272
2308
  const parent = node.parent;
2273
2309
  if (parent !== void 0) {
2274
- if (parent.type === import_utils14.AST_NODE_TYPES.MemberExpression && parent.property === node && !parent.computed) {
2310
+ if (parent.type === import_utils15.AST_NODE_TYPES.MemberExpression && parent.property === node && !parent.computed) {
2275
2311
  return false;
2276
2312
  }
2277
- if (parent.type === import_utils14.AST_NODE_TYPES.Property && parent.key === node && !parent.computed) {
2313
+ if (parent.type === import_utils15.AST_NODE_TYPES.Property && parent.key === node && !parent.computed) {
2278
2314
  return false;
2279
2315
  }
2280
2316
  if (parent.type.startsWith("TS")) {
@@ -2291,7 +2327,7 @@ var isGlobalReference = (node, context) => {
2291
2327
  }
2292
2328
  return true;
2293
2329
  };
2294
- var no_unnecessary_use_client_default = import_utils14.ESLintUtils.RuleCreator(
2330
+ var no_unnecessary_use_client_default = import_utils15.ESLintUtils.RuleCreator(
2295
2331
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
2296
2332
  )({
2297
2333
  name: "no-unnecessary-use-client",
@@ -2316,13 +2352,13 @@ var no_unnecessary_use_client_default = import_utils14.ESLintUtils.RuleCreator(
2316
2352
  const importedLocals = /* @__PURE__ */ new Set();
2317
2353
  const externalLocals = /* @__PURE__ */ new Set();
2318
2354
  const markIfHookOrContext = (callee) => {
2319
- if (callee.type === import_utils14.AST_NODE_TYPES.Identifier) {
2355
+ if (callee.type === import_utils15.AST_NODE_TYPES.Identifier) {
2320
2356
  if (HOOK_REGEX.test(callee.name) || callee.name === "createContext") {
2321
2357
  hasClientIndicator = true;
2322
2358
  }
2323
2359
  return;
2324
2360
  }
2325
- if (callee.type === import_utils14.AST_NODE_TYPES.MemberExpression && callee.property.type === import_utils14.AST_NODE_TYPES.Identifier) {
2361
+ if (callee.type === import_utils15.AST_NODE_TYPES.MemberExpression && callee.property.type === import_utils15.AST_NODE_TYPES.Identifier) {
2326
2362
  const name = callee.property.name;
2327
2363
  if (HOOK_REGEX.test(name) || name === "createContext") {
2328
2364
  hasClientIndicator = true;
@@ -2332,7 +2368,7 @@ var no_unnecessary_use_client_default = import_utils14.ESLintUtils.RuleCreator(
2332
2368
  return {
2333
2369
  Program(node) {
2334
2370
  for (const stmt of node.body) {
2335
- if (stmt.type !== import_utils14.AST_NODE_TYPES.ExpressionStatement) break;
2371
+ if (stmt.type !== import_utils15.AST_NODE_TYPES.ExpressionStatement) break;
2336
2372
  if (isUseClientDirective(stmt)) {
2337
2373
  directiveNode = stmt;
2338
2374
  break;
@@ -2345,7 +2381,7 @@ var no_unnecessary_use_client_default = import_utils14.ESLintUtils.RuleCreator(
2345
2381
  },
2346
2382
  JSXAttribute(node) {
2347
2383
  if (directiveNode === null) return;
2348
- if (node.name.type === import_utils14.AST_NODE_TYPES.JSXIdentifier && EVENT_PROP_REGEX.test(node.name.name)) {
2384
+ if (node.name.type === import_utils15.AST_NODE_TYPES.JSXIdentifier && EVENT_PROP_REGEX.test(node.name.name)) {
2349
2385
  hasClientIndicator = true;
2350
2386
  }
2351
2387
  },
@@ -2412,8 +2448,8 @@ var no_unnecessary_use_client_default = import_utils14.ESLintUtils.RuleCreator(
2412
2448
  });
2413
2449
 
2414
2450
  // src/rules/prefer-discriminated-union.ts
2415
- var import_utils15 = require("@typescript-eslint/utils");
2416
2451
  var import_utils16 = require("@typescript-eslint/utils");
2452
+ var import_utils17 = require("@typescript-eslint/utils");
2417
2453
  var STATUS_MEMBER_NAMES = /* @__PURE__ */ new Set([
2418
2454
  "success",
2419
2455
  "ok",
@@ -2423,27 +2459,27 @@ var STATUS_MEMBER_NAMES = /* @__PURE__ */ new Set([
2423
2459
  ]);
2424
2460
  var MIN_OPTIONAL_MEMBERS = 2;
2425
2461
  function getMemberName(member) {
2426
- if (member.type !== import_utils16.AST_NODE_TYPES.TSPropertySignature) {
2462
+ if (member.type !== import_utils17.AST_NODE_TYPES.TSPropertySignature) {
2427
2463
  return null;
2428
2464
  }
2429
2465
  const { key } = member;
2430
- if (key.type === import_utils16.AST_NODE_TYPES.Identifier) {
2466
+ if (key.type === import_utils17.AST_NODE_TYPES.Identifier) {
2431
2467
  return key.name;
2432
2468
  }
2433
- if (key.type === import_utils16.AST_NODE_TYPES.Literal && typeof key.value === "string") {
2469
+ if (key.type === import_utils17.AST_NODE_TYPES.Literal && typeof key.value === "string") {
2434
2470
  return key.value;
2435
2471
  }
2436
2472
  return null;
2437
2473
  }
2438
2474
  function isBooleanTyped(member) {
2439
- return member.typeAnnotation?.typeAnnotation.type === import_utils16.AST_NODE_TYPES.TSBooleanKeyword;
2475
+ return member.typeAnnotation?.typeAnnotation.type === import_utils17.AST_NODE_TYPES.TSBooleanKeyword;
2440
2476
  }
2441
2477
  function looksLikeMutuallyExclusiveState(typeLiteral) {
2442
2478
  let hasStatusBoolean = false;
2443
2479
  let optionalCount = 0;
2444
2480
  let optionalPayloadCount = 0;
2445
2481
  for (const member of typeLiteral.members) {
2446
- if (member.type !== import_utils16.AST_NODE_TYPES.TSPropertySignature) {
2482
+ if (member.type !== import_utils17.AST_NODE_TYPES.TSPropertySignature) {
2447
2483
  continue;
2448
2484
  }
2449
2485
  if (member.optional) {
@@ -2459,7 +2495,7 @@ function looksLikeMutuallyExclusiveState(typeLiteral) {
2459
2495
  }
2460
2496
  return hasStatusBoolean && optionalCount >= MIN_OPTIONAL_MEMBERS && optionalPayloadCount >= 1;
2461
2497
  }
2462
- var prefer_discriminated_union_default = import_utils15.ESLintUtils.RuleCreator(
2498
+ var prefer_discriminated_union_default = import_utils16.ESLintUtils.RuleCreator(
2463
2499
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
2464
2500
  )({
2465
2501
  name: "prefer-discriminated-union",
@@ -2487,7 +2523,7 @@ var prefer_discriminated_union_default = import_utils15.ESLintUtils.RuleCreator(
2487
2523
  TSInterfaceDeclaration(node) {
2488
2524
  const synthetic = {
2489
2525
  ...node.body,
2490
- type: import_utils16.AST_NODE_TYPES.TSTypeLiteral,
2526
+ type: import_utils17.AST_NODE_TYPES.TSTypeLiteral,
2491
2527
  members: node.body.body
2492
2528
  };
2493
2529
  checkTypeLiteral(synthetic, node);
@@ -2500,13 +2536,13 @@ var prefer_discriminated_union_default = import_utils15.ESLintUtils.RuleCreator(
2500
2536
  });
2501
2537
 
2502
2538
  // src/rules/prefer-schema-for-api-payload.ts
2503
- var import_utils17 = require("@typescript-eslint/utils");
2539
+ var import_utils18 = require("@typescript-eslint/utils");
2504
2540
  var unwrap = (node) => {
2505
2541
  let current = node;
2506
2542
  while (current !== null && current !== void 0) {
2507
- if (current.type === import_utils17.AST_NODE_TYPES.TSAsExpression || current.type === import_utils17.AST_NODE_TYPES.TSTypeAssertion || current.type === import_utils17.AST_NODE_TYPES.TSNonNullExpression || current.type === import_utils17.AST_NODE_TYPES.TSSatisfiesExpression) {
2543
+ if (current.type === import_utils18.AST_NODE_TYPES.TSAsExpression || current.type === import_utils18.AST_NODE_TYPES.TSTypeAssertion || current.type === import_utils18.AST_NODE_TYPES.TSNonNullExpression || current.type === import_utils18.AST_NODE_TYPES.TSSatisfiesExpression) {
2508
2544
  current = current.expression;
2509
- } else if (current.type === import_utils17.AST_NODE_TYPES.ChainExpression) {
2545
+ } else if (current.type === import_utils18.AST_NODE_TYPES.ChainExpression) {
2510
2546
  current = current.expression;
2511
2547
  } else {
2512
2548
  break;
@@ -2517,25 +2553,25 @@ var unwrap = (node) => {
2517
2553
  var isRawPayloadSource = (node) => {
2518
2554
  let current = unwrap(node);
2519
2555
  if (current === null) return false;
2520
- if (current.type === import_utils17.AST_NODE_TYPES.AwaitExpression) {
2556
+ if (current.type === import_utils18.AST_NODE_TYPES.AwaitExpression) {
2521
2557
  current = unwrap(current.argument);
2522
2558
  }
2523
- if (current === null || current.type !== import_utils17.AST_NODE_TYPES.CallExpression) {
2559
+ if (current === null || current.type !== import_utils18.AST_NODE_TYPES.CallExpression) {
2524
2560
  return false;
2525
2561
  }
2526
2562
  const callee = unwrap(current.callee);
2527
- if (callee === null || callee.type !== import_utils17.AST_NODE_TYPES.MemberExpression) {
2563
+ if (callee === null || callee.type !== import_utils18.AST_NODE_TYPES.MemberExpression) {
2528
2564
  return false;
2529
2565
  }
2530
2566
  const property = unwrap(callee.property);
2531
- if (property === null || property.type !== import_utils17.AST_NODE_TYPES.Identifier) {
2567
+ if (property === null || property.type !== import_utils18.AST_NODE_TYPES.Identifier) {
2532
2568
  return false;
2533
2569
  }
2534
2570
  if (property.name === "json") {
2535
2571
  return true;
2536
2572
  }
2537
2573
  const object = unwrap(callee.object);
2538
- return property.name === "parse" && object !== null && object.type === import_utils17.AST_NODE_TYPES.Identifier && object.name === "JSON" && // ...but not `JSON.parse(readFileSync(p, "utf8"))` — see isLocalFileRead.
2574
+ return property.name === "parse" && object !== null && object.type === import_utils18.AST_NODE_TYPES.Identifier && object.name === "JSON" && // ...but not `JSON.parse(readFileSync(p, "utf8"))` — see isLocalFileRead.
2539
2575
  !isLocalFileRead(current.arguments[0]);
2540
2576
  };
2541
2577
  var FILE_READ_RE = /^(readFile|readFileSync|readJson|readJsonSync|readJSON)$/;
@@ -2543,9 +2579,9 @@ var isLocalFileRead = (node) => {
2543
2579
  let found = false;
2544
2580
  const visit = (current) => {
2545
2581
  if (found || current === null || current === void 0) return;
2546
- if (current.type === import_utils17.AST_NODE_TYPES.CallExpression) {
2582
+ if (current.type === import_utils18.AST_NODE_TYPES.CallExpression) {
2547
2583
  const callee = unwrap(current.callee);
2548
- const name = callee?.type === import_utils17.AST_NODE_TYPES.Identifier ? callee.name : callee?.type === import_utils17.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils17.AST_NODE_TYPES.Identifier ? callee.property.name : null;
2584
+ const name = callee?.type === import_utils18.AST_NODE_TYPES.Identifier ? callee.name : callee?.type === import_utils18.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils18.AST_NODE_TYPES.Identifier ? callee.property.name : null;
2549
2585
  if (name !== null && FILE_READ_RE.test(name)) {
2550
2586
  found = true;
2551
2587
  return;
@@ -2567,15 +2603,15 @@ var isLocalFileRead = (node) => {
2567
2603
  var ASSERTION_CALLEE_RE2 = /^(expect|assert|should|invariant)$/;
2568
2604
  var isInsideAssertion = (node) => {
2569
2605
  for (let current = node.parent; current !== void 0 && current !== null; current = current.parent) {
2570
- if (current.type !== import_utils17.AST_NODE_TYPES.CallExpression) continue;
2606
+ if (current.type !== import_utils18.AST_NODE_TYPES.CallExpression) continue;
2571
2607
  let callee = current.callee;
2572
- while (callee.type === import_utils17.AST_NODE_TYPES.MemberExpression) {
2608
+ while (callee.type === import_utils18.AST_NODE_TYPES.MemberExpression) {
2573
2609
  callee = callee.object;
2574
2610
  }
2575
- if (callee.type === import_utils17.AST_NODE_TYPES.CallExpression) {
2611
+ if (callee.type === import_utils18.AST_NODE_TYPES.CallExpression) {
2576
2612
  callee = callee.callee;
2577
2613
  }
2578
- if (callee.type === import_utils17.AST_NODE_TYPES.Identifier && ASSERTION_CALLEE_RE2.test(callee.name)) {
2614
+ if (callee.type === import_utils18.AST_NODE_TYPES.Identifier && ASSERTION_CALLEE_RE2.test(callee.name)) {
2579
2615
  return true;
2580
2616
  }
2581
2617
  }
@@ -2596,17 +2632,17 @@ var isGuardTestPosition = (node) => {
2596
2632
  let parent = current.parent;
2597
2633
  while (parent !== void 0 && parent !== null) {
2598
2634
  switch (parent.type) {
2599
- case import_utils17.AST_NODE_TYPES.UnaryExpression:
2600
- case import_utils17.AST_NODE_TYPES.LogicalExpression:
2601
- case import_utils17.AST_NODE_TYPES.ChainExpression:
2635
+ case import_utils18.AST_NODE_TYPES.UnaryExpression:
2636
+ case import_utils18.AST_NODE_TYPES.LogicalExpression:
2637
+ case import_utils18.AST_NODE_TYPES.ChainExpression:
2602
2638
  current = parent;
2603
2639
  parent = parent.parent;
2604
2640
  continue;
2605
- case import_utils17.AST_NODE_TYPES.IfStatement:
2606
- case import_utils17.AST_NODE_TYPES.ConditionalExpression:
2607
- case import_utils17.AST_NODE_TYPES.WhileStatement:
2608
- case import_utils17.AST_NODE_TYPES.DoWhileStatement:
2609
- case import_utils17.AST_NODE_TYPES.ForStatement:
2641
+ case import_utils18.AST_NODE_TYPES.IfStatement:
2642
+ case import_utils18.AST_NODE_TYPES.ConditionalExpression:
2643
+ case import_utils18.AST_NODE_TYPES.WhileStatement:
2644
+ case import_utils18.AST_NODE_TYPES.DoWhileStatement:
2645
+ case import_utils18.AST_NODE_TYPES.ForStatement:
2610
2646
  return parent.test === current;
2611
2647
  default:
2612
2648
  return false;
@@ -2616,13 +2652,13 @@ var isGuardTestPosition = (node) => {
2616
2652
  };
2617
2653
  var isUnvalidatedVariableRef = (node, scope, tracked) => {
2618
2654
  const unwrapped = unwrap(node);
2619
- if (unwrapped === null || unwrapped.type !== import_utils17.AST_NODE_TYPES.Identifier) {
2655
+ if (unwrapped === null || unwrapped.type !== import_utils18.AST_NODE_TYPES.Identifier) {
2620
2656
  return false;
2621
2657
  }
2622
2658
  const variable = findVariable2(scope, unwrapped.name);
2623
2659
  return variable !== null && tracked.has(variable);
2624
2660
  };
2625
- var prefer_schema_for_api_payload_default = import_utils17.ESLintUtils.RuleCreator(
2661
+ var prefer_schema_for_api_payload_default = import_utils18.ESLintUtils.RuleCreator(
2626
2662
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
2627
2663
  )({
2628
2664
  name: "prefer-schema-for-api-payload",
@@ -2653,11 +2689,11 @@ var prefer_schema_for_api_payload_default = import_utils17.ESLintUtils.RuleCreat
2653
2689
  return {
2654
2690
  VariableDeclarator(node) {
2655
2691
  const scope = context.sourceCode.getScope(node);
2656
- if (node.id.type === import_utils17.AST_NODE_TYPES.Identifier) {
2692
+ if (node.id.type === import_utils18.AST_NODE_TYPES.Identifier) {
2657
2693
  trackInitializer(node);
2658
2694
  return;
2659
2695
  }
2660
- if (node.id.type === import_utils17.AST_NODE_TYPES.ObjectPattern || node.id.type === import_utils17.AST_NODE_TYPES.ArrayPattern) {
2696
+ if (node.id.type === import_utils18.AST_NODE_TYPES.ObjectPattern || node.id.type === import_utils18.AST_NODE_TYPES.ArrayPattern) {
2661
2697
  if (isRawPayloadSource(node.init)) {
2662
2698
  context.report({ node: node.id, messageId: "unparsedJsonAccess" });
2663
2699
  return;
@@ -2669,7 +2705,7 @@ var prefer_schema_for_api_payload_default = import_utils17.ESLintUtils.RuleCreat
2669
2705
  },
2670
2706
  AssignmentExpression(node) {
2671
2707
  const scope = context.sourceCode.getScope(node);
2672
- if (node.left.type === import_utils17.AST_NODE_TYPES.Identifier) {
2708
+ if (node.left.type === import_utils18.AST_NODE_TYPES.Identifier) {
2673
2709
  const variable = findVariable2(scope, node.left.name);
2674
2710
  if (variable === null) return;
2675
2711
  if (isRawPayloadSource(node.right)) {
@@ -2679,7 +2715,7 @@ var prefer_schema_for_api_payload_default = import_utils17.ESLintUtils.RuleCreat
2679
2715
  }
2680
2716
  return;
2681
2717
  }
2682
- if (node.left.type === import_utils17.AST_NODE_TYPES.ObjectPattern || node.left.type === import_utils17.AST_NODE_TYPES.ArrayPattern) {
2718
+ if (node.left.type === import_utils18.AST_NODE_TYPES.ObjectPattern || node.left.type === import_utils18.AST_NODE_TYPES.ArrayPattern) {
2683
2719
  if (isRawPayloadSource(node.right)) {
2684
2720
  context.report({
2685
2721
  node: node.left,
@@ -2696,15 +2732,15 @@ var prefer_schema_for_api_payload_default = import_utils17.ESLintUtils.RuleCreat
2696
2732
  }
2697
2733
  },
2698
2734
  CallExpression(node) {
2699
- if (node.callee.type !== import_utils17.AST_NODE_TYPES.Identifier) return;
2735
+ if (node.callee.type !== import_utils18.AST_NODE_TYPES.Identifier) return;
2700
2736
  if (!GUARD_NAME_RE.test(node.callee.name) && !isGuardTestPosition(node)) {
2701
2737
  return;
2702
2738
  }
2703
2739
  const scope = context.sourceCode.getScope(node);
2704
2740
  for (const arg of node.arguments) {
2705
- if (arg.type === import_utils17.AST_NODE_TYPES.SpreadElement) continue;
2741
+ if (arg.type === import_utils18.AST_NODE_TYPES.SpreadElement) continue;
2706
2742
  const unwrapped = unwrap(arg);
2707
- if (unwrapped === null || unwrapped.type !== import_utils17.AST_NODE_TYPES.Identifier) {
2743
+ if (unwrapped === null || unwrapped.type !== import_utils18.AST_NODE_TYPES.Identifier) {
2708
2744
  continue;
2709
2745
  }
2710
2746
  const variable = findVariable2(scope, unwrapped.name);
@@ -2717,13 +2753,13 @@ var prefer_schema_for_api_payload_default = import_utils17.ESLintUtils.RuleCreat
2717
2753
  const obj = unwrap(node.object);
2718
2754
  if (isRawPayloadSource(obj)) {
2719
2755
  const parent = node.parent;
2720
- if (parent.type === import_utils17.AST_NODE_TYPES.CallExpression && parent.callee === node && node.property.type === import_utils17.AST_NODE_TYPES.Identifier && (node.property.name === "parse" || node.property.name === "safeParse")) {
2756
+ if (parent.type === import_utils18.AST_NODE_TYPES.CallExpression && parent.callee === node && node.property.type === import_utils18.AST_NODE_TYPES.Identifier && (node.property.name === "parse" || node.property.name === "safeParse")) {
2721
2757
  return;
2722
2758
  }
2723
2759
  context.report({ node, messageId: "unparsedJsonAccess" });
2724
2760
  return;
2725
2761
  }
2726
- if (obj !== null && obj.type === import_utils17.AST_NODE_TYPES.Identifier && isUnvalidatedVariableRef(obj, scope, unvalidatedVariables)) {
2762
+ if (obj !== null && obj.type === import_utils18.AST_NODE_TYPES.Identifier && isUnvalidatedVariableRef(obj, scope, unvalidatedVariables)) {
2727
2763
  context.report({ node, messageId: "unparsedJsonAccess" });
2728
2764
  const variable = findVariable2(scope, obj.name);
2729
2765
  if (variable !== null) {
@@ -2736,7 +2772,7 @@ var prefer_schema_for_api_payload_default = import_utils17.ESLintUtils.RuleCreat
2736
2772
  });
2737
2773
 
2738
2774
  // src/rules/prefer-semantic-colors.ts
2739
- var import_utils18 = require("@typescript-eslint/utils");
2775
+ var import_utils19 = require("@typescript-eslint/utils");
2740
2776
  var import_fs = require("fs");
2741
2777
  var import_path = require("path");
2742
2778
 
@@ -2810,8 +2846,8 @@ var SVG_EXEMPT_COLOR_VALUES = /* @__PURE__ */ new Set([
2810
2846
  ]);
2811
2847
  function jsxElementName(node) {
2812
2848
  const name = node.openingElement.name;
2813
- if (name.type === import_utils18.AST_NODE_TYPES.JSXIdentifier) return name.name;
2814
- if (name.type === import_utils18.AST_NODE_TYPES.JSXMemberExpression && name.property.type === import_utils18.AST_NODE_TYPES.JSXIdentifier) {
2849
+ if (name.type === import_utils19.AST_NODE_TYPES.JSXIdentifier) return name.name;
2850
+ if (name.type === import_utils19.AST_NODE_TYPES.JSXMemberExpression && name.property.type === import_utils19.AST_NODE_TYPES.JSXIdentifier) {
2815
2851
  return name.property.name;
2816
2852
  }
2817
2853
  return null;
@@ -2822,7 +2858,7 @@ function isSvgLikeElementName(name) {
2822
2858
  var isInsideSvg = (node) => {
2823
2859
  let current = node.parent;
2824
2860
  while (current !== void 0 && current !== null) {
2825
- if (current.type === import_utils18.AST_NODE_TYPES.JSXElement) {
2861
+ if (current.type === import_utils19.AST_NODE_TYPES.JSXElement) {
2826
2862
  const name = jsxElementName(current);
2827
2863
  if (name !== null && isSvgLikeElementName(name)) return true;
2828
2864
  }
@@ -2833,7 +2869,7 @@ var isInsideSvg = (node) => {
2833
2869
  var isInsideIconFactoryPath = (node) => {
2834
2870
  let current = node.parent;
2835
2871
  while (current !== void 0 && current !== null) {
2836
- if (current.type === import_utils18.AST_NODE_TYPES.Property && propName(current.key) === "path" && current.parent.type === import_utils18.AST_NODE_TYPES.ObjectExpression && current.parent.parent.type === import_utils18.AST_NODE_TYPES.CallExpression && current.parent.parent.callee.type === import_utils18.AST_NODE_TYPES.Identifier && current.parent.parent.callee.name === "createIcon") {
2872
+ if (current.type === import_utils19.AST_NODE_TYPES.Property && propName(current.key) === "path" && current.parent.type === import_utils19.AST_NODE_TYPES.ObjectExpression && current.parent.parent.type === import_utils19.AST_NODE_TYPES.CallExpression && current.parent.parent.callee.type === import_utils19.AST_NODE_TYPES.Identifier && current.parent.parent.callee.name === "createIcon") {
2837
2873
  return true;
2838
2874
  }
2839
2875
  current = current.parent;
@@ -2869,11 +2905,11 @@ var hasSemanticTokenSystem = (filename) => {
2869
2905
  return false;
2870
2906
  };
2871
2907
  var propName = (key) => {
2872
- if (key.type === import_utils18.AST_NODE_TYPES.Identifier) return key.name;
2873
- if (key.type === import_utils18.AST_NODE_TYPES.Literal && typeof key.value === "string") return key.value;
2908
+ if (key.type === import_utils19.AST_NODE_TYPES.Identifier) return key.name;
2909
+ if (key.type === import_utils19.AST_NODE_TYPES.Literal && typeof key.value === "string") return key.value;
2874
2910
  return null;
2875
2911
  };
2876
- var prefer_semantic_colors_default = import_utils18.ESLintUtils.RuleCreator(
2912
+ var prefer_semantic_colors_default = import_utils19.ESLintUtils.RuleCreator(
2877
2913
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
2878
2914
  )({
2879
2915
  name: "prefer-semantic-colors",
@@ -2916,27 +2952,27 @@ var prefer_semantic_colors_default = import_utils18.ESLintUtils.RuleCreator(
2916
2952
  const checkClassNode = (node) => {
2917
2953
  if (node === null) return;
2918
2954
  switch (node.type) {
2919
- case import_utils18.AST_NODE_TYPES.Literal:
2955
+ case import_utils19.AST_NODE_TYPES.Literal:
2920
2956
  if (typeof node.value === "string") reportClasses(node.value, node);
2921
2957
  break;
2922
- case import_utils18.AST_NODE_TYPES.TemplateLiteral:
2958
+ case import_utils19.AST_NODE_TYPES.TemplateLiteral:
2923
2959
  for (const quasi of node.quasis) reportClasses(quasi.value.cooked ?? "", quasi);
2924
2960
  break;
2925
- case import_utils18.AST_NODE_TYPES.ArrayExpression:
2961
+ case import_utils19.AST_NODE_TYPES.ArrayExpression:
2926
2962
  for (const element of node.elements) {
2927
- if (element !== null && element.type !== import_utils18.AST_NODE_TYPES.SpreadElement) checkClassNode(element);
2963
+ if (element !== null && element.type !== import_utils19.AST_NODE_TYPES.SpreadElement) checkClassNode(element);
2928
2964
  }
2929
2965
  break;
2930
- case import_utils18.AST_NODE_TYPES.ObjectExpression:
2966
+ case import_utils19.AST_NODE_TYPES.ObjectExpression:
2931
2967
  for (const property of node.properties) {
2932
- if (property.type === import_utils18.AST_NODE_TYPES.Property) checkClassNode(property.value);
2968
+ if (property.type === import_utils19.AST_NODE_TYPES.Property) checkClassNode(property.value);
2933
2969
  }
2934
2970
  break;
2935
- case import_utils18.AST_NODE_TYPES.ConditionalExpression:
2971
+ case import_utils19.AST_NODE_TYPES.ConditionalExpression:
2936
2972
  checkClassNode(node.consequent);
2937
2973
  checkClassNode(node.alternate);
2938
2974
  break;
2939
- case import_utils18.AST_NODE_TYPES.LogicalExpression:
2975
+ case import_utils19.AST_NODE_TYPES.LogicalExpression:
2940
2976
  checkClassNode(node.right);
2941
2977
  break;
2942
2978
  default:
@@ -2944,29 +2980,29 @@ var prefer_semantic_colors_default = import_utils18.ESLintUtils.RuleCreator(
2944
2980
  }
2945
2981
  };
2946
2982
  const checkColorValueNode = (node) => {
2947
- if (node.type === import_utils18.AST_NODE_TYPES.Literal && typeof node.value === "string" && RAW_COLOR_VALUE_RE.test(node.value)) {
2983
+ if (node.type === import_utils19.AST_NODE_TYPES.Literal && typeof node.value === "string" && RAW_COLOR_VALUE_RE.test(node.value)) {
2948
2984
  context.report({ node, messageId: "inlineColor", data: { value: node.value } });
2949
2985
  }
2950
2986
  };
2951
2987
  return {
2952
2988
  "JSXAttribute[name.name='className']"(node) {
2953
2989
  if (node.value === null) return;
2954
- if (node.value.type === import_utils18.AST_NODE_TYPES.Literal) checkClassNode(node.value);
2955
- else if (node.value.type === import_utils18.AST_NODE_TYPES.JSXExpressionContainer) {
2956
- if (node.value.expression.type !== import_utils18.AST_NODE_TYPES.JSXEmptyExpression) {
2990
+ if (node.value.type === import_utils19.AST_NODE_TYPES.Literal) checkClassNode(node.value);
2991
+ else if (node.value.type === import_utils19.AST_NODE_TYPES.JSXExpressionContainer) {
2992
+ if (node.value.expression.type !== import_utils19.AST_NODE_TYPES.JSXEmptyExpression) {
2957
2993
  checkClassNode(node.value.expression);
2958
2994
  }
2959
2995
  }
2960
2996
  },
2961
2997
  CallExpression(node) {
2962
- if (node.callee.type === import_utils18.AST_NODE_TYPES.Identifier && CLASS_FNS.has(node.callee.name)) {
2998
+ if (node.callee.type === import_utils19.AST_NODE_TYPES.Identifier && CLASS_FNS.has(node.callee.name)) {
2963
2999
  for (const arg of node.arguments) {
2964
- if (arg.type !== import_utils18.AST_NODE_TYPES.SpreadElement) checkClassNode(arg);
3000
+ if (arg.type !== import_utils19.AST_NODE_TYPES.SpreadElement) checkClassNode(arg);
2965
3001
  }
2966
3002
  }
2967
3003
  },
2968
3004
  VariableDeclarator(node) {
2969
- if (node.id.type === import_utils18.AST_NODE_TYPES.Identifier && CLASS_NAME_RE.test(node.id.name)) {
3005
+ if (node.id.type === import_utils19.AST_NODE_TYPES.Identifier && CLASS_NAME_RE.test(node.id.name)) {
2970
3006
  checkClassNode(node.init);
2971
3007
  }
2972
3008
  },
@@ -2978,7 +3014,7 @@ var prefer_semantic_colors_default = import_utils18.ESLintUtils.RuleCreator(
2978
3014
  // Neutral drawing literals and anything inside an SVG defs container are
2979
3015
  // structural, not UI tokens, so they never fire.
2980
3016
  "JSXAttribute[name.name=/^(fill|stroke|color)$/]"(node) {
2981
- if (node.value?.type !== import_utils18.AST_NODE_TYPES.Literal) return;
3017
+ if (node.value?.type !== import_utils19.AST_NODE_TYPES.Literal) return;
2982
3018
  if (typeof node.value.value === "string" && SVG_EXEMPT_COLOR_VALUES.has(node.value.value.toLowerCase())) {
2983
3019
  return;
2984
3020
  }
@@ -2995,7 +3031,7 @@ var prefer_semantic_colors_default = import_utils18.ESLintUtils.RuleCreator(
2995
3031
  });
2996
3032
 
2997
3033
  // src/rules/prefer-server-actions.ts
2998
- var import_utils19 = require("@typescript-eslint/utils");
3034
+ var import_utils20 = require("@typescript-eslint/utils");
2999
3035
  var MUTATION_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "DELETE", "PATCH"]);
3000
3036
  var AXIOS_MUTATION_METHODS = /* @__PURE__ */ new Set(["post", "put", "delete", "patch"]);
3001
3037
  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\/)/;
@@ -3075,7 +3111,7 @@ function getPropertyNode(objNode, propName2) {
3075
3111
  }
3076
3112
  return null;
3077
3113
  }
3078
- var prefer_server_actions_default = import_utils19.ESLintUtils.RuleCreator(
3114
+ var prefer_server_actions_default = import_utils20.ESLintUtils.RuleCreator(
3079
3115
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3080
3116
  )({
3081
3117
  name: "prefer-server-actions",
@@ -3150,7 +3186,7 @@ var prefer_server_actions_default = import_utils19.ESLintUtils.RuleCreator(
3150
3186
  });
3151
3187
 
3152
3188
  // src/rules/prefer-shadcn.ts
3153
- var import_utils20 = require("@typescript-eslint/utils");
3189
+ var import_utils21 = require("@typescript-eslint/utils");
3154
3190
  var REPLACEMENTS = {
3155
3191
  select: "Select",
3156
3192
  textarea: "Textarea",
@@ -3165,10 +3201,10 @@ var SKIPPED_INPUT_TYPES = /* @__PURE__ */ new Set(["file", "hidden"]);
3165
3201
  var kebabCase = (component) => component.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3166
3202
  var literalTypeAttr = (node) => {
3167
3203
  for (const attribute of node.attributes) {
3168
- if (attribute.type !== import_utils20.AST_NODE_TYPES.JSXAttribute || attribute.name.type !== import_utils20.AST_NODE_TYPES.JSXIdentifier || attribute.name.name !== "type") {
3204
+ if (attribute.type !== import_utils21.AST_NODE_TYPES.JSXAttribute || attribute.name.type !== import_utils21.AST_NODE_TYPES.JSXIdentifier || attribute.name.name !== "type") {
3169
3205
  continue;
3170
3206
  }
3171
- if (attribute.value?.type === import_utils20.AST_NODE_TYPES.Literal && typeof attribute.value.value === "string") {
3207
+ if (attribute.value?.type === import_utils21.AST_NODE_TYPES.Literal && typeof attribute.value.value === "string") {
3172
3208
  return { kind: "literal", value: attribute.value.value.toLowerCase() };
3173
3209
  }
3174
3210
  return { kind: "dynamic" };
@@ -3176,7 +3212,7 @@ var literalTypeAttr = (node) => {
3176
3212
  return null;
3177
3213
  };
3178
3214
  var hasFileAcceptAttr = (node) => node.attributes.some(
3179
- (attribute) => attribute.type === import_utils20.AST_NODE_TYPES.JSXAttribute && attribute.name.type === import_utils20.AST_NODE_TYPES.JSXIdentifier && attribute.name.name === "accept"
3215
+ (attribute) => attribute.type === import_utils21.AST_NODE_TYPES.JSXAttribute && attribute.name.type === import_utils21.AST_NODE_TYPES.JSXIdentifier && attribute.name.name === "accept"
3180
3216
  );
3181
3217
  var resolveInputReplacement = (node) => {
3182
3218
  const typeAttr = literalTypeAttr(node);
@@ -3185,7 +3221,7 @@ var resolveInputReplacement = (node) => {
3185
3221
  if (SKIPPED_INPUT_TYPES.has(typeAttr.value)) return null;
3186
3222
  return INPUT_TYPE_REPLACEMENTS[typeAttr.value] ?? "Input";
3187
3223
  };
3188
- var prefer_shadcn_default = import_utils20.ESLintUtils.RuleCreator(
3224
+ var prefer_shadcn_default = import_utils21.ESLintUtils.RuleCreator(
3189
3225
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3190
3226
  )({
3191
3227
  name: "prefer-shadcn",
@@ -3229,36 +3265,36 @@ var prefer_shadcn_default = import_utils20.ESLintUtils.RuleCreator(
3229
3265
  });
3230
3266
 
3231
3267
  // src/rules/require-assert-never.ts
3232
- var import_utils21 = require("@typescript-eslint/utils");
3268
+ var import_utils22 = require("@typescript-eslint/utils");
3233
3269
  var isAssertNeverCall = (expression) => {
3234
- if (expression.type !== import_utils21.AST_NODE_TYPES.CallExpression) return false;
3270
+ if (expression.type !== import_utils22.AST_NODE_TYPES.CallExpression) return false;
3235
3271
  const callee = expression.callee;
3236
- if (callee.type === import_utils21.AST_NODE_TYPES.Identifier) {
3272
+ if (callee.type === import_utils22.AST_NODE_TYPES.Identifier) {
3237
3273
  return callee.name === "assertNever";
3238
3274
  }
3239
- if (callee.type === import_utils21.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils21.AST_NODE_TYPES.Identifier) {
3275
+ if (callee.type === import_utils22.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils22.AST_NODE_TYPES.Identifier) {
3240
3276
  return callee.property.name === "assertNever";
3241
3277
  }
3242
3278
  return false;
3243
3279
  };
3244
3280
  var statementContainsAssertNever = (statement) => {
3245
- if (statement.type === import_utils21.AST_NODE_TYPES.ExpressionStatement) {
3281
+ if (statement.type === import_utils22.AST_NODE_TYPES.ExpressionStatement) {
3246
3282
  return isAssertNeverCall(statement.expression);
3247
3283
  }
3248
- if (statement.type === import_utils21.AST_NODE_TYPES.ThrowStatement) {
3284
+ if (statement.type === import_utils22.AST_NODE_TYPES.ThrowStatement) {
3249
3285
  return isAssertNeverCall(statement.argument);
3250
3286
  }
3251
- if (statement.type === import_utils21.AST_NODE_TYPES.ReturnStatement) {
3287
+ if (statement.type === import_utils22.AST_NODE_TYPES.ReturnStatement) {
3252
3288
  return statement.argument !== null && isAssertNeverCall(statement.argument);
3253
3289
  }
3254
- if (statement.type === import_utils21.AST_NODE_TYPES.BlockStatement) {
3290
+ if (statement.type === import_utils22.AST_NODE_TYPES.BlockStatement) {
3255
3291
  return statement.body.some(statementContainsAssertNever);
3256
3292
  }
3257
3293
  return false;
3258
3294
  };
3259
3295
  var isRuntimeHandlingStatement = (statement) => {
3260
- if (statement.type === import_utils21.AST_NODE_TYPES.EmptyStatement) return false;
3261
- if (statement.type === import_utils21.AST_NODE_TYPES.BlockStatement) {
3296
+ if (statement.type === import_utils22.AST_NODE_TYPES.EmptyStatement) return false;
3297
+ if (statement.type === import_utils22.AST_NODE_TYPES.BlockStatement) {
3262
3298
  return statement.body.some(isRuntimeHandlingStatement);
3263
3299
  }
3264
3300
  return true;
@@ -3274,12 +3310,12 @@ var isCommentOnlyNoopDefault = (defaultCase, sourceCode) => {
3274
3310
  return colonToken !== null && sourceCode.getCommentsAfter(colonToken).length > 0;
3275
3311
  }
3276
3312
  const only = defaultCase.consequent[0];
3277
- if (only !== void 0 && defaultCase.consequent.length === 1 && only.type === import_utils21.AST_NODE_TYPES.BlockStatement && only.body.length === 0) {
3313
+ if (only !== void 0 && defaultCase.consequent.length === 1 && only.type === import_utils22.AST_NODE_TYPES.BlockStatement && only.body.length === 0) {
3278
3314
  return sourceCode.getCommentsInside(only).length > 0;
3279
3315
  }
3280
3316
  return false;
3281
3317
  };
3282
- var require_assert_never_default = import_utils21.ESLintUtils.RuleCreator(
3318
+ var require_assert_never_default = import_utils22.ESLintUtils.RuleCreator(
3283
3319
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3284
3320
  )({
3285
3321
  name: "require-assert-never",
@@ -3317,7 +3353,7 @@ var require_assert_never_default = import_utils21.ESLintUtils.RuleCreator(
3317
3353
  });
3318
3354
 
3319
3355
  // src/rules/require-zod-form-validation.ts
3320
- var import_utils22 = require("@typescript-eslint/utils");
3356
+ var import_utils23 = require("@typescript-eslint/utils");
3321
3357
 
3322
3358
  // src/rules/_zod.ts
3323
3359
  var ZOD_PREFIX_RE = /^Z[A-Z]/;
@@ -3328,14 +3364,14 @@ var ZOD_SCHEMA_NAME_RE = /Schema$|^Z[A-Z]/;
3328
3364
  var looksLikeZodSchema = (node) => {
3329
3365
  let current = node;
3330
3366
  while (true) {
3331
- if (current.type === import_utils22.AST_NODE_TYPES.Identifier) {
3367
+ if (current.type === import_utils23.AST_NODE_TYPES.Identifier) {
3332
3368
  return current.name === "z" || ZOD_SCHEMA_NAME_RE.test(current.name);
3333
3369
  }
3334
- if (current.type === import_utils22.AST_NODE_TYPES.CallExpression) {
3370
+ if (current.type === import_utils23.AST_NODE_TYPES.CallExpression) {
3335
3371
  current = current.callee;
3336
3372
  continue;
3337
3373
  }
3338
- if (current.type === import_utils22.AST_NODE_TYPES.MemberExpression) {
3374
+ if (current.type === import_utils23.AST_NODE_TYPES.MemberExpression) {
3339
3375
  current = current.object;
3340
3376
  continue;
3341
3377
  }
@@ -3343,25 +3379,25 @@ var looksLikeZodSchema = (node) => {
3343
3379
  }
3344
3380
  };
3345
3381
  var isZodParseCall = (node) => {
3346
- if (node.type !== import_utils22.AST_NODE_TYPES.CallExpression) return false;
3382
+ if (node.type !== import_utils23.AST_NODE_TYPES.CallExpression) return false;
3347
3383
  const callee = node.callee;
3348
- if (callee.type !== import_utils22.AST_NODE_TYPES.MemberExpression) return false;
3384
+ if (callee.type !== import_utils23.AST_NODE_TYPES.MemberExpression) return false;
3349
3385
  if (callee.computed) return false;
3350
- if (callee.property.type !== import_utils22.AST_NODE_TYPES.Identifier) return false;
3386
+ if (callee.property.type !== import_utils23.AST_NODE_TYPES.Identifier) return false;
3351
3387
  const method = callee.property.name;
3352
3388
  if (method !== "parse" && method !== "safeParse") return false;
3353
3389
  return looksLikeZodSchema(callee.object);
3354
3390
  };
3355
3391
  var isFormDataMethodCall = (node) => {
3356
3392
  let current = node;
3357
- if (current.type === import_utils22.AST_NODE_TYPES.AwaitExpression) {
3393
+ if (current.type === import_utils23.AST_NODE_TYPES.AwaitExpression) {
3358
3394
  current = current.argument;
3359
3395
  }
3360
- if (current.type !== import_utils22.AST_NODE_TYPES.CallExpression) return false;
3396
+ if (current.type !== import_utils23.AST_NODE_TYPES.CallExpression) return false;
3361
3397
  const callee = current.callee;
3362
- return callee.type === import_utils22.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils22.AST_NODE_TYPES.Identifier && callee.property.name === "formData";
3398
+ return callee.type === import_utils23.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils23.AST_NODE_TYPES.Identifier && callee.property.name === "formData";
3363
3399
  };
3364
- var require_zod_form_validation_default = import_utils22.ESLintUtils.RuleCreator(
3400
+ var require_zod_form_validation_default = import_utils23.ESLintUtils.RuleCreator(
3365
3401
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3366
3402
  )({
3367
3403
  name: "require-zod-form-validation",
@@ -3381,14 +3417,14 @@ var require_zod_form_validation_default = import_utils22.ESLintUtils.RuleCreator
3381
3417
  return {};
3382
3418
  }
3383
3419
  const isFormSourceIdentifier = (node) => {
3384
- if (node.type !== import_utils22.AST_NODE_TYPES.Identifier) return false;
3420
+ if (node.type !== import_utils23.AST_NODE_TYPES.Identifier) return false;
3385
3421
  if (/formdata/i.test(node.name)) return true;
3386
3422
  let scope = context.sourceCode.getScope(node);
3387
3423
  while (scope !== null) {
3388
3424
  const variable = scope.set.get(node.name);
3389
3425
  if (variable !== void 0 && variable.defs.length === 1) {
3390
3426
  const def = variable.defs[0];
3391
- if (def !== void 0 && def.type === "Variable" && def.node.type === import_utils22.AST_NODE_TYPES.VariableDeclarator && def.node.init !== null) {
3427
+ if (def !== void 0 && def.type === "Variable" && def.node.type === import_utils23.AST_NODE_TYPES.VariableDeclarator && def.node.init !== null) {
3392
3428
  return isFormDataMethodCall(def.node.init);
3393
3429
  }
3394
3430
  return false;
@@ -3399,8 +3435,8 @@ var require_zod_form_validation_default = import_utils22.ESLintUtils.RuleCreator
3399
3435
  };
3400
3436
  const isFormDataGetCall = (node) => {
3401
3437
  const callee = node.callee;
3402
- if (callee.type !== import_utils22.AST_NODE_TYPES.MemberExpression) return false;
3403
- if (callee.property.type !== import_utils22.AST_NODE_TYPES.Identifier || callee.property.name !== "get") {
3438
+ if (callee.type !== import_utils23.AST_NODE_TYPES.MemberExpression) return false;
3439
+ if (callee.property.type !== import_utils23.AST_NODE_TYPES.Identifier || callee.property.name !== "get") {
3404
3440
  return false;
3405
3441
  }
3406
3442
  return isFormSourceIdentifier(callee.object);
@@ -3415,11 +3451,11 @@ var require_zod_form_validation_default = import_utils22.ESLintUtils.RuleCreator
3415
3451
  };
3416
3452
  const isInstanceofNarrowing = (node) => {
3417
3453
  const parent = node.parent;
3418
- return parent !== null && parent !== void 0 && parent.type === import_utils22.AST_NODE_TYPES.BinaryExpression && parent.operator === "instanceof" && parent.left === node;
3454
+ return parent !== null && parent !== void 0 && parent.type === import_utils23.AST_NODE_TYPES.BinaryExpression && parent.operator === "instanceof" && parent.left === node;
3419
3455
  };
3420
3456
  const boundDeclarator = (node) => {
3421
3457
  const parent = node.parent;
3422
- if (parent.type === import_utils22.AST_NODE_TYPES.VariableDeclarator && parent.init === node && parent.id.type === import_utils22.AST_NODE_TYPES.Identifier) {
3458
+ if (parent.type === import_utils23.AST_NODE_TYPES.VariableDeclarator && parent.init === node && parent.id.type === import_utils23.AST_NODE_TYPES.Identifier) {
3423
3459
  return parent;
3424
3460
  }
3425
3461
  return null;
@@ -3447,7 +3483,7 @@ var require_zod_form_validation_default = import_utils22.ESLintUtils.RuleCreator
3447
3483
  });
3448
3484
 
3449
3485
  // src/rules/zod-naming-convention.ts
3450
- var import_utils23 = require("@typescript-eslint/utils");
3486
+ var import_utils24 = require("@typescript-eslint/utils");
3451
3487
  var CONVENTIONS = {
3452
3488
  prefix: { test: ZOD_PREFIX_RE, messageId: "zPrefix" },
3453
3489
  suffix: { test: ZOD_SUFFIX_RE, messageId: "schemaSuffix" },
@@ -3471,15 +3507,15 @@ var NON_SCHEMA_TERMINALS = /* @__PURE__ */ new Set([
3471
3507
  "registry",
3472
3508
  "implement"
3473
3509
  ]);
3474
- var terminalMethodName = (callee) => !callee.computed && callee.property.type === import_utils23.AST_NODE_TYPES.Identifier ? callee.property.name : null;
3510
+ var terminalMethodName = (callee) => !callee.computed && callee.property.type === import_utils24.AST_NODE_TYPES.Identifier ? callee.property.name : null;
3475
3511
  var calleeChainStartsWithZ = (node) => {
3476
3512
  let current = node;
3477
- while (current.type === import_utils23.AST_NODE_TYPES.MemberExpression) {
3513
+ while (current.type === import_utils24.AST_NODE_TYPES.MemberExpression) {
3478
3514
  const receiver = current.object;
3479
- if (receiver.type === import_utils23.AST_NODE_TYPES.Identifier && receiver.name === "z") {
3515
+ if (receiver.type === import_utils24.AST_NODE_TYPES.Identifier && receiver.name === "z") {
3480
3516
  return true;
3481
3517
  }
3482
- if (receiver.type === import_utils23.AST_NODE_TYPES.CallExpression) {
3518
+ if (receiver.type === import_utils24.AST_NODE_TYPES.CallExpression) {
3483
3519
  current = receiver.callee;
3484
3520
  continue;
3485
3521
  }
@@ -3487,7 +3523,7 @@ var calleeChainStartsWithZ = (node) => {
3487
3523
  }
3488
3524
  return false;
3489
3525
  };
3490
- var zod_naming_convention_default = import_utils23.ESLintUtils.RuleCreator(
3526
+ var zod_naming_convention_default = import_utils24.ESLintUtils.RuleCreator(
3491
3527
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3492
3528
  )({
3493
3529
  name: "zod-naming-convention",
@@ -3526,13 +3562,13 @@ var zod_naming_convention_default = import_utils23.ESLintUtils.RuleCreator(
3526
3562
  VariableDeclarator(node) {
3527
3563
  const init = node.init;
3528
3564
  if (init === null || init === void 0) return;
3529
- if (init.type !== import_utils23.AST_NODE_TYPES.CallExpression) return;
3565
+ if (init.type !== import_utils24.AST_NODE_TYPES.CallExpression) return;
3530
3566
  const callee = init.callee;
3531
- if (callee.type !== import_utils23.AST_NODE_TYPES.MemberExpression) return;
3567
+ if (callee.type !== import_utils24.AST_NODE_TYPES.MemberExpression) return;
3532
3568
  if (!calleeChainStartsWithZ(callee)) return;
3533
3569
  const terminal = terminalMethodName(callee);
3534
3570
  if (terminal !== null && NON_SCHEMA_TERMINALS.has(terminal)) return;
3535
- if (node.id.type !== import_utils23.AST_NODE_TYPES.Identifier) return;
3571
+ if (node.id.type !== import_utils24.AST_NODE_TYPES.Identifier) return;
3536
3572
  if (test.test(node.id.name)) return;
3537
3573
  if (acceptsSchemaWord && CONTAINS_SCHEMA_RE.test(node.id.name)) return;
3538
3574
  context.report({
@@ -3545,7 +3581,7 @@ var zod_naming_convention_default = import_utils23.ESLintUtils.RuleCreator(
3545
3581
  });
3546
3582
 
3547
3583
  // src/rules/no-cors-wildcard-with-credentials.ts
3548
- var import_utils24 = require("@typescript-eslint/utils");
3584
+ var import_utils25 = require("@typescript-eslint/utils");
3549
3585
  var ACAO_HEADER = "access-control-allow-origin";
3550
3586
  var ACAC_HEADER = "access-control-allow-credentials";
3551
3587
  var HEADER_SET_METHODS = /* @__PURE__ */ new Set(["setheader", "set", "append"]);
@@ -3687,7 +3723,7 @@ function enclosingScope(node) {
3687
3723
  }
3688
3724
  return void 0;
3689
3725
  }
3690
- var no_cors_wildcard_with_credentials_default = import_utils24.ESLintUtils.RuleCreator(
3726
+ var no_cors_wildcard_with_credentials_default = import_utils25.ESLintUtils.RuleCreator(
3691
3727
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3692
3728
  )({
3693
3729
  name: "no-cors-wildcard-with-credentials",
@@ -3755,9 +3791,9 @@ var no_cors_wildcard_with_credentials_default = import_utils24.ESLintUtils.RuleC
3755
3791
  });
3756
3792
 
3757
3793
  // src/rules/no-silent-promise-catch.ts
3758
- var import_utils25 = require("@typescript-eslint/utils");
3794
+ var import_utils26 = require("@typescript-eslint/utils");
3759
3795
  function isBodyParseCall(node) {
3760
- return node.type === import_utils25.AST_NODE_TYPES.CallExpression && node.arguments.length === 0 && node.callee.type === import_utils25.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils25.AST_NODE_TYPES.Identifier && (node.callee.property.name === "json" || node.callee.property.name === "text");
3796
+ return node.type === import_utils26.AST_NODE_TYPES.CallExpression && node.arguments.length === 0 && node.callee.type === import_utils26.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils26.AST_NODE_TYPES.Identifier && (node.callee.property.name === "json" || node.callee.property.name === "text");
3761
3797
  }
3762
3798
  var TEARDOWN_METHODS = /* @__PURE__ */ new Set([
3763
3799
  "cancel",
@@ -3772,21 +3808,21 @@ var TEARDOWN_METHODS = /* @__PURE__ */ new Set([
3772
3808
  var DIRECTIVE_COMMENT_RE = /^\s*(eslint-|@ts-|prettier-ignore|biome-ignore|c8 |v8 |istanbul )/;
3773
3809
  var isExplanatory = (comment) => !DIRECTIVE_COMMENT_RE.test(comment.value);
3774
3810
  function isTeardownCall(node) {
3775
- return node.type === import_utils25.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils25.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils25.AST_NODE_TYPES.Identifier && TEARDOWN_METHODS.has(node.callee.property.name);
3811
+ return node.type === import_utils26.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils26.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils26.AST_NODE_TYPES.Identifier && TEARDOWN_METHODS.has(node.callee.property.name);
3776
3812
  }
3777
3813
  function isSilentExpression(node) {
3778
3814
  switch (node.type) {
3779
- case import_utils25.AST_NODE_TYPES.Literal:
3815
+ case import_utils26.AST_NODE_TYPES.Literal:
3780
3816
  return !("regex" in node);
3781
- case import_utils25.AST_NODE_TYPES.Identifier:
3817
+ case import_utils26.AST_NODE_TYPES.Identifier:
3782
3818
  return node.name === "undefined";
3783
- case import_utils25.AST_NODE_TYPES.UnaryExpression:
3784
- return node.operator === "void" && node.argument.type === import_utils25.AST_NODE_TYPES.Literal;
3785
- case import_utils25.AST_NODE_TYPES.ObjectExpression:
3819
+ case import_utils26.AST_NODE_TYPES.UnaryExpression:
3820
+ return node.operator === "void" && node.argument.type === import_utils26.AST_NODE_TYPES.Literal;
3821
+ case import_utils26.AST_NODE_TYPES.ObjectExpression:
3786
3822
  return node.properties.length === 0;
3787
- case import_utils25.AST_NODE_TYPES.ArrayExpression:
3823
+ case import_utils26.AST_NODE_TYPES.ArrayExpression:
3788
3824
  return node.elements.length === 0;
3789
- case import_utils25.AST_NODE_TYPES.TSAsExpression:
3825
+ case import_utils26.AST_NODE_TYPES.TSAsExpression:
3790
3826
  return isSilentExpression(node.expression);
3791
3827
  default:
3792
3828
  return false;
@@ -3794,7 +3830,7 @@ function isSilentExpression(node) {
3794
3830
  }
3795
3831
  function isSilentHandler(handler) {
3796
3832
  const body = handler.body;
3797
- if (body.type !== import_utils25.AST_NODE_TYPES.BlockStatement) {
3833
+ if (body.type !== import_utils26.AST_NODE_TYPES.BlockStatement) {
3798
3834
  return isSilentExpression(body);
3799
3835
  }
3800
3836
  if (body.body.length === 0) {
@@ -3802,13 +3838,13 @@ function isSilentHandler(handler) {
3802
3838
  }
3803
3839
  if (body.body.length === 1) {
3804
3840
  const only = body.body[0];
3805
- if (only !== void 0 && only.type === import_utils25.AST_NODE_TYPES.ReturnStatement) {
3841
+ if (only !== void 0 && only.type === import_utils26.AST_NODE_TYPES.ReturnStatement) {
3806
3842
  return only.argument === null || isSilentExpression(only.argument);
3807
3843
  }
3808
3844
  }
3809
3845
  return false;
3810
3846
  }
3811
- var no_silent_promise_catch_default = import_utils25.ESLintUtils.RuleCreator(
3847
+ var no_silent_promise_catch_default = import_utils26.ESLintUtils.RuleCreator(
3812
3848
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3813
3849
  )({
3814
3850
  name: "no-silent-promise-catch",
@@ -3833,7 +3869,7 @@ var no_silent_promise_catch_default = import_utils25.ESLintUtils.RuleCreator(
3833
3869
  return true;
3834
3870
  }
3835
3871
  let statement = call;
3836
- while (statement.parent !== void 0 && statement.parent !== null && !statement.type.endsWith("Statement") && statement.type !== import_utils25.AST_NODE_TYPES.VariableDeclaration) {
3872
+ while (statement.parent !== void 0 && statement.parent !== null && !statement.type.endsWith("Statement") && statement.type !== import_utils26.AST_NODE_TYPES.VariableDeclaration) {
3837
3873
  statement = statement.parent;
3838
3874
  }
3839
3875
  if (sourceCode.getCommentsBefore(statement).some(isExplanatory)) {
@@ -3845,7 +3881,7 @@ var no_silent_promise_catch_default = import_utils25.ESLintUtils.RuleCreator(
3845
3881
  };
3846
3882
  return {
3847
3883
  CallExpression(node) {
3848
- if (node.callee.type !== import_utils25.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.property.type !== import_utils25.AST_NODE_TYPES.Identifier || node.callee.property.name !== "catch") {
3884
+ if (node.callee.type !== import_utils26.AST_NODE_TYPES.MemberExpression || node.callee.computed || node.callee.property.type !== import_utils26.AST_NODE_TYPES.Identifier || node.callee.property.name !== "catch") {
3849
3885
  return;
3850
3886
  }
3851
3887
  if (isBodyParseCall(node.callee.object)) {
@@ -3854,14 +3890,14 @@ var no_silent_promise_catch_default = import_utils25.ESLintUtils.RuleCreator(
3854
3890
  if (isTeardownCall(node.callee.object)) {
3855
3891
  return;
3856
3892
  }
3857
- if (node.parent.type === import_utils25.AST_NODE_TYPES.MemberExpression && node.parent.object === node) {
3893
+ if (node.parent.type === import_utils26.AST_NODE_TYPES.MemberExpression && node.parent.object === node) {
3858
3894
  return;
3859
3895
  }
3860
3896
  if (node.arguments.length !== 1) {
3861
3897
  return;
3862
3898
  }
3863
3899
  const handler = node.arguments[0];
3864
- if (handler === void 0 || handler.type !== import_utils25.AST_NODE_TYPES.ArrowFunctionExpression && handler.type !== import_utils25.AST_NODE_TYPES.FunctionExpression) {
3900
+ if (handler === void 0 || handler.type !== import_utils26.AST_NODE_TYPES.ArrowFunctionExpression && handler.type !== import_utils26.AST_NODE_TYPES.FunctionExpression) {
3865
3901
  return;
3866
3902
  }
3867
3903
  if (hasExplanatoryComment(node, handler)) {
@@ -3876,7 +3912,7 @@ var no_silent_promise_catch_default = import_utils25.ESLintUtils.RuleCreator(
3876
3912
  });
3877
3913
 
3878
3914
  // src/rules/require-fetch-timeout.ts
3879
- var import_utils26 = require("@typescript-eslint/utils");
3915
+ var import_utils27 = require("@typescript-eslint/utils");
3880
3916
  var CODEMOD_FIXTURE_RE = /[\\/]__testfixtures__[\\/]/;
3881
3917
  var GLOBAL_OBJECTS = /* @__PURE__ */ new Set([
3882
3918
  "globalThis",
@@ -3893,14 +3929,14 @@ function matchesAnyPattern2(filename, patterns) {
3893
3929
  return false;
3894
3930
  }
3895
3931
  function initProvablyLacksSignal(init) {
3896
- if (init.type !== import_utils26.AST_NODE_TYPES.ObjectExpression) {
3932
+ if (init.type !== import_utils27.AST_NODE_TYPES.ObjectExpression) {
3897
3933
  return false;
3898
3934
  }
3899
3935
  for (const prop of init.properties) {
3900
- if (prop.type === import_utils26.AST_NODE_TYPES.SpreadElement) {
3936
+ if (prop.type === import_utils27.AST_NODE_TYPES.SpreadElement) {
3901
3937
  return false;
3902
3938
  }
3903
- if (prop.key.type === import_utils26.AST_NODE_TYPES.Identifier && prop.key.name === "signal" || prop.key.type === import_utils26.AST_NODE_TYPES.Literal && prop.key.value === "signal") {
3939
+ if (prop.key.type === import_utils27.AST_NODE_TYPES.Identifier && prop.key.name === "signal" || prop.key.type === import_utils27.AST_NODE_TYPES.Literal && prop.key.value === "signal") {
3904
3940
  return false;
3905
3941
  }
3906
3942
  if (prop.computed) {
@@ -3910,9 +3946,9 @@ function initProvablyLacksSignal(init) {
3910
3946
  return true;
3911
3947
  }
3912
3948
  function isStringish(node) {
3913
- return node.type === import_utils26.AST_NODE_TYPES.Literal && typeof node.value === "string" || node.type === import_utils26.AST_NODE_TYPES.TemplateLiteral;
3949
+ return node.type === import_utils27.AST_NODE_TYPES.Literal && typeof node.value === "string" || node.type === import_utils27.AST_NODE_TYPES.TemplateLiteral;
3914
3950
  }
3915
- var require_fetch_timeout_default = import_utils26.ESLintUtils.RuleCreator(
3951
+ var require_fetch_timeout_default = import_utils27.ESLintUtils.RuleCreator(
3916
3952
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
3917
3953
  )({
3918
3954
  name: "require-fetch-timeout",
@@ -3949,14 +3985,14 @@ var require_fetch_timeout_default = import_utils26.ESLintUtils.RuleCreator(
3949
3985
  }
3950
3986
  function resolvesToGlobal(identifier) {
3951
3987
  const scope = context.sourceCode.getScope(identifier);
3952
- const variable = import_utils26.ASTUtils.findVariable(scope, identifier.name);
3988
+ const variable = import_utils27.ASTUtils.findVariable(scope, identifier.name);
3953
3989
  return variable === null || variable.defs.length === 0;
3954
3990
  }
3955
3991
  function isGlobalFetchCall2(callee) {
3956
- if (callee.type === import_utils26.AST_NODE_TYPES.Identifier) {
3992
+ if (callee.type === import_utils27.AST_NODE_TYPES.Identifier) {
3957
3993
  return callee.name === "fetch" && resolvesToGlobal(callee);
3958
3994
  }
3959
- return callee.type === import_utils26.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils26.AST_NODE_TYPES.Identifier && callee.property.name === "fetch" && callee.object.type === import_utils26.AST_NODE_TYPES.Identifier && GLOBAL_OBJECTS.has(callee.object.name) && resolvesToGlobal(callee.object);
3995
+ return callee.type === import_utils27.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils27.AST_NODE_TYPES.Identifier && callee.property.name === "fetch" && callee.object.type === import_utils27.AST_NODE_TYPES.Identifier && GLOBAL_OBJECTS.has(callee.object.name) && resolvesToGlobal(callee.object);
3960
3996
  }
3961
3997
  return {
3962
3998
  CallExpression(node) {
@@ -3976,23 +4012,23 @@ var require_fetch_timeout_default = import_utils26.ESLintUtils.RuleCreator(
3976
4012
  });
3977
4013
 
3978
4014
  // src/rules/require-schema-validate-search.ts
3979
- var import_utils27 = require("@typescript-eslint/utils");
4015
+ var import_utils28 = require("@typescript-eslint/utils");
3980
4016
  var VALIDATOR_METHODS = /* @__PURE__ */ new Set([
3981
4017
  "parse",
3982
4018
  "safeParse",
3983
4019
  "decode"
3984
4020
  ]);
3985
4021
  function isConstTypeAnnotation(typeAnnotation) {
3986
- return typeAnnotation.type === import_utils27.AST_NODE_TYPES.TSTypeReference && typeAnnotation.typeName.type === import_utils27.AST_NODE_TYPES.Identifier && typeAnnotation.typeName.name === "const";
4022
+ return typeAnnotation.type === import_utils28.AST_NODE_TYPES.TSTypeReference && typeAnnotation.typeName.type === import_utils28.AST_NODE_TYPES.Identifier && typeAnnotation.typeName.name === "const";
3987
4023
  }
3988
4024
  function isValidatorCall(node) {
3989
- return node.callee.type === import_utils27.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils27.AST_NODE_TYPES.Identifier && VALIDATOR_METHODS.has(node.callee.property.name);
4025
+ return node.callee.type === import_utils28.AST_NODE_TYPES.MemberExpression && !node.callee.computed && node.callee.property.type === import_utils28.AST_NODE_TYPES.Identifier && VALIDATOR_METHODS.has(node.callee.property.name);
3990
4026
  }
3991
4027
  function findCastExpression(node, insideValidatorArg) {
3992
- if ((node.type === import_utils27.AST_NODE_TYPES.TSAsExpression || node.type === import_utils27.AST_NODE_TYPES.TSTypeAssertion) && !isConstTypeAnnotation(node.typeAnnotation) && !insideValidatorArg) {
4028
+ if ((node.type === import_utils28.AST_NODE_TYPES.TSAsExpression || node.type === import_utils28.AST_NODE_TYPES.TSTypeAssertion) && !isConstTypeAnnotation(node.typeAnnotation) && !insideValidatorArg) {
3993
4029
  return node;
3994
4030
  }
3995
- if (node.type === import_utils27.AST_NODE_TYPES.CallExpression && isValidatorCall(node)) {
4031
+ if (node.type === import_utils28.AST_NODE_TYPES.CallExpression && isValidatorCall(node)) {
3996
4032
  const inCallee = findCastExpression(node.callee, insideValidatorArg);
3997
4033
  if (inCallee !== null) {
3998
4034
  return inCallee;
@@ -4025,7 +4061,7 @@ function findCastExpression(node, insideValidatorArg) {
4025
4061
  }
4026
4062
  return null;
4027
4063
  }
4028
- var require_schema_validate_search_default = import_utils27.ESLintUtils.RuleCreator(
4064
+ var require_schema_validate_search_default = import_utils28.ESLintUtils.RuleCreator(
4029
4065
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
4030
4066
  )({
4031
4067
  name: "require-schema-validate-search",
@@ -4046,11 +4082,11 @@ var require_schema_validate_search_default = import_utils27.ESLintUtils.RuleCrea
4046
4082
  }
4047
4083
  return {
4048
4084
  Property(node) {
4049
- const isValidateSearchKey = !node.computed && node.key.type === import_utils27.AST_NODE_TYPES.Identifier && node.key.name === "validateSearch" || node.key.type === import_utils27.AST_NODE_TYPES.Literal && node.key.value === "validateSearch";
4085
+ const isValidateSearchKey = !node.computed && node.key.type === import_utils28.AST_NODE_TYPES.Identifier && node.key.name === "validateSearch" || node.key.type === import_utils28.AST_NODE_TYPES.Literal && node.key.value === "validateSearch";
4050
4086
  if (!isValidateSearchKey) {
4051
4087
  return;
4052
4088
  }
4053
- if (node.value.type !== import_utils27.AST_NODE_TYPES.ArrowFunctionExpression && node.value.type !== import_utils27.AST_NODE_TYPES.FunctionExpression) {
4089
+ if (node.value.type !== import_utils28.AST_NODE_TYPES.ArrowFunctionExpression && node.value.type !== import_utils28.AST_NODE_TYPES.FunctionExpression) {
4054
4090
  return;
4055
4091
  }
4056
4092
  const cast = findCastExpression(node.value.body, false);
@@ -4063,12 +4099,12 @@ var require_schema_validate_search_default = import_utils27.ESLintUtils.RuleCrea
4063
4099
  });
4064
4100
 
4065
4101
  // src/rules/no-fat-try-blocks.ts
4066
- var import_utils28 = require("@typescript-eslint/utils");
4102
+ var import_utils29 = require("@typescript-eslint/utils");
4067
4103
  var MAX_TRY_BODY_STATEMENTS = 3;
4068
4104
  var NESTED_FUNCTION_TYPES = /* @__PURE__ */ new Set([
4069
- import_utils28.AST_NODE_TYPES.FunctionDeclaration,
4070
- import_utils28.AST_NODE_TYPES.FunctionExpression,
4071
- import_utils28.AST_NODE_TYPES.ArrowFunctionExpression
4105
+ import_utils29.AST_NODE_TYPES.FunctionDeclaration,
4106
+ import_utils29.AST_NODE_TYPES.FunctionExpression,
4107
+ import_utils29.AST_NODE_TYPES.ArrowFunctionExpression
4072
4108
  ]);
4073
4109
  var PURE_METHODS = /* @__PURE__ */ new Set([
4074
4110
  "map",
@@ -4166,20 +4202,20 @@ function isNode4(value) {
4166
4202
  }
4167
4203
  function isPureCall(node) {
4168
4204
  const callee = node.callee;
4169
- if (callee.type !== import_utils28.AST_NODE_TYPES.MemberExpression) {
4205
+ if (callee.type !== import_utils29.AST_NODE_TYPES.MemberExpression) {
4170
4206
  return false;
4171
4207
  }
4172
4208
  const property = callee.property;
4173
- if (property.type !== import_utils28.AST_NODE_TYPES.Identifier) {
4209
+ if (property.type !== import_utils29.AST_NODE_TYPES.Identifier) {
4174
4210
  return false;
4175
4211
  }
4176
- if (callee.object.type === import_utils28.AST_NODE_TYPES.Identifier && PURE_NAMESPACES.has(callee.object.name)) {
4212
+ if (callee.object.type === import_utils29.AST_NODE_TYPES.Identifier && PURE_NAMESPACES.has(callee.object.name)) {
4177
4213
  return true;
4178
4214
  }
4179
4215
  return PURE_METHODS.has(property.name);
4180
4216
  }
4181
4217
  function isPureNew(node) {
4182
- return node.callee.type === import_utils28.AST_NODE_TYPES.Identifier && PURE_CONSTRUCTORS.has(node.callee.name);
4218
+ return node.callee.type === import_utils29.AST_NODE_TYPES.Identifier && PURE_CONSTRUCTORS.has(node.callee.name);
4183
4219
  }
4184
4220
  function subtreeMatches(stmt, predicate) {
4185
4221
  let found = false;
@@ -4216,20 +4252,20 @@ function subtreeMatches(stmt, predicate) {
4216
4252
  visit(stmt);
4217
4253
  return found;
4218
4254
  }
4219
- var hasAwait = (node) => subtreeMatches(node, (n) => n.type === import_utils28.AST_NODE_TYPES.AwaitExpression);
4255
+ var hasAwait = (node) => subtreeMatches(node, (n) => n.type === import_utils29.AST_NODE_TYPES.AwaitExpression);
4220
4256
  var hasThrowingCallOrNew = (node) => subtreeMatches(
4221
4257
  node,
4222
- (n) => n.type === import_utils28.AST_NODE_TYPES.CallExpression && !isPureCall(n) || n.type === import_utils28.AST_NODE_TYPES.NewExpression && !isPureNew(n)
4258
+ (n) => n.type === import_utils29.AST_NODE_TYPES.CallExpression && !isPureCall(n) || n.type === import_utils29.AST_NODE_TYPES.NewExpression && !isPureNew(n)
4223
4259
  );
4224
4260
  function unwrap2(expr) {
4225
4261
  let current = expr;
4226
- while (current.type === import_utils28.AST_NODE_TYPES.ChainExpression || current.type === import_utils28.AST_NODE_TYPES.TSNonNullExpression) {
4262
+ while (current.type === import_utils29.AST_NODE_TYPES.ChainExpression || current.type === import_utils29.AST_NODE_TYPES.TSNonNullExpression) {
4227
4263
  current = current.expression;
4228
4264
  }
4229
4265
  return current;
4230
4266
  }
4231
4267
  function isBareCallStatement(stmt) {
4232
- return stmt.type === import_utils28.AST_NODE_TYPES.ExpressionStatement && unwrap2(stmt.expression).type === import_utils28.AST_NODE_TYPES.CallExpression;
4268
+ return stmt.type === import_utils29.AST_NODE_TYPES.ExpressionStatement && unwrap2(stmt.expression).type === import_utils29.AST_NODE_TYPES.CallExpression;
4233
4269
  }
4234
4270
  function canThrow(stmt) {
4235
4271
  if (hasAwait(stmt)) {
@@ -4238,10 +4274,10 @@ function canThrow(stmt) {
4238
4274
  if (isBareCallStatement(stmt)) {
4239
4275
  return false;
4240
4276
  }
4241
- if (stmt.type === import_utils28.AST_NODE_TYPES.BlockStatement) {
4277
+ if (stmt.type === import_utils29.AST_NODE_TYPES.BlockStatement) {
4242
4278
  return stmt.body.some(canThrow);
4243
4279
  }
4244
- if (stmt.type === import_utils28.AST_NODE_TYPES.IfStatement) {
4280
+ if (stmt.type === import_utils29.AST_NODE_TYPES.IfStatement) {
4245
4281
  return hasThrowingCallOrNew(stmt.test) || canThrow(stmt.consequent) || stmt.alternate !== null && canThrow(stmt.alternate);
4246
4282
  }
4247
4283
  return hasThrowingCallOrNew(stmt);
@@ -4252,9 +4288,9 @@ function handlerRethrows(handler) {
4252
4288
  }
4253
4289
  const body = handler.body.body;
4254
4290
  const last = body[body.length - 1];
4255
- return last !== void 0 && last.type === import_utils28.AST_NODE_TYPES.ThrowStatement;
4291
+ return last !== void 0 && last.type === import_utils29.AST_NODE_TYPES.ThrowStatement;
4256
4292
  }
4257
- var no_fat_try_blocks_default = import_utils28.ESLintUtils.RuleCreator(
4293
+ var no_fat_try_blocks_default = import_utils29.ESLintUtils.RuleCreator(
4258
4294
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
4259
4295
  )({
4260
4296
  name: "no-fat-try-blocks",
@@ -4298,7 +4334,7 @@ var no_fat_try_blocks_default = import_utils28.ESLintUtils.RuleCreator(
4298
4334
  });
4299
4335
 
4300
4336
  // src/rules/no-secret-in-log.ts
4301
- var import_utils29 = require("@typescript-eslint/utils");
4337
+ var import_utils30 = require("@typescript-eslint/utils");
4302
4338
 
4303
4339
  // src/rules/_secret_names.ts
4304
4340
  var SECRET_WORDS = /* @__PURE__ */ new Set([
@@ -4560,7 +4596,7 @@ function propertyKeyName2(prop) {
4560
4596
  }
4561
4597
  return null;
4562
4598
  }
4563
- var no_secret_in_log_default = import_utils29.ESLintUtils.RuleCreator(
4599
+ var no_secret_in_log_default = import_utils30.ESLintUtils.RuleCreator(
4564
4600
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
4565
4601
  )({
4566
4602
  name: "no-secret-in-log",
@@ -4637,15 +4673,15 @@ var no_secret_in_log_default = import_utils29.ESLintUtils.RuleCreator(
4637
4673
  });
4638
4674
 
4639
4675
  // src/rules/no-unsafe-cast.ts
4640
- var import_utils30 = require("@typescript-eslint/utils");
4641
4676
  var import_utils31 = require("@typescript-eslint/utils");
4677
+ var import_utils32 = require("@typescript-eslint/utils");
4642
4678
  function isAnyAnnotation(node) {
4643
- return node.type === import_utils31.AST_NODE_TYPES.TSAnyKeyword;
4679
+ return node.type === import_utils32.AST_NODE_TYPES.TSAnyKeyword;
4644
4680
  }
4645
4681
  function isConstAssertion(typeAnnotation) {
4646
- return typeAnnotation.type === import_utils31.AST_NODE_TYPES.TSTypeReference && typeAnnotation.typeName.type === import_utils31.AST_NODE_TYPES.Identifier && typeAnnotation.typeName.name === "const";
4682
+ return typeAnnotation.type === import_utils32.AST_NODE_TYPES.TSTypeReference && typeAnnotation.typeName.type === import_utils32.AST_NODE_TYPES.Identifier && typeAnnotation.typeName.name === "const";
4647
4683
  }
4648
- var no_unsafe_cast_default = import_utils30.ESLintUtils.RuleCreator(
4684
+ var no_unsafe_cast_default = import_utils31.ESLintUtils.RuleCreator(
4649
4685
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
4650
4686
  )({
4651
4687
  name: "no-unsafe-cast",
@@ -4674,7 +4710,7 @@ var no_unsafe_cast_default = import_utils30.ESLintUtils.RuleCreator(
4674
4710
  return;
4675
4711
  }
4676
4712
  const inner = node.expression;
4677
- if (inner.type === import_utils31.AST_NODE_TYPES.TSAsExpression || inner.type === import_utils31.AST_NODE_TYPES.TSTypeAssertion) {
4713
+ if (inner.type === import_utils32.AST_NODE_TYPES.TSAsExpression || inner.type === import_utils32.AST_NODE_TYPES.TSTypeAssertion) {
4678
4714
  context.report({ node, messageId: "doubleCast" });
4679
4715
  }
4680
4716
  }
@@ -4685,8 +4721,57 @@ var no_unsafe_cast_default = import_utils30.ESLintUtils.RuleCreator(
4685
4721
  }
4686
4722
  });
4687
4723
 
4724
+ // src/rules/no-unsafe-mock-casting.ts
4725
+ var import_utils33 = require("@typescript-eslint/utils");
4726
+ var import_utils34 = require("@typescript-eslint/utils");
4727
+ function isMockTypeReference(node) {
4728
+ if (node.type !== import_utils34.AST_NODE_TYPES.TSTypeReference) {
4729
+ return false;
4730
+ }
4731
+ const typeName = node.typeName;
4732
+ if (typeName.type === import_utils34.AST_NODE_TYPES.Identifier) {
4733
+ const name = typeName.name;
4734
+ return name === "Mock" || name === "MockInstance" || name === "SpyInstance";
4735
+ }
4736
+ if (typeName.type === import_utils34.AST_NODE_TYPES.TSQualifiedName) {
4737
+ const rightName = typeName.right.name;
4738
+ return rightName === "Mock" || rightName === "MockInstance" || rightName === "SpyInstance";
4739
+ }
4740
+ return false;
4741
+ }
4742
+ var no_unsafe_mock_casting_default = import_utils33.ESLintUtils.RuleCreator(
4743
+ (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
4744
+ )({
4745
+ name: "no-unsafe-mock-casting",
4746
+ meta: {
4747
+ type: "problem",
4748
+ docs: {
4749
+ description: "Disallow casting to mock types like `jest.Mock` or `vi.Mock`. Use `vi.mocked()` or `jest.mocked()` instead."
4750
+ },
4751
+ schema: [],
4752
+ messages: {
4753
+ unsafeMockCast: "Do not cast to a Mock type. Use `vi.mocked(fn)` or `jest.mocked(fn)` instead to preserve type safety."
4754
+ }
4755
+ },
4756
+ defaultOptions: [],
4757
+ create(context) {
4758
+ if (isGeneratedFile(context.filename, context.sourceCode.text)) {
4759
+ return {};
4760
+ }
4761
+ function checkAssertion(node) {
4762
+ if (isMockTypeReference(node.typeAnnotation)) {
4763
+ context.report({ node, messageId: "unsafeMockCast" });
4764
+ }
4765
+ }
4766
+ return {
4767
+ TSAsExpression: checkAssertion,
4768
+ TSTypeAssertion: checkAssertion
4769
+ };
4770
+ }
4771
+ });
4772
+
4688
4773
  // src/rules/prefer-string-literal-union.ts
4689
- var import_utils32 = require("@typescript-eslint/utils");
4774
+ var import_utils35 = require("@typescript-eslint/utils");
4690
4775
  var ts = __toESM(require("typescript"), 1);
4691
4776
  var CHOICE_TOKENS = /* @__PURE__ */ new Set([
4692
4777
  "status",
@@ -4729,19 +4814,19 @@ function isChoiceLikeName(name) {
4729
4814
  return CHOICE_TOKENS.has(lastWord(name));
4730
4815
  }
4731
4816
  function keyName(key) {
4732
- if (key.type === import_utils32.AST_NODE_TYPES.Identifier) {
4817
+ if (key.type === import_utils35.AST_NODE_TYPES.Identifier) {
4733
4818
  return key.name;
4734
4819
  }
4735
- if (key.type === import_utils32.AST_NODE_TYPES.Literal && typeof key.value === "string") {
4820
+ if (key.type === import_utils35.AST_NODE_TYPES.Literal && typeof key.value === "string") {
4736
4821
  return key.value;
4737
4822
  }
4738
4823
  return null;
4739
4824
  }
4740
4825
  function isStringLiteralMember(t) {
4741
- return t.type === import_utils32.AST_NODE_TYPES.TSLiteralType && t.literal.type === import_utils32.AST_NODE_TYPES.Literal && typeof t.literal.value === "string";
4826
+ return t.type === import_utils35.AST_NODE_TYPES.TSLiteralType && t.literal.type === import_utils35.AST_NODE_TYPES.Literal && typeof t.literal.value === "string";
4742
4827
  }
4743
4828
  function isStringLiteralUnion(node) {
4744
- if (node?.type !== import_utils32.AST_NODE_TYPES.TSUnionType) {
4829
+ if (node?.type !== import_utils35.AST_NODE_TYPES.TSUnionType) {
4745
4830
  return false;
4746
4831
  }
4747
4832
  return node.types.filter(isStringLiteralMember).length >= MIN_CLUSTER_SIZE;
@@ -4770,12 +4855,12 @@ function bindingSourceExpression(decl) {
4770
4855
  return ts.isForOfStatement(node) ? node.expression : node.initializer;
4771
4856
  }
4772
4857
  function refKey(node) {
4773
- if (node.type === import_utils32.AST_NODE_TYPES.Identifier) {
4858
+ if (node.type === import_utils35.AST_NODE_TYPES.Identifier) {
4774
4859
  return node.name;
4775
4860
  }
4776
- if (node.type === import_utils32.AST_NODE_TYPES.MemberExpression && !node.computed) {
4861
+ if (node.type === import_utils35.AST_NODE_TYPES.MemberExpression && !node.computed) {
4777
4862
  const inner = refKey(node.object);
4778
- if (inner === null || node.property.type !== import_utils32.AST_NODE_TYPES.Identifier) {
4863
+ if (inner === null || node.property.type !== import_utils35.AST_NODE_TYPES.Identifier) {
4779
4864
  return null;
4780
4865
  }
4781
4866
  return `${inner}.${node.property.name}`;
@@ -4783,12 +4868,12 @@ function refKey(node) {
4783
4868
  return null;
4784
4869
  }
4785
4870
  function strLiteral(node) {
4786
- if (node.type === import_utils32.AST_NODE_TYPES.Literal && typeof node.value === "string") {
4871
+ if (node.type === import_utils35.AST_NODE_TYPES.Literal && typeof node.value === "string") {
4787
4872
  return node.value;
4788
4873
  }
4789
4874
  return null;
4790
4875
  }
4791
- var prefer_string_literal_union_default = import_utils32.ESLintUtils.RuleCreator(
4876
+ var prefer_string_literal_union_default = import_utils35.ESLintUtils.RuleCreator(
4792
4877
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
4793
4878
  )({
4794
4879
  name: "prefer-string-literal-union",
@@ -4826,7 +4911,7 @@ var prefer_string_literal_union_default = import_utils32.ESLintUtils.RuleCreator
4826
4911
  );
4827
4912
  let services;
4828
4913
  try {
4829
- services = import_utils32.ESLintUtils.getParserServices(context);
4914
+ services = import_utils35.ESLintUtils.getParserServices(context);
4830
4915
  } catch {
4831
4916
  services = null;
4832
4917
  }
@@ -4938,7 +5023,7 @@ var prefer_string_literal_union_default = import_utils32.ESLintUtils.RuleCreator
4938
5023
  containersWithUnion.add(container);
4939
5024
  return;
4940
5025
  }
4941
- if (typeNode?.type !== import_utils32.AST_NODE_TYPES.TSStringKeyword) {
5026
+ if (typeNode?.type !== import_utils35.AST_NODE_TYPES.TSStringKeyword) {
4942
5027
  return;
4943
5028
  }
4944
5029
  const name = keyName(key);
@@ -5026,10 +5111,10 @@ var prefer_string_literal_union_default = import_utils32.ESLintUtils.RuleCreator
5026
5111
  }
5027
5112
  };
5028
5113
  function refKeyText(node) {
5029
- if (node.type === import_utils32.AST_NODE_TYPES.BinaryExpression) {
5114
+ if (node.type === import_utils35.AST_NODE_TYPES.BinaryExpression) {
5030
5115
  return refKey(node.left) ?? refKey(node.right) ?? "value";
5031
5116
  }
5032
- if (node.type === import_utils32.AST_NODE_TYPES.SwitchStatement) {
5117
+ if (node.type === import_utils35.AST_NODE_TYPES.SwitchStatement) {
5033
5118
  return refKey(node.discriminant) ?? "value";
5034
5119
  }
5035
5120
  return "value";
@@ -5037,8 +5122,98 @@ var prefer_string_literal_union_default = import_utils32.ESLintUtils.RuleCreator
5037
5122
  }
5038
5123
  });
5039
5124
 
5125
+ // src/rules/prefer-zod-enum.ts
5126
+ var import_utils36 = require("@typescript-eslint/utils");
5127
+ function isZodModule(source) {
5128
+ return /(^|[/@-])zod([/-]|$)/.test(source);
5129
+ }
5130
+ var prefer_zod_enum_default = import_utils36.ESLintUtils.RuleCreator(
5131
+ (name) => `https://github.com/sarj-ai/standards/tree/main/packages/typescript#${name}`
5132
+ )({
5133
+ name: "prefer-zod-enum",
5134
+ meta: {
5135
+ type: "suggestion",
5136
+ docs: {
5137
+ description: "Prefer z.enum([...]) over z.union([z.literal(...), ...]) for string choices"
5138
+ },
5139
+ fixable: "code",
5140
+ schema: [],
5141
+ messages: {
5142
+ preferEnum: "Use `z.enum([...])` instead of a union of string-literal schemas."
5143
+ }
5144
+ },
5145
+ defaultOptions: [],
5146
+ create(context) {
5147
+ const sourceCode = context.sourceCode;
5148
+ const zodNamespaces = /* @__PURE__ */ new Set();
5149
+ function enumValues(node) {
5150
+ const callee = node.callee;
5151
+ if (callee.type !== import_utils36.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils36.AST_NODE_TYPES.Identifier || !zodNamespaces.has(callee.object.name) || callee.property.type !== import_utils36.AST_NODE_TYPES.Identifier || callee.property.name !== "union" || node.arguments.length !== 1) {
5152
+ return null;
5153
+ }
5154
+ const argument = node.arguments[0];
5155
+ if (argument === void 0 || argument.type !== import_utils36.AST_NODE_TYPES.ArrayExpression || argument.elements.length === 0) {
5156
+ return null;
5157
+ }
5158
+ const values = [];
5159
+ for (const element of argument.elements) {
5160
+ if (element === null || element.type !== import_utils36.AST_NODE_TYPES.CallExpression || element.arguments.length !== 1 || element.callee.type !== import_utils36.AST_NODE_TYPES.MemberExpression || element.callee.computed || element.callee.object.type !== import_utils36.AST_NODE_TYPES.Identifier || !zodNamespaces.has(element.callee.object.name) || element.callee.property.type !== import_utils36.AST_NODE_TYPES.Identifier || element.callee.property.name !== "literal") {
5161
+ return null;
5162
+ }
5163
+ const value = element.arguments[0];
5164
+ if (value === void 0 || value.type !== import_utils36.AST_NODE_TYPES.Literal || typeof value.value !== "string") {
5165
+ return null;
5166
+ }
5167
+ values.push(value);
5168
+ }
5169
+ return values;
5170
+ }
5171
+ function buildFix(node, values) {
5172
+ const argument = node.arguments[0];
5173
+ if (argument === void 0 || argument.type !== import_utils36.AST_NODE_TYPES.ArrayExpression || sourceCode.getCommentsInside(argument).length > 0) {
5174
+ return void 0;
5175
+ }
5176
+ const callee = node.callee;
5177
+ if (callee.type !== import_utils36.AST_NODE_TYPES.MemberExpression || callee.property.type !== import_utils36.AST_NODE_TYPES.Identifier) {
5178
+ return void 0;
5179
+ }
5180
+ return (fixer) => [
5181
+ fixer.replaceText(callee.property, "enum"),
5182
+ fixer.replaceText(
5183
+ argument,
5184
+ `[${values.map((value) => sourceCode.getText(value)).join(", ")}]`
5185
+ )
5186
+ ];
5187
+ }
5188
+ return {
5189
+ ImportDeclaration(node) {
5190
+ if (!isZodModule(node.source.value)) {
5191
+ return;
5192
+ }
5193
+ for (const specifier of node.specifiers) {
5194
+ if (specifier.type === import_utils36.AST_NODE_TYPES.ImportNamespaceSpecifier || specifier.type === import_utils36.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === import_utils36.AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === import_utils36.AST_NODE_TYPES.Identifier && specifier.imported.name === "z") {
5195
+ zodNamespaces.add(specifier.local.name);
5196
+ }
5197
+ }
5198
+ },
5199
+ CallExpression(node) {
5200
+ const values = enumValues(node);
5201
+ if (values === null) {
5202
+ return;
5203
+ }
5204
+ const fix = buildFix(node, values);
5205
+ context.report({
5206
+ node,
5207
+ messageId: "preferEnum",
5208
+ ...fix === void 0 ? {} : { fix }
5209
+ });
5210
+ }
5211
+ };
5212
+ }
5213
+ });
5214
+
5040
5215
  // src/rules/single-public-export.ts
5041
- var import_utils33 = require("@typescript-eslint/utils");
5216
+ var import_utils37 = require("@typescript-eslint/utils");
5042
5217
  var JUNK_DRAWER_STEMS = /* @__PURE__ */ new Set([
5043
5218
  "util",
5044
5219
  "utils",
@@ -5072,12 +5247,12 @@ var kebabCase2 = (name) => {
5072
5247
  }
5073
5248
  return normalized.replace(CAMEL_BOUNDARY_RE, "-").toLowerCase();
5074
5249
  };
5075
- var isFunctionExpression = (node) => node !== null && (node.type === import_utils33.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils33.AST_NODE_TYPES.FunctionExpression);
5250
+ var isFunctionExpression = (node) => node !== null && (node.type === import_utils37.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils37.AST_NODE_TYPES.FunctionExpression);
5076
5251
  var functionConstName = (decl) => {
5077
5252
  if (decl.declarations.length !== 1) return null;
5078
5253
  const [declarator] = decl.declarations;
5079
5254
  if (declarator === void 0) return null;
5080
- if (declarator.id.type !== import_utils33.AST_NODE_TYPES.Identifier) return null;
5255
+ if (declarator.id.type !== import_utils37.AST_NODE_TYPES.Identifier) return null;
5081
5256
  if (!isFunctionExpression(declarator.init)) return null;
5082
5257
  return declarator.id.name;
5083
5258
  };
@@ -5091,20 +5266,20 @@ var summarizeExports = (body) => {
5091
5266
  };
5092
5267
  for (const statement of body) {
5093
5268
  switch (statement.type) {
5094
- case import_utils33.AST_NODE_TYPES.ExportAllDeclaration:
5269
+ case import_utils37.AST_NODE_TYPES.ExportAllDeclaration:
5095
5270
  hasReExport = true;
5096
5271
  break;
5097
- case import_utils33.AST_NODE_TYPES.ExportDefaultDeclaration: {
5272
+ case import_utils37.AST_NODE_TYPES.ExportDefaultDeclaration: {
5098
5273
  names += 1;
5099
5274
  const decl = statement.declaration;
5100
- if (decl.type === import_utils33.AST_NODE_TYPES.FunctionDeclaration && decl.id !== null) {
5275
+ if (decl.type === import_utils37.AST_NODE_TYPES.FunctionDeclaration && decl.id !== null) {
5101
5276
  candidate = { name: decl.id.name, node: statement };
5102
- } else if (decl.type === import_utils33.AST_NODE_TYPES.ClassDeclaration && decl.id !== null) {
5277
+ } else if (decl.type === import_utils37.AST_NODE_TYPES.ClassDeclaration && decl.id !== null) {
5103
5278
  candidate = { name: decl.id.name, node: statement };
5104
5279
  }
5105
5280
  break;
5106
5281
  }
5107
- case import_utils33.AST_NODE_TYPES.ExportNamedDeclaration: {
5282
+ case import_utils37.AST_NODE_TYPES.ExportNamedDeclaration: {
5108
5283
  if (statement.source !== null) {
5109
5284
  hasReExport = true;
5110
5285
  break;
@@ -5115,15 +5290,15 @@ var summarizeExports = (body) => {
5115
5290
  break;
5116
5291
  }
5117
5292
  switch (decl.type) {
5118
- case import_utils33.AST_NODE_TYPES.FunctionDeclaration:
5293
+ case import_utils37.AST_NODE_TYPES.FunctionDeclaration:
5119
5294
  if (decl.id !== null) addCandidate(decl.id.name, statement);
5120
5295
  else names += 1;
5121
5296
  break;
5122
- case import_utils33.AST_NODE_TYPES.ClassDeclaration:
5297
+ case import_utils37.AST_NODE_TYPES.ClassDeclaration:
5123
5298
  if (decl.id !== null) addCandidate(decl.id.name, statement);
5124
5299
  else names += 1;
5125
5300
  break;
5126
- case import_utils33.AST_NODE_TYPES.VariableDeclaration: {
5301
+ case import_utils37.AST_NODE_TYPES.VariableDeclaration: {
5127
5302
  const fnName = functionConstName(decl);
5128
5303
  if (fnName !== null && decl.declarations.length === 1) {
5129
5304
  addCandidate(fnName, statement);
@@ -5143,7 +5318,7 @@ var summarizeExports = (body) => {
5143
5318
  }
5144
5319
  return { names, hasReExport, candidate };
5145
5320
  };
5146
- var single_public_export_default = import_utils33.ESLintUtils.RuleCreator(
5321
+ var single_public_export_default = import_utils37.ESLintUtils.RuleCreator(
5147
5322
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5148
5323
  )({
5149
5324
  name: "single-public-export",
@@ -5184,10 +5359,10 @@ var single_public_export_default = import_utils33.ESLintUtils.RuleCreator(
5184
5359
  });
5185
5360
 
5186
5361
  // src/rules/no-offset-pagination.ts
5187
- var import_utils35 = require("@typescript-eslint/utils");
5362
+ var import_utils39 = require("@typescript-eslint/utils");
5188
5363
 
5189
5364
  // src/rules/_sql.ts
5190
- var import_utils34 = require("@typescript-eslint/utils");
5365
+ var import_utils38 = require("@typescript-eslint/utils");
5191
5366
  function stripSqlNoise(text) {
5192
5367
  const out = [...text];
5193
5368
  const n = text.length;
@@ -5248,13 +5423,13 @@ function stripSqlNoise(text) {
5248
5423
  var SUBSTITUTION_MARKER = "?";
5249
5424
  function sqlTextOf(node) {
5250
5425
  switch (node.type) {
5251
- case import_utils34.AST_NODE_TYPES.Literal:
5426
+ case import_utils38.AST_NODE_TYPES.Literal:
5252
5427
  return typeof node.value === "string" ? node.value : null;
5253
- case import_utils34.AST_NODE_TYPES.TemplateLiteral:
5428
+ case import_utils38.AST_NODE_TYPES.TemplateLiteral:
5254
5429
  return node.quasis.map((q) => q.value.cooked ?? q.value.raw).join(SUBSTITUTION_MARKER);
5255
- case import_utils34.AST_NODE_TYPES.TaggedTemplateExpression:
5430
+ case import_utils38.AST_NODE_TYPES.TaggedTemplateExpression:
5256
5431
  return sqlTextOf(node.quasi);
5257
- case import_utils34.AST_NODE_TYPES.BinaryExpression: {
5432
+ case import_utils38.AST_NODE_TYPES.BinaryExpression: {
5258
5433
  if (node.operator !== "+") {
5259
5434
  return null;
5260
5435
  }
@@ -5262,7 +5437,7 @@ function sqlTextOf(node) {
5262
5437
  const right = sqlTextOf(node.right);
5263
5438
  return left !== null && right !== null ? left + right : null;
5264
5439
  }
5265
- case import_utils34.AST_NODE_TYPES.ArrayExpression: {
5440
+ case import_utils38.AST_NODE_TYPES.ArrayExpression: {
5266
5441
  const parts = [];
5267
5442
  for (const element of node.elements) {
5268
5443
  if (element === null) {
@@ -5282,7 +5457,7 @@ function sqlTextOf(node) {
5282
5457
  }
5283
5458
  function isJoinedFragmentArray(node) {
5284
5459
  const parent = node.parent;
5285
- return parent?.type === import_utils34.AST_NODE_TYPES.MemberExpression && parent.object === node && !parent.computed && parent.property.type === import_utils34.AST_NODE_TYPES.Identifier && parent.property.name === "join" && parent.parent?.type === import_utils34.AST_NODE_TYPES.CallExpression;
5460
+ return parent?.type === import_utils38.AST_NODE_TYPES.MemberExpression && parent.object === node && !parent.computed && parent.property.type === import_utils38.AST_NODE_TYPES.Identifier && parent.property.name === "join" && parent.parent?.type === import_utils38.AST_NODE_TYPES.CallExpression;
5286
5461
  }
5287
5462
  function markConsumed(node, consumed) {
5288
5463
  consumed.add(node);
@@ -5332,7 +5507,7 @@ function createSqlListener(handler) {
5332
5507
  // src/rules/no-offset-pagination.ts
5333
5508
  var OFFSET_PAGINATION = /\bOFFSET\s+(?:%s|%\(\w+\)s|\?\d*|:\w+|@\w+|\$\d+|\d+)/i;
5334
5509
  var OFFSET_GATE = /offset/i;
5335
- var no_offset_pagination_default = import_utils35.ESLintUtils.RuleCreator(
5510
+ var no_offset_pagination_default = import_utils39.ESLintUtils.RuleCreator(
5336
5511
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5337
5512
  )({
5338
5513
  name: "no-offset-pagination",
@@ -5361,15 +5536,15 @@ var no_offset_pagination_default = import_utils35.ESLintUtils.RuleCreator(
5361
5536
  });
5362
5537
 
5363
5538
  // src/rules/no-positional-tuple-return.ts
5364
- var import_utils36 = require("@typescript-eslint/utils");
5539
+ var import_utils40 = require("@typescript-eslint/utils");
5365
5540
  var MIN_ELEMENTS = 2;
5366
5541
  var ACCESSOR_PAIR_LENGTH = 2;
5367
5542
  var AWAITABLE_TYPES = /* @__PURE__ */ new Set(["Promise", "PromiseLike", "Awaited"]);
5368
5543
  function tupleReturnType(node) {
5369
- if (node.type === import_utils36.AST_NODE_TYPES.TSTupleType) {
5544
+ if (node.type === import_utils40.AST_NODE_TYPES.TSTupleType) {
5370
5545
  return node;
5371
5546
  }
5372
- if (node.type === import_utils36.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils36.AST_NODE_TYPES.Identifier && AWAITABLE_TYPES.has(node.typeName.name)) {
5547
+ if (node.type === import_utils40.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils40.AST_NODE_TYPES.Identifier && AWAITABLE_TYPES.has(node.typeName.name)) {
5373
5548
  const argument = node.typeArguments?.params[0];
5374
5549
  return argument === void 0 ? null : tupleReturnType(argument);
5375
5550
  }
@@ -5383,30 +5558,30 @@ function isPermittedTuple(tuple, sourceCode) {
5383
5558
  if (elements.length < MIN_ELEMENTS) {
5384
5559
  return true;
5385
5560
  }
5386
- if (elements.some((element) => element.type === import_utils36.AST_NODE_TYPES.TSRestType)) {
5561
+ if (elements.some((element) => element.type === import_utils40.AST_NODE_TYPES.TSRestType)) {
5387
5562
  return true;
5388
5563
  }
5389
- if (elements.some((element) => element.type === import_utils36.AST_NODE_TYPES.TSNamedTupleMember)) {
5564
+ if (elements.some((element) => element.type === import_utils40.AST_NODE_TYPES.TSNamedTupleMember)) {
5390
5565
  return true;
5391
5566
  }
5392
- if (elements[0]?.type === import_utils36.AST_NODE_TYPES.TSLiteralType) {
5567
+ if (elements[0]?.type === import_utils40.AST_NODE_TYPES.TSLiteralType) {
5393
5568
  return true;
5394
5569
  }
5395
- if (elements.length === ACCESSOR_PAIR_LENGTH && elements.some((element) => element.type === import_utils36.AST_NODE_TYPES.TSFunctionType)) {
5570
+ if (elements.length === ACCESSOR_PAIR_LENGTH && elements.some((element) => element.type === import_utils40.AST_NODE_TYPES.TSFunctionType)) {
5396
5571
  return true;
5397
5572
  }
5398
5573
  const texts = new Set(elements.map((element) => normalizedText(sourceCode, element)));
5399
5574
  return texts.size === 1;
5400
5575
  }
5401
5576
  function functionName(node) {
5402
- if (node.type === import_utils36.AST_NODE_TYPES.FunctionDeclaration) {
5577
+ if (node.type === import_utils40.AST_NODE_TYPES.FunctionDeclaration) {
5403
5578
  return node.id?.name ?? null;
5404
5579
  }
5405
5580
  const parent = node.parent;
5406
- if (parent?.type === import_utils36.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils36.AST_NODE_TYPES.Identifier) {
5581
+ if (parent?.type === import_utils40.AST_NODE_TYPES.VariableDeclarator && parent.id.type === import_utils40.AST_NODE_TYPES.Identifier) {
5407
5582
  return parent.id.name;
5408
5583
  }
5409
- if ((parent?.type === import_utils36.AST_NODE_TYPES.MethodDefinition || parent?.type === import_utils36.AST_NODE_TYPES.PropertyDefinition || parent?.type === import_utils36.AST_NODE_TYPES.Property) && parent.key.type === import_utils36.AST_NODE_TYPES.Identifier) {
5584
+ if ((parent?.type === import_utils40.AST_NODE_TYPES.MethodDefinition || parent?.type === import_utils40.AST_NODE_TYPES.PropertyDefinition || parent?.type === import_utils40.AST_NODE_TYPES.Property) && parent.key.type === import_utils40.AST_NODE_TYPES.Identifier) {
5410
5585
  return parent.key.name;
5411
5586
  }
5412
5587
  return null;
@@ -5414,7 +5589,7 @@ function functionName(node) {
5414
5589
  function isInlineExported(node) {
5415
5590
  for (let current = node; current != null; current = current.parent) {
5416
5591
  const parent = current.parent;
5417
- if (parent?.type === import_utils36.AST_NODE_TYPES.ExportNamedDeclaration || parent?.type === import_utils36.AST_NODE_TYPES.ExportDefaultDeclaration) {
5592
+ if (parent?.type === import_utils40.AST_NODE_TYPES.ExportNamedDeclaration || parent?.type === import_utils40.AST_NODE_TYPES.ExportDefaultDeclaration) {
5418
5593
  return true;
5419
5594
  }
5420
5595
  }
@@ -5423,18 +5598,18 @@ function isInlineExported(node) {
5423
5598
  function moduleScopeBindingName(node) {
5424
5599
  let current = node;
5425
5600
  let child = node;
5426
- while (current.parent != null && current.parent.type !== import_utils36.AST_NODE_TYPES.Program) {
5601
+ while (current.parent != null && current.parent.type !== import_utils40.AST_NODE_TYPES.Program) {
5427
5602
  child = current;
5428
5603
  current = current.parent;
5429
5604
  }
5430
- if (current.parent?.type !== import_utils36.AST_NODE_TYPES.Program) {
5605
+ if (current.parent?.type !== import_utils40.AST_NODE_TYPES.Program) {
5431
5606
  return null;
5432
5607
  }
5433
- if (current.type === import_utils36.AST_NODE_TYPES.FunctionDeclaration || current.type === import_utils36.AST_NODE_TYPES.ClassDeclaration) {
5608
+ if (current.type === import_utils40.AST_NODE_TYPES.FunctionDeclaration || current.type === import_utils40.AST_NODE_TYPES.ClassDeclaration) {
5434
5609
  return current.id?.name ?? null;
5435
5610
  }
5436
- if (current.type === import_utils36.AST_NODE_TYPES.VariableDeclaration) {
5437
- if (child.type !== import_utils36.AST_NODE_TYPES.VariableDeclarator || child.id.type !== import_utils36.AST_NODE_TYPES.Identifier) {
5611
+ if (current.type === import_utils40.AST_NODE_TYPES.VariableDeclaration) {
5612
+ if (child.type !== import_utils40.AST_NODE_TYPES.VariableDeclarator || child.id.type !== import_utils40.AST_NODE_TYPES.Identifier) {
5438
5613
  return null;
5439
5614
  }
5440
5615
  return child.id.name;
@@ -5444,19 +5619,19 @@ function moduleScopeBindingName(node) {
5444
5619
  function specifierExportedNames(program) {
5445
5620
  const names = /* @__PURE__ */ new Set();
5446
5621
  for (const statement of program.body) {
5447
- if (statement.type === import_utils36.AST_NODE_TYPES.ExportNamedDeclaration && statement.declaration == null && statement.source == null && statement.exportKind !== "type") {
5622
+ if (statement.type === import_utils40.AST_NODE_TYPES.ExportNamedDeclaration && statement.declaration == null && statement.source == null && statement.exportKind !== "type") {
5448
5623
  for (const specifier of statement.specifiers) {
5449
- if (specifier.exportKind !== "type" && specifier.local.type === import_utils36.AST_NODE_TYPES.Identifier) {
5624
+ if (specifier.exportKind !== "type" && specifier.local.type === import_utils40.AST_NODE_TYPES.Identifier) {
5450
5625
  names.add(specifier.local.name);
5451
5626
  }
5452
5627
  }
5453
5628
  continue;
5454
5629
  }
5455
- if (statement.type === import_utils36.AST_NODE_TYPES.ExportDefaultDeclaration && statement.declaration.type === import_utils36.AST_NODE_TYPES.Identifier) {
5630
+ if (statement.type === import_utils40.AST_NODE_TYPES.ExportDefaultDeclaration && statement.declaration.type === import_utils40.AST_NODE_TYPES.Identifier) {
5456
5631
  names.add(statement.declaration.name);
5457
5632
  continue;
5458
5633
  }
5459
- if (statement.type === import_utils36.AST_NODE_TYPES.TSExportAssignment && statement.expression.type === import_utils36.AST_NODE_TYPES.Identifier) {
5634
+ if (statement.type === import_utils40.AST_NODE_TYPES.TSExportAssignment && statement.expression.type === import_utils40.AST_NODE_TYPES.Identifier) {
5460
5635
  names.add(statement.expression.name);
5461
5636
  }
5462
5637
  }
@@ -5472,7 +5647,7 @@ function isExported(node, specifierExports) {
5472
5647
  const binding = moduleScopeBindingName(node);
5473
5648
  return binding !== null && specifierExports.has(binding);
5474
5649
  }
5475
- var no_positional_tuple_return_default = import_utils36.ESLintUtils.RuleCreator(
5650
+ var no_positional_tuple_return_default = import_utils40.ESLintUtils.RuleCreator(
5476
5651
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5477
5652
  )({
5478
5653
  name: "no-positional-tuple-return",
@@ -5520,16 +5695,16 @@ var no_positional_tuple_return_default = import_utils36.ESLintUtils.RuleCreator(
5520
5695
  });
5521
5696
 
5522
5697
  // src/rules/no-repeated-string-literal.ts
5523
- var import_utils37 = require("@typescript-eslint/utils");
5698
+ var import_utils41 = require("@typescript-eslint/utils");
5524
5699
  var MIN_LENGTH = 40;
5525
5700
  var MIN_DISTINCT_SCOPES = 2;
5526
5701
  var PREVIEW_LENGTH = 40;
5527
5702
  var SQL_KEYWORD_RE = /\b(SELECT|INSERT|UPDATE|DELETE|FROM|WHERE|JOIN|VALUES|ON CONFLICT|RETURNING|GROUP BY|ORDER BY)\b/;
5528
5703
  var IDENTIFIER_RE = /^[a-z_][a-z0-9_.]*$/;
5529
5704
  var FUNCTION_TYPES = /* @__PURE__ */ new Set([
5530
- import_utils37.AST_NODE_TYPES.FunctionDeclaration,
5531
- import_utils37.AST_NODE_TYPES.FunctionExpression,
5532
- import_utils37.AST_NODE_TYPES.ArrowFunctionExpression
5705
+ import_utils41.AST_NODE_TYPES.FunctionDeclaration,
5706
+ import_utils41.AST_NODE_TYPES.FunctionExpression,
5707
+ import_utils41.AST_NODE_TYPES.ArrowFunctionExpression
5533
5708
  ]);
5534
5709
  function isStructured(value) {
5535
5710
  return value.includes("\n") || SQL_KEYWORD_RE.test(value) || IDENTIFIER_RE.test(value);
@@ -5551,9 +5726,9 @@ function isScaffolding(node) {
5551
5726
  if (parent === void 0) {
5552
5727
  return true;
5553
5728
  }
5554
- return parent.type === import_utils37.AST_NODE_TYPES.ImportDeclaration || parent.type === import_utils37.AST_NODE_TYPES.ExportNamedDeclaration || parent.type === import_utils37.AST_NODE_TYPES.ExportAllDeclaration || parent.type === import_utils37.AST_NODE_TYPES.TSImportType || parent.type === import_utils37.AST_NODE_TYPES.JSXAttribute || parent.type === import_utils37.AST_NODE_TYPES.TSLiteralType;
5729
+ return parent.type === import_utils41.AST_NODE_TYPES.ImportDeclaration || parent.type === import_utils41.AST_NODE_TYPES.ExportNamedDeclaration || parent.type === import_utils41.AST_NODE_TYPES.ExportAllDeclaration || parent.type === import_utils41.AST_NODE_TYPES.TSImportType || parent.type === import_utils41.AST_NODE_TYPES.JSXAttribute || parent.type === import_utils41.AST_NODE_TYPES.TSLiteralType;
5555
5730
  }
5556
- var no_repeated_string_literal_default = import_utils37.ESLintUtils.RuleCreator(
5731
+ var no_repeated_string_literal_default = import_utils41.ESLintUtils.RuleCreator(
5557
5732
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5558
5733
  )({
5559
5734
  name: "no-repeated-string-literal",
@@ -5593,7 +5768,7 @@ var no_repeated_string_literal_default = import_utils37.ESLintUtils.RuleCreator(
5593
5768
  }
5594
5769
  },
5595
5770
  TemplateLiteral(node) {
5596
- if (node.parent.type === import_utils37.AST_NODE_TYPES.TaggedTemplateExpression) {
5771
+ if (node.parent.type === import_utils41.AST_NODE_TYPES.TaggedTemplateExpression) {
5597
5772
  return;
5598
5773
  }
5599
5774
  const [only] = node.quasis;
@@ -5627,7 +5802,7 @@ var no_repeated_string_literal_default = import_utils37.ESLintUtils.RuleCreator(
5627
5802
  });
5628
5803
 
5629
5804
  // src/rules/no-select-star.ts
5630
- var import_utils38 = require("@typescript-eslint/utils");
5805
+ var import_utils42 = require("@typescript-eslint/utils");
5631
5806
  var QUERY_SHAPE = /\bSELECT\b[\s\S]*?\bFROM\b/i;
5632
5807
  var SELECT_KEYWORD = /\bSELECT\b/gi;
5633
5808
  var FROM_KEYWORD = /^FROM\b/i;
@@ -5667,7 +5842,7 @@ function hasRealSelectStar(sql) {
5667
5842
  }
5668
5843
  return false;
5669
5844
  }
5670
- var no_select_star_default = import_utils38.ESLintUtils.RuleCreator(
5845
+ var no_select_star_default = import_utils42.ESLintUtils.RuleCreator(
5671
5846
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5672
5847
  )({
5673
5848
  name: "no-select-star",
@@ -5696,7 +5871,7 @@ var no_select_star_default = import_utils38.ESLintUtils.RuleCreator(
5696
5871
  });
5697
5872
 
5698
5873
  // src/rules/no-sleep-in-test-body.ts
5699
- var import_utils39 = require("@typescript-eslint/utils");
5874
+ var import_utils43 = require("@typescript-eslint/utils");
5700
5875
  var SLEEP_HELPERS = /* @__PURE__ */ new Set(["sleep", "delay", "wait", "pause"]);
5701
5876
  var TEST_CALLERS = /* @__PURE__ */ new Set([
5702
5877
  "it",
@@ -5705,34 +5880,34 @@ var TEST_CALLERS = /* @__PURE__ */ new Set([
5705
5880
  "afterEach"
5706
5881
  ]);
5707
5882
  var FUNCTION_TYPES2 = /* @__PURE__ */ new Set([
5708
- import_utils39.AST_NODE_TYPES.FunctionDeclaration,
5709
- import_utils39.AST_NODE_TYPES.FunctionExpression,
5710
- import_utils39.AST_NODE_TYPES.ArrowFunctionExpression
5883
+ import_utils43.AST_NODE_TYPES.FunctionDeclaration,
5884
+ import_utils43.AST_NODE_TYPES.FunctionExpression,
5885
+ import_utils43.AST_NODE_TYPES.ArrowFunctionExpression
5711
5886
  ]);
5712
5887
  function isNonzeroNumericLiteral(node) {
5713
- return node?.type === import_utils39.AST_NODE_TYPES.Literal && typeof node.value === "number" && node.value !== 0;
5888
+ return node?.type === import_utils43.AST_NODE_TYPES.Literal && typeof node.value === "number" && node.value !== 0;
5714
5889
  }
5715
5890
  function isTimedSetTimeout(node) {
5716
- return node.type === import_utils39.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils39.AST_NODE_TYPES.Identifier && node.callee.name === "setTimeout" && node.arguments.length >= 2 && isNonzeroNumericLiteral(node.arguments[1]);
5891
+ return node.type === import_utils43.AST_NODE_TYPES.CallExpression && node.callee.type === import_utils43.AST_NODE_TYPES.Identifier && node.callee.name === "setTimeout" && node.arguments.length >= 2 && isNonzeroNumericLiteral(node.arguments[1]);
5717
5892
  }
5718
5893
  function isPromiseSleep(node) {
5719
- if (node.callee.type !== import_utils39.AST_NODE_TYPES.Identifier || node.callee.name !== "Promise") {
5894
+ if (node.callee.type !== import_utils43.AST_NODE_TYPES.Identifier || node.callee.name !== "Promise") {
5720
5895
  return false;
5721
5896
  }
5722
5897
  const executor = node.arguments[0];
5723
- if (executor?.type !== import_utils39.AST_NODE_TYPES.ArrowFunctionExpression && executor?.type !== import_utils39.AST_NODE_TYPES.FunctionExpression) {
5898
+ if (executor?.type !== import_utils43.AST_NODE_TYPES.ArrowFunctionExpression && executor?.type !== import_utils43.AST_NODE_TYPES.FunctionExpression) {
5724
5899
  return false;
5725
5900
  }
5726
5901
  const body = executor.body;
5727
- if (body.type !== import_utils39.AST_NODE_TYPES.BlockStatement) {
5902
+ if (body.type !== import_utils43.AST_NODE_TYPES.BlockStatement) {
5728
5903
  return isTimedSetTimeout(body);
5729
5904
  }
5730
5905
  return body.body.some(
5731
- (stmt) => stmt.type === import_utils39.AST_NODE_TYPES.ExpressionStatement && isTimedSetTimeout(stmt.expression)
5906
+ (stmt) => stmt.type === import_utils43.AST_NODE_TYPES.ExpressionStatement && isTimedSetTimeout(stmt.expression)
5732
5907
  );
5733
5908
  }
5734
5909
  function isHelperSleep(node) {
5735
- return node.callee.type === import_utils39.AST_NODE_TYPES.Identifier && SLEEP_HELPERS.has(node.callee.name) && node.arguments.length >= 1 && isNonzeroNumericLiteral(node.arguments[0]);
5910
+ return node.callee.type === import_utils43.AST_NODE_TYPES.Identifier && SLEEP_HELPERS.has(node.callee.name) && node.arguments.length >= 1 && isNonzeroNumericLiteral(node.arguments[0]);
5736
5911
  }
5737
5912
  function nearestEnclosingFunction(node) {
5738
5913
  for (let current = node.parent; current != null; current = current.parent) {
@@ -5740,7 +5915,7 @@ function nearestEnclosingFunction(node) {
5740
5915
  continue;
5741
5916
  }
5742
5917
  const grandparent = current.parent;
5743
- const isPromiseExecutor = grandparent?.type === import_utils39.AST_NODE_TYPES.NewExpression && isPromiseSleep(grandparent);
5918
+ const isPromiseExecutor = grandparent?.type === import_utils43.AST_NODE_TYPES.NewExpression && isPromiseSleep(grandparent);
5744
5919
  if (!isPromiseExecutor) {
5745
5920
  return current;
5746
5921
  }
@@ -5748,29 +5923,29 @@ function nearestEnclosingFunction(node) {
5748
5923
  return null;
5749
5924
  }
5750
5925
  function testCallerName(callee) {
5751
- if (callee.type === import_utils39.AST_NODE_TYPES.Identifier) {
5926
+ if (callee.type === import_utils43.AST_NODE_TYPES.Identifier) {
5752
5927
  return callee.name;
5753
5928
  }
5754
- if (callee.type === import_utils39.AST_NODE_TYPES.MemberExpression) {
5929
+ if (callee.type === import_utils43.AST_NODE_TYPES.MemberExpression) {
5755
5930
  return testCallerName(callee.object);
5756
5931
  }
5757
- if (callee.type === import_utils39.AST_NODE_TYPES.CallExpression) {
5932
+ if (callee.type === import_utils43.AST_NODE_TYPES.CallExpression) {
5758
5933
  return testCallerName(callee.callee);
5759
5934
  }
5760
- if (callee.type === import_utils39.AST_NODE_TYPES.TaggedTemplateExpression) {
5935
+ if (callee.type === import_utils43.AST_NODE_TYPES.TaggedTemplateExpression) {
5761
5936
  return testCallerName(callee.tag);
5762
5937
  }
5763
5938
  return null;
5764
5939
  }
5765
5940
  function isTestBody(fn) {
5766
5941
  const call = fn.parent;
5767
- if (call?.type !== import_utils39.AST_NODE_TYPES.CallExpression || !call.arguments.some((argument) => argument === fn)) {
5942
+ if (call?.type !== import_utils43.AST_NODE_TYPES.CallExpression || !call.arguments.some((argument) => argument === fn)) {
5768
5943
  return false;
5769
5944
  }
5770
5945
  const name = testCallerName(call.callee);
5771
5946
  return name !== null && TEST_CALLERS.has(name);
5772
5947
  }
5773
- var no_sleep_in_test_body_default = import_utils39.ESLintUtils.RuleCreator(
5948
+ var no_sleep_in_test_body_default = import_utils43.ESLintUtils.RuleCreator(
5774
5949
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5775
5950
  )({
5776
5951
  name: "no-sleep-in-test-body",
@@ -5811,8 +5986,90 @@ var no_sleep_in_test_body_default = import_utils39.ESLintUtils.RuleCreator(
5811
5986
  }
5812
5987
  });
5813
5988
 
5989
+ // src/rules/no-conditional-in-test.ts
5990
+ var import_utils44 = require("@typescript-eslint/utils");
5991
+ var TEST_CALLERS2 = /* @__PURE__ */ new Set(["it", "test"]);
5992
+ var FUNCTION_TYPES3 = /* @__PURE__ */ new Set([
5993
+ import_utils44.AST_NODE_TYPES.FunctionDeclaration,
5994
+ import_utils44.AST_NODE_TYPES.FunctionExpression,
5995
+ import_utils44.AST_NODE_TYPES.ArrowFunctionExpression
5996
+ ]);
5997
+ function nearestEnclosingFunction2(node) {
5998
+ for (let current = node.parent; current != null; current = current.parent) {
5999
+ if (FUNCTION_TYPES3.has(current.type)) {
6000
+ return current;
6001
+ }
6002
+ }
6003
+ return null;
6004
+ }
6005
+ function testCallerName2(callee) {
6006
+ if (callee.type === import_utils44.AST_NODE_TYPES.Identifier) {
6007
+ return callee.name;
6008
+ }
6009
+ if (callee.type === import_utils44.AST_NODE_TYPES.MemberExpression) {
6010
+ return testCallerName2(callee.object);
6011
+ }
6012
+ if (callee.type === import_utils44.AST_NODE_TYPES.CallExpression) {
6013
+ return testCallerName2(callee.callee);
6014
+ }
6015
+ if (callee.type === import_utils44.AST_NODE_TYPES.TaggedTemplateExpression) {
6016
+ return testCallerName2(callee.tag);
6017
+ }
6018
+ return null;
6019
+ }
6020
+ function isTestBody2(fn) {
6021
+ const call = fn.parent;
6022
+ if (call?.type !== import_utils44.AST_NODE_TYPES.CallExpression || !call.arguments.some((argument) => argument === fn)) {
6023
+ return false;
6024
+ }
6025
+ const name = testCallerName2(call.callee);
6026
+ return name !== null && TEST_CALLERS2.has(name);
6027
+ }
6028
+ var no_conditional_in_test_default = import_utils44.ESLintUtils.RuleCreator(
6029
+ (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
6030
+ )({
6031
+ name: "no-conditional-in-test",
6032
+ meta: {
6033
+ type: "problem",
6034
+ docs: {
6035
+ description: "Disallow conditional logic (if, switch, ternary) in test bodies, which can hide missing assertions or test multiple code paths."
6036
+ },
6037
+ schema: [],
6038
+ messages: {
6039
+ noConditionalInTest: "Avoid using conditional logic in tests. It can obscure intent and hide unexecuted assertions. Split the test instead."
6040
+ }
6041
+ },
6042
+ defaultOptions: [],
6043
+ create(context) {
6044
+ if (!isTestFile(context.filename)) {
6045
+ return {};
6046
+ }
6047
+ const report = (node) => {
6048
+ const enclosing = nearestEnclosingFunction2(node);
6049
+ if (enclosing === null || !isTestBody2(enclosing)) {
6050
+ return;
6051
+ }
6052
+ context.report({ node, messageId: "noConditionalInTest" });
6053
+ };
6054
+ return {
6055
+ IfStatement(node) {
6056
+ report(node);
6057
+ },
6058
+ SwitchStatement(node) {
6059
+ report(node);
6060
+ },
6061
+ ConditionalExpression(node) {
6062
+ report(node);
6063
+ },
6064
+ LogicalExpression(node) {
6065
+ report(node);
6066
+ }
6067
+ };
6068
+ }
6069
+ });
6070
+
5814
6071
  // src/rules/prefer-constant-time-secret-compare.ts
5815
- var import_utils40 = require("@typescript-eslint/utils");
6072
+ var import_utils45 = require("@typescript-eslint/utils");
5816
6073
  var EQUALITY_OPERATORS = /* @__PURE__ */ new Set(["===", "!==", "==", "!="]);
5817
6074
  var SENTINEL_IDENTIFIERS = /* @__PURE__ */ new Set(["undefined", "NaN"]);
5818
6075
  var SENTINEL_WORDS = /(^|_)(SENTINEL|EMPTY|NONE|NULL|UNSET|MISSING|PLACEHOLDER|DUMMY|FAKE|EXAMPLE)(_|$)/;
@@ -5825,36 +6082,36 @@ function isConstantReference(identifier) {
5825
6082
  }
5826
6083
  function isExcludedOperand(node) {
5827
6084
  switch (node.type) {
5828
- case import_utils40.AST_NODE_TYPES.Literal:
6085
+ case import_utils45.AST_NODE_TYPES.Literal:
5829
6086
  return true;
5830
- case import_utils40.AST_NODE_TYPES.TemplateLiteral:
6087
+ case import_utils45.AST_NODE_TYPES.TemplateLiteral:
5831
6088
  return node.expressions.length === 0;
5832
- case import_utils40.AST_NODE_TYPES.Identifier:
6089
+ case import_utils45.AST_NODE_TYPES.Identifier:
5833
6090
  return SENTINEL_IDENTIFIERS.has(node.name) || SENTINEL_PREFIX_RE.test(node.name) || isConstantReference(node.name);
5834
- case import_utils40.AST_NODE_TYPES.MemberExpression:
5835
- return !node.computed && node.property.type === import_utils40.AST_NODE_TYPES.Identifier && (SENTINEL_PREFIX_RE.test(node.property.name) || isConstantReference(node.property.name));
6091
+ case import_utils45.AST_NODE_TYPES.MemberExpression:
6092
+ return !node.computed && node.property.type === import_utils45.AST_NODE_TYPES.Identifier && (SENTINEL_PREFIX_RE.test(node.property.name) || isConstantReference(node.property.name));
5836
6093
  default:
5837
6094
  return false;
5838
6095
  }
5839
6096
  }
5840
6097
  function operandName(node) {
5841
- if (node.type === import_utils40.AST_NODE_TYPES.Identifier) {
6098
+ if (node.type === import_utils45.AST_NODE_TYPES.Identifier) {
5842
6099
  return node.name;
5843
6100
  }
5844
- if (node.type === import_utils40.AST_NODE_TYPES.MemberExpression && !node.computed && node.property.type === import_utils40.AST_NODE_TYPES.Identifier) {
6101
+ if (node.type === import_utils45.AST_NODE_TYPES.MemberExpression && !node.computed && node.property.type === import_utils45.AST_NODE_TYPES.Identifier) {
5845
6102
  return node.property.name;
5846
6103
  }
5847
6104
  return null;
5848
6105
  }
5849
6106
  function isSecretOperand(node) {
5850
- if (node.type === import_utils40.AST_NODE_TYPES.TemplateLiteral) {
6107
+ if (node.type === import_utils45.AST_NODE_TYPES.TemplateLiteral) {
5851
6108
  return node.expressions.some((expression) => isSecretOperand(expression));
5852
6109
  }
5853
6110
  const name = operandName(node);
5854
6111
  return name !== null && isAuthSecretName(name);
5855
6112
  }
5856
6113
  function secretNameOf(node) {
5857
- if (node.type === import_utils40.AST_NODE_TYPES.TemplateLiteral) {
6114
+ if (node.type === import_utils45.AST_NODE_TYPES.TemplateLiteral) {
5858
6115
  for (const expression of node.expressions) {
5859
6116
  const nested = secretNameOf(expression);
5860
6117
  if (nested !== null) {
@@ -5865,7 +6122,7 @@ function secretNameOf(node) {
5865
6122
  }
5866
6123
  return operandName(node);
5867
6124
  }
5868
- var prefer_constant_time_secret_compare_default = import_utils40.ESLintUtils.RuleCreator(
6125
+ var prefer_constant_time_secret_compare_default = import_utils45.ESLintUtils.RuleCreator(
5869
6126
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5870
6127
  )({
5871
6128
  name: "prefer-constant-time-secret-compare",
@@ -5908,11 +6165,11 @@ var prefer_constant_time_secret_compare_default = import_utils40.ESLintUtils.Rul
5908
6165
  });
5909
6166
 
5910
6167
  // src/rules/store-insert-requires-on-conflict.ts
5911
- var import_utils41 = require("@typescript-eslint/utils");
6168
+ var import_utils46 = require("@typescript-eslint/utils");
5912
6169
  var INSERT_WRITE = /\bINSERT\s+(?:OR\s+\w+\s+)?INTO\s+[\w."'`?$:@-]+\s*(?:\([^)]*\)\s*)?(?:VALUES|SELECT|DEFAULT\s+VALUES)\b/i;
5913
6170
  var CONFLICT_HANDLED = /\bON\s+CONFLICT\b|\bON\s+DUPLICATE\s+KEY\b|\bINSERT\s+OR\s+(?:IGNORE|REPLACE)\b/i;
5914
6171
  var INSERT_GATE = /insert/i;
5915
- var store_insert_requires_on_conflict_default = import_utils41.ESLintUtils.RuleCreator(
6172
+ var store_insert_requires_on_conflict_default = import_utils46.ESLintUtils.RuleCreator(
5916
6173
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
5917
6174
  )({
5918
6175
  name: "store-insert-requires-on-conflict",
@@ -5941,17 +6198,17 @@ var store_insert_requires_on_conflict_default = import_utils41.ESLintUtils.RuleC
5941
6198
  });
5942
6199
 
5943
6200
  // src/rules/no-dynamic-sql.ts
5944
- var import_utils42 = require("@typescript-eslint/utils");
6201
+ var import_utils47 = require("@typescript-eslint/utils");
5945
6202
  var DEFAULT_METHODS = ["prepare", "exec", "query"];
5946
6203
  var CONSTANT_CASE_RE = /^[A-Z][A-Z0-9_]*$/;
5947
6204
  function isStaticFragment(expression) {
5948
- if (expression.type === import_utils42.AST_NODE_TYPES.Identifier) {
6205
+ if (expression.type === import_utils47.AST_NODE_TYPES.Identifier) {
5949
6206
  return CONSTANT_CASE_RE.test(expression.name);
5950
6207
  }
5951
- if (expression.type === import_utils42.AST_NODE_TYPES.MemberExpression && !expression.computed && expression.property.type === import_utils42.AST_NODE_TYPES.Identifier) {
6208
+ if (expression.type === import_utils47.AST_NODE_TYPES.MemberExpression && !expression.computed && expression.property.type === import_utils47.AST_NODE_TYPES.Identifier) {
5952
6209
  return CONSTANT_CASE_RE.test(expression.property.name);
5953
6210
  }
5954
- if (expression.type === import_utils42.AST_NODE_TYPES.Literal) {
6211
+ if (expression.type === import_utils47.AST_NODE_TYPES.Literal) {
5955
6212
  return typeof expression.value === "string";
5956
6213
  }
5957
6214
  return false;
@@ -5962,36 +6219,36 @@ function runtimeInterpolations(template) {
5962
6219
  );
5963
6220
  }
5964
6221
  function concatOperands(node) {
5965
- if (node.type === import_utils42.AST_NODE_TYPES.BinaryExpression && node.operator === "+") {
6222
+ if (node.type === import_utils47.AST_NODE_TYPES.BinaryExpression && node.operator === "+") {
5966
6223
  return [...concatOperands(node.left), ...concatOperands(node.right)];
5967
6224
  }
5968
6225
  return [node];
5969
6226
  }
5970
6227
  function runtimeConcatOperands(node) {
5971
- if (node.type !== import_utils42.AST_NODE_TYPES.BinaryExpression || node.operator !== "+") {
6228
+ if (node.type !== import_utils47.AST_NODE_TYPES.BinaryExpression || node.operator !== "+") {
5972
6229
  return [];
5973
6230
  }
5974
6231
  const operands = concatOperands(node);
5975
6232
  const hasStringLiteral = operands.some(
5976
- (operand) => operand.type === import_utils42.AST_NODE_TYPES.Literal && typeof operand.value === "string"
6233
+ (operand) => operand.type === import_utils47.AST_NODE_TYPES.Literal && typeof operand.value === "string"
5977
6234
  );
5978
6235
  if (!hasStringLiteral) {
5979
6236
  return [];
5980
6237
  }
5981
6238
  return operands.filter(
5982
- (operand) => operand.type !== import_utils42.AST_NODE_TYPES.Literal && !isStaticFragment(operand)
6239
+ (operand) => operand.type !== import_utils47.AST_NODE_TYPES.Literal && !isStaticFragment(operand)
5983
6240
  );
5984
6241
  }
5985
6242
  var SQL_STATEMENT_RE = /\b(?:select\s|insert\s+into\b|insert\s+or\b|update\s+\w|delete\s+from\b|replace\s+into\b|merge\s+into\b|upsert\s+into\b|create\s+(?:temp(?:orary)?\s+)?(?:table|index|view|trigger|schema|database)\b|alter\s+table\b|drop\s+(?:table|index|view|trigger)\b|truncate\s+table\b|pragma\s+\w|with\s+\w+\s+as\s*\(|from\s+\w+\s+where\b)/i;
5986
6243
  var RUNTIME_MARKER = " ? ";
5987
6244
  function staticStatementText(node) {
5988
- if (node.type === import_utils42.AST_NODE_TYPES.TemplateLiteral) {
6245
+ if (node.type === import_utils47.AST_NODE_TYPES.TemplateLiteral) {
5989
6246
  return node.quasis.map((quasi) => quasi.value.cooked ?? quasi.value.raw).join(RUNTIME_MARKER);
5990
6247
  }
5991
- if (node.type === import_utils42.AST_NODE_TYPES.Literal) {
6248
+ if (node.type === import_utils47.AST_NODE_TYPES.Literal) {
5992
6249
  return typeof node.value === "string" ? node.value : RUNTIME_MARKER;
5993
6250
  }
5994
- if (node.type === import_utils42.AST_NODE_TYPES.BinaryExpression && node.operator === "+") {
6251
+ if (node.type === import_utils47.AST_NODE_TYPES.BinaryExpression && node.operator === "+") {
5995
6252
  return staticStatementText(node.left) + staticStatementText(node.right);
5996
6253
  }
5997
6254
  return RUNTIME_MARKER;
@@ -6001,13 +6258,13 @@ function looksLikeSql(node) {
6001
6258
  }
6002
6259
  function statementMethodName(node, methods) {
6003
6260
  const callee = node.callee;
6004
- if (callee.type !== import_utils42.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils42.AST_NODE_TYPES.Identifier) {
6261
+ if (callee.type !== import_utils47.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils47.AST_NODE_TYPES.Identifier) {
6005
6262
  return null;
6006
6263
  }
6007
6264
  const name = callee.property.name;
6008
6265
  return methods.has(name) ? name : null;
6009
6266
  }
6010
- var no_dynamic_sql_default = import_utils42.ESLintUtils.RuleCreator(
6267
+ var no_dynamic_sql_default = import_utils47.ESLintUtils.RuleCreator(
6011
6268
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
6012
6269
  )({
6013
6270
  name: "no-dynamic-sql",
@@ -6046,7 +6303,7 @@ var no_dynamic_sql_default = import_utils42.ESLintUtils.RuleCreator(
6046
6303
  if (statement === void 0 || !looksLikeSql(statement)) {
6047
6304
  return;
6048
6305
  }
6049
- const offenders = statement.type === import_utils42.AST_NODE_TYPES.TemplateLiteral ? runtimeInterpolations(statement) : runtimeConcatOperands(statement);
6306
+ const offenders = statement.type === import_utils47.AST_NODE_TYPES.TemplateLiteral ? runtimeInterpolations(statement) : runtimeConcatOperands(statement);
6050
6307
  for (const offender of offenders) {
6051
6308
  context.report({
6052
6309
  node: offender,
@@ -6060,7 +6317,7 @@ var no_dynamic_sql_default = import_utils42.ESLintUtils.RuleCreator(
6060
6317
  });
6061
6318
 
6062
6319
  // src/rules/no-raw-fetch-outside-clients.ts
6063
- var import_utils43 = require("@typescript-eslint/utils");
6320
+ var import_utils48 = require("@typescript-eslint/utils");
6064
6321
  var DEFAULT_ALLOW = [
6065
6322
  "[\\\\/]clients?[\\\\/]",
6066
6323
  "-client\\.[cm]?[jt]sx?$",
@@ -6124,7 +6381,7 @@ function compile(patterns) {
6124
6381
  }
6125
6382
  return compiled;
6126
6383
  }
6127
- var no_raw_fetch_outside_clients_default = import_utils43.ESLintUtils.RuleCreator(
6384
+ var no_raw_fetch_outside_clients_default = import_utils48.ESLintUtils.RuleCreator(
6128
6385
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
6129
6386
  )({
6130
6387
  name: "no-raw-fetch-outside-clients",
@@ -6172,7 +6429,7 @@ var no_raw_fetch_outside_clients_default = import_utils43.ESLintUtils.RuleCreato
6172
6429
  });
6173
6430
 
6174
6431
  // src/rules/no-storage-in-stateless-modules.ts
6175
- var import_utils44 = require("@typescript-eslint/utils");
6432
+ var import_utils49 = require("@typescript-eslint/utils");
6176
6433
  var DEFAULT_METHODS2 = [
6177
6434
  "prepare",
6178
6435
  "put",
@@ -6191,7 +6448,7 @@ function compile2(patterns) {
6191
6448
  }
6192
6449
  function storageMethodName(node, methods) {
6193
6450
  const callee = node.callee;
6194
- if (callee.type !== import_utils44.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils44.AST_NODE_TYPES.Identifier) {
6451
+ if (callee.type !== import_utils49.AST_NODE_TYPES.MemberExpression || callee.computed || callee.property.type !== import_utils49.AST_NODE_TYPES.Identifier) {
6195
6452
  return null;
6196
6453
  }
6197
6454
  const name = callee.property.name;
@@ -6203,7 +6460,7 @@ function storageMethodName(node, methods) {
6203
6460
  }
6204
6461
  return name;
6205
6462
  }
6206
- var no_storage_in_stateless_modules_default = import_utils44.ESLintUtils.RuleCreator(
6463
+ var no_storage_in_stateless_modules_default = import_utils49.ESLintUtils.RuleCreator(
6207
6464
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
6208
6465
  )({
6209
6466
  name: "no-storage-in-stateless-modules",
@@ -6261,7 +6518,7 @@ var no_storage_in_stateless_modules_default = import_utils44.ESLintUtils.RuleCre
6261
6518
  });
6262
6519
 
6263
6520
  // src/rules/no-zod-native-enum.ts
6264
- var import_utils45 = require("@typescript-eslint/utils");
6521
+ var import_utils50 = require("@typescript-eslint/utils");
6265
6522
  var ts2 = __toESM(require("typescript"), 1);
6266
6523
  var IGNORE_PATTERNS2 = [
6267
6524
  /[\\/]generated[\\/]/,
@@ -6275,11 +6532,11 @@ function isIgnoredFile2(filename, sourceText) {
6275
6532
  }
6276
6533
  return /@generated\b/.test(sourceText.slice(0, 1024));
6277
6534
  }
6278
- function isZodModule(source) {
6535
+ function isZodModule2(source) {
6279
6536
  return /(^|[/@-])zod([/-]|$)/.test(source);
6280
6537
  }
6281
6538
  function unwrap3(node) {
6282
- if (node.type === import_utils45.AST_NODE_TYPES.TSAsExpression || node.type === import_utils45.AST_NODE_TYPES.TSSatisfiesExpression) {
6539
+ if (node.type === import_utils50.AST_NODE_TYPES.TSAsExpression || node.type === import_utils50.AST_NODE_TYPES.TSSatisfiesExpression) {
6283
6540
  return unwrap3(node.expression);
6284
6541
  }
6285
6542
  return node;
@@ -6287,14 +6544,14 @@ function unwrap3(node) {
6287
6544
  function stringValueTexts(node, sourceCode) {
6288
6545
  const texts = [];
6289
6546
  for (const prop of node.properties) {
6290
- if (prop.type !== import_utils45.AST_NODE_TYPES.Property) {
6547
+ if (prop.type !== import_utils50.AST_NODE_TYPES.Property) {
6291
6548
  return null;
6292
6549
  }
6293
6550
  if (prop.computed || prop.shorthand || prop.method || prop.kind !== "init") {
6294
6551
  return null;
6295
6552
  }
6296
6553
  const value = prop.value;
6297
- if (value.type !== import_utils45.AST_NODE_TYPES.Literal || typeof value.value !== "string") {
6554
+ if (value.type !== import_utils50.AST_NODE_TYPES.Literal || typeof value.value !== "string") {
6298
6555
  return null;
6299
6556
  }
6300
6557
  const text = sourceCode.getText(value);
@@ -6310,7 +6567,7 @@ function resolvesToLocalEnum(node, scope) {
6310
6567
  const variable = current.variables.find((v) => v.name === node.name);
6311
6568
  if (variable !== void 0) {
6312
6569
  return variable.defs.some(
6313
- (def) => def.node.type === import_utils45.AST_NODE_TYPES.TSEnumDeclaration
6570
+ (def) => def.node.type === import_utils50.AST_NODE_TYPES.TSEnumDeclaration
6314
6571
  );
6315
6572
  }
6316
6573
  current = current.upper;
@@ -6330,7 +6587,7 @@ function resolvesToImportedEnum(node, services) {
6330
6587
  }
6331
6588
  return (symbol.flags & ENUM_SYMBOL_FLAGS) !== 0;
6332
6589
  }
6333
- var no_zod_native_enum_default = import_utils45.ESLintUtils.RuleCreator(
6590
+ var no_zod_native_enum_default = import_utils50.ESLintUtils.RuleCreator(
6334
6591
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
6335
6592
  )({
6336
6593
  name: "no-zod-native-enum",
@@ -6357,32 +6614,32 @@ var no_zod_native_enum_default = import_utils45.ESLintUtils.RuleCreator(
6357
6614
  }
6358
6615
  let services;
6359
6616
  try {
6360
- services = import_utils45.ESLintUtils.getParserServices(context);
6617
+ services = import_utils50.ESLintUtils.getParserServices(context);
6361
6618
  } catch {
6362
6619
  services = null;
6363
6620
  }
6364
6621
  const zodImportedNames = /* @__PURE__ */ new Map();
6365
6622
  function isZodMemberCall(node, api) {
6366
6623
  const callee = node.callee;
6367
- if (callee.type === import_utils45.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils45.AST_NODE_TYPES.Identifier) {
6624
+ if (callee.type === import_utils50.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils50.AST_NODE_TYPES.Identifier) {
6368
6625
  return callee.property.name === api;
6369
6626
  }
6370
- if (callee.type === import_utils45.AST_NODE_TYPES.Identifier) {
6627
+ if (callee.type === import_utils50.AST_NODE_TYPES.Identifier) {
6371
6628
  return zodImportedNames.get(callee.name) === api;
6372
6629
  }
6373
6630
  return false;
6374
6631
  }
6375
6632
  function buildFix(node) {
6376
6633
  const callee = node.callee;
6377
- if (callee.type !== import_utils45.AST_NODE_TYPES.MemberExpression || callee.property.type !== import_utils45.AST_NODE_TYPES.Identifier) {
6634
+ if (callee.type !== import_utils50.AST_NODE_TYPES.MemberExpression || callee.property.type !== import_utils50.AST_NODE_TYPES.Identifier) {
6378
6635
  return null;
6379
6636
  }
6380
6637
  const arg = node.arguments[0];
6381
- if (arg === void 0 || node.arguments.length !== 1 || arg.type === import_utils45.AST_NODE_TYPES.SpreadElement) {
6638
+ if (arg === void 0 || node.arguments.length !== 1 || arg.type === import_utils50.AST_NODE_TYPES.SpreadElement) {
6382
6639
  return null;
6383
6640
  }
6384
6641
  const inner = unwrap3(arg);
6385
- if (inner.type !== import_utils45.AST_NODE_TYPES.ObjectExpression) {
6642
+ if (inner.type !== import_utils50.AST_NODE_TYPES.ObjectExpression) {
6386
6643
  return null;
6387
6644
  }
6388
6645
  const values = stringValueTexts(inner, sourceCode);
@@ -6398,11 +6655,11 @@ var no_zod_native_enum_default = import_utils45.ESLintUtils.RuleCreator(
6398
6655
  }
6399
6656
  return {
6400
6657
  ImportDeclaration(node) {
6401
- if (!isZodModule(node.source.value)) {
6658
+ if (!isZodModule2(node.source.value)) {
6402
6659
  return;
6403
6660
  }
6404
6661
  for (const spec of node.specifiers) {
6405
- if (spec.type === import_utils45.AST_NODE_TYPES.ImportSpecifier && spec.imported.type === import_utils45.AST_NODE_TYPES.Identifier) {
6662
+ if (spec.type === import_utils50.AST_NODE_TYPES.ImportSpecifier && spec.imported.type === import_utils50.AST_NODE_TYPES.Identifier) {
6406
6663
  zodImportedNames.set(spec.local.name, spec.imported.name);
6407
6664
  }
6408
6665
  }
@@ -6421,7 +6678,7 @@ var no_zod_native_enum_default = import_utils45.ESLintUtils.RuleCreator(
6421
6678
  return;
6422
6679
  }
6423
6680
  const arg = node.arguments[0];
6424
- if (arg === void 0 || arg.type !== import_utils45.AST_NODE_TYPES.Identifier) {
6681
+ if (arg === void 0 || arg.type !== import_utils50.AST_NODE_TYPES.Identifier) {
6425
6682
  return;
6426
6683
  }
6427
6684
  const isEnum = resolvesToLocalEnum(arg, sourceCode.getScope(arg)) || services !== null && resolvesToImportedEnum(arg, services);
@@ -6438,7 +6695,7 @@ var no_zod_native_enum_default = import_utils45.ESLintUtils.RuleCreator(
6438
6695
  });
6439
6696
 
6440
6697
  // src/rules/prefer-module-level-constant.ts
6441
- var import_utils46 = require("@typescript-eslint/utils");
6698
+ var import_utils51 = require("@typescript-eslint/utils");
6442
6699
  var DEFAULT_MIN_ELEMENTS = 3;
6443
6700
  var MAX_LITERAL_DEPTH = 4;
6444
6701
  var IGNORE_PATTERNS3 = [
@@ -6473,10 +6730,10 @@ var MUTATING_METHODS = /* @__PURE__ */ new Set([
6473
6730
  // Object-ish escape hatches
6474
6731
  "assign"
6475
6732
  ]);
6476
- var FUNCTION_TYPES3 = /* @__PURE__ */ new Set([
6477
- import_utils46.AST_NODE_TYPES.FunctionDeclaration,
6478
- import_utils46.AST_NODE_TYPES.FunctionExpression,
6479
- import_utils46.AST_NODE_TYPES.ArrowFunctionExpression
6733
+ var FUNCTION_TYPES4 = /* @__PURE__ */ new Set([
6734
+ import_utils51.AST_NODE_TYPES.FunctionDeclaration,
6735
+ import_utils51.AST_NODE_TYPES.FunctionExpression,
6736
+ import_utils51.AST_NODE_TYPES.ArrowFunctionExpression
6480
6737
  ]);
6481
6738
  var COLLECTION_CONSTRUCTORS = /* @__PURE__ */ new Set(["Set", "Map"]);
6482
6739
  function isIgnoredFile3(filename, sourceText) {
@@ -6489,13 +6746,13 @@ function isTestFile2(filename) {
6489
6746
  return TEST_FILE_PATTERNS.some((re) => re.test(filename));
6490
6747
  }
6491
6748
  function unwrap4(node) {
6492
- if (node.type === import_utils46.AST_NODE_TYPES.TSAsExpression || node.type === import_utils46.AST_NODE_TYPES.TSSatisfiesExpression || node.type === import_utils46.AST_NODE_TYPES.TSNonNullExpression) {
6749
+ 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) {
6493
6750
  return unwrap4(node.expression);
6494
6751
  }
6495
6752
  return node;
6496
6753
  }
6497
6754
  function isRegexLiteral(node) {
6498
- return node.type === import_utils46.AST_NODE_TYPES.Literal && "regex" in node && node.regex !== void 0;
6755
+ return node.type === import_utils51.AST_NODE_TYPES.Literal && "regex" in node && node.regex !== void 0;
6499
6756
  }
6500
6757
  function isLiteralOnly(node, depth) {
6501
6758
  if (depth > MAX_LITERAL_DEPTH) {
@@ -6503,29 +6760,29 @@ function isLiteralOnly(node, depth) {
6503
6760
  }
6504
6761
  const inner = unwrap4(node);
6505
6762
  switch (inner.type) {
6506
- case import_utils46.AST_NODE_TYPES.Literal: {
6763
+ case import_utils51.AST_NODE_TYPES.Literal: {
6507
6764
  return true;
6508
6765
  }
6509
- case import_utils46.AST_NODE_TYPES.TemplateLiteral: {
6766
+ case import_utils51.AST_NODE_TYPES.TemplateLiteral: {
6510
6767
  return inner.expressions.length === 0;
6511
6768
  }
6512
- case import_utils46.AST_NODE_TYPES.UnaryExpression: {
6513
- return (inner.operator === "-" || inner.operator === "+") && inner.argument.type === import_utils46.AST_NODE_TYPES.Literal && typeof inner.argument.value === "number";
6769
+ case import_utils51.AST_NODE_TYPES.UnaryExpression: {
6770
+ return (inner.operator === "-" || inner.operator === "+") && inner.argument.type === import_utils51.AST_NODE_TYPES.Literal && typeof inner.argument.value === "number";
6514
6771
  }
6515
- case import_utils46.AST_NODE_TYPES.ArrayExpression: {
6772
+ case import_utils51.AST_NODE_TYPES.ArrayExpression: {
6516
6773
  return inner.elements.every(
6517
- (el) => el !== null && el.type !== import_utils46.AST_NODE_TYPES.SpreadElement && isLiteralOnly(el, depth + 1)
6774
+ (el) => el !== null && el.type !== import_utils51.AST_NODE_TYPES.SpreadElement && isLiteralOnly(el, depth + 1)
6518
6775
  );
6519
6776
  }
6520
- case import_utils46.AST_NODE_TYPES.ObjectExpression: {
6777
+ case import_utils51.AST_NODE_TYPES.ObjectExpression: {
6521
6778
  return inner.properties.every((prop) => {
6522
- if (prop.type !== import_utils46.AST_NODE_TYPES.Property) {
6779
+ if (prop.type !== import_utils51.AST_NODE_TYPES.Property) {
6523
6780
  return false;
6524
6781
  }
6525
6782
  if (prop.shorthand || prop.method || prop.kind !== "init") {
6526
6783
  return false;
6527
6784
  }
6528
- if (prop.computed && prop.key.type !== import_utils46.AST_NODE_TYPES.Literal) {
6785
+ if (prop.computed && prop.key.type !== import_utils51.AST_NODE_TYPES.Literal) {
6529
6786
  return false;
6530
6787
  }
6531
6788
  return isLiteralOnly(prop.value, depth + 1);
@@ -6538,7 +6795,7 @@ function isLiteralOnly(node, depth) {
6538
6795
  }
6539
6796
  function unwrapObjectFreeze(node) {
6540
6797
  const inner = unwrap4(node);
6541
- if (inner.type === import_utils46.AST_NODE_TYPES.CallExpression && inner.callee.type === import_utils46.AST_NODE_TYPES.MemberExpression && !inner.callee.computed && inner.callee.object.type === import_utils46.AST_NODE_TYPES.Identifier && inner.callee.object.name === "Object" && inner.callee.property.type === import_utils46.AST_NODE_TYPES.Identifier && inner.callee.property.name === "freeze" && inner.arguments.length === 1 && inner.arguments[0] !== void 0 && inner.arguments[0].type !== import_utils46.AST_NODE_TYPES.SpreadElement) {
6798
+ 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) {
6542
6799
  return unwrap4(inner.arguments[0]);
6543
6800
  }
6544
6801
  return inner;
@@ -6554,19 +6811,19 @@ function classify(init, checkRegex) {
6554
6811
  }
6555
6812
  return { kind: "regex", size: 1 };
6556
6813
  }
6557
- if (node.type === import_utils46.AST_NODE_TYPES.ArrayExpression) {
6814
+ if (node.type === import_utils51.AST_NODE_TYPES.ArrayExpression) {
6558
6815
  return isLiteralOnly(node, 0) ? { kind: "array", size: node.elements.length } : null;
6559
6816
  }
6560
- if (node.type === import_utils46.AST_NODE_TYPES.ObjectExpression) {
6817
+ if (node.type === import_utils51.AST_NODE_TYPES.ObjectExpression) {
6561
6818
  return isLiteralOnly(node, 0) ? { kind: "object", size: node.properties.length } : null;
6562
6819
  }
6563
- if (node.type === import_utils46.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils46.AST_NODE_TYPES.Identifier && COLLECTION_CONSTRUCTORS.has(node.callee.name)) {
6820
+ if (node.type === import_utils51.AST_NODE_TYPES.NewExpression && node.callee.type === import_utils51.AST_NODE_TYPES.Identifier && COLLECTION_CONSTRUCTORS.has(node.callee.name)) {
6564
6821
  const arg = node.arguments[0];
6565
- if (node.arguments.length !== 1 || arg === void 0 || arg.type === import_utils46.AST_NODE_TYPES.SpreadElement) {
6822
+ if (node.arguments.length !== 1 || arg === void 0 || arg.type === import_utils51.AST_NODE_TYPES.SpreadElement) {
6566
6823
  return null;
6567
6824
  }
6568
6825
  const entries = unwrap4(arg);
6569
- if (entries.type !== import_utils46.AST_NODE_TYPES.ArrayExpression) {
6826
+ if (entries.type !== import_utils51.AST_NODE_TYPES.ArrayExpression) {
6570
6827
  return null;
6571
6828
  }
6572
6829
  return isLiteralOnly(entries, 0) ? { kind: node.callee.name === "Set" ? "Set" : "Map", size: entries.elements.length } : null;
@@ -6576,7 +6833,7 @@ function classify(init, checkRegex) {
6576
6833
  function enclosingFunction2(node) {
6577
6834
  let current = node.parent;
6578
6835
  while (current !== void 0 && current !== null) {
6579
- if (FUNCTION_TYPES3.has(current.type)) {
6836
+ if (FUNCTION_TYPES4.has(current.type)) {
6580
6837
  return current;
6581
6838
  }
6582
6839
  current = current.parent;
@@ -6595,10 +6852,10 @@ var NON_RETAINING_BUILTINS = /* @__PURE__ */ new Map(
6595
6852
  );
6596
6853
  function isNonRetainingBuiltinCall(node, argument) {
6597
6854
  const callee = node.callee;
6598
- if (callee.type === import_utils46.AST_NODE_TYPES.Identifier && callee.name === "structuredClone") {
6855
+ if (callee.type === import_utils51.AST_NODE_TYPES.Identifier && callee.name === "structuredClone") {
6599
6856
  return true;
6600
6857
  }
6601
- if (callee.type !== import_utils46.AST_NODE_TYPES.MemberExpression || callee.computed || callee.object.type !== import_utils46.AST_NODE_TYPES.Identifier || callee.property.type !== import_utils46.AST_NODE_TYPES.Identifier) {
6858
+ 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) {
6602
6859
  return false;
6603
6860
  }
6604
6861
  const members = NON_RETAINING_BUILTINS.get(callee.object.name);
@@ -6612,43 +6869,43 @@ function isNonRetainingBuiltinCall(node, argument) {
6612
6869
  }
6613
6870
  function isSafeRead(identifier) {
6614
6871
  const parent = identifier.parent;
6615
- if (parent.type === import_utils46.AST_NODE_TYPES.MemberExpression) {
6872
+ if (parent.type === import_utils51.AST_NODE_TYPES.MemberExpression) {
6616
6873
  if (parent.object !== identifier) {
6617
6874
  return true;
6618
6875
  }
6619
6876
  const grandparent = parent.parent;
6620
- if (grandparent.type === import_utils46.AST_NODE_TYPES.AssignmentExpression && grandparent.left === parent) {
6877
+ if (grandparent.type === import_utils51.AST_NODE_TYPES.AssignmentExpression && grandparent.left === parent) {
6621
6878
  return false;
6622
6879
  }
6623
- if (grandparent.type === import_utils46.AST_NODE_TYPES.UpdateExpression) {
6880
+ if (grandparent.type === import_utils51.AST_NODE_TYPES.UpdateExpression) {
6624
6881
  return false;
6625
6882
  }
6626
- if (grandparent.type === import_utils46.AST_NODE_TYPES.UnaryExpression && grandparent.operator === "delete") {
6883
+ if (grandparent.type === import_utils51.AST_NODE_TYPES.UnaryExpression && grandparent.operator === "delete") {
6627
6884
  return false;
6628
6885
  }
6629
- if (!parent.computed && parent.property.type === import_utils46.AST_NODE_TYPES.Identifier && MUTATING_METHODS.has(parent.property.name) && grandparent.type === import_utils46.AST_NODE_TYPES.CallExpression && grandparent.callee === parent) {
6886
+ if (!parent.computed && parent.property.type === import_utils51.AST_NODE_TYPES.Identifier && MUTATING_METHODS.has(parent.property.name) && grandparent.type === import_utils51.AST_NODE_TYPES.CallExpression && grandparent.callee === parent) {
6630
6887
  return false;
6631
6888
  }
6632
6889
  return true;
6633
6890
  }
6634
- if (parent.type === import_utils46.AST_NODE_TYPES.ForOfStatement && parent.right === identifier) {
6891
+ if (parent.type === import_utils51.AST_NODE_TYPES.ForOfStatement && parent.right === identifier) {
6635
6892
  return true;
6636
6893
  }
6637
- if (parent.type === import_utils46.AST_NODE_TYPES.SpreadElement) {
6894
+ if (parent.type === import_utils51.AST_NODE_TYPES.SpreadElement) {
6638
6895
  return true;
6639
6896
  }
6640
- if (parent.type === import_utils46.AST_NODE_TYPES.BinaryExpression) {
6897
+ if (parent.type === import_utils51.AST_NODE_TYPES.BinaryExpression) {
6641
6898
  return true;
6642
6899
  }
6643
- if (parent.type === import_utils46.AST_NODE_TYPES.CallExpression && parent.arguments.includes(identifier) && isNonRetainingBuiltinCall(parent, identifier)) {
6900
+ if (parent.type === import_utils51.AST_NODE_TYPES.CallExpression && parent.arguments.includes(identifier) && isNonRetainingBuiltinCall(parent, identifier)) {
6644
6901
  return true;
6645
6902
  }
6646
- if (parent.type === import_utils46.AST_NODE_TYPES.UnaryExpression && parent.operator !== "delete") {
6903
+ if (parent.type === import_utils51.AST_NODE_TYPES.UnaryExpression && parent.operator !== "delete") {
6647
6904
  return true;
6648
6905
  }
6649
6906
  return false;
6650
6907
  }
6651
- var prefer_module_level_constant_default = import_utils46.ESLintUtils.RuleCreator(
6908
+ var prefer_module_level_constant_default = import_utils51.ESLintUtils.RuleCreator(
6652
6909
  (name) => `https://github.com/sarj-ai/linting/blob/main/packages/typescript/src/rules/${name}.ts`
6653
6910
  )({
6654
6911
  name: "prefer-module-level-constant",
@@ -6700,7 +6957,7 @@ var prefer_module_level_constant_default = import_utils46.ESLintUtils.RuleCreato
6700
6957
  if (reference.isWrite()) {
6701
6958
  return false;
6702
6959
  }
6703
- if (reference.identifier.type !== import_utils46.AST_NODE_TYPES.Identifier) {
6960
+ if (reference.identifier.type !== import_utils51.AST_NODE_TYPES.Identifier) {
6704
6961
  return false;
6705
6962
  }
6706
6963
  if (!isSafeRead(reference.identifier)) {
@@ -6712,10 +6969,10 @@ var prefer_module_level_constant_default = import_utils46.ESLintUtils.RuleCreato
6712
6969
  return {
6713
6970
  VariableDeclarator(node) {
6714
6971
  const declaration = node.parent;
6715
- if (declaration.type !== import_utils46.AST_NODE_TYPES.VariableDeclaration || declaration.kind !== "const" || declaration.declare === true) {
6972
+ if (declaration.type !== import_utils51.AST_NODE_TYPES.VariableDeclaration || declaration.kind !== "const" || declaration.declare === true) {
6716
6973
  return;
6717
6974
  }
6718
- if (node.id.type !== import_utils46.AST_NODE_TYPES.Identifier || node.init === null) {
6975
+ if (node.id.type !== import_utils51.AST_NODE_TYPES.Identifier || node.init === null) {
6719
6976
  return;
6720
6977
  }
6721
6978
  if (enclosingFunction2(node) === null) {
@@ -6742,7 +6999,7 @@ var prefer_module_level_constant_default = import_utils46.ESLintUtils.RuleCreato
6742
6999
  });
6743
7000
 
6744
7001
  // src/rules/jsdoc-restates-signature.ts
6745
- var import_utils47 = require("@typescript-eslint/utils");
7002
+ var import_utils52 = require("@typescript-eslint/utils");
6746
7003
  var VALUE_TAGS = /* @__PURE__ */ new Set([
6747
7004
  "alpha",
6748
7005
  "author",
@@ -6825,30 +7082,30 @@ function declarationNames(node) {
6825
7082
  switch (node.type) {
6826
7083
  // `export function f()` — the JSDoc sits above the `export`, so the token
6827
7084
  // after it resolves to the wrapper, not to the thing being documented.
6828
- case import_utils47.AST_NODE_TYPES.ExportNamedDeclaration:
6829
- case import_utils47.AST_NODE_TYPES.ExportDefaultDeclaration:
7085
+ case import_utils52.AST_NODE_TYPES.ExportNamedDeclaration:
7086
+ case import_utils52.AST_NODE_TYPES.ExportDefaultDeclaration:
6830
7087
  return node.declaration == null ? null : declarationNames(node.declaration);
6831
- case import_utils47.AST_NODE_TYPES.FunctionDeclaration:
6832
- case import_utils47.AST_NODE_TYPES.TSDeclareFunction:
7088
+ case import_utils52.AST_NODE_TYPES.FunctionDeclaration:
7089
+ case import_utils52.AST_NODE_TYPES.TSDeclareFunction:
6833
7090
  return node.id === null ? null : { name: node.id.name, params: paramNames(node.params) };
6834
- case import_utils47.AST_NODE_TYPES.ClassDeclaration:
6835
- case import_utils47.AST_NODE_TYPES.TSInterfaceDeclaration:
6836
- case import_utils47.AST_NODE_TYPES.TSTypeAliasDeclaration:
6837
- case import_utils47.AST_NODE_TYPES.TSEnumDeclaration:
7091
+ case import_utils52.AST_NODE_TYPES.ClassDeclaration:
7092
+ case import_utils52.AST_NODE_TYPES.TSInterfaceDeclaration:
7093
+ case import_utils52.AST_NODE_TYPES.TSTypeAliasDeclaration:
7094
+ case import_utils52.AST_NODE_TYPES.TSEnumDeclaration:
6838
7095
  return node.id === null ? null : { name: node.id.name, params: [] };
6839
- case import_utils47.AST_NODE_TYPES.VariableDeclaration: {
7096
+ case import_utils52.AST_NODE_TYPES.VariableDeclaration: {
6840
7097
  const declarator = node.declarations[0];
6841
- if (declarator === void 0 || declarator.id.type !== import_utils47.AST_NODE_TYPES.Identifier) return null;
7098
+ if (declarator === void 0 || declarator.id.type !== import_utils52.AST_NODE_TYPES.Identifier) return null;
6842
7099
  const init = declarator.init;
6843
- const params = init != null && (init.type === import_utils47.AST_NODE_TYPES.ArrowFunctionExpression || init.type === import_utils47.AST_NODE_TYPES.FunctionExpression) ? paramNames(init.params) : [];
7100
+ const params = init != null && (init.type === import_utils52.AST_NODE_TYPES.ArrowFunctionExpression || init.type === import_utils52.AST_NODE_TYPES.FunctionExpression) ? paramNames(init.params) : [];
6844
7101
  return { name: declarator.id.name, params };
6845
7102
  }
6846
- case import_utils47.AST_NODE_TYPES.MethodDefinition:
6847
- case import_utils47.AST_NODE_TYPES.PropertyDefinition:
6848
- case import_utils47.AST_NODE_TYPES.TSMethodSignature:
6849
- case import_utils47.AST_NODE_TYPES.TSPropertySignature: {
6850
- if (node.key.type !== import_utils47.AST_NODE_TYPES.Identifier) return null;
6851
- const params = node.type === import_utils47.AST_NODE_TYPES.MethodDefinition ? paramNames(node.value.params) : node.type === import_utils47.AST_NODE_TYPES.TSMethodSignature ? paramNames(node.params) : [];
7103
+ case import_utils52.AST_NODE_TYPES.MethodDefinition:
7104
+ case import_utils52.AST_NODE_TYPES.PropertyDefinition:
7105
+ case import_utils52.AST_NODE_TYPES.TSMethodSignature:
7106
+ case import_utils52.AST_NODE_TYPES.TSPropertySignature: {
7107
+ if (node.key.type !== import_utils52.AST_NODE_TYPES.Identifier) return null;
7108
+ const params = node.type === import_utils52.AST_NODE_TYPES.MethodDefinition ? paramNames(node.value.params) : node.type === import_utils52.AST_NODE_TYPES.TSMethodSignature ? paramNames(node.params) : [];
6852
7109
  return { name: node.key.name, params };
6853
7110
  }
6854
7111
  default:
@@ -6858,9 +7115,9 @@ function declarationNames(node) {
6858
7115
  function paramNames(params) {
6859
7116
  const names = [];
6860
7117
  for (const param of params) {
6861
- const target = param.type === import_utils47.AST_NODE_TYPES.AssignmentPattern ? param.left : param;
6862
- if (target.type === import_utils47.AST_NODE_TYPES.Identifier) names.push(target.name);
6863
- else if (target.type === import_utils47.AST_NODE_TYPES.TSParameterProperty) continue;
7118
+ const target = param.type === import_utils52.AST_NODE_TYPES.AssignmentPattern ? param.left : param;
7119
+ if (target.type === import_utils52.AST_NODE_TYPES.Identifier) names.push(target.name);
7120
+ else if (target.type === import_utils52.AST_NODE_TYPES.TSParameterProperty) continue;
6864
7121
  }
6865
7122
  return names;
6866
7123
  }
@@ -6869,7 +7126,7 @@ function tokensOf(names) {
6869
7126
  for (const name of names) for (const part of splitIdentifier(name)) tokens.add(part);
6870
7127
  return tokens;
6871
7128
  }
6872
- var jsdoc_restates_signature_default = import_utils47.ESLintUtils.RuleCreator(
7129
+ var jsdoc_restates_signature_default = import_utils52.ESLintUtils.RuleCreator(
6873
7130
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
6874
7131
  )({
6875
7132
  name: "jsdoc-restates-signature",
@@ -6905,7 +7162,7 @@ var jsdoc_restates_signature_default = import_utils47.ESLintUtils.RuleCreator(
6905
7162
  if (token === null || token.loc.start.line !== comment.loc.end.line + 1) continue;
6906
7163
  let node = sourceCode.getNodeByRangeIndex(token.range[0]);
6907
7164
  let declaration = null;
6908
- while (node != null && node.type !== import_utils47.AST_NODE_TYPES.Program) {
7165
+ while (node != null && node.type !== import_utils52.AST_NODE_TYPES.Program) {
6909
7166
  declaration = declarationNames(node);
6910
7167
  if (declaration !== null) break;
6911
7168
  node = node.parent ?? null;
@@ -6960,7 +7217,7 @@ var jsdoc_restates_signature_default = import_utils47.ESLintUtils.RuleCreator(
6960
7217
  });
6961
7218
 
6962
7219
  // src/rules/no-restated-comment.ts
6963
- var import_utils48 = require("@typescript-eslint/utils");
7220
+ var import_utils53 = require("@typescript-eslint/utils");
6964
7221
  var MAX_WORDS = 8;
6965
7222
  var MIN_CONTENT_TOKENS = 2;
6966
7223
  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;
@@ -6984,7 +7241,7 @@ function headsSiblingRun(node) {
6984
7241
  const next = index >= 0 ? body[index + 1] : void 0;
6985
7242
  return next !== void 0 && next.type === node.type;
6986
7243
  }
6987
- var no_restated_comment_default = import_utils48.ESLintUtils.RuleCreator(
7244
+ var no_restated_comment_default = import_utils53.ESLintUtils.RuleCreator(
6988
7245
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
6989
7246
  )({
6990
7247
  name: "no-restated-comment",
@@ -7012,7 +7269,7 @@ var no_restated_comment_default = import_utils48.ESLintUtils.RuleCreator(
7012
7269
  function labelsASiblingRun(comment) {
7013
7270
  const token = sourceCode.getTokenAfter(comment, { includeComments: false });
7014
7271
  if (token === null) return false;
7015
- for (let node = sourceCode.getNodeByRangeIndex(token.range[0]); node != null && node.type !== import_utils48.AST_NODE_TYPES.Program; node = node.parent) {
7272
+ for (let node = sourceCode.getNodeByRangeIndex(token.range[0]); node != null && node.type !== import_utils53.AST_NODE_TYPES.Program; node = node.parent) {
7016
7273
  if (headsSiblingRun(node)) return true;
7017
7274
  }
7018
7275
  return false;
@@ -7052,7 +7309,7 @@ var no_restated_comment_default = import_utils48.ESLintUtils.RuleCreator(
7052
7309
  });
7053
7310
 
7054
7311
  // src/rules/trailing-value-narration.ts
7055
- var import_utils49 = require("@typescript-eslint/utils");
7312
+ var import_utils54 = require("@typescript-eslint/utils");
7056
7313
  var NUMBER_RE = /(?<![\w.])(\d+(?:\.\d+)?)(?![\w.])/g;
7057
7314
  var WORD_RE3 = /[A-Za-z]+(?:'[a-z]+)?|\d+(?:\.\d+)?/g;
7058
7315
  var UNIT_WORDS = /* @__PURE__ */ new Set([
@@ -7136,7 +7393,7 @@ function narratesValue(body, code) {
7136
7393
  (word) => STOPWORDS3.has(word) || UNIT_WORDS.has(word) || commentNumbers.has(word) || identifiers.has(word) || stems.has(stem(word))
7137
7394
  );
7138
7395
  }
7139
- var trailing_value_narration_default = import_utils49.ESLintUtils.RuleCreator(
7396
+ var trailing_value_narration_default = import_utils54.ESLintUtils.RuleCreator(
7140
7397
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
7141
7398
  )({
7142
7399
  name: "trailing-value-narration",
@@ -7177,7 +7434,7 @@ var trailing_value_narration_default = import_utils49.ESLintUtils.RuleCreator(
7177
7434
  });
7178
7435
 
7179
7436
  // src/rules/no-tautological-expect.ts
7180
- var import_utils50 = require("@typescript-eslint/utils");
7437
+ var import_utils55 = require("@typescript-eslint/utils");
7181
7438
  var EQUALITY_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual"]);
7182
7439
  var ZERO_ARG_MATCHERS = /* @__PURE__ */ new Set([
7183
7440
  "toBeDefined",
@@ -7191,17 +7448,17 @@ var OPERAND_PREVIEW_CHARS = 40;
7191
7448
  var NUMERIC_SIGNS = /* @__PURE__ */ new Set(["-", "+"]);
7192
7449
  function isLiteral(node) {
7193
7450
  switch (node.type) {
7194
- case import_utils50.AST_NODE_TYPES.Literal:
7451
+ case import_utils55.AST_NODE_TYPES.Literal:
7195
7452
  return true;
7196
- case import_utils50.AST_NODE_TYPES.TemplateLiteral:
7453
+ case import_utils55.AST_NODE_TYPES.TemplateLiteral:
7197
7454
  return node.expressions.length === 0;
7198
- case import_utils50.AST_NODE_TYPES.UnaryExpression:
7455
+ case import_utils55.AST_NODE_TYPES.UnaryExpression:
7199
7456
  return NUMERIC_SIGNS.has(node.operator) && isLiteral(node.argument);
7200
- case import_utils50.AST_NODE_TYPES.ArrayExpression:
7457
+ case import_utils55.AST_NODE_TYPES.ArrayExpression:
7201
7458
  return node.elements.every((element) => element !== null && isLiteral(element));
7202
- case import_utils50.AST_NODE_TYPES.ObjectExpression:
7459
+ case import_utils55.AST_NODE_TYPES.ObjectExpression:
7203
7460
  return node.properties.every(
7204
- (property) => property.type === import_utils50.AST_NODE_TYPES.Property && !property.computed && isLiteral(property.value)
7461
+ (property) => property.type === import_utils55.AST_NODE_TYPES.Property && !property.computed && isLiteral(property.value)
7205
7462
  );
7206
7463
  default:
7207
7464
  return false;
@@ -7209,12 +7466,12 @@ function isLiteral(node) {
7209
7466
  }
7210
7467
  function expectOperand(callee) {
7211
7468
  const receiver = callee.object;
7212
- if (receiver.type !== import_utils50.AST_NODE_TYPES.CallExpression || receiver.callee.type !== import_utils50.AST_NODE_TYPES.Identifier || receiver.callee.name !== "expect" || receiver.arguments.length !== 1) {
7469
+ if (receiver.type !== import_utils55.AST_NODE_TYPES.CallExpression || receiver.callee.type !== import_utils55.AST_NODE_TYPES.Identifier || receiver.callee.name !== "expect" || receiver.arguments.length !== 1) {
7213
7470
  return null;
7214
7471
  }
7215
7472
  return receiver.arguments[0] ?? null;
7216
7473
  }
7217
- var no_tautological_expect_default = import_utils50.ESLintUtils.RuleCreator(
7474
+ var no_tautological_expect_default = import_utils55.ESLintUtils.RuleCreator(
7218
7475
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
7219
7476
  )({
7220
7477
  name: "no-tautological-expect",
@@ -7241,10 +7498,10 @@ var no_tautological_expect_default = import_utils50.ESLintUtils.RuleCreator(
7241
7498
  return {
7242
7499
  CallExpression(node) {
7243
7500
  const callee = node.callee;
7244
- if (callee.type !== import_utils50.AST_NODE_TYPES.MemberExpression || callee.computed) {
7501
+ if (callee.type !== import_utils55.AST_NODE_TYPES.MemberExpression || callee.computed) {
7245
7502
  return;
7246
7503
  }
7247
- if (callee.property.type !== import_utils50.AST_NODE_TYPES.Identifier) {
7504
+ if (callee.property.type !== import_utils55.AST_NODE_TYPES.Identifier) {
7248
7505
  return;
7249
7506
  }
7250
7507
  const matcher = callee.property.name;
@@ -7278,26 +7535,26 @@ var no_tautological_expect_default = import_utils50.ESLintUtils.RuleCreator(
7278
7535
  });
7279
7536
 
7280
7537
  // src/rules/require-interface-for-injected-service.ts
7281
- var import_utils51 = require("@typescript-eslint/utils");
7538
+ var import_utils56 = require("@typescript-eslint/utils");
7282
7539
  var CONFIGISH_TYPE_RE = /(?:Options|Opts|Config|Configuration|Settings|Params|Props|Args|Env|Environment|Callbacks|Flags)$/;
7283
7540
  var CONFIGISH_NAME_RE = /^(?:options|opts|config|configuration|settings|params|props|args|env|environment|callbacks|flags|logger|log|clock)$/i;
7284
7541
  var HTTP_TRANSPORT_TYPE_RE = /^(?:KyInstance|AxiosInstance|Session)$/;
7285
7542
  var TRANSPORT_WRAPPER_NAME_RE = /Client$/;
7286
7543
  var ROUTER_FACTORY_NAME = "Router";
7287
7544
  var FRAMEWORK_HTTP_TYPES = /* @__PURE__ */ new Set(["Request", "Response", "NextFunction"]);
7288
- var isExportedClass = (node) => node.parent.type === import_utils51.AST_NODE_TYPES.ExportNamedDeclaration || node.parent.type === import_utils51.AST_NODE_TYPES.ExportDefaultDeclaration;
7289
- var qualifiedName = (name) => name.type === import_utils51.AST_NODE_TYPES.Identifier ? name.name : name.type === import_utils51.AST_NODE_TYPES.TSQualifiedName ? `${qualifiedName(name.left)}.${name.right.name}` : "";
7545
+ var isExportedClass = (node) => node.parent.type === import_utils56.AST_NODE_TYPES.ExportNamedDeclaration || node.parent.type === import_utils56.AST_NODE_TYPES.ExportDefaultDeclaration;
7546
+ var qualifiedName = (name) => name.type === import_utils56.AST_NODE_TYPES.Identifier ? name.name : name.type === import_utils56.AST_NODE_TYPES.TSQualifiedName ? `${qualifiedName(name.left)}.${name.right.name}` : "";
7290
7547
  var typeReferenceName = (annotated) => {
7291
7548
  let target = annotated;
7292
- if (target.type === import_utils51.AST_NODE_TYPES.TSParameterProperty) target = target.parameter;
7293
- if (target.type === import_utils51.AST_NODE_TYPES.AssignmentPattern) target = target.left;
7294
- if (target.type !== import_utils51.AST_NODE_TYPES.Identifier) return null;
7549
+ if (target.type === import_utils56.AST_NODE_TYPES.TSParameterProperty) target = target.parameter;
7550
+ if (target.type === import_utils56.AST_NODE_TYPES.AssignmentPattern) target = target.left;
7551
+ if (target.type !== import_utils56.AST_NODE_TYPES.Identifier) return null;
7295
7552
  const annotation = target.typeAnnotation?.typeAnnotation;
7296
- if (annotation === void 0 || annotation.type !== import_utils51.AST_NODE_TYPES.TSTypeReference) {
7553
+ if (annotation === void 0 || annotation.type !== import_utils56.AST_NODE_TYPES.TSTypeReference) {
7297
7554
  return null;
7298
7555
  }
7299
7556
  const { typeName } = annotation;
7300
- const rightmost = typeName.type === import_utils51.AST_NODE_TYPES.Identifier ? typeName.name : typeName.type === import_utils51.AST_NODE_TYPES.TSQualifiedName ? typeName.right.name : null;
7557
+ const rightmost = typeName.type === import_utils56.AST_NODE_TYPES.Identifier ? typeName.name : typeName.type === import_utils56.AST_NODE_TYPES.TSQualifiedName ? typeName.right.name : null;
7301
7558
  if (rightmost === null) return null;
7302
7559
  return { name: target.name, typeName: rightmost, display: qualifiedName(typeName) };
7303
7560
  };
@@ -7307,17 +7564,17 @@ var readConstructor = (ctor) => {
7307
7564
  let constructedFields = 0;
7308
7565
  if (body !== null && body !== void 0) {
7309
7566
  for (const statement of body.body) {
7310
- if (statement.type !== import_utils51.AST_NODE_TYPES.ExpressionStatement) continue;
7567
+ if (statement.type !== import_utils56.AST_NODE_TYPES.ExpressionStatement) continue;
7311
7568
  const expression = statement.expression;
7312
- if (expression.type !== import_utils51.AST_NODE_TYPES.AssignmentExpression || expression.operator !== "=" || expression.left.type !== import_utils51.AST_NODE_TYPES.MemberExpression || expression.left.object.type !== import_utils51.AST_NODE_TYPES.ThisExpression) {
7569
+ if (expression.type !== import_utils56.AST_NODE_TYPES.AssignmentExpression || expression.operator !== "=" || expression.left.type !== import_utils56.AST_NODE_TYPES.MemberExpression || expression.left.object.type !== import_utils56.AST_NODE_TYPES.ThisExpression) {
7313
7570
  continue;
7314
7571
  }
7315
7572
  const source = expression.right;
7316
- if (source.type === import_utils51.AST_NODE_TYPES.NewExpression) {
7573
+ if (source.type === import_utils56.AST_NODE_TYPES.NewExpression) {
7317
7574
  constructedFields += 1;
7318
- } else if (source.type === import_utils51.AST_NODE_TYPES.Identifier) {
7575
+ } else if (source.type === import_utils56.AST_NODE_TYPES.Identifier) {
7319
7576
  storedFrom.add(source.name);
7320
- } else if (source.type === import_utils51.AST_NODE_TYPES.MemberExpression && source.object.type === import_utils51.AST_NODE_TYPES.Identifier) {
7577
+ } else if (source.type === import_utils56.AST_NODE_TYPES.MemberExpression && source.object.type === import_utils56.AST_NODE_TYPES.Identifier) {
7321
7578
  storedFrom.add(source.object.name);
7322
7579
  }
7323
7580
  }
@@ -7326,7 +7583,7 @@ var readConstructor = (ctor) => {
7326
7583
  for (const parameter of ctor.value.params) {
7327
7584
  const reference = typeReferenceName(parameter);
7328
7585
  if (reference === null) continue;
7329
- const stored = parameter.type === import_utils51.AST_NODE_TYPES.TSParameterProperty || storedFrom.has(reference.name);
7586
+ const stored = parameter.type === import_utils56.AST_NODE_TYPES.TSParameterProperty || storedFrom.has(reference.name);
7330
7587
  if (!stored) continue;
7331
7588
  if (CONFIGISH_TYPE_RE.test(reference.typeName)) continue;
7332
7589
  if (CONFIGISH_NAME_RE.test(reference.name)) continue;
@@ -7356,19 +7613,19 @@ var subtreeHas = (root, found) => {
7356
7613
  return hit;
7357
7614
  };
7358
7615
  var isFrameworkWiring = (body) => subtreeHas(body, (node) => {
7359
- if (node.type === import_utils51.AST_NODE_TYPES.CallExpression) {
7616
+ if (node.type === import_utils56.AST_NODE_TYPES.CallExpression) {
7360
7617
  const { callee } = node;
7361
- if (callee.type === import_utils51.AST_NODE_TYPES.Identifier) return callee.name === ROUTER_FACTORY_NAME;
7362
- return callee.type === import_utils51.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils51.AST_NODE_TYPES.Identifier && callee.property.name === ROUTER_FACTORY_NAME;
7618
+ if (callee.type === import_utils56.AST_NODE_TYPES.Identifier) return callee.name === ROUTER_FACTORY_NAME;
7619
+ return callee.type === import_utils56.AST_NODE_TYPES.MemberExpression && !callee.computed && callee.property.type === import_utils56.AST_NODE_TYPES.Identifier && callee.property.name === ROUTER_FACTORY_NAME;
7363
7620
  }
7364
- return node.type === import_utils51.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils51.AST_NODE_TYPES.TSQualifiedName && FRAMEWORK_HTTP_TYPES.has(node.typeName.right.name);
7621
+ return node.type === import_utils56.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils56.AST_NODE_TYPES.TSQualifiedName && FRAMEWORK_HTTP_TYPES.has(node.typeName.right.name);
7365
7622
  });
7366
7623
  var stem2 = (name) => name.replace(/^I(?=[A-Z])/, "").replace(/Impl$/, "");
7367
7624
  var fileInterfaceNames = (program) => {
7368
7625
  const names = [];
7369
7626
  for (const statement of program.body) {
7370
- const declaration = statement.type === import_utils51.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
7371
- if (declaration?.type === import_utils51.AST_NODE_TYPES.TSInterfaceDeclaration) names.push(declaration.id.name);
7627
+ const declaration = statement.type === import_utils56.AST_NODE_TYPES.ExportNamedDeclaration ? statement.declaration : statement;
7628
+ if (declaration?.type === import_utils56.AST_NODE_TYPES.TSInterfaceDeclaration) names.push(declaration.id.name);
7372
7629
  }
7373
7630
  return names;
7374
7631
  };
@@ -7386,16 +7643,16 @@ var isTransportWrapper = (className, collaborators, program) => {
7386
7643
  var publicMethodNames = (body) => {
7387
7644
  const names = [];
7388
7645
  for (const member of body.body) {
7389
- if (member.type !== import_utils51.AST_NODE_TYPES.MethodDefinition) continue;
7646
+ if (member.type !== import_utils56.AST_NODE_TYPES.MethodDefinition) continue;
7390
7647
  if (member.kind !== "method" || member.static) continue;
7391
7648
  if (member.accessibility === "private" || member.accessibility === "protected") continue;
7392
- if (member.key.type === import_utils51.AST_NODE_TYPES.PrivateIdentifier) continue;
7393
- if (member.key.type === import_utils51.AST_NODE_TYPES.Identifier) names.push(member.key.name);
7649
+ if (member.key.type === import_utils56.AST_NODE_TYPES.PrivateIdentifier) continue;
7650
+ if (member.key.type === import_utils56.AST_NODE_TYPES.Identifier) names.push(member.key.name);
7394
7651
  else names.push("\u2026");
7395
7652
  }
7396
7653
  return names;
7397
7654
  };
7398
- var require_interface_for_injected_service_default = import_utils51.ESLintUtils.RuleCreator(
7655
+ var require_interface_for_injected_service_default = import_utils56.ESLintUtils.RuleCreator(
7399
7656
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
7400
7657
  )({
7401
7658
  name: "require-interface-for-injected-service",
@@ -7423,7 +7680,7 @@ var require_interface_for_injected_service_default = import_utils51.ESLintUtils.
7423
7680
  if (node.implements.length > 0) return;
7424
7681
  if (node.decorators.length > 0) return;
7425
7682
  const ctor = node.body.body.find(
7426
- (member) => member.type === import_utils51.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
7683
+ (member) => member.type === import_utils56.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
7427
7684
  );
7428
7685
  if (ctor === void 0) return;
7429
7686
  const { collaborators, constructedFields } = readConstructor(ctor);
@@ -7448,26 +7705,26 @@ var require_interface_for_injected_service_default = import_utils51.ESLintUtils.
7448
7705
  });
7449
7706
 
7450
7707
  // src/rules/prefer-non-nullable-collection.ts
7451
- var import_utils52 = require("@typescript-eslint/utils");
7708
+ var import_utils57 = require("@typescript-eslint/utils");
7452
7709
  var ARRAY_TYPE_NAMES = /* @__PURE__ */ new Set(["Array", "ReadonlyArray"]);
7453
7710
  function propertyName(node) {
7454
7711
  const key = node.key;
7455
- if (key.type === import_utils52.AST_NODE_TYPES.Identifier) return key.name;
7456
- if (key.type === import_utils52.AST_NODE_TYPES.Literal) return String(key.value);
7712
+ if (key.type === import_utils57.AST_NODE_TYPES.Identifier) return key.name;
7713
+ if (key.type === import_utils57.AST_NODE_TYPES.Literal) return String(key.value);
7457
7714
  return "collection";
7458
7715
  }
7459
7716
  function isArrayType(node) {
7460
- if (node.type === import_utils52.AST_NODE_TYPES.TSArrayType) return true;
7461
- return node.type === import_utils52.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils52.AST_NODE_TYPES.Identifier && ARRAY_TYPE_NAMES.has(node.typeName.name);
7717
+ if (node.type === import_utils57.AST_NODE_TYPES.TSArrayType) return true;
7718
+ return node.type === import_utils57.AST_NODE_TYPES.TSTypeReference && node.typeName.type === import_utils57.AST_NODE_TYPES.Identifier && ARRAY_TYPE_NAMES.has(node.typeName.name);
7462
7719
  }
7463
7720
  function isNullishType(node) {
7464
- return node.type === import_utils52.AST_NODE_TYPES.TSNullKeyword || node.type === import_utils52.AST_NODE_TYPES.TSUndefinedKeyword;
7721
+ return node.type === import_utils57.AST_NODE_TYPES.TSNullKeyword || node.type === import_utils57.AST_NODE_TYPES.TSUndefinedKeyword;
7465
7722
  }
7466
7723
  function isNullableArrayOnly(node) {
7467
7724
  const values = node.types.filter((member) => !isNullishType(member));
7468
7725
  return values.length > 0 && values.length < node.types.length && values.every(isArrayType);
7469
7726
  }
7470
- var prefer_non_nullable_collection_default = import_utils52.ESLintUtils.RuleCreator(
7727
+ var prefer_non_nullable_collection_default = import_utils57.ESLintUtils.RuleCreator(
7471
7728
  (name) => `https://github.com/sarj-ai/standards/tree/main/packages/typescript#${name}`
7472
7729
  )({
7473
7730
  name: "prefer-non-nullable-collection",
@@ -7490,7 +7747,7 @@ var prefer_non_nullable_collection_default = import_utils52.ESLintUtils.RuleCrea
7490
7747
  function checkOptionalProperty(node) {
7491
7748
  const annotation = node.typeAnnotation?.typeAnnotation;
7492
7749
  if (annotation === void 0) return;
7493
- if (annotation.type !== import_utils52.AST_NODE_TYPES.TSUnionType || !isNullableArrayOnly(annotation)) {
7750
+ if (annotation.type !== import_utils57.AST_NODE_TYPES.TSUnionType || !isNullableArrayOnly(annotation)) {
7494
7751
  return;
7495
7752
  }
7496
7753
  context.report({
@@ -7503,7 +7760,7 @@ var prefer_non_nullable_collection_default = import_utils52.ESLintUtils.RuleCrea
7503
7760
  TSPropertySignature: checkOptionalProperty,
7504
7761
  PropertyDefinition: checkOptionalProperty,
7505
7762
  TSTypeAliasDeclaration(node) {
7506
- if (node.typeAnnotation.type !== import_utils52.AST_NODE_TYPES.TSUnionType) return;
7763
+ if (node.typeAnnotation.type !== import_utils57.AST_NODE_TYPES.TSUnionType) return;
7507
7764
  if (!isNullableArrayOnly(node.typeAnnotation)) return;
7508
7765
  context.report({
7509
7766
  node,
@@ -7516,7 +7773,7 @@ var prefer_non_nullable_collection_default = import_utils52.ESLintUtils.RuleCrea
7516
7773
  });
7517
7774
 
7518
7775
  // src/rules/primary-export-file-name.ts
7519
- var import_utils53 = require("@typescript-eslint/utils");
7776
+ var import_utils58 = require("@typescript-eslint/utils");
7520
7777
  var CONVENTIONAL_BUCKET_EXPORTS2 = /* @__PURE__ */ new Set(["cn"]);
7521
7778
  var GENERIC_ENTRYPOINTS = /* @__PURE__ */ new Set(["main", "run", "cli", "setup", "teardown", "execute"]);
7522
7779
  var ACRONYM_OVERRIDES2 = [
@@ -7534,23 +7791,23 @@ var kebabCase3 = (name) => {
7534
7791
  }
7535
7792
  return normalized.replace(CAMEL_BOUNDARY_RE2, "-").toLowerCase();
7536
7793
  };
7537
- var isFunctionOrClass = (node) => node.type === import_utils53.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils53.AST_NODE_TYPES.FunctionExpression;
7794
+ var isFunctionOrClass = (node) => node.type === import_utils58.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils58.AST_NODE_TYPES.FunctionExpression;
7538
7795
  var findPrimaryExport = (body) => {
7539
7796
  let exportCount = 0;
7540
7797
  let primaryCandidate = null;
7541
7798
  for (const statement of body) {
7542
- if (statement.type === import_utils53.AST_NODE_TYPES.ExportAllDeclaration) {
7799
+ if (statement.type === import_utils58.AST_NODE_TYPES.ExportAllDeclaration) {
7543
7800
  return null;
7544
7801
  }
7545
- if (statement.type === import_utils53.AST_NODE_TYPES.ExportDefaultDeclaration) {
7802
+ if (statement.type === import_utils58.AST_NODE_TYPES.ExportDefaultDeclaration) {
7546
7803
  exportCount += 1;
7547
7804
  const decl = statement.declaration;
7548
- if ((decl.type === import_utils53.AST_NODE_TYPES.FunctionDeclaration || decl.type === import_utils53.AST_NODE_TYPES.ClassDeclaration) && decl.id !== null) {
7805
+ if ((decl.type === import_utils58.AST_NODE_TYPES.FunctionDeclaration || decl.type === import_utils58.AST_NODE_TYPES.ClassDeclaration) && decl.id !== null) {
7549
7806
  primaryCandidate = { name: decl.id.name, node: statement, isDefault: true };
7550
- } else if (decl.type === import_utils53.AST_NODE_TYPES.Identifier) {
7807
+ } else if (decl.type === import_utils58.AST_NODE_TYPES.Identifier) {
7551
7808
  primaryCandidate = { name: decl.name, node: statement, isDefault: true };
7552
7809
  }
7553
- } else if (statement.type === import_utils53.AST_NODE_TYPES.ExportNamedDeclaration) {
7810
+ } else if (statement.type === import_utils58.AST_NODE_TYPES.ExportNamedDeclaration) {
7554
7811
  if (statement.source !== null) {
7555
7812
  return null;
7556
7813
  }
@@ -7559,27 +7816,27 @@ var findPrimaryExport = (body) => {
7559
7816
  exportCount += statement.specifiers.length;
7560
7817
  if (statement.specifiers.length === 1 && primaryCandidate === null) {
7561
7818
  const spec = statement.specifiers[0];
7562
- if (spec && spec.exported.type === import_utils53.AST_NODE_TYPES.Identifier) {
7819
+ if (spec && spec.exported.type === import_utils58.AST_NODE_TYPES.Identifier) {
7563
7820
  primaryCandidate = { name: spec.exported.name, node: statement, isDefault: false };
7564
7821
  }
7565
7822
  }
7566
- } else if (decl.type === import_utils53.AST_NODE_TYPES.FunctionDeclaration || decl.type === import_utils53.AST_NODE_TYPES.ClassDeclaration) {
7823
+ } else if (decl.type === import_utils58.AST_NODE_TYPES.FunctionDeclaration || decl.type === import_utils58.AST_NODE_TYPES.ClassDeclaration) {
7567
7824
  if (decl.id !== null) {
7568
7825
  exportCount += 1;
7569
7826
  if (primaryCandidate === null) {
7570
7827
  primaryCandidate = { name: decl.id.name, node: statement, isDefault: false };
7571
7828
  }
7572
7829
  }
7573
- } else if (decl.type === import_utils53.AST_NODE_TYPES.VariableDeclaration) {
7830
+ } else if (decl.type === import_utils58.AST_NODE_TYPES.VariableDeclaration) {
7574
7831
  for (const declarator of decl.declarations) {
7575
- if (declarator.id.type === import_utils53.AST_NODE_TYPES.Identifier) {
7832
+ if (declarator.id.type === import_utils58.AST_NODE_TYPES.Identifier) {
7576
7833
  exportCount += 1;
7577
7834
  if (primaryCandidate === null && declarator.init && isFunctionOrClass(declarator.init)) {
7578
7835
  primaryCandidate = { name: declarator.id.name, node: statement, isDefault: false };
7579
7836
  }
7580
7837
  }
7581
7838
  }
7582
- } else if (decl.type === import_utils53.AST_NODE_TYPES.TSTypeAliasDeclaration || decl.type === import_utils53.AST_NODE_TYPES.TSInterfaceDeclaration) {
7839
+ } else if (decl.type === import_utils58.AST_NODE_TYPES.TSTypeAliasDeclaration || decl.type === import_utils58.AST_NODE_TYPES.TSInterfaceDeclaration) {
7583
7840
  exportCount += 1;
7584
7841
  if (primaryCandidate === null) {
7585
7842
  primaryCandidate = { name: decl.id.name, node: statement, isDefault: false };
@@ -7592,7 +7849,7 @@ var findPrimaryExport = (body) => {
7592
7849
  }
7593
7850
  return { ...primaryCandidate, count: exportCount };
7594
7851
  };
7595
- var primary_export_file_name_default = import_utils53.ESLintUtils.RuleCreator(
7852
+ var primary_export_file_name_default = import_utils58.ESLintUtils.RuleCreator(
7596
7853
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
7597
7854
  )({
7598
7855
  name: "primary-export-file-name",
@@ -7634,7 +7891,7 @@ var primary_export_file_name_default = import_utils53.ESLintUtils.RuleCreator(
7634
7891
  });
7635
7892
 
7636
7893
  // src/rules/no-implicit-attribute-access.ts
7637
- var import_utils54 = require("@typescript-eslint/utils");
7894
+ var import_utils59 = require("@typescript-eslint/utils");
7638
7895
  var EXCLUDED_BASES = /* @__PURE__ */ new Set([
7639
7896
  "environ",
7640
7897
  "headers",
@@ -7650,15 +7907,15 @@ var EXCLUDED_BASES = /* @__PURE__ */ new Set([
7650
7907
  "sessionStorage"
7651
7908
  ]);
7652
7909
  function getBaseName(node) {
7653
- if (node.type === import_utils54.AST_NODE_TYPES.Identifier) {
7910
+ if (node.type === import_utils59.AST_NODE_TYPES.Identifier) {
7654
7911
  return node.name;
7655
7912
  }
7656
- if (node.type === import_utils54.AST_NODE_TYPES.MemberExpression && node.property.type === import_utils54.AST_NODE_TYPES.Identifier) {
7913
+ if (node.type === import_utils59.AST_NODE_TYPES.MemberExpression && node.property.type === import_utils59.AST_NODE_TYPES.Identifier) {
7657
7914
  return node.property.name;
7658
7915
  }
7659
7916
  return null;
7660
7917
  }
7661
- var no_implicit_attribute_access_default = import_utils54.ESLintUtils.RuleCreator(
7918
+ var no_implicit_attribute_access_default = import_utils59.ESLintUtils.RuleCreator(
7662
7919
  (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
7663
7920
  )({
7664
7921
  name: "no-implicit-attribute-access",
@@ -7679,7 +7936,7 @@ var no_implicit_attribute_access_default = import_utils54.ESLintUtils.RuleCreato
7679
7936
  if (!node.computed) {
7680
7937
  return;
7681
7938
  }
7682
- if (node.property.type === import_utils54.AST_NODE_TYPES.Literal && typeof node.property.value === "string") {
7939
+ if (node.property.type === import_utils59.AST_NODE_TYPES.Literal && typeof node.property.value === "string") {
7683
7940
  const baseName = getBaseName(node.object);
7684
7941
  if (!baseName || !EXCLUDED_BASES.has(baseName)) {
7685
7942
  context.report({
@@ -7692,11 +7949,11 @@ var no_implicit_attribute_access_default = import_utils54.ESLintUtils.RuleCreato
7692
7949
  },
7693
7950
  CallExpression(node) {
7694
7951
  const callee = node.callee;
7695
- if (callee.type === import_utils54.AST_NODE_TYPES.MemberExpression) {
7696
- const method = callee.property.type === import_utils54.AST_NODE_TYPES.Identifier ? callee.property.name : null;
7952
+ if (callee.type === import_utils59.AST_NODE_TYPES.MemberExpression) {
7953
+ const method = callee.property.type === import_utils59.AST_NODE_TYPES.Identifier ? callee.property.name : null;
7697
7954
  if (method === "get") {
7698
7955
  const arg = node.arguments[0];
7699
- if (arg && arg.type === import_utils54.AST_NODE_TYPES.Literal && typeof arg.value === "string") {
7956
+ if (arg && arg.type === import_utils59.AST_NODE_TYPES.Literal && typeof arg.value === "string") {
7700
7957
  const baseName = getBaseName(callee.object);
7701
7958
  if (!baseName || !EXCLUDED_BASES.has(baseName)) {
7702
7959
  context.report({
@@ -7713,8 +7970,174 @@ var no_implicit_attribute_access_default = import_utils54.ESLintUtils.RuleCreato
7713
7970
  }
7714
7971
  });
7715
7972
 
7973
+ // src/rules/strict-test-assertions.ts
7974
+ var import_utils60 = require("@typescript-eslint/utils");
7975
+ var strict_test_assertions_default = import_utils60.ESLintUtils.RuleCreator.withoutDocs({
7976
+ meta: {
7977
+ type: "suggestion",
7978
+ docs: {
7979
+ description: "Replace multiple sequential assertions with a single toMatchObject or toStrictEqual"
7980
+ },
7981
+ fixable: "code",
7982
+ messages: {
7983
+ combineAssertions: "Combine multiple sequential assertions on the same object into a single toMatchObject or toStrictEqual"
7984
+ },
7985
+ schema: []
7986
+ },
7987
+ defaultOptions: [],
7988
+ create(context) {
7989
+ function checkBody(body) {
7990
+ let currentObject = null;
7991
+ let sequence = [];
7992
+ function getExpectObject(expr) {
7993
+ if (expr.type === import_utils60.AST_NODE_TYPES.CallExpression && expr.callee.type === import_utils60.AST_NODE_TYPES.MemberExpression && expr.callee.object.type === import_utils60.AST_NODE_TYPES.CallExpression && expr.callee.object.callee.type === import_utils60.AST_NODE_TYPES.Identifier && expr.callee.object.callee.name === "expect" && expr.callee.object.arguments.length === 1) {
7994
+ const arg = expr.callee.object.arguments.at(0);
7995
+ if (arg?.type === import_utils60.AST_NODE_TYPES.MemberExpression) {
7996
+ return arg.object;
7997
+ }
7998
+ }
7999
+ return null;
8000
+ }
8001
+ function reportSequence() {
8002
+ const first = sequence.at(0);
8003
+ if (sequence.length > 1 && first) {
8004
+ context.report({
8005
+ node: first,
8006
+ messageId: "combineAssertions",
8007
+ fix(fixer) {
8008
+ if (!currentObject) return null;
8009
+ const objectText = context.sourceCode.getText(currentObject);
8010
+ const props = sequence.map((stmt) => {
8011
+ if (stmt.expression.type !== import_utils60.AST_NODE_TYPES.CallExpression || stmt.expression.callee.type !== import_utils60.AST_NODE_TYPES.MemberExpression || stmt.expression.callee.object.type !== import_utils60.AST_NODE_TYPES.CallExpression) {
8012
+ return null;
8013
+ }
8014
+ const actual = stmt.expression.callee.object.arguments.at(0);
8015
+ const expected = stmt.expression.arguments.at(0);
8016
+ if (actual?.type === import_utils60.AST_NODE_TYPES.MemberExpression && actual.property.type === import_utils60.AST_NODE_TYPES.Identifier && expected) {
8017
+ const propName2 = actual.property.name;
8018
+ const valText = context.sourceCode.getText(expected);
8019
+ return `${propName2}: ${valText}`;
8020
+ }
8021
+ return null;
8022
+ });
8023
+ if (props.some((p) => p === null)) return null;
8024
+ const replacement = `expect(${objectText}).toMatchObject({ ${props.join(", ")} });`;
8025
+ return [
8026
+ fixer.replaceText(first, replacement),
8027
+ ...sequence.slice(1).map((stmt) => fixer.remove(stmt))
8028
+ ];
8029
+ }
8030
+ });
8031
+ }
8032
+ }
8033
+ for (const statement of body) {
8034
+ if (statement.type === import_utils60.AST_NODE_TYPES.ExpressionStatement) {
8035
+ const obj = getExpectObject(statement.expression);
8036
+ if (obj && currentObject && context.sourceCode.getText(obj) === context.sourceCode.getText(currentObject)) {
8037
+ sequence.push(statement);
8038
+ } else {
8039
+ reportSequence();
8040
+ if (obj) {
8041
+ currentObject = obj;
8042
+ sequence = [statement];
8043
+ } else {
8044
+ currentObject = null;
8045
+ sequence = [];
8046
+ }
8047
+ }
8048
+ } else {
8049
+ reportSequence();
8050
+ currentObject = null;
8051
+ sequence = [];
8052
+ }
8053
+ }
8054
+ reportSequence();
8055
+ }
8056
+ return {
8057
+ BlockStatement(node) {
8058
+ checkBody(node.body);
8059
+ },
8060
+ Program(node) {
8061
+ checkBody(node.body);
8062
+ }
8063
+ };
8064
+ }
8065
+ });
8066
+
8067
+ // src/rules/no-async-callback-in-waitfor.ts
8068
+ var import_utils61 = require("@typescript-eslint/utils");
8069
+ var no_async_callback_in_waitfor_default = import_utils61.ESLintUtils.RuleCreator(
8070
+ (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
8071
+ )({
8072
+ name: "no-async-callback-in-waitfor",
8073
+ meta: {
8074
+ type: "problem",
8075
+ docs: {
8076
+ description: "Disallow async callbacks in `waitFor` to prevent swallowed promise rejections."
8077
+ },
8078
+ schema: [],
8079
+ messages: {
8080
+ noAsyncCallbackInWaitFor: "The callback to `waitFor` should not be async. It expects synchronous assertions and runs the callback repeatedly."
8081
+ }
8082
+ },
8083
+ defaultOptions: [],
8084
+ create(context) {
8085
+ if (!isTestFile(context.filename)) {
8086
+ return {};
8087
+ }
8088
+ return {
8089
+ CallExpression(node) {
8090
+ if (node.callee.type === import_utils61.AST_NODE_TYPES.Identifier && node.callee.name === "waitFor") {
8091
+ const callback = node.arguments[0];
8092
+ if (callback && (callback.type === import_utils61.AST_NODE_TYPES.ArrowFunctionExpression || callback.type === import_utils61.AST_NODE_TYPES.FunctionExpression) && callback.async) {
8093
+ context.report({
8094
+ node: callback,
8095
+ messageId: "noAsyncCallbackInWaitFor"
8096
+ });
8097
+ }
8098
+ }
8099
+ }
8100
+ };
8101
+ }
8102
+ });
8103
+
8104
+ // src/rules/prefer-setup-file-mocks.ts
8105
+ var import_utils62 = require("@typescript-eslint/utils");
8106
+ var prefer_setup_file_mocks_default = import_utils62.ESLintUtils.RuleCreator(
8107
+ (name) => `https://github.com/sarj-ai/standards/blob/main/packages/typescript/src/rules/${name}.ts`
8108
+ )({
8109
+ name: "prefer-setup-file-mocks",
8110
+ meta: {
8111
+ type: "suggestion",
8112
+ docs: {
8113
+ description: "Prefer defining module mocks in setup files rather than using vi.mock or jest.mock inline in test files."
8114
+ },
8115
+ schema: [],
8116
+ messages: {
8117
+ preferSetupFileMocks: "Define module mocks in a setup file (e.g. vitest.setup.ts) instead of using vi.mock or jest.mock directly in test files."
8118
+ }
8119
+ },
8120
+ defaultOptions: [],
8121
+ create(context) {
8122
+ if (!isTestFile(context.filename)) {
8123
+ return {};
8124
+ }
8125
+ return {
8126
+ CallExpression(node) {
8127
+ if (node.callee.type === import_utils62.AST_NODE_TYPES.MemberExpression && node.callee.object.type === import_utils62.AST_NODE_TYPES.Identifier && (node.callee.object.name === "vi" || node.callee.object.name === "jest") && node.callee.property.type === import_utils62.AST_NODE_TYPES.Identifier && node.callee.property.name === "mock") {
8128
+ context.report({
8129
+ node,
8130
+ messageId: "preferSetupFileMocks"
8131
+ });
8132
+ }
8133
+ }
8134
+ };
8135
+ }
8136
+ });
8137
+
7716
8138
  // src/index.ts
7717
8139
  var rules = {
8140
+ "ban-loose-type-guards-in-tests": ban_loose_type_guards_in_tests_default,
7718
8141
  "enforce-file-structure": enforce_file_structure_default,
7719
8142
  "no-client-side-data-fetching": no_client_side_data_fetching_default,
7720
8143
  "no-comment-cruft": no_comment_cruft_default,
@@ -7739,7 +8162,9 @@ var rules = {
7739
8162
  "no-fat-try-blocks": no_fat_try_blocks_default,
7740
8163
  "no-secret-in-log": no_secret_in_log_default,
7741
8164
  "no-unsafe-cast": no_unsafe_cast_default,
8165
+ "no-unsafe-mock-casting": no_unsafe_mock_casting_default,
7742
8166
  "prefer-string-literal-union": prefer_string_literal_union_default,
8167
+ "prefer-zod-enum": prefer_zod_enum_default,
7743
8168
  "single-public-export": single_public_export_default,
7744
8169
  "primary-export-file-name": primary_export_file_name_default,
7745
8170
  "no-silent-promise-catch": no_silent_promise_catch_default,
@@ -7750,6 +8175,7 @@ var rules = {
7750
8175
  "no-repeated-string-literal": no_repeated_string_literal_default,
7751
8176
  "no-select-star": no_select_star_default,
7752
8177
  "no-sleep-in-test-body": no_sleep_in_test_body_default,
8178
+ "no-conditional-in-test": no_conditional_in_test_default,
7753
8179
  "prefer-constant-time-secret-compare": prefer_constant_time_secret_compare_default,
7754
8180
  "store-insert-requires-on-conflict": store_insert_requires_on_conflict_default,
7755
8181
  "no-dynamic-sql": no_dynamic_sql_default,
@@ -7762,13 +8188,16 @@ var rules = {
7762
8188
  "trailing-value-narration": trailing_value_narration_default,
7763
8189
  "no-tautological-expect": no_tautological_expect_default,
7764
8190
  "require-interface-for-injected-service": require_interface_for_injected_service_default,
8191
+ "strict-test-assertions": strict_test_assertions_default,
7765
8192
  "prefer-non-nullable-collection": prefer_non_nullable_collection_default,
7766
- "no-implicit-attribute-access": no_implicit_attribute_access_default
8193
+ "no-implicit-attribute-access": no_implicit_attribute_access_default,
8194
+ "no-async-callback-in-waitfor": no_async_callback_in_waitfor_default,
8195
+ "prefer-setup-file-mocks": prefer_setup_file_mocks_default
7767
8196
  };
7768
8197
  var plugin = {
7769
8198
  meta: {
7770
8199
  name: "@sarj/eslint-plugin",
7771
- version: "2.16.0"
8200
+ version: "2.17.0"
7772
8201
  },
7773
8202
  rules,
7774
8203
  configs: {
@@ -7778,6 +8207,7 @@ var plugin = {
7778
8207
  "@sarj/zod-naming-convention": "warn",
7779
8208
  "@sarj/require-assert-never": "error",
7780
8209
  "@sarj/require-zod-form-validation": "error",
8210
+ "@sarj/ban-loose-type-guards-in-tests": "error",
7781
8211
  "@sarj/enforce-file-structure": "warn",
7782
8212
  "@sarj/no-client-side-data-fetching": "warn",
7783
8213
  "@sarj/prefer-server-actions": "warn",
@@ -7802,9 +8232,11 @@ var plugin = {
7802
8232
  "@sarj/no-cors-wildcard-with-credentials": "warn",
7803
8233
  "@sarj/no-secret-in-log": "warn",
7804
8234
  "@sarj/no-unsafe-cast": "warn",
8235
+ "@sarj/no-unsafe-mock-casting": "warn",
7805
8236
  "@sarj/single-public-export": "warn",
7806
8237
  "@sarj/primary-export-file-name": "warn",
7807
8238
  "@sarj/prefer-string-literal-union": "warn",
8239
+ "@sarj/prefer-zod-enum": "warn",
7808
8240
  // Mined from 2y of PR review feedback + 5-repo code-smell audit (2026-07).
7809
8241
  "@sarj/require-fetch-timeout": "warn",
7810
8242
  "@sarj/no-silent-promise-catch": "warn",
@@ -7818,6 +8250,7 @@ var plugin = {
7818
8250
  "@sarj/no-offset-pagination": "warn",
7819
8251
  "@sarj/no-select-star": "warn",
7820
8252
  "@sarj/no-sleep-in-test-body": "warn",
8253
+ "@sarj/no-conditional-in-test": "warn",
7821
8254
  "@sarj/no-repeated-string-literal": "warn",
7822
8255
  "@sarj/no-positional-tuple-return": "warn",
7823
8256
  // Injection guard — low FP, applies to any repo touching SQL.
@@ -7854,7 +8287,9 @@ var plugin = {
7854
8287
  // port, 29 fire, 28 of them true positives.
7855
8288
  "@sarj/require-interface-for-injected-service": "warn",
7856
8289
  "@sarj/prefer-non-nullable-collection": "warn",
7857
- "@sarj/no-implicit-attribute-access": "warn"
8290
+ "@sarj/no-implicit-attribute-access": "warn",
8291
+ "@sarj/no-async-callback-in-waitfor": "warn",
8292
+ "@sarj/prefer-setup-file-mocks": "warn"
7858
8293
  }
7859
8294
  },
7860
8295
  strict: {
@@ -7863,6 +8298,7 @@ var plugin = {
7863
8298
  "@sarj/zod-naming-convention": "error",
7864
8299
  "@sarj/require-assert-never": "error",
7865
8300
  "@sarj/require-zod-form-validation": "error",
8301
+ "@sarj/ban-loose-type-guards-in-tests": "error",
7866
8302
  "@sarj/enforce-file-structure": "error",
7867
8303
  "@sarj/no-raw-env": "error",
7868
8304
  "@sarj/prefer-shadcn": "error",
@@ -7891,10 +8327,12 @@ var plugin = {
7891
8327
  "@sarj/no-cors-wildcard-with-credentials": "error",
7892
8328
  "@sarj/no-secret-in-log": "error",
7893
8329
  "@sarj/no-unsafe-cast": "error",
8330
+ "@sarj/no-unsafe-mock-casting": "error",
7894
8331
  "@sarj/single-public-export": "error",
7895
8332
  "@sarj/primary-export-file-name": "error",
7896
8333
  // Promoted to error 2026-07-25 — strict means strict (user directive).
7897
8334
  "@sarj/prefer-string-literal-union": "error",
8335
+ "@sarj/prefer-zod-enum": "error",
7898
8336
  // Mined from 2y of PR review feedback + 5-repo code-smell audit (2026-07).
7899
8337
  "@sarj/require-fetch-timeout": "error",
7900
8338
  "@sarj/no-silent-promise-catch": "error",
@@ -7905,6 +8343,7 @@ var plugin = {
7905
8343
  "@sarj/no-offset-pagination": "error",
7906
8344
  "@sarj/no-select-star": "error",
7907
8345
  "@sarj/no-sleep-in-test-body": "error",
8346
+ "@sarj/no-conditional-in-test": "error",
7908
8347
  "@sarj/no-repeated-string-literal": "error",
7909
8348
  // API-shape advice rather than a runtime defect — a corpus sweep found its
7910
8349
  // only hits are parser `[value, cursor]` returns, which are conventional.
@@ -7934,7 +8373,9 @@ var plugin = {
7934
8373
  // corpus (175 `implements` clauses vs 29 hits), so strict enforces it.
7935
8374
  "@sarj/require-interface-for-injected-service": "error",
7936
8375
  "@sarj/prefer-non-nullable-collection": "error",
7937
- "@sarj/no-implicit-attribute-access": "error"
8376
+ "@sarj/no-implicit-attribute-access": "error",
8377
+ "@sarj/no-async-callback-in-waitfor": "error",
8378
+ "@sarj/prefer-setup-file-mocks": "error"
7938
8379
  }
7939
8380
  }
7940
8381
  }