@pobammer-ts/eslint-cease-nonsense-rules 1.10.0 → 1.12.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.
Files changed (68) hide show
  1. package/README.md +149 -0
  2. package/dist/build-metadata.json +3 -3
  3. package/dist/index.d.ts +9 -6
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1056 -295
  6. package/dist/index.js.map +50 -41
  7. package/dist/rules/ban-instances.d.ts +6 -7
  8. package/dist/rules/ban-instances.d.ts.map +1 -1
  9. package/dist/rules/ban-react-fc.d.ts +4 -7
  10. package/dist/rules/ban-react-fc.d.ts.map +1 -1
  11. package/dist/rules/enforce-ianitor-check-type.d.ts +7 -3
  12. package/dist/rules/enforce-ianitor-check-type.d.ts.map +1 -1
  13. package/dist/rules/no-async-constructor.d.ts +4 -5
  14. package/dist/rules/no-async-constructor.d.ts.map +1 -1
  15. package/dist/rules/no-color3-constructor.d.ts +4 -3
  16. package/dist/rules/no-color3-constructor.d.ts.map +1 -1
  17. package/dist/rules/no-commented-code.d.ts.map +1 -1
  18. package/dist/rules/no-god-components.d.ts.map +1 -1
  19. package/dist/rules/no-identity-map.d.ts +4 -2
  20. package/dist/rules/no-identity-map.d.ts.map +1 -1
  21. package/dist/rules/no-instance-methods-without-this.d.ts +4 -9
  22. package/dist/rules/no-instance-methods-without-this.d.ts.map +1 -1
  23. package/dist/rules/no-print.d.ts +4 -3
  24. package/dist/rules/no-print.d.ts.map +1 -1
  25. package/dist/rules/no-useless-use-spring.d.ts +4 -4
  26. package/dist/rules/no-useless-use-spring.d.ts.map +1 -1
  27. package/dist/rules/no-warn.d.ts +4 -3
  28. package/dist/rules/no-warn.d.ts.map +1 -1
  29. package/dist/rules/prefer-class-properties.d.ts +4 -3
  30. package/dist/rules/prefer-class-properties.d.ts.map +1 -1
  31. package/dist/rules/prefer-early-return.d.ts +4 -4
  32. package/dist/rules/prefer-early-return.d.ts.map +1 -1
  33. package/dist/rules/prefer-module-scope-constants.d.ts +4 -2
  34. package/dist/rules/prefer-module-scope-constants.d.ts.map +1 -1
  35. package/dist/rules/prefer-pascal-case-enums.d.ts +4 -4
  36. package/dist/rules/prefer-pascal-case-enums.d.ts.map +1 -1
  37. package/dist/rules/prefer-pattern-replacements.d.ts +8 -0
  38. package/dist/rules/prefer-pattern-replacements.d.ts.map +1 -0
  39. package/dist/rules/prefer-sequence-overloads.d.ts +4 -7
  40. package/dist/rules/prefer-sequence-overloads.d.ts.map +1 -1
  41. package/dist/rules/prefer-singular-enums.d.ts +4 -4
  42. package/dist/rules/prefer-singular-enums.d.ts.map +1 -1
  43. package/dist/rules/react-hooks-strict-return.d.ts +4 -3
  44. package/dist/rules/react-hooks-strict-return.d.ts.map +1 -1
  45. package/dist/rules/require-named-effect-functions.d.ts.map +1 -1
  46. package/dist/rules/require-react-component-keys.d.ts +4 -5
  47. package/dist/rules/require-react-component-keys.d.ts.map +1 -1
  48. package/dist/rules/require-react-display-names.d.ts +11 -0
  49. package/dist/rules/require-react-display-names.d.ts.map +1 -0
  50. package/dist/rules/strict-component-boundaries.d.ts +4 -8
  51. package/dist/rules/strict-component-boundaries.d.ts.map +1 -1
  52. package/dist/utilities/configure-utilities.d.ts +14 -0
  53. package/dist/utilities/configure-utilities.d.ts.map +1 -1
  54. package/dist/utilities/create-rule.d.ts +9 -0
  55. package/dist/utilities/create-rule.d.ts.map +1 -0
  56. package/dist/utilities/pattern-replacement/constant-folder.d.ts +24 -0
  57. package/dist/utilities/pattern-replacement/constant-folder.d.ts.map +1 -0
  58. package/dist/utilities/pattern-replacement/index.d.ts +7 -0
  59. package/dist/utilities/pattern-replacement/index.d.ts.map +1 -0
  60. package/dist/utilities/pattern-replacement/pattern-matcher.d.ts +62 -0
  61. package/dist/utilities/pattern-replacement/pattern-matcher.d.ts.map +1 -0
  62. package/dist/utilities/pattern-replacement/pattern-parser.d.ts +22 -0
  63. package/dist/utilities/pattern-replacement/pattern-parser.d.ts.map +1 -0
  64. package/dist/utilities/pattern-replacement/pattern-types.d.ts +69 -0
  65. package/dist/utilities/pattern-replacement/pattern-types.d.ts.map +1 -0
  66. package/dist/utilities/pattern-replacement/replacement-generator.d.ts +16 -0
  67. package/dist/utilities/pattern-replacement/replacement-generator.d.ts.map +1 -0
  68. package/package.json +17 -17
package/dist/index.js CHANGED
@@ -7726,7 +7726,7 @@ var require_Referencer = __commonJS((exports) => {
7726
7726
  this.visitForIn(node);
7727
7727
  }
7728
7728
  ForStatement(node) {
7729
- if (node.init && node.init.type === types_1.AST_NODE_TYPES.VariableDeclaration && node.init.kind !== "var") {
7729
+ if (node.init?.type === types_1.AST_NODE_TYPES.VariableDeclaration && node.init.kind !== "var") {
7730
7730
  this.scopeManager.nestForScope(node);
7731
7731
  }
7732
7732
  this.visitChildren(node);
@@ -8233,7 +8233,6 @@ function Assign(left, right) {
8233
8233
  var exports_emit = {};
8234
8234
  __export(exports_emit, {
8235
8235
  Ternary: () => Ternary,
8236
- StringGraphemeCount: () => StringGraphemeCount2,
8237
8236
  Statements: () => Statements,
8238
8237
  Return: () => Return,
8239
8238
  ReduceOr: () => ReduceOr,
@@ -8252,6 +8251,8 @@ __export(exports_emit, {
8252
8251
  IsObject: () => IsObject2,
8253
8252
  IsNumber: () => IsNumber2,
8254
8253
  IsNull: () => IsNull2,
8254
+ IsMinLength: () => IsMinLength3,
8255
+ IsMaxLength: () => IsMaxLength3,
8255
8256
  IsLessThan: () => IsLessThan2,
8256
8257
  IsLessEqualThan: () => IsLessEqualThan2,
8257
8258
  IsIterator: () => IsIterator2,
@@ -8283,7 +8284,6 @@ var exports_guard = {};
8283
8284
  __export(exports_guard, {
8284
8285
  Values: () => Values,
8285
8286
  Symbols: () => Symbols,
8286
- StringGraphemeCount: () => StringGraphemeCount,
8287
8287
  Keys: () => Keys,
8288
8288
  IsValueLike: () => IsValueLike,
8289
8289
  IsUndefined: () => IsUndefined,
@@ -8294,6 +8294,8 @@ __export(exports_guard, {
8294
8294
  IsNumber: () => IsNumber,
8295
8295
  IsNull: () => IsNull,
8296
8296
  IsMultipleOf: () => IsMultipleOf,
8297
+ IsMinLength: () => IsMinLength2,
8298
+ IsMaxLength: () => IsMaxLength2,
8297
8299
  IsLessThan: () => IsLessThan,
8298
8300
  IsLessEqualThan: () => IsLessEqualThan,
8299
8301
  IsIterator: () => IsIterator,
@@ -8310,11 +8312,114 @@ __export(exports_guard, {
8310
8312
  IsAsyncIterator: () => IsAsyncIterator,
8311
8313
  IsArray: () => IsArray,
8312
8314
  HasPropertyKey: () => HasPropertyKey,
8315
+ GraphemeCount: () => GraphemeCount2,
8313
8316
  EveryAll: () => EveryAll,
8314
8317
  Every: () => Every,
8315
8318
  EntriesRegExp: () => EntriesRegExp,
8316
8319
  Entries: () => Entries
8317
8320
  });
8321
+
8322
+ // node_modules/typebox/build/guard/string.mjs
8323
+ function IsBetween(value, min, max) {
8324
+ return value >= min && value <= max;
8325
+ }
8326
+ function IsRegionalIndicator(value) {
8327
+ return IsBetween(value, 127462, 127487);
8328
+ }
8329
+ function IsVariationSelector(value) {
8330
+ return IsBetween(value, 65024, 65039);
8331
+ }
8332
+ function IsCombiningMark(value) {
8333
+ return IsBetween(value, 768, 879) || IsBetween(value, 6832, 6911) || IsBetween(value, 7616, 7679) || IsBetween(value, 65056, 65071);
8334
+ }
8335
+ function CodePointLength(value) {
8336
+ return value > 65535 ? 2 : 1;
8337
+ }
8338
+ function ConsumeModifiers(value, index) {
8339
+ while (index < value.length) {
8340
+ const point = value.codePointAt(index);
8341
+ if (IsCombiningMark(point) || IsVariationSelector(point)) {
8342
+ index += CodePointLength(point);
8343
+ } else {
8344
+ break;
8345
+ }
8346
+ }
8347
+ return index;
8348
+ }
8349
+ function NextGraphemeClusterIndex(value, clusterStart) {
8350
+ const startCP = value.codePointAt(clusterStart);
8351
+ let clusterEnd = clusterStart + CodePointLength(startCP);
8352
+ clusterEnd = ConsumeModifiers(value, clusterEnd);
8353
+ while (clusterEnd < value.length - 1 && value[clusterEnd] === "‍") {
8354
+ const nextCP = value.codePointAt(clusterEnd + 1);
8355
+ clusterEnd += 1 + CodePointLength(nextCP);
8356
+ clusterEnd = ConsumeModifiers(value, clusterEnd);
8357
+ }
8358
+ if (IsRegionalIndicator(startCP) && clusterEnd < value.length && IsRegionalIndicator(value.codePointAt(clusterEnd))) {
8359
+ clusterEnd += CodePointLength(value.codePointAt(clusterEnd));
8360
+ }
8361
+ return clusterEnd;
8362
+ }
8363
+ function IsGraphemeCodePoint(value) {
8364
+ return IsBetween(value, 55296, 56319) || IsBetween(value, 768, 879) || value === 8205;
8365
+ }
8366
+ function GraphemeCount(value) {
8367
+ let count = 0;
8368
+ let index = 0;
8369
+ while (index < value.length) {
8370
+ index = NextGraphemeClusterIndex(value, index);
8371
+ count++;
8372
+ }
8373
+ return count;
8374
+ }
8375
+ function IsMinLength(value, minLength) {
8376
+ let count = 0;
8377
+ let index = 0;
8378
+ while (index < value.length) {
8379
+ index = NextGraphemeClusterIndex(value, index);
8380
+ count++;
8381
+ if (count >= minLength)
8382
+ return true;
8383
+ }
8384
+ return false;
8385
+ }
8386
+ function IsMaxLength(value, maxLength) {
8387
+ let count = 0;
8388
+ let index = 0;
8389
+ while (index < value.length) {
8390
+ index = NextGraphemeClusterIndex(value, index);
8391
+ count++;
8392
+ if (count > maxLength)
8393
+ return false;
8394
+ }
8395
+ return true;
8396
+ }
8397
+ function IsMinLengthFast(value, minLength) {
8398
+ let index = 0;
8399
+ while (index < value.length) {
8400
+ if (IsGraphemeCodePoint(value.charCodeAt(index))) {
8401
+ return IsMinLength(value, minLength);
8402
+ }
8403
+ index++;
8404
+ if (index >= minLength)
8405
+ return true;
8406
+ }
8407
+ return false;
8408
+ }
8409
+ function IsMaxLengthFast(value, maxLength) {
8410
+ let index = 0;
8411
+ while (index < value.length) {
8412
+ if (IsGraphemeCodePoint(value.charCodeAt(index))) {
8413
+ return IsMaxLength(value, maxLength);
8414
+ }
8415
+ index++;
8416
+ if (index > maxLength)
8417
+ return false;
8418
+ }
8419
+ return true;
8420
+ }
8421
+
8422
+ // node_modules/typebox/build/guard/guard.mjs
8318
8423
  function IsArray(value) {
8319
8424
  return Array.isArray(value);
8320
8425
  }
@@ -8405,8 +8510,14 @@ function IsClassInstance(value) {
8405
8510
  function IsValueLike(value) {
8406
8511
  return IsBigInt(value) || IsBoolean(value) || IsNull(value) || IsNumber(value) || IsString(value) || IsUndefined(value);
8407
8512
  }
8408
- function StringGraphemeCount(value) {
8409
- return Array.from(value).length;
8513
+ function GraphemeCount2(value) {
8514
+ return GraphemeCount(value);
8515
+ }
8516
+ function IsMaxLength2(value, length) {
8517
+ return IsMaxLengthFast(value, length);
8518
+ }
8519
+ function IsMinLength2(value, length) {
8520
+ return IsMinLengthFast(value, length);
8410
8521
  }
8411
8522
  function Every(value, offset, callback) {
8412
8523
  for (let index = offset;index < value.length; index++) {
@@ -8529,8 +8640,11 @@ function IsLessEqualThan2(left, right) {
8529
8640
  function IsGreaterEqualThan2(left, right) {
8530
8641
  return `${left} >= ${right}`;
8531
8642
  }
8532
- function StringGraphemeCount2(value) {
8533
- return `Guard.StringGraphemeCount(${value})`;
8643
+ function IsMinLength3(value, length) {
8644
+ return `Guard.IsMinLength(${value}, ${length})`;
8645
+ }
8646
+ function IsMaxLength3(value, length) {
8647
+ return `Guard.IsMaxLength(${value}, ${length})`;
8534
8648
  }
8535
8649
  function Every2(value, offset, params, expression) {
8536
8650
  return IsEqual(offset, "0") ? `${value}.every((${params[0]}, ${params[1]}) => ${expression})` : `((value, callback) => { for(let index = ${offset}; index < value.length; index++) if (!callback(value[index], index)) return false; return true })(${value}, (${params[0]}, ${params[1]}) => ${expression})`;
@@ -10794,6 +10908,10 @@ function EvaluateUnion(types) {
10794
10908
  function EvaluateType(type) {
10795
10909
  return IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
10796
10910
  }
10911
+ function EvaluateUnionFast(types) {
10912
+ const result = exports_guard.IsEqual(types.length, 1) ? types[0] : exports_guard.IsEqual(types.length, 0) ? Never() : Union(types);
10913
+ return result;
10914
+ }
10797
10915
 
10798
10916
  // node_modules/typebox/build/type/engine/evaluate/broaden.mjs
10799
10917
  function BroadFilter(type, types) {
@@ -11559,10 +11677,10 @@ function IndexElementsWithIndexer(types, indexer) {
11559
11677
  function FromTupleWithIndexer(types, indexer) {
11560
11678
  const formattedArrayIndexer = FormatArrayIndexer(indexer);
11561
11679
  const elements = IndexElementsWithIndexer(types, formattedArrayIndexer);
11562
- return EvaluateUnion(elements);
11680
+ return EvaluateUnionFast(elements);
11563
11681
  }
11564
11682
  function FromTupleWithoutIndexer(types) {
11565
- return EvaluateUnion(types);
11683
+ return EvaluateUnionFast(types);
11566
11684
  }
11567
11685
  function FromTuple(types, indexer) {
11568
11686
  return IsNumber4(indexer) || IsInteger3(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
@@ -11731,7 +11849,7 @@ function FromPropertyKeys(keys) {
11731
11849
  function FromObject5(properties2) {
11732
11850
  const propertyKeys = exports_guard.Keys(properties2);
11733
11851
  const variants = FromPropertyKeys(propertyKeys);
11734
- const result = EvaluateUnion(variants);
11852
+ const result = EvaluateUnionFast(variants);
11735
11853
  return result;
11736
11854
  }
11737
11855
 
@@ -11743,7 +11861,7 @@ function FromRecord(type) {
11743
11861
  // node_modules/typebox/build/type/engine/keyof/from-tuple.mjs
11744
11862
  function FromTuple3(types) {
11745
11863
  const result = types.map((_, index) => Literal(index));
11746
- return EvaluateUnion(result);
11864
+ return EvaluateUnionFast(result);
11747
11865
  }
11748
11866
 
11749
11867
  // node_modules/typebox/build/type/engine/keyof/instantiate.mjs
@@ -12674,7 +12792,7 @@ function IsMaxItems(schema2) {
12674
12792
  return exports_guard.HasPropertyKey(schema2, "maxItems") && exports_guard.IsNumber(schema2.maxItems);
12675
12793
  }
12676
12794
  // node_modules/typebox/build/schema/types/maxLength.mjs
12677
- function IsMaxLength(schema2) {
12795
+ function IsMaxLength4(schema2) {
12678
12796
  return exports_guard.HasPropertyKey(schema2, "maxLength") && exports_guard.IsNumber(schema2.maxLength);
12679
12797
  }
12680
12798
  // node_modules/typebox/build/schema/types/maxProperties.mjs
@@ -12694,7 +12812,7 @@ function IsMinItems(schema2) {
12694
12812
  return exports_guard.HasPropertyKey(schema2, "minItems") && exports_guard.IsNumber(schema2.minItems);
12695
12813
  }
12696
12814
  // node_modules/typebox/build/schema/types/minLength.mjs
12697
- function IsMinLength(schema2) {
12815
+ function IsMinLength4(schema2) {
12698
12816
  return exports_guard.HasPropertyKey(schema2, "minLength") && exports_guard.IsNumber(schema2.minLength);
12699
12817
  }
12700
12818
  // node_modules/typebox/build/schema/types/minProperties.mjs
@@ -13818,10 +13936,10 @@ function ErrorMaxItems(stack, context, schemaPath, instancePath, schema4, value)
13818
13936
 
13819
13937
  // node_modules/typebox/build/schema/engine/maxLength.mjs
13820
13938
  function BuildMaxLength(stack, context, schema4, value) {
13821
- return exports_emit.IsLessEqualThan(exports_emit.StringGraphemeCount(value), exports_emit.Constant(schema4.maxLength));
13939
+ return exports_emit.IsMaxLength(value, exports_emit.Constant(schema4.maxLength));
13822
13940
  }
13823
13941
  function CheckMaxLength(stack, context, schema4, value) {
13824
- return exports_guard.IsLessEqualThan(exports_guard.StringGraphemeCount(value), schema4.maxLength);
13942
+ return exports_guard.IsMaxLength(value, schema4.maxLength);
13825
13943
  }
13826
13944
  function ErrorMaxLength(stack, context, schemaPath, instancePath, schema4, value) {
13827
13945
  return CheckMaxLength(stack, context, schema4, value) || context.AddError({
@@ -13908,10 +14026,10 @@ function ErrorMinItems(stack, context, schemaPath, instancePath, schema4, value)
13908
14026
 
13909
14027
  // node_modules/typebox/build/schema/engine/minLength.mjs
13910
14028
  function BuildMinLength(stack, context, schema4, value) {
13911
- return exports_emit.IsGreaterEqualThan(exports_emit.StringGraphemeCount(value), exports_emit.Constant(schema4.minLength));
14029
+ return exports_emit.IsMinLength(value, exports_emit.Constant(schema4.minLength));
13912
14030
  }
13913
14031
  function CheckMinLength(stack, context, schema4, value) {
13914
- return exports_guard.IsGreaterEqualThan(exports_guard.StringGraphemeCount(value), schema4.minLength);
14032
+ return exports_guard.IsMinLength(value, schema4.minLength);
13915
14033
  }
13916
14034
  function ErrorMinLength(stack, context, schemaPath, instancePath, schema4, value) {
13917
14035
  return CheckMinLength(stack, context, schema4, value) || context.AddError({
@@ -14403,7 +14521,7 @@ function HasStringType(schema4) {
14403
14521
  return HasTypeName(schema4, "string");
14404
14522
  }
14405
14523
  function HasStringKeywords(schema4) {
14406
- return IsSchemaObject(schema4) && (IsMinLength(schema4) || IsMaxLength(schema4) || IsFormat(schema4) || IsPattern(schema4));
14524
+ return IsSchemaObject(schema4) && (IsMinLength4(schema4) || IsMaxLength4(schema4) || IsFormat(schema4) || IsPattern(schema4));
14407
14525
  }
14408
14526
  function HasNumberType(schema4) {
14409
14527
  return HasTypeName(schema4, "number") || HasTypeName(schema4, "bigint");
@@ -14472,9 +14590,9 @@ function BuildSchema(stack, context, schema4, value) {
14472
14590
  const constraints = [];
14473
14591
  if (IsFormat(schema4))
14474
14592
  constraints.push(BuildFormat(stack, context, schema4, value));
14475
- if (IsMaxLength(schema4))
14593
+ if (IsMaxLength4(schema4))
14476
14594
  constraints.push(BuildMaxLength(stack, context, schema4, value));
14477
- if (IsMinLength(schema4))
14595
+ if (IsMinLength4(schema4))
14478
14596
  constraints.push(BuildMinLength(stack, context, schema4, value));
14479
14597
  if (IsPattern(schema4))
14480
14598
  constraints.push(BuildPattern(stack, context, schema4, value));
@@ -14530,13 +14648,13 @@ function BuildSchema(stack, context, schema4, value) {
14530
14648
  }
14531
14649
  function CheckSchema(stack, context, schema4, value) {
14532
14650
  stack.Push(schema4);
14533
- const result = IsBooleanSchema(schema4) ? CheckBooleanSchema(stack, context, schema4, value) : (!IsType(schema4) || CheckType(stack, context, schema4, value)) && (!(exports_guard.IsObject(value) && !exports_guard.IsArray(value)) || (!IsRequired(schema4) || CheckRequired(stack, context, schema4, value)) && (!IsAdditionalProperties(schema4) || CheckAdditionalProperties(stack, context, schema4, value)) && (!IsDependencies(schema4) || CheckDependencies(stack, context, schema4, value)) && (!IsDependentRequired(schema4) || CheckDependentRequired(stack, context, schema4, value)) && (!IsDependentSchemas(schema4) || CheckDependentSchemas(stack, context, schema4, value)) && (!IsPatternProperties(schema4) || CheckPatternProperties(stack, context, schema4, value)) && (!IsProperties(schema4) || CheckProperties(stack, context, schema4, value)) && (!IsPropertyNames(schema4) || CheckPropertyNames(stack, context, schema4, value)) && (!IsMinProperties(schema4) || CheckMinProperties(stack, context, schema4, value)) && (!IsMaxProperties(schema4) || CheckMaxProperties(stack, context, schema4, value))) && (!exports_guard.IsArray(value) || (!IsAdditionalItems(schema4) || CheckAdditionalItems(stack, context, schema4, value)) && (!IsContains(schema4) || CheckContains(stack, context, schema4, value)) && (!IsItems(schema4) || CheckItems(stack, context, schema4, value)) && (!IsMaxContains(schema4) || CheckMaxContains(stack, context, schema4, value)) && (!IsMaxItems(schema4) || CheckMaxItems(stack, context, schema4, value)) && (!IsMinContains(schema4) || CheckMinContains(stack, context, schema4, value)) && (!IsMinItems(schema4) || CheckMinItems(stack, context, schema4, value)) && (!IsPrefixItems(schema4) || CheckPrefixItems(stack, context, schema4, value)) && (!IsUniqueItems(schema4) || CheckUniqueItems(stack, context, schema4, value))) && (!exports_guard.IsString(value) || (!IsFormat(schema4) || CheckFormat(stack, context, schema4, value)) && (!IsMaxLength(schema4) || CheckMaxLength(stack, context, schema4, value)) && (!IsMinLength(schema4) || CheckMinLength(stack, context, schema4, value)) && (!IsPattern(schema4) || CheckPattern(stack, context, schema4, value))) && (!(exports_guard.IsNumber(value) || exports_guard.IsBigInt(value)) || (!IsExclusiveMaximum(schema4) || CheckExclusiveMaximum(stack, context, schema4, value)) && (!IsExclusiveMinimum(schema4) || CheckExclusiveMinimum(stack, context, schema4, value)) && (!IsMaximum(schema4) || CheckMaximum(stack, context, schema4, value)) && (!IsMinimum(schema4) || CheckMinimum(stack, context, schema4, value)) && (!IsMultipleOf2(schema4) || CheckMultipleOf(stack, context, schema4, value))) && (!IsRecursiveRef(schema4) || CheckRecursiveRef(stack, context, schema4, value)) && (!IsRef2(schema4) || CheckRef(stack, context, schema4, value)) && (!IsGuard2(schema4) || CheckGuard(stack, context, schema4, value)) && (!IsConst(schema4) || CheckConst(stack, context, schema4, value)) && (!IsEnum2(schema4) || CheckEnum(stack, context, schema4, value)) && (!IsIf(schema4) || CheckIf(stack, context, schema4, value)) && (!IsNot(schema4) || CheckNot(stack, context, schema4, value)) && (!IsAllOf(schema4) || CheckAllOf(stack, context, schema4, value)) && (!IsAnyOf(schema4) || CheckAnyOf(stack, context, schema4, value)) && (!IsOneOf(schema4) || CheckOneOf(stack, context, schema4, value)) && (!IsUnevaluatedItems(schema4) || (!exports_guard.IsArray(value) || CheckUnevaluatedItems(stack, context, schema4, value))) && (!IsUnevaluatedProperties(schema4) || (!exports_guard.IsObject(value) || CheckUnevaluatedProperties(stack, context, schema4, value))) && (!IsRefine2(schema4) || CheckRefine(stack, context, schema4, value));
14651
+ const result = IsBooleanSchema(schema4) ? CheckBooleanSchema(stack, context, schema4, value) : (!IsType(schema4) || CheckType(stack, context, schema4, value)) && (!(exports_guard.IsObject(value) && !exports_guard.IsArray(value)) || (!IsRequired(schema4) || CheckRequired(stack, context, schema4, value)) && (!IsAdditionalProperties(schema4) || CheckAdditionalProperties(stack, context, schema4, value)) && (!IsDependencies(schema4) || CheckDependencies(stack, context, schema4, value)) && (!IsDependentRequired(schema4) || CheckDependentRequired(stack, context, schema4, value)) && (!IsDependentSchemas(schema4) || CheckDependentSchemas(stack, context, schema4, value)) && (!IsPatternProperties(schema4) || CheckPatternProperties(stack, context, schema4, value)) && (!IsProperties(schema4) || CheckProperties(stack, context, schema4, value)) && (!IsPropertyNames(schema4) || CheckPropertyNames(stack, context, schema4, value)) && (!IsMinProperties(schema4) || CheckMinProperties(stack, context, schema4, value)) && (!IsMaxProperties(schema4) || CheckMaxProperties(stack, context, schema4, value))) && (!exports_guard.IsArray(value) || (!IsAdditionalItems(schema4) || CheckAdditionalItems(stack, context, schema4, value)) && (!IsContains(schema4) || CheckContains(stack, context, schema4, value)) && (!IsItems(schema4) || CheckItems(stack, context, schema4, value)) && (!IsMaxContains(schema4) || CheckMaxContains(stack, context, schema4, value)) && (!IsMaxItems(schema4) || CheckMaxItems(stack, context, schema4, value)) && (!IsMinContains(schema4) || CheckMinContains(stack, context, schema4, value)) && (!IsMinItems(schema4) || CheckMinItems(stack, context, schema4, value)) && (!IsPrefixItems(schema4) || CheckPrefixItems(stack, context, schema4, value)) && (!IsUniqueItems(schema4) || CheckUniqueItems(stack, context, schema4, value))) && (!exports_guard.IsString(value) || (!IsFormat(schema4) || CheckFormat(stack, context, schema4, value)) && (!IsMaxLength4(schema4) || CheckMaxLength(stack, context, schema4, value)) && (!IsMinLength4(schema4) || CheckMinLength(stack, context, schema4, value)) && (!IsPattern(schema4) || CheckPattern(stack, context, schema4, value))) && (!(exports_guard.IsNumber(value) || exports_guard.IsBigInt(value)) || (!IsExclusiveMaximum(schema4) || CheckExclusiveMaximum(stack, context, schema4, value)) && (!IsExclusiveMinimum(schema4) || CheckExclusiveMinimum(stack, context, schema4, value)) && (!IsMaximum(schema4) || CheckMaximum(stack, context, schema4, value)) && (!IsMinimum(schema4) || CheckMinimum(stack, context, schema4, value)) && (!IsMultipleOf2(schema4) || CheckMultipleOf(stack, context, schema4, value))) && (!IsRecursiveRef(schema4) || CheckRecursiveRef(stack, context, schema4, value)) && (!IsRef2(schema4) || CheckRef(stack, context, schema4, value)) && (!IsGuard2(schema4) || CheckGuard(stack, context, schema4, value)) && (!IsConst(schema4) || CheckConst(stack, context, schema4, value)) && (!IsEnum2(schema4) || CheckEnum(stack, context, schema4, value)) && (!IsIf(schema4) || CheckIf(stack, context, schema4, value)) && (!IsNot(schema4) || CheckNot(stack, context, schema4, value)) && (!IsAllOf(schema4) || CheckAllOf(stack, context, schema4, value)) && (!IsAnyOf(schema4) || CheckAnyOf(stack, context, schema4, value)) && (!IsOneOf(schema4) || CheckOneOf(stack, context, schema4, value)) && (!IsUnevaluatedItems(schema4) || (!exports_guard.IsArray(value) || CheckUnevaluatedItems(stack, context, schema4, value))) && (!IsUnevaluatedProperties(schema4) || (!exports_guard.IsObject(value) || CheckUnevaluatedProperties(stack, context, schema4, value))) && (!IsRefine2(schema4) || CheckRefine(stack, context, schema4, value));
14534
14652
  stack.Pop(schema4);
14535
14653
  return result;
14536
14654
  }
14537
14655
  function ErrorSchema(stack, context, schemaPath, instancePath, schema4, value) {
14538
14656
  stack.Push(schema4);
14539
- const result = IsBooleanSchema(schema4) ? ErrorBooleanSchema(stack, context, schemaPath, instancePath, schema4, value) : !!(+(!IsType(schema4) || ErrorType(stack, context, schemaPath, instancePath, schema4, value)) & +(!(exports_guard.IsObject(value) && !exports_guard.IsArray(value)) || !!(+(!IsRequired(schema4) || ErrorRequired(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsAdditionalProperties(schema4) || ErrorAdditionalProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsDependencies(schema4) || ErrorDependencies(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsDependentRequired(schema4) || ErrorDependentRequired(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsDependentSchemas(schema4) || ErrorDependentSchemas(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPatternProperties(schema4) || ErrorPatternProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsProperties(schema4) || ErrorProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPropertyNames(schema4) || ErrorPropertyNames(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinProperties(schema4) || ErrorMinProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxProperties(schema4) || ErrorMaxProperties(stack, context, schemaPath, instancePath, schema4, value)))) & +(!exports_guard.IsArray(value) || !!(+(!IsAdditionalItems(schema4) || ErrorAdditionalItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsContains(schema4) || ErrorContains(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsItems(schema4) || ErrorItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxContains(schema4) || ErrorMaxContains(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxItems(schema4) || ErrorMaxItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinContains(schema4) || ErrorMinContains(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinItems(schema4) || ErrorMinItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPrefixItems(schema4) || ErrorPrefixItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsUniqueItems(schema4) || ErrorUniqueItems(stack, context, schemaPath, instancePath, schema4, value)))) & +(!exports_guard.IsString(value) || !!(+(!IsFormat(schema4) || ErrorFormat(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxLength(schema4) || ErrorMaxLength(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinLength(schema4) || ErrorMinLength(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPattern(schema4) || ErrorPattern(stack, context, schemaPath, instancePath, schema4, value)))) & +(!(exports_guard.IsNumber(value) || exports_guard.IsBigInt(value)) || !!(+(!IsExclusiveMaximum(schema4) || ErrorExclusiveMaximum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsExclusiveMinimum(schema4) || ErrorExclusiveMinimum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaximum(schema4) || ErrorMaximum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinimum(schema4) || ErrorMinimum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMultipleOf2(schema4) || ErrorMultipleOf(stack, context, schemaPath, instancePath, schema4, value)))) & +(!IsRecursiveRef(schema4) || ErrorRecursiveRef(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsRef2(schema4) || ErrorRef(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsGuard2(schema4) || ErrorGuard(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsConst(schema4) || ErrorConst(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsEnum2(schema4) || ErrorEnum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsIf(schema4) || ErrorIf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsNot(schema4) || ErrorNot(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsAllOf(schema4) || ErrorAllOf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsAnyOf(schema4) || ErrorAnyOf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsOneOf(schema4) || ErrorOneOf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsUnevaluatedItems(schema4) || (!exports_guard.IsArray(value) || ErrorUnevaluatedItems(stack, context, schemaPath, instancePath, schema4, value))) & +(!IsUnevaluatedProperties(schema4) || (!exports_guard.IsObject(value) || ErrorUnevaluatedProperties(stack, context, schemaPath, instancePath, schema4, value)))) && (!IsRefine2(schema4) || ErrorRefine(stack, context, schemaPath, instancePath, schema4, value));
14657
+ const result = IsBooleanSchema(schema4) ? ErrorBooleanSchema(stack, context, schemaPath, instancePath, schema4, value) : !!(+(!IsType(schema4) || ErrorType(stack, context, schemaPath, instancePath, schema4, value)) & +(!(exports_guard.IsObject(value) && !exports_guard.IsArray(value)) || !!(+(!IsRequired(schema4) || ErrorRequired(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsAdditionalProperties(schema4) || ErrorAdditionalProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsDependencies(schema4) || ErrorDependencies(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsDependentRequired(schema4) || ErrorDependentRequired(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsDependentSchemas(schema4) || ErrorDependentSchemas(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPatternProperties(schema4) || ErrorPatternProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsProperties(schema4) || ErrorProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPropertyNames(schema4) || ErrorPropertyNames(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinProperties(schema4) || ErrorMinProperties(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxProperties(schema4) || ErrorMaxProperties(stack, context, schemaPath, instancePath, schema4, value)))) & +(!exports_guard.IsArray(value) || !!(+(!IsAdditionalItems(schema4) || ErrorAdditionalItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsContains(schema4) || ErrorContains(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsItems(schema4) || ErrorItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxContains(schema4) || ErrorMaxContains(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxItems(schema4) || ErrorMaxItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinContains(schema4) || ErrorMinContains(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinItems(schema4) || ErrorMinItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPrefixItems(schema4) || ErrorPrefixItems(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsUniqueItems(schema4) || ErrorUniqueItems(stack, context, schemaPath, instancePath, schema4, value)))) & +(!exports_guard.IsString(value) || !!(+(!IsFormat(schema4) || ErrorFormat(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaxLength4(schema4) || ErrorMaxLength(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinLength4(schema4) || ErrorMinLength(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsPattern(schema4) || ErrorPattern(stack, context, schemaPath, instancePath, schema4, value)))) & +(!(exports_guard.IsNumber(value) || exports_guard.IsBigInt(value)) || !!(+(!IsExclusiveMaximum(schema4) || ErrorExclusiveMaximum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsExclusiveMinimum(schema4) || ErrorExclusiveMinimum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMaximum(schema4) || ErrorMaximum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMinimum(schema4) || ErrorMinimum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsMultipleOf2(schema4) || ErrorMultipleOf(stack, context, schemaPath, instancePath, schema4, value)))) & +(!IsRecursiveRef(schema4) || ErrorRecursiveRef(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsRef2(schema4) || ErrorRef(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsGuard2(schema4) || ErrorGuard(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsConst(schema4) || ErrorConst(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsEnum2(schema4) || ErrorEnum(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsIf(schema4) || ErrorIf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsNot(schema4) || ErrorNot(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsAllOf(schema4) || ErrorAllOf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsAnyOf(schema4) || ErrorAnyOf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsOneOf(schema4) || ErrorOneOf(stack, context, schemaPath, instancePath, schema4, value)) & +(!IsUnevaluatedItems(schema4) || (!exports_guard.IsArray(value) || ErrorUnevaluatedItems(stack, context, schemaPath, instancePath, schema4, value))) & +(!IsUnevaluatedProperties(schema4) || (!exports_guard.IsObject(value) || ErrorUnevaluatedProperties(stack, context, schemaPath, instancePath, schema4, value)))) && (!IsRefine2(schema4) || ErrorRefine(stack, context, schemaPath, instancePath, schema4, value));
14540
14658
  stack.Pop(schema4);
14541
14659
  return result;
14542
14660
  }
@@ -15974,7 +16092,7 @@ function FromString9(context, type3) {
15974
16092
  const needsDefault = (IsPattern(type3) || IsFormat(type3)) && !IsDefault(type3);
15975
16093
  if (needsDefault)
15976
16094
  throw Error("Strings with format or pattern constraints must specify default");
15977
- const minLength3 = IsMinLength(type3) ? type3.minLength : 0;
16095
+ const minLength3 = IsMinLength4(type3) ? type3.minLength : 0;
15978
16096
  return "".padEnd(minLength3);
15979
16097
  }
15980
16098
 
@@ -16145,6 +16263,10 @@ function Compile(...args) {
16145
16263
  });
16146
16264
  return new Validator(context, type3);
16147
16265
  }
16266
+ // src/utilities/create-rule.ts
16267
+ import { ESLintUtils } from "@typescript-eslint/utils";
16268
+ var createRule = ESLintUtils.RuleCreator((name) => `https://github.com/howmanysmall/eslint-cease-nonsense-rules/blob/main/docs/rules/${name}.md`);
16269
+
16148
16270
  // src/rules/ban-instances.ts
16149
16271
  var isArrayConfig = Compile(build_default.Array(build_default.String()));
16150
16272
  var isObjectConfig = Compile(build_default.Record(build_default.String(), build_default.String()));
@@ -16170,11 +16292,7 @@ function normalizeConfig(options3) {
16170
16292
  }
16171
16293
  return { bannedClasses };
16172
16294
  }
16173
- var docs = {
16174
- description: "Ban specified Roblox Instance classes in new Instance() calls and JSX elements.",
16175
- recommended: false
16176
- };
16177
- var banInstances = {
16295
+ var ban_instances_default = createRule({
16178
16296
  create(context) {
16179
16297
  const config = normalizeConfig(context.options[0]);
16180
16298
  if (config.bannedClasses.size === 0)
@@ -16228,7 +16346,9 @@ var banInstances = {
16228
16346
  },
16229
16347
  defaultOptions: [{ bannedInstances: [] }],
16230
16348
  meta: {
16231
- docs,
16349
+ docs: {
16350
+ description: "Ban specified Roblox Instance classes in new Instance() calls and JSX elements."
16351
+ },
16232
16352
  messages: {
16233
16353
  bannedInstance: "Instance class '{{className}}' is banned.",
16234
16354
  bannedInstanceCustom: "{{customMessage}}"
@@ -16256,14 +16376,14 @@ var banInstances = {
16256
16376
  }
16257
16377
  ],
16258
16378
  type: "problem"
16259
- }
16260
- };
16261
- var ban_instances_default = banInstances;
16379
+ },
16380
+ name: "ban-instances"
16381
+ });
16262
16382
 
16263
16383
  // src/rules/ban-react-fc.ts
16264
16384
  import { TSESTree as TSESTree2 } from "@typescript-eslint/types";
16265
16385
  var BANNED_FC_NAMES = new Set(["FC", "FunctionComponent", "VFC", "VoidFunctionComponent"]);
16266
- var banReactFC = {
16386
+ var ban_react_fc_default = createRule({
16267
16387
  create(context) {
16268
16388
  return {
16269
16389
  VariableDeclarator(node) {
@@ -16292,21 +16412,20 @@ var banReactFC = {
16292
16412
  defaultOptions: [],
16293
16413
  meta: {
16294
16414
  docs: {
16295
- description: "Ban React.FC and similar component type annotations. Use explicit function declarations instead.",
16296
- recommended: true
16415
+ description: "Ban React.FC and similar component type annotations. Use explicit function declarations instead."
16297
16416
  },
16298
16417
  messages: {
16299
16418
  banReactFC: "Avoid React.FC/FunctionComponent/VFC/VoidFunctionComponent types. They break debug information and profiling. Use explicit function declarations instead: `function Component(props: Props) { ... }`"
16300
16419
  },
16301
16420
  schema: [],
16302
16421
  type: "problem"
16303
- }
16304
- };
16305
- var ban_react_fc_default = banReactFC;
16422
+ },
16423
+ name: "ban-react-fc"
16424
+ });
16306
16425
 
16307
16426
  // src/rules/enforce-ianitor-check-type.ts
16308
16427
  import { TSESTree as TSESTree3 } from "@typescript-eslint/types";
16309
- import { ESLintUtils } from "@typescript-eslint/utils";
16428
+ import { ESLintUtils as ESLintUtils2 } from "@typescript-eslint/utils";
16310
16429
  var DEFAULT_CONFIGURATION = {
16311
16430
  baseThreshold: 10,
16312
16431
  errorThreshold: 25,
@@ -16383,8 +16502,8 @@ function calculateIanitorComplexity(node) {
16383
16502
  return 1;
16384
16503
  }
16385
16504
  }
16386
- var createRule = ESLintUtils.RuleCreator((name) => `https://github.com/howmanysmall/eslint-cease-nonsense-rules/blob/main/docs/rules/${name}.md`);
16387
- var enforceIanitorCheckType = createRule({
16505
+ var createRule2 = ESLintUtils2.RuleCreator((name) => `https://github.com/howmanysmall/eslint-cease-nonsense-rules/blob/main/docs/rules/${name}.md`);
16506
+ var enforceIanitorCheckType = createRule2({
16388
16507
  create(context) {
16389
16508
  const [rawOptions] = context.options;
16390
16509
  const config = { ...DEFAULT_CONFIGURATION, ...rawOptions };
@@ -17560,7 +17679,7 @@ function reportViolation(context, violation) {
17560
17679
  node: violation.node
17561
17680
  });
17562
17681
  }
17563
- var noAsyncConstructor = {
17682
+ var no_async_constructor_default = createRule({
17564
17683
  create(context) {
17565
17684
  return {
17566
17685
  "MethodDefinition[kind='constructor']"(node) {
@@ -17583,8 +17702,7 @@ var noAsyncConstructor = {
17583
17702
  defaultOptions: [],
17584
17703
  meta: {
17585
17704
  docs: {
17586
- description: "Disallow asynchronous operations inside class constructors. Constructors return immediately, " + "so async work causes race conditions, unhandled rejections, and incomplete object states.",
17587
- recommended: true
17705
+ description: "Disallow asynchronous operations inside class constructors. Constructors return immediately, " + "so async work causes race conditions, unhandled rejections, and incomplete object states."
17588
17706
  },
17589
17707
  messages: {
17590
17708
  asyncIifeInConstructor: "Refactor this asynchronous operation outside of the constructor. " + "Async IIFEs create unhandled promises and incomplete object state.",
@@ -17595,9 +17713,9 @@ var noAsyncConstructor = {
17595
17713
  },
17596
17714
  schema: [],
17597
17715
  type: "problem"
17598
- }
17599
- };
17600
- var no_async_constructor_default = noAsyncConstructor;
17716
+ },
17717
+ name: "no-async-constructor"
17718
+ });
17601
17719
 
17602
17720
  // src/rules/no-color3-constructor.ts
17603
17721
  import { TSESTree as TSESTree4 } from "@typescript-eslint/types";
@@ -17622,7 +17740,7 @@ function collectNumericComponents(parameters3) {
17622
17740
  }
17623
17741
  return { allZero, components };
17624
17742
  }
17625
- var noColor3Constructor = {
17743
+ var no_color3_constructor_default = createRule({
17626
17744
  create(context) {
17627
17745
  return {
17628
17746
  NewExpression(node) {
@@ -17658,10 +17776,10 @@ var noColor3Constructor = {
17658
17776
  }
17659
17777
  };
17660
17778
  },
17779
+ defaultOptions: [],
17661
17780
  meta: {
17662
17781
  docs: {
17663
- description: "Ban new Color3(...) except new Color3() or new Color3(0, 0, 0). Use Color3.fromRGB() instead.",
17664
- recommended: true
17782
+ description: "Ban new Color3(...) except new Color3() or new Color3(0, 0, 0). Use Color3.fromRGB() instead."
17665
17783
  },
17666
17784
  fixable: "code",
17667
17785
  messages: {
@@ -17670,9 +17788,9 @@ var noColor3Constructor = {
17670
17788
  },
17671
17789
  schema: [],
17672
17790
  type: "problem"
17673
- }
17674
- };
17675
- var no_color3_constructor_default = noColor3Constructor;
17791
+ },
17792
+ name: "no-color3-constructor"
17793
+ });
17676
17794
 
17677
17795
  // src/rules/no-commented-code.ts
17678
17796
  import path from "node:path";
@@ -18026,27 +18144,27 @@ var noCommentedCode = {
18026
18144
  if (trimmedValue === "}")
18027
18145
  continue;
18028
18146
  const balanced = injectMissingBraces(trimmedValue);
18029
- if (containsCode(balanced, context.filename)) {
18030
- const firstComment = group.comments.at(0);
18031
- const lastComment = group.comments.at(-1);
18032
- if (!(firstComment && lastComment))
18033
- continue;
18034
- context.report({
18035
- loc: {
18036
- end: lastComment.loc.end,
18037
- start: firstComment.loc.start
18038
- },
18039
- messageId: "commentedCode",
18040
- suggest: [
18041
- {
18042
- desc: "Remove this commented out code",
18043
- fix(fixer) {
18044
- return fixer.removeRange([firstComment.range[0], lastComment.range[1]]);
18045
- }
18147
+ if (!containsCode(balanced, context.filename))
18148
+ return;
18149
+ const firstComment = group.comments.at(0);
18150
+ const lastComment = group.comments.at(-1);
18151
+ if (!(firstComment && lastComment))
18152
+ continue;
18153
+ context.report({
18154
+ loc: {
18155
+ end: lastComment.loc.end,
18156
+ start: firstComment.loc.start
18157
+ },
18158
+ messageId: "commentedCode",
18159
+ suggest: [
18160
+ {
18161
+ desc: "Remove this commented out code",
18162
+ fix(fixer) {
18163
+ return fixer.removeRange([firstComment.range[0], lastComment.range[1]]);
18046
18164
  }
18047
- ]
18048
- });
18049
- }
18165
+ }
18166
+ ]
18167
+ });
18050
18168
  }
18051
18169
  }
18052
18170
  };
@@ -18512,7 +18630,7 @@ function isLikelyBinding(context, callee, patterns2) {
18512
18630
  }
18513
18631
  return object3.type === AST_NODE_TYPES2.CallExpression && isJoinBindingsCall(object3);
18514
18632
  }
18515
- var noIdentityMap = {
18633
+ var no_identity_map_default = createRule({
18516
18634
  create(context) {
18517
18635
  const [{ bindingPatterns = DEFAULT_BINDING_PATTERNS } = {}] = context.options;
18518
18636
  return {
@@ -18570,9 +18688,9 @@ var noIdentityMap = {
18570
18688
  }
18571
18689
  ],
18572
18690
  type: "suggestion"
18573
- }
18574
- };
18575
- var no_identity_map_default = noIdentityMap;
18691
+ },
18692
+ name: "no-identity-map"
18693
+ });
18576
18694
 
18577
18695
  // src/rules/no-instance-methods-without-this.ts
18578
18696
  import { AST_NODE_TYPES as AST_NODE_TYPES3 } from "@typescript-eslint/types";
@@ -18642,7 +18760,7 @@ function methodUsesThis(node) {
18642
18760
  return false;
18643
18761
  return traverseForThis(value, new WeakSet);
18644
18762
  }
18645
- var noInstanceMethodsWithoutThis = {
18763
+ var no_instance_methods_without_this_default = createRule({
18646
18764
  create(context) {
18647
18765
  const [rawOptions] = context.options;
18648
18766
  const options3 = normalizeOptions(rawOptions);
@@ -18664,8 +18782,7 @@ var noInstanceMethodsWithoutThis = {
18664
18782
  defaultOptions: [DEFAULT_OPTIONS],
18665
18783
  meta: {
18666
18784
  docs: {
18667
- description: "Detect instance methods that do not use 'this' and suggest converting them to standalone functions for better performance in roblox-ts.",
18668
- recommended: true
18785
+ description: "Detect instance methods that do not use 'this' and suggest converting them to standalone functions for better performance in roblox-ts."
18669
18786
  },
18670
18787
  messages: {
18671
18788
  noInstanceMethodWithoutThis: "Method '{{methodName}}' does not use 'this' and creates unnecessary metatable overhead in roblox-ts. Convert it to a standalone function for better performance."
@@ -18694,12 +18811,12 @@ var noInstanceMethodsWithoutThis = {
18694
18811
  }
18695
18812
  ],
18696
18813
  type: "problem"
18697
- }
18698
- };
18699
- var no_instance_methods_without_this_default = noInstanceMethodsWithoutThis;
18814
+ },
18815
+ name: "no-instance-methods-without-this"
18816
+ });
18700
18817
 
18701
18818
  // src/rules/no-print.ts
18702
- var noPrint = {
18819
+ var no_print_default = createRule({
18703
18820
  create(context) {
18704
18821
  return {
18705
18822
  'CallExpression[callee.type="Identifier"][callee.name="print"]'(node) {
@@ -18710,19 +18827,19 @@ var noPrint = {
18710
18827
  }
18711
18828
  };
18712
18829
  },
18830
+ defaultOptions: [],
18713
18831
  meta: {
18714
18832
  docs: {
18715
- description: "Ban print() function calls. Use Log instead.",
18716
- recommended: false
18833
+ description: "Ban print() function calls. Use Log instead."
18717
18834
  },
18718
18835
  messages: {
18719
18836
  useLog: "Use Log instead of print()"
18720
18837
  },
18721
18838
  schema: [],
18722
18839
  type: "problem"
18723
- }
18724
- };
18725
- var no_print_default = noPrint;
18840
+ },
18841
+ name: "no-print"
18842
+ });
18726
18843
 
18727
18844
  // src/rules/no-shorthand-names.ts
18728
18845
  import { TSESTree as TSESTree6 } from "@typescript-eslint/types";
@@ -19311,11 +19428,11 @@ function isStaticExpression(context, expression, seen, options3) {
19311
19428
  case AST_NODE_TYPES4.ChainExpression:
19312
19429
  return isStaticExpression(context, unwrapped.expression, seen, options3);
19313
19430
  case AST_NODE_TYPES4.CallExpression:
19314
- return context !== undefined && isStaticCallCallee(context, unwrapped.callee, seen, options3) && unwrapped.arguments.every((arg) => arg.type !== AST_NODE_TYPES4.SpreadElement && isStaticExpression(context, arg, seen, options3));
19431
+ return context !== undefined && isStaticCallCallee(context, unwrapped.callee, seen, options3) && unwrapped.arguments.every((argument) => argument.type !== AST_NODE_TYPES4.SpreadElement && isStaticExpression(context, argument, seen, options3));
19315
19432
  case AST_NODE_TYPES4.NewExpression:
19316
- return context !== undefined && isStaticCallCallee(context, unwrapped.callee, seen, options3) && (unwrapped.arguments ?? []).every((arg) => arg.type !== AST_NODE_TYPES4.SpreadElement && isStaticExpression(context, arg, seen, options3));
19433
+ return context !== undefined && isStaticCallCallee(context, unwrapped.callee, seen, options3) && (unwrapped.arguments ?? []).every((argument) => argument.type !== AST_NODE_TYPES4.SpreadElement && isStaticExpression(context, argument, seen, options3));
19317
19434
  case AST_NODE_TYPES4.SequenceExpression:
19318
- return unwrapped.expressions.length > 0 && unwrapped.expressions.every((expr) => isStaticExpression(context, expr, seen, options3));
19435
+ return unwrapped.expressions.length > 0 && unwrapped.expressions.every((expression2) => isStaticExpression(context, expression2, seen, options3));
19319
19436
  case AST_NODE_TYPES4.AssignmentExpression:
19320
19437
  return isStaticExpression(context, unwrapped.right, seen, options3);
19321
19438
  default:
@@ -19354,7 +19471,7 @@ function isSpringHookCall(node, options3) {
19354
19471
  }
19355
19472
  return false;
19356
19473
  }
19357
- var noUselessUseSpring = {
19474
+ var no_useless_use_spring_default = createRule({
19358
19475
  create(context) {
19359
19476
  const [rawOptions] = context.options;
19360
19477
  const normalized = {
@@ -19422,12 +19539,12 @@ var noUselessUseSpring = {
19422
19539
  }
19423
19540
  ],
19424
19541
  type: "suggestion"
19425
- }
19426
- };
19427
- var no_useless_use_spring_default = noUselessUseSpring;
19542
+ },
19543
+ name: "no-useless-use-spring"
19544
+ });
19428
19545
 
19429
19546
  // src/rules/no-warn.ts
19430
- var noWarn = {
19547
+ var no_warn_default = createRule({
19431
19548
  create(context) {
19432
19549
  return {
19433
19550
  'CallExpression[callee.type="Identifier"][callee.name="warn"]'(node) {
@@ -19438,19 +19555,19 @@ var noWarn = {
19438
19555
  }
19439
19556
  };
19440
19557
  },
19558
+ defaultOptions: [],
19441
19559
  meta: {
19442
19560
  docs: {
19443
- description: "Ban warn() function calls. Use Log instead.",
19444
- recommended: false
19561
+ description: "Ban warn() function calls. Use Log instead."
19445
19562
  },
19446
19563
  messages: {
19447
19564
  useLog: "Use Log instead of warn()"
19448
19565
  },
19449
19566
  schema: [],
19450
19567
  type: "problem"
19451
- }
19452
- };
19453
- var no_warn_default = noWarn;
19568
+ },
19569
+ name: "no-warn"
19570
+ });
19454
19571
 
19455
19572
  // src/rules/prefer-class-properties.ts
19456
19573
  import { AST_NODE_TYPES as AST_NODE_TYPES5 } from "@typescript-eslint/utils";
@@ -19496,7 +19613,7 @@ function isStaticMemberExpression(node) {
19496
19613
  function isConstructor(node) {
19497
19614
  return node.type === AST_NODE_TYPES5.MethodDefinition && node.kind === "constructor" && node.key.type === AST_NODE_TYPES5.Identifier && node.key.name === "constructor";
19498
19615
  }
19499
- var preferClassProperties = {
19616
+ var prefer_class_properties_default = createRule({
19500
19617
  create(context) {
19501
19618
  const option = context.options[0] ?? "always";
19502
19619
  if (option === "never") {
@@ -19558,9 +19675,9 @@ var preferClassProperties = {
19558
19675
  },
19559
19676
  schema: [{ enum: ["always", "never"], type: "string" }],
19560
19677
  type: "suggestion"
19561
- }
19562
- };
19563
- var prefer_class_properties_default = preferClassProperties;
19678
+ },
19679
+ name: "prefer-class-properties"
19680
+ });
19564
19681
 
19565
19682
  // src/rules/prefer-early-return.ts
19566
19683
  import { AST_NODE_TYPES as AST_NODE_TYPES6 } from "@typescript-eslint/utils";
@@ -19580,7 +19697,7 @@ function canSimplifyConditionalBody(body, maxStatements) {
19580
19697
  }
19581
19698
  return isOffendingConsequent(statement.consequent, maxStatements);
19582
19699
  }
19583
- var preferEarlyReturn = {
19700
+ var prefer_early_return_default = createRule({
19584
19701
  create(context) {
19585
19702
  const options3 = context.options[0] ?? {};
19586
19703
  const maxStatements = options3.maximumStatements ?? DEFAULT_MAXIMUM_STATEMENTS;
@@ -19617,9 +19734,9 @@ var preferEarlyReturn = {
19617
19734
  }
19618
19735
  ],
19619
19736
  type: "suggestion"
19620
- }
19621
- };
19622
- var prefer_early_return_default = preferEarlyReturn;
19737
+ },
19738
+ name: "prefer-early-return"
19739
+ });
19623
19740
 
19624
19741
  // src/rules/prefer-module-scope-constants.ts
19625
19742
  var import_scope_manager3 = __toESM(require_dist2(), 1);
@@ -19636,7 +19753,7 @@ function isTopScope(scope) {
19636
19753
  }
19637
19754
  return false;
19638
19755
  }
19639
- var preferModuleScopeConstants = {
19756
+ var prefer_module_scope_constants_default = createRule({
19640
19757
  create(context) {
19641
19758
  let inConstDeclaration = false;
19642
19759
  return {
@@ -19678,9 +19795,9 @@ var preferModuleScopeConstants = {
19678
19795
  },
19679
19796
  schema: [],
19680
19797
  type: "suggestion"
19681
- }
19682
- };
19683
- var prefer_module_scope_constants_default = preferModuleScopeConstants;
19798
+ },
19799
+ name: "prefer-module-scope-constants"
19800
+ });
19684
19801
 
19685
19802
  // src/rules/prefer-pascal-case-enums.ts
19686
19803
  import { AST_NODE_TYPES as AST_NODE_TYPES8 } from "@typescript-eslint/utils";
@@ -19729,7 +19846,7 @@ function getIdentifierName(node) {
19729
19846
  return;
19730
19847
  return STARTS_WITH_DIGIT.test(node.value) ? undefined : node.value;
19731
19848
  }
19732
- var preferPascalCaseEnums = {
19849
+ var prefer_pascal_case_enums_default = createRule({
19733
19850
  create(context) {
19734
19851
  function report(node, identifier3) {
19735
19852
  context.report({
@@ -19763,18 +19880,438 @@ var preferPascalCaseEnums = {
19763
19880
  },
19764
19881
  schema: [],
19765
19882
  type: "suggestion"
19883
+ },
19884
+ name: "prefer-pascal-case-enums"
19885
+ });
19886
+
19887
+ // src/utilities/pattern-replacement/pattern-matcher.ts
19888
+ import { AST_NODE_TYPES as AST_NODE_TYPES10 } from "@typescript-eslint/types";
19889
+
19890
+ // src/utilities/pattern-replacement/constant-folder.ts
19891
+ import { AST_NODE_TYPES as AST_NODE_TYPES9 } from "@typescript-eslint/types";
19892
+ function normalizeZero(num) {
19893
+ return Object.is(num, -0) ? 0 : num;
19894
+ }
19895
+ function unwrap(node) {
19896
+ switch (node.type) {
19897
+ case AST_NODE_TYPES9.TSAsExpression:
19898
+ case AST_NODE_TYPES9.TSNonNullExpression:
19899
+ return unwrap(node.expression);
19900
+ default:
19901
+ return node;
19766
19902
  }
19767
- };
19768
- var prefer_pascal_case_enums_default = preferPascalCaseEnums;
19903
+ }
19904
+ function evaluateConstant(node) {
19905
+ const expression = unwrap(node);
19906
+ if (expression.type === AST_NODE_TYPES9.Literal && typeof expression.value === "number") {
19907
+ return normalizeZero(expression.value);
19908
+ }
19909
+ if (expression.type === AST_NODE_TYPES9.UnaryExpression) {
19910
+ const argument = evaluateConstant(expression.argument);
19911
+ if (argument === undefined)
19912
+ return;
19913
+ switch (expression.operator) {
19914
+ case "-":
19915
+ return normalizeZero(-argument);
19916
+ case "+":
19917
+ return normalizeZero(Number(argument));
19918
+ default:
19919
+ return;
19920
+ }
19921
+ }
19922
+ if (expression.type === AST_NODE_TYPES9.BinaryExpression) {
19923
+ if (expression.left.type === AST_NODE_TYPES9.PrivateIdentifier)
19924
+ return;
19925
+ const left = evaluateConstant(expression.left);
19926
+ const right = evaluateConstant(expression.right);
19927
+ if (left === undefined || right === undefined)
19928
+ return;
19929
+ let result;
19930
+ switch (expression.operator) {
19931
+ case "+":
19932
+ result = left + right;
19933
+ break;
19934
+ case "-":
19935
+ result = left - right;
19936
+ break;
19937
+ case "*":
19938
+ result = left * right;
19939
+ break;
19940
+ case "/":
19941
+ result = left / right;
19942
+ break;
19943
+ default:
19944
+ return;
19945
+ }
19946
+ return Number.isFinite(result) ? normalizeZero(result) : undefined;
19947
+ }
19948
+ return;
19949
+ }
19950
+
19951
+ // src/utilities/pattern-replacement/pattern-matcher.ts
19952
+ function buildPatternIndex(patterns2) {
19953
+ const index2 = new Map;
19954
+ for (const pattern4 of patterns2) {
19955
+ const key = pattern4.type === "constructor" ? `constructor:${pattern4.typeName}` : `staticMethod:${pattern4.typeName}:${pattern4.methodName}`;
19956
+ const existing = index2.get(key);
19957
+ if (existing)
19958
+ existing.push(pattern4);
19959
+ else
19960
+ index2.set(key, [pattern4]);
19961
+ }
19962
+ return index2;
19963
+ }
19964
+ function resolveCallee(node) {
19965
+ const callee = unwrap(node.callee);
19966
+ if (node.type === AST_NODE_TYPES10.NewExpression && callee.type === AST_NODE_TYPES10.Identifier) {
19967
+ return { kind: "constructor", typeName: callee.name };
19968
+ }
19969
+ if (node.type === AST_NODE_TYPES10.CallExpression) {
19970
+ const member = callee.type === AST_NODE_TYPES10.ChainExpression ? unwrap(callee.expression) : callee;
19971
+ if (member.type === AST_NODE_TYPES10.MemberExpression && !member.computed) {
19972
+ const object3 = unwrap(member.object);
19973
+ if (object3.type === AST_NODE_TYPES10.Identifier && member.property.type === AST_NODE_TYPES10.Identifier) {
19974
+ return {
19975
+ kind: "staticMethod",
19976
+ methodName: member.property.name,
19977
+ typeName: object3.name
19978
+ };
19979
+ }
19980
+ }
19981
+ }
19982
+ return { kind: "unknown" };
19983
+ }
19984
+ function captureParameter(node, sourceCode) {
19985
+ const expression = unwrap(node);
19986
+ const sourceText = sourceCode.getText(expression);
19987
+ const constValue = evaluateConstant(expression);
19988
+ let expressionKey;
19989
+ let isComplex = false;
19990
+ if (expression.type === AST_NODE_TYPES10.Literal && typeof expression.value === "number") {
19991
+ expressionKey = `literal:${normalizeZero(expression.value)}`;
19992
+ } else if (expression.type === AST_NODE_TYPES10.Identifier) {
19993
+ if (expression.name === "undefined")
19994
+ expressionKey = "undefined";
19995
+ else
19996
+ expressionKey = `id:${expression.name}`;
19997
+ } else if (constValue === undefined) {
19998
+ expressionKey = `complex:${sourceText}`;
19999
+ isComplex = true;
20000
+ } else
20001
+ expressionKey = `const:${constValue}`;
20002
+ if (constValue === undefined)
20003
+ return { expressionKey, isComplex, node: expression, sourceText };
20004
+ return { constValue, expressionKey, isComplex, node: expression, sourceText };
20005
+ }
20006
+ function matchParameters(patterns2, parameters3, sourceCode) {
20007
+ const captures = new Map;
20008
+ const optionalStart = patterns2.findIndex((parsedArg) => parsedArg.kind === "optional");
20009
+ const minimumParameters = optionalStart === -1 ? patterns2.length : optionalStart;
20010
+ if (parameters3.length < minimumParameters || parameters3.length > patterns2.length)
20011
+ return;
20012
+ for (let index2 = 0;index2 < patterns2.length; index2 += 1) {
20013
+ const pattern4 = patterns2[index2];
20014
+ if (pattern4 === undefined)
20015
+ continue;
20016
+ const parameter2 = parameters3[index2];
20017
+ const unwrappedParameter = parameter2 === undefined ? undefined : unwrap(parameter2);
20018
+ const isMissing = parameter2 === undefined || unwrappedParameter?.type === AST_NODE_TYPES10.Identifier && unwrappedParameter.name === "undefined";
20019
+ if (pattern4.kind === "literal") {
20020
+ if (isMissing)
20021
+ return;
20022
+ const captured = captureParameter(parameter2, sourceCode);
20023
+ if (captured.constValue !== pattern4.value)
20024
+ return;
20025
+ } else if (pattern4.kind === "optional") {
20026
+ if (isMissing)
20027
+ continue;
20028
+ const captured = captureParameter(parameter2, sourceCode);
20029
+ if (captured.constValue !== pattern4.value)
20030
+ return;
20031
+ } else if (pattern4.kind === "capture") {
20032
+ if (isMissing)
20033
+ return;
20034
+ const captured = captureParameter(parameter2, sourceCode);
20035
+ const captureName = pattern4.name;
20036
+ const existing = captures.get(captureName);
20037
+ if (existing !== undefined && existing.expressionKey !== captured.expressionKey)
20038
+ return;
20039
+ captures.set(captureName, captured);
20040
+ } else if (pattern4.kind === "wildcard" && isMissing)
20041
+ return;
20042
+ }
20043
+ return captures;
20044
+ }
20045
+ var CONDITION_PATTERN = regex2("^(?<operator>[!<>=]+)\\s*(?<target>.+)$");
20046
+ function parseCondition(condition) {
20047
+ const match = CONDITION_PATTERN.exec(condition);
20048
+ return match ? [match.groups.operator, match.groups.target] : ["==", "0"];
20049
+ }
20050
+ function evaluateConditions(conditions, captures) {
20051
+ for (const [name, condition] of conditions) {
20052
+ const captured = captures.get(name);
20053
+ if (captured?.constValue === undefined)
20054
+ return false;
20055
+ const value = captured.constValue;
20056
+ const [operator, targetStr] = parseCondition(condition);
20057
+ const target2 = Number.parseFloat(targetStr);
20058
+ if (!Number.isFinite(target2))
20059
+ return false;
20060
+ let passes;
20061
+ switch (operator) {
20062
+ case "!=":
20063
+ passes = value !== target2;
20064
+ break;
20065
+ case "==":
20066
+ passes = value === target2;
20067
+ break;
20068
+ case ">":
20069
+ passes = value > target2;
20070
+ break;
20071
+ case "<":
20072
+ passes = value < target2;
20073
+ break;
20074
+ case ">=":
20075
+ passes = value >= target2;
20076
+ break;
20077
+ case "<=":
20078
+ passes = value <= target2;
20079
+ break;
20080
+ default:
20081
+ passes = false;
20082
+ }
20083
+ if (!passes)
20084
+ return false;
20085
+ }
20086
+ return true;
20087
+ }
20088
+ function canSafelySubstitute(captures) {
20089
+ for (const [, captured] of captures)
20090
+ if (captured.isComplex)
20091
+ return false;
20092
+ return true;
20093
+ }
20094
+ // src/utilities/pattern-replacement/pattern-parser.ts
20095
+ var CONSTRUCTOR_PATTERN = regex2("^new\\s+(?<typeName>\\w+)\\((?<argumentsString>.*)\\)$");
20096
+ var STATIC_METHOD_PATTERN = regex2("^(?<typeName>\\w+)\\.(?<methodName>\\w+)\\((?<argumentsString>.*)\\)$");
20097
+ var STATIC_ACCESS_PATTERN = regex2("^(?<typeName>\\w+)\\.(?<property>\\w+)$");
20098
+ var CALL_PATTERN = regex2("^(?<name>\\w+)\\((?<argumentsString>.*)\\)$");
20099
+ function parseParameters(parametersString) {
20100
+ const trimmed = parametersString.trim();
20101
+ if (trimmed === "")
20102
+ return [];
20103
+ const parameters3 = trimmed.split(",").map((parameter2) => parameter2.trim());
20104
+ const result = new Array;
20105
+ let size = 0;
20106
+ for (const parameter2 of parameters3) {
20107
+ if (parameter2 === "_")
20108
+ result[size++] = { kind: "wildcard" };
20109
+ else if (parameter2.startsWith("$"))
20110
+ result[size++] = { kind: "capture", name: parameter2.slice(1) };
20111
+ else if (parameter2.endsWith("?")) {
20112
+ const value = Number.parseFloat(parameter2.slice(0, -1));
20113
+ result[size++] = { kind: "optional", value };
20114
+ } else {
20115
+ const value = Number.parseFloat(parameter2);
20116
+ result[size++] = { kind: "literal", value };
20117
+ }
20118
+ }
20119
+ return result;
20120
+ }
20121
+ function parseReplacement(replacement) {
20122
+ const staticMatch = STATIC_ACCESS_PATTERN.exec(replacement);
20123
+ if (staticMatch && !replacement.includes("("))
20124
+ return { ...staticMatch.groups, kind: "staticAccess" };
20125
+ const callMatch = CALL_PATTERN.exec(replacement);
20126
+ if (callMatch) {
20127
+ const { name, argumentsString } = callMatch.groups;
20128
+ const parameters3 = argumentsString.trim() === "" ? [] : argumentsString.split(",").map((value) => value.trim());
20129
+ return { kind: "call", name, parameters: parameters3 };
20130
+ }
20131
+ return { kind: "identifier", name: replacement };
20132
+ }
20133
+ function parsePattern(match, replacement, when) {
20134
+ const conditions = new Map;
20135
+ if (when)
20136
+ for (const [key, value] of Object.entries(when))
20137
+ conditions.set(key, value);
20138
+ const constructorMatch = CONSTRUCTOR_PATTERN.exec(match);
20139
+ if (constructorMatch) {
20140
+ const { typeName, argumentsString } = constructorMatch.groups;
20141
+ return {
20142
+ conditions,
20143
+ original: match,
20144
+ parameters: parseParameters(argumentsString),
20145
+ replacement: parseReplacement(replacement),
20146
+ type: "constructor",
20147
+ typeName
20148
+ };
20149
+ }
20150
+ const staticMethodMatch = STATIC_METHOD_PATTERN.exec(match);
20151
+ if (staticMethodMatch) {
20152
+ const { typeName, methodName, argumentsString } = staticMethodMatch.groups;
20153
+ return {
20154
+ conditions,
20155
+ methodName,
20156
+ original: match,
20157
+ parameters: parseParameters(argumentsString),
20158
+ replacement: parseReplacement(replacement),
20159
+ type: "staticMethod",
20160
+ typeName
20161
+ };
20162
+ }
20163
+ throw new Error(`Invalid pattern: ${match}`);
20164
+ }
20165
+ // src/utilities/pattern-replacement/pattern-types.ts
20166
+ function pattern4(configuration) {
20167
+ return configuration;
20168
+ }
20169
+ // src/utilities/pattern-replacement/replacement-generator.ts
20170
+ function getReplacementIdentifier(replacement) {
20171
+ switch (replacement.kind) {
20172
+ case "identifier":
20173
+ return replacement.name;
20174
+ case "call":
20175
+ return replacement.name;
20176
+ case "staticAccess":
20177
+ return;
20178
+ }
20179
+ }
20180
+ function generateReplacement(replacement, captures) {
20181
+ const { kind } = replacement;
20182
+ switch (kind) {
20183
+ case "identifier":
20184
+ return replacement.name;
20185
+ case "staticAccess":
20186
+ return `${replacement.typeName}.${replacement.property}`;
20187
+ case "call": {
20188
+ const parameters3 = replacement.parameters.map((argument) => {
20189
+ if (argument.startsWith("$")) {
20190
+ const captureName = argument.slice(1);
20191
+ const captured = captures.get(captureName);
20192
+ if (captured === undefined)
20193
+ throw new Error(`Missing capture: ${captureName}`);
20194
+ return captured.sourceText;
20195
+ }
20196
+ return argument;
20197
+ });
20198
+ return `${replacement.name}(${parameters3.join(", ")})`;
20199
+ }
20200
+ default:
20201
+ throw new Error(`Unknown replacement kind: ${kind}`);
20202
+ }
20203
+ }
20204
+ // src/rules/prefer-pattern-replacements.ts
20205
+ var isRuleOptions2 = Compile(build_default.Object({
20206
+ patterns: build_default.Array(build_default.Object({}, { additionalProperties: true }))
20207
+ }));
20208
+ function parsePatterns(patterns2) {
20209
+ return patterns2.map((pattern5) => parsePattern(pattern5.match, pattern5.replacement, pattern5.when));
20210
+ }
20211
+ var prefer_pattern_replacements_default = createRule({
20212
+ create(context) {
20213
+ const validatedOptions = isRuleOptions2.Check(context.options[0]) ? context.options[0] : undefined;
20214
+ if (!validatedOptions || validatedOptions.patterns.length === 0)
20215
+ return {};
20216
+ const parsedPatterns = parsePatterns(validatedOptions.patterns);
20217
+ const patternIndex = buildPatternIndex(parsedPatterns);
20218
+ const { sourceCode } = context;
20219
+ function hasNameConflict(node, identifierName) {
20220
+ let scope = sourceCode.getScope(node);
20221
+ while (scope) {
20222
+ if (scope.set.has(identifierName))
20223
+ return true;
20224
+ scope = scope.upper ?? undefined;
20225
+ }
20226
+ return false;
20227
+ }
20228
+ function checkNode(node) {
20229
+ const resolved = resolveCallee(node);
20230
+ if (resolved.kind === "unknown")
20231
+ return;
20232
+ const key = resolved.kind === "constructor" ? `constructor:${resolved.typeName}` : `staticMethod:${resolved.typeName}:${resolved.methodName}`;
20233
+ const candidates2 = patternIndex.get(key);
20234
+ if (!candidates2 || candidates2.length === 0)
20235
+ return;
20236
+ const skippedConflicts = [];
20237
+ for (const pattern5 of candidates2) {
20238
+ const captures = matchParameters(pattern5.parameters, node.arguments, sourceCode);
20239
+ if (!(captures && evaluateConditions(pattern5.conditions, captures) && canSafelySubstitute(captures))) {
20240
+ continue;
20241
+ }
20242
+ const replacementId = getReplacementIdentifier(pattern5.replacement);
20243
+ if (replacementId && hasNameConflict(node, replacementId)) {
20244
+ skippedConflicts.push({
20245
+ conflict: replacementId,
20246
+ replacement: generateReplacement(pattern5.replacement, captures)
20247
+ });
20248
+ continue;
20249
+ }
20250
+ const originalText = sourceCode.getText(node);
20251
+ const replacementText = generateReplacement(pattern5.replacement, captures);
20252
+ context.report({
20253
+ data: { original: originalText, replacement: replacementText },
20254
+ fix: (fixer) => fixer.replaceText(node, replacementText),
20255
+ messageId: "preferReplacement",
20256
+ node
20257
+ });
20258
+ for (const { replacement, conflict } of skippedConflicts) {
20259
+ context.report({
20260
+ data: { conflict, replacement },
20261
+ messageId: "skippedDueToConflict",
20262
+ node
20263
+ });
20264
+ }
20265
+ return;
20266
+ }
20267
+ for (const { replacement, conflict } of skippedConflicts) {
20268
+ context.report({
20269
+ data: { conflict, replacement },
20270
+ messageId: "skippedDueToConflict",
20271
+ node
20272
+ });
20273
+ }
20274
+ }
20275
+ return {
20276
+ CallExpression: checkNode,
20277
+ NewExpression: checkNode
20278
+ };
20279
+ },
20280
+ defaultOptions: [{ patterns: [] }],
20281
+ meta: {
20282
+ docs: {
20283
+ description: "Enforce using configured replacements for common constructor/method patterns"
20284
+ },
20285
+ fixable: "code",
20286
+ messages: {
20287
+ preferReplacement: "Prefer '{{replacement}}' over '{{original}}'",
20288
+ skippedDueToConflict: "Pattern '{{replacement}}' was skipped because '{{conflict}}' is already in scope."
20289
+ },
20290
+ schema: [
20291
+ {
20292
+ additionalProperties: false,
20293
+ properties: {
20294
+ patterns: {
20295
+ items: { type: "object" },
20296
+ type: "array"
20297
+ }
20298
+ },
20299
+ type: "object"
20300
+ }
20301
+ ],
20302
+ type: "suggestion"
20303
+ },
20304
+ name: "prefer-pattern-replacements"
20305
+ });
19769
20306
 
19770
20307
  // src/rules/prefer-sequence-overloads.ts
19771
- import { AST_NODE_TYPES as AST_NODE_TYPES9 } from "@typescript-eslint/types";
20308
+ import { AST_NODE_TYPES as AST_NODE_TYPES11 } from "@typescript-eslint/types";
19772
20309
  var sequenceDescriptors = [
19773
20310
  { keypointName: "ColorSequenceKeypoint", sequenceName: "ColorSequence" },
19774
20311
  { keypointName: "NumberSequenceKeypoint", sequenceName: "NumberSequence" }
19775
20312
  ];
19776
20313
  function isSequenceIdentifier(node) {
19777
- if (node.type !== AST_NODE_TYPES9.Identifier)
20314
+ if (node.type !== AST_NODE_TYPES11.Identifier)
19778
20315
  return false;
19779
20316
  for (const { sequenceName } of sequenceDescriptors)
19780
20317
  if (sequenceName === node.name)
@@ -19788,16 +20325,16 @@ function findDescriptor(sequenceName) {
19788
20325
  return;
19789
20326
  }
19790
20327
  var isNumericLiteral = Compile(build_default.Object({
19791
- type: build_default.Literal(AST_NODE_TYPES9.Literal),
20328
+ type: build_default.Literal(AST_NODE_TYPES11.Literal),
19792
20329
  value: build_default.Number()
19793
20330
  }));
19794
20331
  function isExpressionArgument(argument) {
19795
- return argument !== undefined && argument.type !== AST_NODE_TYPES9.SpreadElement;
20332
+ return argument !== undefined && argument.type !== AST_NODE_TYPES11.SpreadElement;
19796
20333
  }
19797
20334
  function extractKeypoint(element, descriptor) {
19798
- if (element === undefined || element.type !== AST_NODE_TYPES9.NewExpression)
20335
+ if (element === undefined || element.type !== AST_NODE_TYPES11.NewExpression)
19799
20336
  return;
19800
- if (element.callee.type !== AST_NODE_TYPES9.Identifier || element.callee.name !== descriptor.keypointName)
20337
+ if (element.callee.type !== AST_NODE_TYPES11.Identifier || element.callee.name !== descriptor.keypointName)
19801
20338
  return;
19802
20339
  if (element.arguments.length !== 2)
19803
20340
  return;
@@ -19811,11 +20348,7 @@ function extractKeypoint(element, descriptor) {
19811
20348
  value: valueArgument
19812
20349
  };
19813
20350
  }
19814
- var docs2 = {
19815
- description: "Prefer the optimized ColorSequence and NumberSequence constructor overloads over passing ColorSequenceKeypoint or NumberSequenceKeypoint arrays when only using endpoints 0 and 1.",
19816
- recommended: true
19817
- };
19818
- var preferSequenceOverloads = {
20351
+ var prefer_sequence_overloads_default = createRule({
19819
20352
  create(context) {
19820
20353
  const { sourceCode } = context;
19821
20354
  return {
@@ -19827,7 +20360,7 @@ var preferSequenceOverloads = {
19827
20360
  if (descriptor === undefined || node.arguments.length !== 1)
19828
20361
  return;
19829
20362
  const [argument] = node.arguments;
19830
- if (argument === undefined || argument.type !== AST_NODE_TYPES9.ArrayExpression || argument.elements.length !== 2)
20363
+ if (argument === undefined || argument.type !== AST_NODE_TYPES11.ArrayExpression || argument.elements.length !== 2)
19831
20364
  return;
19832
20365
  const firstElement = argument.elements[0] ?? undefined;
19833
20366
  const secondElement = argument.elements[1] ?? undefined;
@@ -19861,7 +20394,9 @@ var preferSequenceOverloads = {
19861
20394
  },
19862
20395
  defaultOptions: [],
19863
20396
  meta: {
19864
- docs: docs2,
20397
+ docs: {
20398
+ description: "Prefer using single or two-point overloads for Roblox Sequence methods instead of all three overloads."
20399
+ },
19865
20400
  fixable: "code",
19866
20401
  messages: {
19867
20402
  preferSingleOverload: "Use the single-argument {{sequenceName}} constructor overload instead of redundant keypoints when both endpoints share the same value.",
@@ -19869,9 +20404,9 @@ var preferSequenceOverloads = {
19869
20404
  },
19870
20405
  schema: [],
19871
20406
  type: "problem"
19872
- }
19873
- };
19874
- var prefer_sequence_overloads_default = preferSequenceOverloads;
20407
+ },
20408
+ name: "prefer-sequence-overloads"
20409
+ });
19875
20410
 
19876
20411
  // src/rules/prefer-singular-enums.ts
19877
20412
  var IRREGULAR_PLURALS = new Set([
@@ -19985,7 +20520,7 @@ function isPlural(name) {
19985
20520
  const last = getLastAlphaToken(name);
19986
20521
  return last ? isPluralWord(last.lower, last.original) : false;
19987
20522
  }
19988
- var preferSingularEnums = {
20523
+ var prefer_singular_enums_default = createRule({
19989
20524
  create(context) {
19990
20525
  return {
19991
20526
  TSEnumDeclaration(node) {
@@ -20010,9 +20545,9 @@ var preferSingularEnums = {
20010
20545
  },
20011
20546
  schema: [],
20012
20547
  type: "suggestion"
20013
- }
20014
- };
20015
- var prefer_singular_enums_default = preferSingularEnums;
20548
+ },
20549
+ name: "prefer-singular-enums"
20550
+ });
20016
20551
 
20017
20552
  // src/rules/prefer-udim2-shorthand.ts
20018
20553
  import { TSESTree as TSESTree7 } from "@typescript-eslint/utils";
@@ -20173,16 +20708,16 @@ var preferUDim2Shorthand = {
20173
20708
  var prefer_udim2_shorthand_default = preferUDim2Shorthand;
20174
20709
 
20175
20710
  // src/rules/react-hooks-strict-return.ts
20176
- import { AST_NODE_TYPES as AST_NODE_TYPES10 } from "@typescript-eslint/utils";
20711
+ import { AST_NODE_TYPES as AST_NODE_TYPES12 } from "@typescript-eslint/utils";
20177
20712
  var MAX_RETURN_ELEMENTS = 2;
20178
20713
  var HOOK_PATTERN = /^use[A-Z0-9].*$/;
20179
20714
  function isHookNode(node) {
20180
20715
  let name;
20181
- if (node.type === AST_NODE_TYPES10.VariableDeclarator && node.id.type === AST_NODE_TYPES10.Identifier) {
20716
+ if (node.type === AST_NODE_TYPES12.VariableDeclarator && node.id.type === AST_NODE_TYPES12.Identifier) {
20182
20717
  ({ name } = node.id);
20183
- } else if (node.type === AST_NODE_TYPES10.FunctionDeclaration && node.id)
20718
+ } else if (node.type === AST_NODE_TYPES12.FunctionDeclaration && node.id)
20184
20719
  ({ name } = node.id);
20185
- else if (node.type === AST_NODE_TYPES10.FunctionExpression && node.id)
20720
+ else if (node.type === AST_NODE_TYPES12.FunctionExpression && node.id)
20186
20721
  ({ name } = node.id);
20187
20722
  return name !== undefined && HOOK_PATTERN.test(name);
20188
20723
  }
@@ -20206,27 +20741,27 @@ function getArrayElementsFromVariable(scope, name) {
20206
20741
  if (!identifier3.parent)
20207
20742
  continue;
20208
20743
  const { parent } = identifier3;
20209
- if (parent.type !== AST_NODE_TYPES10.VariableDeclarator)
20744
+ if (parent.type !== AST_NODE_TYPES12.VariableDeclarator)
20210
20745
  continue;
20211
- if (!parent.init || parent.init.type !== AST_NODE_TYPES10.ArrayExpression)
20746
+ if (!parent.init || parent.init.type !== AST_NODE_TYPES12.ArrayExpression)
20212
20747
  continue;
20213
20748
  elements.push(...parent.init.elements);
20214
20749
  }
20215
20750
  return elements;
20216
20751
  }
20217
20752
  function countReturnElements(argument, scope) {
20218
- if (argument.type === AST_NODE_TYPES10.Identifier)
20753
+ if (argument.type === AST_NODE_TYPES12.Identifier)
20219
20754
  return getArrayElementsFromVariable(scope, argument.name).length;
20220
- if (argument.type !== AST_NODE_TYPES10.ArrayExpression)
20755
+ if (argument.type !== AST_NODE_TYPES12.ArrayExpression)
20221
20756
  return 0;
20222
20757
  let count = 0;
20223
20758
  for (const element of argument.elements) {
20224
20759
  if (element === null)
20225
20760
  count += 1;
20226
- else if (element.type === AST_NODE_TYPES10.SpreadElement) {
20227
- if (element.argument.type === AST_NODE_TYPES10.Identifier) {
20761
+ else if (element.type === AST_NODE_TYPES12.SpreadElement) {
20762
+ if (element.argument.type === AST_NODE_TYPES12.Identifier) {
20228
20763
  count += getArrayElementsFromVariable(scope, element.argument.name).length;
20229
- } else if (element.argument.type === AST_NODE_TYPES10.ArrayExpression) {
20764
+ } else if (element.argument.type === AST_NODE_TYPES12.ArrayExpression) {
20230
20765
  count += element.argument.elements.length;
20231
20766
  } else
20232
20767
  count += 1;
@@ -20239,14 +20774,14 @@ function exceedsMaxReturnProperties(node, scope) {
20239
20774
  const { argument } = node;
20240
20775
  if (argument === null)
20241
20776
  return false;
20242
- if (argument.type === AST_NODE_TYPES10.ObjectExpression)
20777
+ if (argument.type === AST_NODE_TYPES12.ObjectExpression)
20243
20778
  return false;
20244
- if (argument.type === AST_NODE_TYPES10.Identifier) {
20779
+ if (argument.type === AST_NODE_TYPES12.Identifier) {
20245
20780
  const variable = getVariableByName(scope, argument.name);
20246
20781
  if (variable) {
20247
20782
  for (const { identifier: identifier3 } of variable.references) {
20248
20783
  const { parent } = identifier3;
20249
- if (parent?.type === AST_NODE_TYPES10.VariableDeclarator && parent.init?.type === AST_NODE_TYPES10.ObjectExpression) {
20784
+ if (parent?.type === AST_NODE_TYPES12.VariableDeclarator && parent.init?.type === AST_NODE_TYPES12.ObjectExpression) {
20250
20785
  return false;
20251
20786
  }
20252
20787
  }
@@ -20254,7 +20789,7 @@ function exceedsMaxReturnProperties(node, scope) {
20254
20789
  }
20255
20790
  return countReturnElements(argument, scope) > MAX_RETURN_ELEMENTS;
20256
20791
  }
20257
- var reactHooksStrictReturn = {
20792
+ var react_hooks_strict_return_default = createRule({
20258
20793
  create(context) {
20259
20794
  let hookDepth = 0;
20260
20795
  function enterHook(node) {
@@ -20268,13 +20803,13 @@ var reactHooksStrictReturn = {
20268
20803
  return {
20269
20804
  ArrowFunctionExpression(node) {
20270
20805
  const { parent } = node;
20271
- if (parent?.type === AST_NODE_TYPES10.VariableDeclarator && parent.id.type === AST_NODE_TYPES10.Identifier && HOOK_PATTERN.test(parent.id.name)) {
20806
+ if (parent?.type === AST_NODE_TYPES12.VariableDeclarator && parent.id.type === AST_NODE_TYPES12.Identifier && HOOK_PATTERN.test(parent.id.name)) {
20272
20807
  hookDepth += 1;
20273
20808
  }
20274
20809
  },
20275
20810
  "ArrowFunctionExpression:exit"(node) {
20276
20811
  const { parent } = node;
20277
- if (parent?.type === AST_NODE_TYPES10.VariableDeclarator && parent.id.type === AST_NODE_TYPES10.Identifier && HOOK_PATTERN.test(parent.id.name)) {
20812
+ if (parent?.type === AST_NODE_TYPES12.VariableDeclarator && parent.id.type === AST_NODE_TYPES12.Identifier && HOOK_PATTERN.test(parent.id.name)) {
20278
20813
  hookDepth -= 1;
20279
20814
  }
20280
20815
  },
@@ -20307,9 +20842,9 @@ var reactHooksStrictReturn = {
20307
20842
  },
20308
20843
  schema: [],
20309
20844
  type: "suggestion"
20310
- }
20311
- };
20312
- var react_hooks_strict_return_default = reactHooksStrictReturn;
20845
+ },
20846
+ name: "react-hooks-strict-return"
20847
+ });
20313
20848
 
20314
20849
  // src/rules/require-named-effect-functions.ts
20315
20850
  import { TSESTree as TSESTree8 } from "@typescript-eslint/types";
@@ -20323,7 +20858,7 @@ var isHookConfiguration = build_default.Object({
20323
20858
  allowAsync: build_default.Boolean(),
20324
20859
  name: build_default.String()
20325
20860
  });
20326
- var isRuleOptions2 = Compile(build_default.Object({
20861
+ var isRuleOptions3 = Compile(build_default.Object({
20327
20862
  environment: isEnvironmentMode,
20328
20863
  hooks: build_default.Array(isHookConfiguration)
20329
20864
  }, { additionalProperties: true }));
@@ -20334,7 +20869,7 @@ function parseOptions2(options3) {
20334
20869
  hooks: DEFAULT_HOOKS
20335
20870
  };
20336
20871
  }
20337
- if (!isRuleOptions2.Check(options3)) {
20872
+ if (!isRuleOptions3.Check(options3)) {
20338
20873
  return {
20339
20874
  environment: "roblox-ts",
20340
20875
  hooks: DEFAULT_HOOKS
@@ -20555,8 +21090,7 @@ var requireNamedEffectFunctions = {
20555
21090
  return;
20556
21091
  }
20557
21092
  if (argumentNode.type === TSESTree8.AST_NODE_TYPES.FunctionExpression) {
20558
- const functionExpressionNode = argumentNode;
20559
- const functionHasId = Boolean(functionExpressionNode.id);
21093
+ const functionHasId = Boolean(argumentNode.id);
20560
21094
  if (functionHasId && argumentNode.async) {
20561
21095
  context.report({
20562
21096
  data: { hook: hookName },
@@ -20644,7 +21178,7 @@ var requireNamedEffectFunctions = {
20644
21178
  var require_named_effect_functions_default = requireNamedEffectFunctions;
20645
21179
 
20646
21180
  // src/rules/require-paired-calls.ts
20647
- import { AST_NODE_TYPES as AST_NODE_TYPES11 } from "@typescript-eslint/types";
21181
+ import { AST_NODE_TYPES as AST_NODE_TYPES13 } from "@typescript-eslint/types";
20648
21182
  var isStringArray = Compile(build_default.Readonly(build_default.Array(build_default.String())));
20649
21183
  var isPairConfiguration = Compile(build_default.Readonly(build_default.Object({
20650
21184
  alternatives: build_default.Optional(isStringArray),
@@ -20655,27 +21189,27 @@ var isPairConfiguration = Compile(build_default.Readonly(build_default.Object({
20655
21189
  requireSync: build_default.Optional(build_default.Boolean()),
20656
21190
  yieldingFunctions: build_default.Optional(isStringArray)
20657
21191
  })));
20658
- var isRuleOptions3 = Compile(build_default.Partial(build_default.Readonly(build_default.Object({
21192
+ var isRuleOptions4 = Compile(build_default.Partial(build_default.Readonly(build_default.Object({
20659
21193
  allowConditionalClosers: build_default.Optional(build_default.Boolean()),
20660
21194
  allowMultipleOpeners: build_default.Optional(build_default.Boolean()),
20661
21195
  maxNestingDepth: build_default.Optional(build_default.Number()),
20662
21196
  pairs: build_default.Readonly(build_default.Array(isPairConfiguration))
20663
21197
  }))));
20664
21198
  var LOOP_NODE_TYPES = new Set([
20665
- AST_NODE_TYPES11.DoWhileStatement,
20666
- AST_NODE_TYPES11.ForInStatement,
20667
- AST_NODE_TYPES11.ForOfStatement,
20668
- AST_NODE_TYPES11.ForStatement,
20669
- AST_NODE_TYPES11.WhileStatement
21199
+ AST_NODE_TYPES13.DoWhileStatement,
21200
+ AST_NODE_TYPES13.ForInStatement,
21201
+ AST_NODE_TYPES13.ForOfStatement,
21202
+ AST_NODE_TYPES13.ForStatement,
21203
+ AST_NODE_TYPES13.WhileStatement
20670
21204
  ]);
20671
21205
  var DEFAULT_ROBLOX_YIELDING_FUNCTIONS = ["task.wait", "wait", "*.WaitForChild", "*.*Async"];
20672
21206
  function getCallName(node) {
20673
21207
  const { callee } = node;
20674
- if (callee.type === AST_NODE_TYPES11.Identifier)
21208
+ if (callee.type === AST_NODE_TYPES13.Identifier)
20675
21209
  return callee.name;
20676
- if (callee.type === AST_NODE_TYPES11.MemberExpression) {
20677
- const object3 = callee.object.type === AST_NODE_TYPES11.Identifier ? callee.object.name : undefined;
20678
- const property = callee.property.type === AST_NODE_TYPES11.Identifier ? callee.property.name : undefined;
21210
+ if (callee.type === AST_NODE_TYPES13.MemberExpression) {
21211
+ const object3 = callee.object.type === AST_NODE_TYPES13.Identifier ? callee.object.name : undefined;
21212
+ const property = callee.property.type === AST_NODE_TYPES13.Identifier ? callee.property.name : undefined;
20679
21213
  if (object3 !== undefined && property !== undefined)
20680
21214
  return `${object3}.${property}`;
20681
21215
  }
@@ -20711,12 +21245,12 @@ function isLoopLikeStatement(node) {
20711
21245
  return LOOP_NODE_TYPES.has(node.type);
20712
21246
  }
20713
21247
  function isSwitchStatement(node) {
20714
- return node?.type === AST_NODE_TYPES11.SwitchStatement;
21248
+ return node?.type === AST_NODE_TYPES13.SwitchStatement;
20715
21249
  }
20716
21250
  function findLabeledStatementBody(label, startingNode) {
20717
21251
  let current = startingNode;
20718
21252
  while (current) {
20719
- if (current.type === AST_NODE_TYPES11.LabeledStatement && current.label.name === label.name)
21253
+ if (current.type === AST_NODE_TYPES13.LabeledStatement && current.label.name === label.name)
20720
21254
  return current.body;
20721
21255
  current = current.parent ?? undefined;
20722
21256
  }
@@ -20765,7 +21299,7 @@ var messages = {
20765
21299
  var rule = {
20766
21300
  create(context) {
20767
21301
  const [rawOptions] = context.options;
20768
- const baseOptions = isRuleOptions3.Check(rawOptions) ? rawOptions : {};
21302
+ const baseOptions = isRuleOptions4.Check(rawOptions) ? rawOptions : {};
20769
21303
  const options3 = {
20770
21304
  allowConditionalClosers: baseOptions.allowConditionalClosers ?? false,
20771
21305
  allowMultipleOpeners: baseOptions.allowMultipleOpeners ?? true,
@@ -20865,12 +21399,12 @@ var rule = {
20865
21399
  if (configuration.platform !== "roblox")
20866
21400
  return false;
20867
21401
  const yieldingFunctions = configuration.yieldingFunctions ?? DEFAULT_ROBLOX_YIELDING_FUNCTIONS;
20868
- return yieldingFunctions.some((pattern4) => {
20869
- if (pattern4.startsWith("*.")) {
20870
- const methodName = pattern4.slice(2);
21402
+ return yieldingFunctions.some((pattern5) => {
21403
+ if (pattern5.startsWith("*.")) {
21404
+ const methodName = pattern5.slice(2);
20871
21405
  return functionName.endsWith(`.${methodName}`);
20872
21406
  }
20873
- return functionName === pattern4;
21407
+ return functionName === pattern5;
20874
21408
  });
20875
21409
  }
20876
21410
  function onFunctionEnter(node) {
@@ -20978,7 +21512,7 @@ var rule = {
20978
21512
  function onIfConsequentExit(node) {
20979
21513
  const consequentNode = node;
20980
21514
  const { parent } = consequentNode;
20981
- if (parent?.type === AST_NODE_TYPES11.IfStatement) {
21515
+ if (parent?.type === AST_NODE_TYPES13.IfStatement) {
20982
21516
  const branches = branchStacks.get(parent) ?? [];
20983
21517
  branches.push(cloneStack());
20984
21518
  branchStacks.set(parent, branches);
@@ -20993,7 +21527,7 @@ var rule = {
20993
21527
  function onIfAlternateExit(node) {
20994
21528
  const alternateNode = node;
20995
21529
  const { parent } = alternateNode;
20996
- if (parent?.type === AST_NODE_TYPES11.IfStatement) {
21530
+ if (parent?.type === AST_NODE_TYPES13.IfStatement) {
20997
21531
  const branches = branchStacks.get(parent) ?? [];
20998
21532
  branches.push(cloneStack());
20999
21533
  branchStacks.set(parent, branches);
@@ -21042,7 +21576,7 @@ var rule = {
21042
21576
  function onTryBlockExit(node) {
21043
21577
  const blockNode = node;
21044
21578
  const { parent } = blockNode;
21045
- if (parent?.type === AST_NODE_TYPES11.TryStatement) {
21579
+ if (parent?.type === AST_NODE_TYPES13.TryStatement) {
21046
21580
  const branches = branchStacks.get(parent) ?? [];
21047
21581
  branches.push(cloneStack());
21048
21582
  branchStacks.set(parent, branches);
@@ -21061,7 +21595,7 @@ var rule = {
21061
21595
  function onCatchClauseExit(node) {
21062
21596
  const catchNode = node;
21063
21597
  const { parent } = catchNode;
21064
- if (parent?.type === AST_NODE_TYPES11.TryStatement) {
21598
+ if (parent?.type === AST_NODE_TYPES13.TryStatement) {
21065
21599
  const branches = branchStacks.get(parent) ?? [];
21066
21600
  branches.push(cloneStack());
21067
21601
  branchStacks.set(parent, branches);
@@ -21124,7 +21658,7 @@ var rule = {
21124
21658
  function onSwitchCaseExit(node) {
21125
21659
  const caseNode = node;
21126
21660
  const { parent } = caseNode;
21127
- if (parent?.type === AST_NODE_TYPES11.SwitchStatement) {
21661
+ if (parent?.type === AST_NODE_TYPES13.SwitchStatement) {
21128
21662
  const branches = branchStacks.get(parent) ?? [];
21129
21663
  branches.push(cloneStack());
21130
21664
  branchStacks.set(parent, branches);
@@ -21155,7 +21689,7 @@ var rule = {
21155
21689
  for (const { opener, config, node: node2 } of openerStack) {
21156
21690
  const validClosers = getValidClosers(config);
21157
21691
  const closer = validClosers.length === 1 ? validClosers[0] ?? "closer" : validClosers.join("' or '");
21158
- const statementType = statementNode.type === AST_NODE_TYPES11.ReturnStatement ? "return" : "throw";
21692
+ const statementType = statementNode.type === AST_NODE_TYPES13.ReturnStatement ? "return" : "throw";
21159
21693
  const lineNumber = statementNode.loc?.start.line ?? 0;
21160
21694
  context.report({
21161
21695
  data: {
@@ -21172,7 +21706,7 @@ var rule = {
21172
21706
  const statementNode = node;
21173
21707
  if (openerStack.length === 0)
21174
21708
  return;
21175
- const targetLoop = statementNode.type === AST_NODE_TYPES11.ContinueStatement ? resolveContinueTargetLoop(statementNode) : resolveBreakTargetLoop(statementNode);
21709
+ const targetLoop = statementNode.type === AST_NODE_TYPES13.ContinueStatement ? resolveContinueTargetLoop(statementNode) : resolveBreakTargetLoop(statementNode);
21176
21710
  if (!targetLoop)
21177
21711
  return;
21178
21712
  for (const { node: openerNode, config, opener, loopAncestors } of openerStack) {
@@ -21180,7 +21714,7 @@ var rule = {
21180
21714
  continue;
21181
21715
  const validClosers = getValidClosers(config);
21182
21716
  const closer = validClosers.length === 1 ? validClosers[0] ?? "closer" : validClosers.join("' or '");
21183
- const statementType = statementNode.type === AST_NODE_TYPES11.BreakStatement ? "break" : "continue";
21717
+ const statementType = statementNode.type === AST_NODE_TYPES13.BreakStatement ? "break" : "continue";
21184
21718
  const lineNumber = statementNode.loc?.start.line ?? 0;
21185
21719
  context.report({
21186
21720
  data: {
@@ -21318,7 +21852,7 @@ var rule = {
21318
21852
  continue;
21319
21853
  const validClosers = getValidClosers(config);
21320
21854
  const closer = validClosers.length === 1 ? validClosers[0] ?? "closer" : validClosers.join("' or '");
21321
- const asyncType = asyncNode.type === AST_NODE_TYPES11.AwaitExpression ? "await" : "yield";
21855
+ const asyncType = asyncNode.type === AST_NODE_TYPES13.AwaitExpression ? "await" : "yield";
21322
21856
  context.report({
21323
21857
  data: { asyncType, closer, opener },
21324
21858
  messageId: "asyncViolation",
@@ -21495,40 +22029,44 @@ function ascendPastWrappers(node) {
21495
22029
  return current;
21496
22030
  }
21497
22031
  function hasKeyAttribute(node) {
21498
- for (const attribute of node.openingElement.attributes)
22032
+ for (const attribute of node.openingElement.attributes) {
21499
22033
  if (attribute.type === TSESTree9.AST_NODE_TYPES.JSXAttribute && attribute.name.name === "key")
21500
22034
  return true;
22035
+ }
21501
22036
  return false;
21502
22037
  }
21503
- function isReactComponentHOC2(callExpr) {
22038
+ function isHigherOrderComponent(callExpr) {
21504
22039
  const { callee } = callExpr;
21505
- if (callee.type === TSESTree9.AST_NODE_TYPES.Identifier)
22040
+ if (callee.type === TSESTree9.AST_NODE_TYPES.Identifier) {
21506
22041
  return callee.name === "forwardRef" || callee.name === "memo";
21507
- if (callee.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.type === TSESTree9.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === TSESTree9.AST_NODE_TYPES.Identifier)
22042
+ }
22043
+ if (callee.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.type === TSESTree9.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === TSESTree9.AST_NODE_TYPES.Identifier) {
21508
22044
  return callee.property.name === "forwardRef" || callee.property.name === "memo";
22045
+ }
21509
22046
  return false;
21510
22047
  }
21511
22048
  function getEnclosingFunctionLike(node) {
21512
22049
  let current = node.parent;
21513
22050
  while (current) {
21514
- if (current.type === TSESTree9.AST_NODE_TYPES.ArrowFunctionExpression || current.type === TSESTree9.AST_NODE_TYPES.FunctionExpression || current.type === TSESTree9.AST_NODE_TYPES.FunctionDeclaration)
22051
+ if (current.type === TSESTree9.AST_NODE_TYPES.ArrowFunctionExpression || current.type === TSESTree9.AST_NODE_TYPES.FunctionExpression || current.type === TSESTree9.AST_NODE_TYPES.FunctionDeclaration) {
21515
22052
  return current;
22053
+ }
21516
22054
  current = current.parent;
21517
22055
  }
21518
22056
  return;
21519
22057
  }
21520
- function isIterationOrMemoCallback(callExpr, iterationMethods, memoizationHooks) {
21521
- const { callee } = callExpr;
22058
+ function isIterationOrMemoCallback(callExpression, iterationMethods, memoizationHooks) {
22059
+ const { callee } = callExpression;
21522
22060
  if (callee.type === TSESTree9.AST_NODE_TYPES.Identifier && memoizationHooks.has(callee.name))
21523
22061
  return true;
21524
22062
  if (callee.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree9.AST_NODE_TYPES.Identifier) {
21525
- const methodName = callee.property.name;
21526
- if (iterationMethods.has(methodName))
22063
+ const { name } = callee.property;
22064
+ if (iterationMethods.has(name))
21527
22065
  return true;
21528
- if (methodName === "from" && callee.object.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.object.type === TSESTree9.AST_NODE_TYPES.Identifier && callee.object.object.name === "Array" && callExpr.arguments.length >= 2) {
22066
+ if (name === "from" && callee.object.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.object.type === TSESTree9.AST_NODE_TYPES.Identifier && callee.object.object.name === "Array" && callExpression.arguments.length >= 2) {
21529
22067
  return true;
21530
22068
  }
21531
- if (methodName === "call" && callee.object.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.object.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.object.property.type === TSESTree9.AST_NODE_TYPES.Identifier && iterationMethods.has(callee.object.object.property.name)) {
22069
+ if (name === "call" && callee.object.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.object.type === TSESTree9.AST_NODE_TYPES.MemberExpression && callee.object.object.property.type === TSESTree9.AST_NODE_TYPES.Identifier && iterationMethods.has(callee.object.object.property.name)) {
21532
22070
  return true;
21533
22071
  }
21534
22072
  }
@@ -21580,23 +22118,24 @@ function referenceActsAsCallback(reference, iterationMethods, memoizationHooks)
21580
22118
  const callExpression = findEnclosingCallExpression(reference.identifier);
21581
22119
  if (!callExpression)
21582
22120
  return false;
21583
- if (isReactComponentHOC2(callExpression))
22121
+ if (isHigherOrderComponent(callExpression))
21584
22122
  return false;
21585
22123
  return isIterationOrMemoCallback(callExpression, iterationMethods, memoizationHooks);
21586
22124
  }
21587
22125
  function isFunctionUsedAsCallback(context, functionLike, iterationMethods, memoizationHooks) {
21588
22126
  const inlineCall = findEnclosingCallExpression(functionLike);
21589
22127
  if (inlineCall) {
21590
- if (isReactComponentHOC2(inlineCall))
22128
+ if (isHigherOrderComponent(inlineCall))
21591
22129
  return false;
21592
22130
  return isIterationOrMemoCallback(inlineCall, iterationMethods, memoizationHooks);
21593
22131
  }
21594
22132
  const variable = getVariableForFunction(context, functionLike);
21595
22133
  if (!variable)
21596
22134
  return false;
21597
- for (const reference of variable.references)
22135
+ for (const reference of variable.references) {
21598
22136
  if (referenceActsAsCallback(reference, iterationMethods, memoizationHooks))
21599
22137
  return true;
22138
+ }
21600
22139
  return false;
21601
22140
  }
21602
22141
  var SHOULD_ASCEND_TYPES = new Set([
@@ -21648,7 +22187,7 @@ function isTopLevelReturn(node) {
21648
22187
  if (IS_FUNCTION_EXPRESSION.has(currentNode.type)) {
21649
22188
  const functionParent = ascendPastWrappers(currentNode.parent);
21650
22189
  if (functionParent?.type === TSESTree9.AST_NODE_TYPES.CallExpression) {
21651
- return isReactComponentHOC2(functionParent);
22190
+ return isHigherOrderComponent(functionParent);
21652
22191
  }
21653
22192
  return true;
21654
22193
  }
@@ -21656,8 +22195,9 @@ function isTopLevelReturn(node) {
21656
22195
  }
21657
22196
  if (parent.type === TSESTree9.AST_NODE_TYPES.ArrowFunctionExpression) {
21658
22197
  const functionParent = ascendPastWrappers(parent.parent);
21659
- if (functionParent?.type === TSESTree9.AST_NODE_TYPES.CallExpression)
21660
- return isReactComponentHOC2(functionParent);
22198
+ if (functionParent?.type === TSESTree9.AST_NODE_TYPES.CallExpression) {
22199
+ return isHigherOrderComponent(functionParent);
22200
+ }
21661
22201
  return true;
21662
22202
  }
21663
22203
  return false;
@@ -21722,11 +22262,7 @@ function isTernaryJSXChild(node) {
21722
22262
  return false;
21723
22263
  return containerParent.type === TSESTree9.AST_NODE_TYPES.JSXElement || containerParent.type === TSESTree9.AST_NODE_TYPES.JSXFragment;
21724
22264
  }
21725
- var docs3 = {
21726
- description: "Enforce key props on all React elements except top-level returns",
21727
- recommended: true
21728
- };
21729
- var requireReactComponentKeys = {
22265
+ var require_react_component_keys_default = createRule({
21730
22266
  create(context) {
21731
22267
  const options3 = {
21732
22268
  ...DEFAULT_OPTIONS3,
@@ -21778,7 +22314,9 @@ var requireReactComponentKeys = {
21778
22314
  },
21779
22315
  defaultOptions: [DEFAULT_OPTIONS3],
21780
22316
  meta: {
21781
- docs: docs3,
22317
+ docs: {
22318
+ description: "Require keys on React components when used in lists or iteration."
22319
+ },
21782
22320
  messages: {
21783
22321
  missingKey: "All React elements except top-level returns require a key prop",
21784
22322
  rootComponentWithKey: "Root component returns should not have key props"
@@ -21826,9 +22364,220 @@ var requireReactComponentKeys = {
21826
22364
  }
21827
22365
  ],
21828
22366
  type: "problem"
21829
- }
22367
+ },
22368
+ name: "require-react-component-keys"
22369
+ });
22370
+
22371
+ // src/rules/require-react-display-names.ts
22372
+ import { TSESTree as TSESTree10 } from "@typescript-eslint/types";
22373
+ var DEFAULT_OPTIONS4 = {
22374
+ environment: "roblox-ts"
21830
22375
  };
21831
- var require_react_component_keys_default = requireReactComponentKeys;
22376
+ var REACT_SOURCES_ROBLOX = new Set(["@rbxts/react", "@rbxts/roact"]);
22377
+ var REACT_SOURCES_STANDARD = new Set(["react", "react-dom"]);
22378
+ function getReactSources(environment2) {
22379
+ return environment2 === "roblox-ts" ? REACT_SOURCES_ROBLOX : REACT_SOURCES_STANDARD;
22380
+ }
22381
+ function isReactImport(node, reactSources) {
22382
+ return reactSources.has(node.source.value);
22383
+ }
22384
+ function isMemoCall(node, memoIdentifiers, reactNamespaces) {
22385
+ const { callee } = node;
22386
+ if (callee.type === TSESTree10.AST_NODE_TYPES.Identifier)
22387
+ return memoIdentifiers.has(callee.name);
22388
+ if (callee.type === TSESTree10.AST_NODE_TYPES.MemberExpression && callee.object.type === TSESTree10.AST_NODE_TYPES.Identifier && callee.property.type === TSESTree10.AST_NODE_TYPES.Identifier) {
22389
+ return reactNamespaces.has(callee.object.name) && callee.property.name === "memo";
22390
+ }
22391
+ return false;
22392
+ }
22393
+ function isCreateContextCall(node, createContextIdentifiers, reactNamespaces) {
22394
+ const { callee } = node;
22395
+ if (callee.type === TSESTree10.AST_NODE_TYPES.Identifier)
22396
+ return createContextIdentifiers.has(callee.name);
22397
+ if (callee.type === TSESTree10.AST_NODE_TYPES.MemberExpression && callee.object.type === TSESTree10.AST_NODE_TYPES.Identifier && callee.property.type === TSESTree10.AST_NODE_TYPES.Identifier) {
22398
+ return reactNamespaces.has(callee.object.name) && callee.property.name === "createContext";
22399
+ }
22400
+ return false;
22401
+ }
22402
+ function getVariableName(node) {
22403
+ if (node.id.type === TSESTree10.AST_NODE_TYPES.Identifier)
22404
+ return node.id.name;
22405
+ return;
22406
+ }
22407
+ function isNodeInExport(node) {
22408
+ let current = node;
22409
+ while (current) {
22410
+ const { type: type3 } = current;
22411
+ if (type3 === TSESTree10.AST_NODE_TYPES.ExportNamedDeclaration)
22412
+ return true;
22413
+ if (type3 === TSESTree10.AST_NODE_TYPES.ExportDefaultDeclaration)
22414
+ return true;
22415
+ current = current.parent;
22416
+ }
22417
+ return false;
22418
+ }
22419
+ function isReferenceExported(reference) {
22420
+ return isNodeInExport(reference.identifier);
22421
+ }
22422
+ var require_react_display_names_default = createRule({
22423
+ create(context) {
22424
+ const options3 = {
22425
+ ...DEFAULT_OPTIONS4,
22426
+ ...context.options[0]
22427
+ };
22428
+ const reactSources = getReactSources(options3.environment);
22429
+ const memoIdentifiers = new Set;
22430
+ const createContextIdentifiers = new Set;
22431
+ const reactNamespaces = new Set;
22432
+ const trackedVariables = new Map;
22433
+ const displayNameAssignments = new Set;
22434
+ return {
22435
+ "AssignmentExpression[left.type='MemberExpression'][left.property.name='displayName']"(node) {
22436
+ const left = node.left;
22437
+ if (left.object.type === TSESTree10.AST_NODE_TYPES.Identifier) {
22438
+ displayNameAssignments.add(left.object.name);
22439
+ }
22440
+ },
22441
+ ExportDefaultDeclaration(node) {
22442
+ const { declaration } = node;
22443
+ if (declaration.type === TSESTree10.AST_NODE_TYPES.CallExpression) {
22444
+ if (isMemoCall(declaration, memoIdentifiers, reactNamespaces)) {
22445
+ context.report({
22446
+ messageId: "directMemoExport",
22447
+ node
22448
+ });
22449
+ return;
22450
+ }
22451
+ if (isCreateContextCall(declaration, createContextIdentifiers, reactNamespaces)) {
22452
+ context.report({
22453
+ messageId: "directContextExport",
22454
+ node
22455
+ });
22456
+ return;
22457
+ }
22458
+ }
22459
+ if (declaration.type === TSESTree10.AST_NODE_TYPES.Identifier) {
22460
+ const tracked = trackedVariables.get(declaration.name);
22461
+ if (tracked) {
22462
+ trackedVariables.set(declaration.name, {
22463
+ ...tracked,
22464
+ isDefaultExported: true
22465
+ });
22466
+ }
22467
+ }
22468
+ },
22469
+ ExportNamedDeclaration(node) {
22470
+ if (!node.specifiers)
22471
+ return;
22472
+ for (const specifier of node.specifiers) {
22473
+ if (specifier.type !== TSESTree10.AST_NODE_TYPES.ExportSpecifier)
22474
+ continue;
22475
+ const localName = specifier.local.type === TSESTree10.AST_NODE_TYPES.Identifier ? specifier.local.name : specifier.local.value;
22476
+ const exportedName = specifier.exported.type === TSESTree10.AST_NODE_TYPES.Identifier ? specifier.exported.name : specifier.exported.value;
22477
+ if (exportedName === "default") {
22478
+ const tracked = trackedVariables.get(localName);
22479
+ if (tracked) {
22480
+ trackedVariables.set(localName, {
22481
+ ...tracked,
22482
+ isDefaultExported: true
22483
+ });
22484
+ }
22485
+ }
22486
+ }
22487
+ },
22488
+ ImportDeclaration(node) {
22489
+ if (!isReactImport(node, reactSources))
22490
+ return;
22491
+ for (const specifier of node.specifiers) {
22492
+ if (specifier.type === TSESTree10.AST_NODE_TYPES.ImportDefaultSpecifier || specifier.type === TSESTree10.AST_NODE_TYPES.ImportNamespaceSpecifier) {
22493
+ reactNamespaces.add(specifier.local.name);
22494
+ } else if (specifier.type === TSESTree10.AST_NODE_TYPES.ImportSpecifier) {
22495
+ const importedName = specifier.imported.type === TSESTree10.AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;
22496
+ if (importedName === "memo")
22497
+ memoIdentifiers.add(specifier.local.name);
22498
+ else if (importedName === "createContext")
22499
+ createContextIdentifiers.add(specifier.local.name);
22500
+ }
22501
+ }
22502
+ },
22503
+ "Program:exit"() {
22504
+ for (const [name, tracked] of trackedVariables) {
22505
+ const hasDisplayName = displayNameAssignments.has(name);
22506
+ if (hasDisplayName)
22507
+ continue;
22508
+ const declaredVariables = context.sourceCode.getDeclaredVariables(tracked.node);
22509
+ const variable = declaredVariables.find((declared) => declared.name === name);
22510
+ let isExported = tracked.isDefaultExported;
22511
+ if (variable)
22512
+ isExported ||= variable.references.some(isReferenceExported);
22513
+ const declarationParent = tracked.node.parent;
22514
+ if (declarationParent?.parent?.type === TSESTree10.AST_NODE_TYPES.ExportNamedDeclaration) {
22515
+ isExported = true;
22516
+ }
22517
+ if (isExported) {
22518
+ context.report({
22519
+ data: { name },
22520
+ messageId: tracked.kind === "memo" ? "missingMemoDisplayName" : "missingContextDisplayName",
22521
+ node: tracked.node
22522
+ });
22523
+ }
22524
+ }
22525
+ },
22526
+ VariableDeclarator(node) {
22527
+ if (!node.init || node.init.type !== TSESTree10.AST_NODE_TYPES.CallExpression)
22528
+ return;
22529
+ const name = getVariableName(node);
22530
+ if (!name)
22531
+ return;
22532
+ if (isMemoCall(node.init, memoIdentifiers, reactNamespaces)) {
22533
+ trackedVariables.set(name, {
22534
+ hasDisplayName: false,
22535
+ isDefaultExported: false,
22536
+ kind: "memo",
22537
+ name,
22538
+ node
22539
+ });
22540
+ } else if (isCreateContextCall(node.init, createContextIdentifiers, reactNamespaces)) {
22541
+ trackedVariables.set(name, {
22542
+ hasDisplayName: false,
22543
+ isDefaultExported: false,
22544
+ kind: "context",
22545
+ name,
22546
+ node
22547
+ });
22548
+ }
22549
+ }
22550
+ };
22551
+ },
22552
+ defaultOptions: [DEFAULT_OPTIONS4],
22553
+ meta: {
22554
+ docs: {
22555
+ description: "Require displayName property on exported React.memo components and React.createContext contexts for better debugging."
22556
+ },
22557
+ messages: {
22558
+ directContextExport: "Do not export createContext result directly. Assign to a variable, set displayName, then export.",
22559
+ directMemoExport: "Do not export memo result directly. Assign to a variable, set displayName, then export both named and default.",
22560
+ missingContextDisplayName: "Exported Context '{{name}}' is missing displayName. Add `{{name}}.displayName = \"{{name}}\";` before exporting.",
22561
+ missingMemoDisplayName: "Exported memoized component '{{name}}' is missing displayName. Add `{{name}}.displayName = \"{{name}}\";` before exporting."
22562
+ },
22563
+ schema: [
22564
+ {
22565
+ additionalProperties: false,
22566
+ properties: {
22567
+ environment: {
22568
+ default: "roblox-ts",
22569
+ description: "The React environment: 'roblox-ts' uses @rbxts/react, 'standard' uses react.",
22570
+ enum: ["roblox-ts", "standard"],
22571
+ type: "string"
22572
+ }
22573
+ },
22574
+ type: "object"
22575
+ }
22576
+ ],
22577
+ type: "problem"
22578
+ },
22579
+ name: "require-react-display-names"
22580
+ });
21832
22581
 
21833
22582
  // src/rules/strict-component-boundaries.ts
21834
22583
  import { basename, extname, relative } from "node:path";
@@ -21849,8 +22598,8 @@ function resolveRelativeImport(importSource, sourceFile) {
21849
22598
  }
21850
22599
 
21851
22600
  // src/rules/strict-component-boundaries.ts
21852
- function toRegExp(pattern4) {
21853
- return new RegExp(pattern4, "i");
22601
+ function toRegExp(pattern5) {
22602
+ return new RegExp(pattern5, "i");
21854
22603
  }
21855
22604
  function pathSegmentsFromSource(source) {
21856
22605
  return source.split("/").filter((part) => !part.startsWith("."));
@@ -21874,7 +22623,7 @@ function isValidFixtureImport(pathParts) {
21874
22623
  const partsBeforeFixture = pathParts.slice(0, fixtureIndex);
21875
22624
  return !hasAnotherComponentInPath(partsBeforeFixture);
21876
22625
  }
21877
- var strictComponentBoundaries = {
22626
+ var strict_component_boundaries_default = createRule({
21878
22627
  create(context) {
21879
22628
  const [{ allow = [], maxDepth = 1 } = {}] = context.options;
21880
22629
  const allowPatterns = allow.map(toRegExp);
@@ -21936,21 +22685,21 @@ var strictComponentBoundaries = {
21936
22685
  }
21937
22686
  ],
21938
22687
  type: "problem"
21939
- }
21940
- };
21941
- var strict_component_boundaries_default = strictComponentBoundaries;
22688
+ },
22689
+ name: "strict-component-boundaries"
22690
+ });
21942
22691
 
21943
22692
  // src/rules/use-exhaustive-dependencies.ts
21944
- import { TSESTree as TSESTree10 } from "@typescript-eslint/types";
22693
+ import { TSESTree as TSESTree11 } from "@typescript-eslint/types";
21945
22694
  var FUNCTION_DECLARATIONS = new Set([
21946
- TSESTree10.AST_NODE_TYPES.FunctionExpression,
21947
- TSESTree10.AST_NODE_TYPES.ArrowFunctionExpression,
21948
- TSESTree10.AST_NODE_TYPES.FunctionDeclaration
22695
+ TSESTree11.AST_NODE_TYPES.FunctionExpression,
22696
+ TSESTree11.AST_NODE_TYPES.ArrowFunctionExpression,
22697
+ TSESTree11.AST_NODE_TYPES.FunctionDeclaration
21949
22698
  ]);
21950
22699
  var UNSTABLE_VALUES = new Set([
21951
22700
  ...FUNCTION_DECLARATIONS,
21952
- TSESTree10.AST_NODE_TYPES.ObjectExpression,
21953
- TSESTree10.AST_NODE_TYPES.ArrayExpression
22701
+ TSESTree11.AST_NODE_TYPES.ObjectExpression,
22702
+ TSESTree11.AST_NODE_TYPES.ArrayExpression
21954
22703
  ]);
21955
22704
  var testingMetrics = {
21956
22705
  moduleLevelStableConst: 0,
@@ -22034,9 +22783,9 @@ var GLOBAL_BUILTINS = new Set([
22034
22783
  ]);
22035
22784
  function getHookName4(node) {
22036
22785
  const { callee } = node;
22037
- if (callee.type === TSESTree10.AST_NODE_TYPES.Identifier)
22786
+ if (callee.type === TSESTree11.AST_NODE_TYPES.Identifier)
22038
22787
  return callee.name;
22039
- if (callee.type === TSESTree10.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree10.AST_NODE_TYPES.Identifier) {
22788
+ if (callee.type === TSESTree11.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree11.AST_NODE_TYPES.Identifier) {
22040
22789
  return callee.property.name;
22041
22790
  }
22042
22791
  return;
@@ -22044,9 +22793,9 @@ function getHookName4(node) {
22044
22793
  function getMemberExpressionDepth(node) {
22045
22794
  let depth = 0;
22046
22795
  let current = node;
22047
- if (current.type === TSESTree10.AST_NODE_TYPES.ChainExpression)
22796
+ if (current.type === TSESTree11.AST_NODE_TYPES.ChainExpression)
22048
22797
  current = current.expression;
22049
- while (current.type === TSESTree10.AST_NODE_TYPES.MemberExpression) {
22798
+ while (current.type === TSESTree11.AST_NODE_TYPES.MemberExpression) {
22050
22799
  depth += 1;
22051
22800
  current = current.object;
22052
22801
  }
@@ -22054,36 +22803,36 @@ function getMemberExpressionDepth(node) {
22054
22803
  }
22055
22804
  function getRootIdentifier(node) {
22056
22805
  let current = node;
22057
- if (current.type === TSESTree10.AST_NODE_TYPES.ChainExpression)
22806
+ if (current.type === TSESTree11.AST_NODE_TYPES.ChainExpression)
22058
22807
  current = current.expression;
22059
- while (current.type === TSESTree10.AST_NODE_TYPES.MemberExpression || current.type === TSESTree10.AST_NODE_TYPES.TSNonNullExpression) {
22060
- if (current.type === TSESTree10.AST_NODE_TYPES.MemberExpression)
22808
+ while (current.type === TSESTree11.AST_NODE_TYPES.MemberExpression || current.type === TSESTree11.AST_NODE_TYPES.TSNonNullExpression) {
22809
+ if (current.type === TSESTree11.AST_NODE_TYPES.MemberExpression)
22061
22810
  current = current.object;
22062
22811
  else
22063
22812
  current = current.expression;
22064
22813
  }
22065
- return current.type === TSESTree10.AST_NODE_TYPES.Identifier ? current : undefined;
22814
+ return current.type === TSESTree11.AST_NODE_TYPES.Identifier ? current : undefined;
22066
22815
  }
22067
22816
  function nodeToDependencyString(node, sourceCode) {
22068
22817
  return sourceCode.getText(node);
22069
22818
  }
22070
22819
  function nodeToSafeDependencyPath(node, sourceCode) {
22071
- if (node.type === TSESTree10.AST_NODE_TYPES.Identifier)
22820
+ if (node.type === TSESTree11.AST_NODE_TYPES.Identifier)
22072
22821
  return node.name;
22073
- if (node.type === TSESTree10.AST_NODE_TYPES.ChainExpression) {
22822
+ if (node.type === TSESTree11.AST_NODE_TYPES.ChainExpression) {
22074
22823
  return nodeToSafeDependencyPath(node.expression, sourceCode);
22075
22824
  }
22076
22825
  if (TS_RUNTIME_EXPRESSIONS.has(node.type)) {
22077
22826
  const expr = node;
22078
22827
  return nodeToSafeDependencyPath(expr.expression, sourceCode);
22079
22828
  }
22080
- if (node.type === TSESTree10.AST_NODE_TYPES.MemberExpression) {
22829
+ if (node.type === TSESTree11.AST_NODE_TYPES.MemberExpression) {
22081
22830
  const objectPath = nodeToSafeDependencyPath(node.object, sourceCode);
22082
22831
  if (node.computed) {
22083
22832
  const propertyText = sourceCode.getText(node.property);
22084
22833
  return `${objectPath}[${propertyText}]`;
22085
22834
  }
22086
- const propertyName = node.property.type === TSESTree10.AST_NODE_TYPES.Identifier ? node.property.name : "";
22835
+ const propertyName = node.property.type === TSESTree11.AST_NODE_TYPES.Identifier ? node.property.name : "";
22087
22836
  const separator = node.optional ? "?." : ".";
22088
22837
  return `${objectPath}${separator}${propertyName}`;
22089
22838
  }
@@ -22092,13 +22841,13 @@ function nodeToSafeDependencyPath(node, sourceCode) {
22092
22841
  function isStableArrayIndex(stableResult, node, identifierName) {
22093
22842
  if (!stableResult)
22094
22843
  return false;
22095
- if (!(stableResult instanceof Set) || node.type !== TSESTree10.AST_NODE_TYPES.VariableDeclarator || node.id.type !== TSESTree10.AST_NODE_TYPES.ArrayPattern) {
22844
+ if (!(stableResult instanceof Set) || node.type !== TSESTree11.AST_NODE_TYPES.VariableDeclarator || node.id.type !== TSESTree11.AST_NODE_TYPES.ArrayPattern) {
22096
22845
  return false;
22097
22846
  }
22098
22847
  const { elements } = node.id;
22099
22848
  let index2 = 0;
22100
22849
  for (const element of elements) {
22101
- if (element.type === TSESTree10.AST_NODE_TYPES.Identifier && element.name === identifierName) {
22850
+ if (element.type === TSESTree11.AST_NODE_TYPES.Identifier && element.name === identifierName) {
22102
22851
  return stableResult.has(index2);
22103
22852
  }
22104
22853
  index2 += 1;
@@ -22107,7 +22856,7 @@ function isStableArrayIndex(stableResult, node, identifierName) {
22107
22856
  }
22108
22857
  function isStableHookValue(init, node, identifierName, stableHooks) {
22109
22858
  const castInit = init;
22110
- if (castInit.type !== TSESTree10.AST_NODE_TYPES.CallExpression)
22859
+ if (castInit.type !== TSESTree11.AST_NODE_TYPES.CallExpression)
22111
22860
  return false;
22112
22861
  const hookName = getHookName4(castInit);
22113
22862
  if (!hookName)
@@ -22127,35 +22876,35 @@ function isStableValue(variable, identifierName, stableHooks) {
22127
22876
  const { node, type: type3 } = definition;
22128
22877
  if (STABLE_VALUE_TYPES.has(type3))
22129
22878
  return true;
22130
- if (type3 === "Variable" && node.type === TSESTree10.AST_NODE_TYPES.VariableDeclarator) {
22879
+ if (type3 === "Variable" && node.type === TSESTree11.AST_NODE_TYPES.VariableDeclarator) {
22131
22880
  const { parent } = node;
22132
- if (!parent || parent.type !== TSESTree10.AST_NODE_TYPES.VariableDeclaration || parent.kind !== "const") {
22881
+ if (!parent || parent.type !== TSESTree11.AST_NODE_TYPES.VariableDeclaration || parent.kind !== "const") {
22133
22882
  continue;
22134
22883
  }
22135
22884
  const init = node.init;
22136
22885
  if (init && isStableHookValue(init, node, identifierName, stableHooks))
22137
22886
  return true;
22138
- if (init?.type === TSESTree10.AST_NODE_TYPES.CallExpression) {
22887
+ if (init?.type === TSESTree11.AST_NODE_TYPES.CallExpression) {
22139
22888
  const { callee } = init;
22140
- if (callee.type === TSESTree10.AST_NODE_TYPES.MemberExpression && callee.object.type === TSESTree10.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === TSESTree10.AST_NODE_TYPES.Identifier && callee.property.name === "joinBindings") {
22889
+ if (callee.type === TSESTree11.AST_NODE_TYPES.MemberExpression && callee.object.type === TSESTree11.AST_NODE_TYPES.Identifier && callee.object.name === "React" && callee.property.type === TSESTree11.AST_NODE_TYPES.Identifier && callee.property.name === "joinBindings") {
22141
22890
  return true;
22142
22891
  }
22143
- if (callee.type === TSESTree10.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree10.AST_NODE_TYPES.Identifier && callee.property.name === "map") {
22892
+ if (callee.type === TSESTree11.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree11.AST_NODE_TYPES.Identifier && callee.property.name === "map") {
22144
22893
  return true;
22145
22894
  }
22146
22895
  }
22147
22896
  if (init) {
22148
- if (init.type === TSESTree10.AST_NODE_TYPES.Literal || init.type === TSESTree10.AST_NODE_TYPES.TemplateLiteral) {
22897
+ if (init.type === TSESTree11.AST_NODE_TYPES.Literal || init.type === TSESTree11.AST_NODE_TYPES.TemplateLiteral) {
22149
22898
  return true;
22150
22899
  }
22151
- if (init.type === TSESTree10.AST_NODE_TYPES.UnaryExpression && init.argument.type === TSESTree10.AST_NODE_TYPES.Literal) {
22900
+ if (init.type === TSESTree11.AST_NODE_TYPES.UnaryExpression && init.argument.type === TSESTree11.AST_NODE_TYPES.Literal) {
22152
22901
  return true;
22153
22902
  }
22154
22903
  }
22155
22904
  const variableDefinition = variable.defs.find((definition2) => definition2.node === node);
22156
- if (variableDefinition && variableDefinition.node.type === TSESTree10.AST_NODE_TYPES.VariableDeclarator) {
22905
+ if (variableDefinition && variableDefinition.node.type === TSESTree11.AST_NODE_TYPES.VariableDeclarator) {
22157
22906
  const declarationParent = variableDefinition.node.parent?.parent;
22158
- if (declarationParent && (declarationParent.type === TSESTree10.AST_NODE_TYPES.Program || declarationParent.type === TSESTree10.AST_NODE_TYPES.ExportNamedDeclaration)) {
22907
+ if (declarationParent && (declarationParent.type === TSESTree11.AST_NODE_TYPES.Program || declarationParent.type === TSESTree11.AST_NODE_TYPES.ExportNamedDeclaration)) {
22159
22908
  testingMetrics.moduleLevelStableConst += 1;
22160
22909
  return true;
22161
22910
  }
@@ -22168,14 +22917,14 @@ function findTopmostMemberExpression(node) {
22168
22917
  let current = node;
22169
22918
  let { parent } = node;
22170
22919
  while (parent) {
22171
- if (parent.type === TSESTree10.AST_NODE_TYPES.CallExpression && parent.callee === current) {
22172
- if (current.type === TSESTree10.AST_NODE_TYPES.MemberExpression)
22920
+ if (parent.type === TSESTree11.AST_NODE_TYPES.CallExpression && parent.callee === current) {
22921
+ if (current.type === TSESTree11.AST_NODE_TYPES.MemberExpression)
22173
22922
  return current.object;
22174
22923
  break;
22175
22924
  }
22176
- const isMemberParent = parent.type === TSESTree10.AST_NODE_TYPES.MemberExpression && parent.object === current;
22177
- const isChainParent = parent.type === TSESTree10.AST_NODE_TYPES.ChainExpression;
22178
- const isNonNullParent = parent.type === TSESTree10.AST_NODE_TYPES.TSNonNullExpression;
22925
+ const isMemberParent = parent.type === TSESTree11.AST_NODE_TYPES.MemberExpression && parent.object === current;
22926
+ const isChainParent = parent.type === TSESTree11.AST_NODE_TYPES.ChainExpression;
22927
+ const isNonNullParent = parent.type === TSESTree11.AST_NODE_TYPES.TSNonNullExpression;
22179
22928
  if (!(isMemberParent || isChainParent || isNonNullParent))
22180
22929
  break;
22181
22930
  current = parent;
@@ -22184,21 +22933,21 @@ function findTopmostMemberExpression(node) {
22184
22933
  return current;
22185
22934
  }
22186
22935
  var IS_CEASE_BOUNDARY = new Set([
22187
- TSESTree10.AST_NODE_TYPES.FunctionDeclaration,
22188
- TSESTree10.AST_NODE_TYPES.FunctionExpression,
22189
- TSESTree10.AST_NODE_TYPES.ArrowFunctionExpression,
22190
- TSESTree10.AST_NODE_TYPES.VariableDeclarator
22936
+ TSESTree11.AST_NODE_TYPES.FunctionDeclaration,
22937
+ TSESTree11.AST_NODE_TYPES.FunctionExpression,
22938
+ TSESTree11.AST_NODE_TYPES.ArrowFunctionExpression,
22939
+ TSESTree11.AST_NODE_TYPES.VariableDeclarator
22191
22940
  ]);
22192
22941
  var TS_RUNTIME_EXPRESSIONS = new Set([
22193
- TSESTree10.AST_NODE_TYPES.TSNonNullExpression,
22194
- TSESTree10.AST_NODE_TYPES.TSAsExpression,
22195
- TSESTree10.AST_NODE_TYPES.TSSatisfiesExpression,
22196
- TSESTree10.AST_NODE_TYPES.TSTypeAssertion,
22197
- TSESTree10.AST_NODE_TYPES.TSInstantiationExpression
22942
+ TSESTree11.AST_NODE_TYPES.TSNonNullExpression,
22943
+ TSESTree11.AST_NODE_TYPES.TSAsExpression,
22944
+ TSESTree11.AST_NODE_TYPES.TSSatisfiesExpression,
22945
+ TSESTree11.AST_NODE_TYPES.TSTypeAssertion,
22946
+ TSESTree11.AST_NODE_TYPES.TSInstantiationExpression
22198
22947
  ]);
22199
22948
  function isComputedPropertyIdentifier(identifier3) {
22200
22949
  const { parent } = identifier3;
22201
- return parent?.type === TSESTree10.AST_NODE_TYPES.Property && parent.computed && parent.key === identifier3;
22950
+ return parent?.type === TSESTree11.AST_NODE_TYPES.Property && parent.computed && parent.key === identifier3;
22202
22951
  }
22203
22952
  function isInTypePosition(identifier3) {
22204
22953
  let parent = identifier3.parent;
@@ -22252,10 +23001,10 @@ function resolveFunctionReference(identifier3, scope) {
22252
23001
  return;
22253
23002
  for (const definition of variable.defs) {
22254
23003
  const { node } = definition;
22255
- if (node.type === TSESTree10.AST_NODE_TYPES.FunctionDeclaration) {
23004
+ if (node.type === TSESTree11.AST_NODE_TYPES.FunctionDeclaration) {
22256
23005
  return node;
22257
23006
  }
22258
- if (node.type === TSESTree10.AST_NODE_TYPES.VariableDeclarator && node.init && (node.init.type === TSESTree10.AST_NODE_TYPES.ArrowFunctionExpression || node.init.type === TSESTree10.AST_NODE_TYPES.FunctionExpression)) {
23007
+ if (node.type === TSESTree11.AST_NODE_TYPES.VariableDeclarator && node.init && (node.init.type === TSESTree11.AST_NODE_TYPES.ArrowFunctionExpression || node.init.type === TSESTree11.AST_NODE_TYPES.FunctionExpression)) {
22259
23008
  return node.init;
22260
23009
  }
22261
23010
  }
@@ -22265,7 +23014,7 @@ function collectCaptures(node, sourceCode) {
22265
23014
  const captures = new Array;
22266
23015
  const captureSet = new Set;
22267
23016
  function visit(current) {
22268
- if (current.type === TSESTree10.AST_NODE_TYPES.Identifier) {
23017
+ if (current.type === TSESTree11.AST_NODE_TYPES.Identifier) {
22269
23018
  const { name } = current;
22270
23019
  if (captureSet.has(name) || GLOBAL_BUILTINS.has(name) || isInTypePosition(current))
22271
23020
  return;
@@ -22307,21 +23056,21 @@ function collectCaptures(node, sourceCode) {
22307
23056
  }
22308
23057
  }
22309
23058
  }
22310
- if (current.type === TSESTree10.AST_NODE_TYPES.TSSatisfiesExpression || current.type === TSESTree10.AST_NODE_TYPES.TSAsExpression || current.type === TSESTree10.AST_NODE_TYPES.TSTypeAssertion || current.type === TSESTree10.AST_NODE_TYPES.TSNonNullExpression) {
23059
+ if (current.type === TSESTree11.AST_NODE_TYPES.TSSatisfiesExpression || current.type === TSESTree11.AST_NODE_TYPES.TSAsExpression || current.type === TSESTree11.AST_NODE_TYPES.TSTypeAssertion || current.type === TSESTree11.AST_NODE_TYPES.TSNonNullExpression) {
22311
23060
  visit(current.expression);
22312
23061
  return;
22313
23062
  }
22314
- if (current.type === TSESTree10.AST_NODE_TYPES.MemberExpression) {
23063
+ if (current.type === TSESTree11.AST_NODE_TYPES.MemberExpression) {
22315
23064
  visit(current.object);
22316
23065
  if (current.computed)
22317
23066
  visit(current.property);
22318
23067
  return;
22319
23068
  }
22320
- if (current.type === TSESTree10.AST_NODE_TYPES.ChainExpression) {
23069
+ if (current.type === TSESTree11.AST_NODE_TYPES.ChainExpression) {
22321
23070
  visit(current.expression);
22322
23071
  return;
22323
23072
  }
22324
- if (current.type === TSESTree10.AST_NODE_TYPES.Property) {
23073
+ if (current.type === TSESTree11.AST_NODE_TYPES.Property) {
22325
23074
  if (current.computed)
22326
23075
  visit(current.key);
22327
23076
  visit(current.value);
@@ -22346,7 +23095,7 @@ function parseDependencies(node, sourceCode) {
22346
23095
  for (const element of node.elements) {
22347
23096
  if (!element)
22348
23097
  continue;
22349
- const actualNode = element.type === TSESTree10.AST_NODE_TYPES.SpreadElement ? element.argument : element;
23098
+ const actualNode = element.type === TSESTree11.AST_NODE_TYPES.SpreadElement ? element.argument : element;
22350
23099
  const name = nodeToDependencyString(actualNode, sourceCode);
22351
23100
  const depth = getMemberExpressionDepth(actualNode);
22352
23101
  dependencies4.push({
@@ -22423,9 +23172,9 @@ var useExhaustiveDependencies = {
22423
23172
  if (closureArgument === undefined)
22424
23173
  return;
22425
23174
  let closureFunction;
22426
- if (closureArgument.type === TSESTree10.AST_NODE_TYPES.ArrowFunctionExpression || closureArgument.type === TSESTree10.AST_NODE_TYPES.FunctionExpression) {
23175
+ if (closureArgument.type === TSESTree11.AST_NODE_TYPES.ArrowFunctionExpression || closureArgument.type === TSESTree11.AST_NODE_TYPES.FunctionExpression) {
22427
23176
  closureFunction = closureArgument;
22428
- } else if (closureArgument.type === TSESTree10.AST_NODE_TYPES.Identifier) {
23177
+ } else if (closureArgument.type === TSESTree11.AST_NODE_TYPES.Identifier) {
22429
23178
  const scope = getScope(callNode);
22430
23179
  closureFunction = resolveFunctionReference(closureArgument, scope);
22431
23180
  }
@@ -22459,7 +23208,7 @@ var useExhaustiveDependencies = {
22459
23208
  }
22460
23209
  if (!dependenciesArgument)
22461
23210
  return;
22462
- if (dependenciesArgument.type !== TSESTree10.AST_NODE_TYPES.ArrayExpression)
23211
+ if (dependenciesArgument.type !== TSESTree11.AST_NODE_TYPES.ArrayExpression)
22463
23212
  return;
22464
23213
  const dependenciesArray = dependenciesArgument;
22465
23214
  const captures = collectCaptures(closureFunction, context.sourceCode);
@@ -22669,7 +23418,7 @@ var useExhaustiveDependencies = {
22669
23418
  var use_exhaustive_dependencies_default = useExhaustiveDependencies;
22670
23419
 
22671
23420
  // src/rules/use-hook-at-top-level.ts
22672
- import { TSESTree as TSESTree11 } from "@typescript-eslint/types";
23421
+ import { TSESTree as TSESTree12 } from "@typescript-eslint/types";
22673
23422
  var HOOK_NAME_PATTERN = /^use[A-Z]/;
22674
23423
  var COMPONENT_NAME_PATTERN2 = /^[A-Z]/;
22675
23424
  function isReactHook(name) {
@@ -22679,23 +23428,23 @@ function isComponent(name) {
22679
23428
  return COMPONENT_NAME_PATTERN2.test(name);
22680
23429
  }
22681
23430
  function isComponentOrHook(node) {
22682
- if (node.type === TSESTree11.AST_NODE_TYPES.FunctionDeclaration && node.id) {
23431
+ if (node.type === TSESTree12.AST_NODE_TYPES.FunctionDeclaration && node.id) {
22683
23432
  const { name } = node.id;
22684
23433
  return isComponent(name) || isReactHook(name);
22685
23434
  }
22686
- if (node.type === TSESTree11.AST_NODE_TYPES.FunctionExpression || node.type === TSESTree11.AST_NODE_TYPES.ArrowFunctionExpression) {
23435
+ if (node.type === TSESTree12.AST_NODE_TYPES.FunctionExpression || node.type === TSESTree12.AST_NODE_TYPES.ArrowFunctionExpression) {
22687
23436
  const { parent } = node;
22688
23437
  if (parent === undefined)
22689
23438
  return false;
22690
- if (parent.type === TSESTree11.AST_NODE_TYPES.VariableDeclarator && parent.id.type === TSESTree11.AST_NODE_TYPES.Identifier) {
23439
+ if (parent.type === TSESTree12.AST_NODE_TYPES.VariableDeclarator && parent.id.type === TSESTree12.AST_NODE_TYPES.Identifier) {
22691
23440
  const { name } = parent.id;
22692
23441
  return isComponent(name) || isReactHook(name);
22693
23442
  }
22694
- if (parent.type === TSESTree11.AST_NODE_TYPES.Property && parent.key.type === TSESTree11.AST_NODE_TYPES.Identifier) {
23443
+ if (parent.type === TSESTree12.AST_NODE_TYPES.Property && parent.key.type === TSESTree12.AST_NODE_TYPES.Identifier) {
22695
23444
  const { name } = parent.key;
22696
23445
  return isComponent(name) || isReactHook(name);
22697
23446
  }
22698
- if (parent.type === TSESTree11.AST_NODE_TYPES.MethodDefinition && parent.key.type === TSESTree11.AST_NODE_TYPES.Identifier) {
23447
+ if (parent.type === TSESTree12.AST_NODE_TYPES.MethodDefinition && parent.key.type === TSESTree12.AST_NODE_TYPES.Identifier) {
22699
23448
  const { name } = parent.key;
22700
23449
  return isComponent(name) || isReactHook(name);
22701
23450
  }
@@ -22704,17 +23453,17 @@ function isComponentOrHook(node) {
22704
23453
  }
22705
23454
  function isHookCall(node) {
22706
23455
  const { callee } = node;
22707
- if (callee.type === TSESTree11.AST_NODE_TYPES.Identifier)
23456
+ if (callee.type === TSESTree12.AST_NODE_TYPES.Identifier)
22708
23457
  return isReactHook(callee.name);
22709
- if (callee.type === TSESTree11.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree11.AST_NODE_TYPES.Identifier) {
23458
+ if (callee.type === TSESTree12.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree12.AST_NODE_TYPES.Identifier) {
22710
23459
  return isReactHook(callee.property.name);
22711
23460
  }
22712
23461
  return false;
22713
23462
  }
22714
23463
  var FUNCTION_BOUNDARIES2 = new Set([
22715
- TSESTree11.AST_NODE_TYPES.FunctionDeclaration,
22716
- TSESTree11.AST_NODE_TYPES.FunctionExpression,
22717
- TSESTree11.AST_NODE_TYPES.ArrowFunctionExpression
23464
+ TSESTree12.AST_NODE_TYPES.FunctionDeclaration,
23465
+ TSESTree12.AST_NODE_TYPES.FunctionExpression,
23466
+ TSESTree12.AST_NODE_TYPES.ArrowFunctionExpression
22718
23467
  ]);
22719
23468
  function isInFinallyBlock(node) {
22720
23469
  let current = node.parent;
@@ -22723,7 +23472,7 @@ function isInFinallyBlock(node) {
22723
23472
  for (let depth = 0;depth < maxDepth && current; depth += 1) {
22724
23473
  if (FUNCTION_BOUNDARIES2.has(current.type))
22725
23474
  break;
22726
- if (current.type === TSESTree11.AST_NODE_TYPES.TryStatement) {
23475
+ if (current.type === TSESTree12.AST_NODE_TYPES.TryStatement) {
22727
23476
  let checkNode = node;
22728
23477
  while (checkNode && checkNode !== current) {
22729
23478
  if (checkNode === current.finalizer) {
@@ -22771,14 +23520,14 @@ var useHookAtTopLevel = {
22771
23520
  if (ignoreHooks?.includes(hookName))
22772
23521
  return true;
22773
23522
  if (importSources && Object.keys(importSources).length > 0) {
22774
- if (node.callee.type === TSESTree11.AST_NODE_TYPES.MemberExpression) {
22775
- const objectName = node.callee.object.type === TSESTree11.AST_NODE_TYPES.Identifier ? node.callee.object.name : undefined;
23523
+ if (node.callee.type === TSESTree12.AST_NODE_TYPES.MemberExpression) {
23524
+ const objectName = node.callee.object.type === TSESTree12.AST_NODE_TYPES.Identifier ? node.callee.object.name : undefined;
22776
23525
  if (objectName && importSources[objectName] === false)
22777
23526
  return true;
22778
23527
  if (objectName && importSources[objectName] === true)
22779
23528
  return false;
22780
23529
  }
22781
- if (node.callee.type === TSESTree11.AST_NODE_TYPES.Identifier) {
23530
+ if (node.callee.type === TSESTree12.AST_NODE_TYPES.Identifier) {
22782
23531
  const importSource = importSourceMap.get(hookName);
22783
23532
  if (importSource && importSources[importSource] === false)
22784
23533
  return true;
@@ -22793,7 +23542,7 @@ var useHookAtTopLevel = {
22793
23542
  const current = getCurrentContext();
22794
23543
  const depth = current ? current.functionDepth + 1 : 0;
22795
23544
  const isComponentOrHookFlag = isComponentOrHook(functionNode);
22796
- if (functionNode.type === TSESTree11.AST_NODE_TYPES.FunctionDeclaration && functionNode.id) {
23545
+ if (functionNode.type === TSESTree12.AST_NODE_TYPES.FunctionDeclaration && functionNode.id) {
22797
23546
  currentFunctionName = functionNode.id.name;
22798
23547
  }
22799
23548
  if (current?.isComponentOrHook) {
@@ -22832,7 +23581,7 @@ var useHookAtTopLevel = {
22832
23581
  if (!isHookCall(callNode))
22833
23582
  return;
22834
23583
  const { callee } = callNode;
22835
- const hookName = callee.type === TSESTree11.AST_NODE_TYPES.Identifier ? callee.name : callee.type === TSESTree11.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree11.AST_NODE_TYPES.Identifier ? callee.property.name : undefined;
23584
+ const hookName = callee.type === TSESTree12.AST_NODE_TYPES.Identifier ? callee.name : callee.type === TSESTree12.AST_NODE_TYPES.MemberExpression && callee.property.type === TSESTree12.AST_NODE_TYPES.Identifier ? callee.property.name : undefined;
22836
23585
  if (!hookName || shouldIgnoreHook(hookName, callNode))
22837
23586
  return;
22838
23587
  const current = getCurrentContext();
@@ -22930,10 +23679,10 @@ var useHookAtTopLevel = {
22930
23679
  if (!configuration.importSources || Object.keys(configuration.importSources).length === 0)
22931
23680
  return;
22932
23681
  for (const specifier of importNode.specifiers) {
22933
- if (specifier.type !== TSESTree11.AST_NODE_TYPES.ImportSpecifier)
23682
+ if (specifier.type !== TSESTree12.AST_NODE_TYPES.ImportSpecifier)
22934
23683
  continue;
22935
23684
  const { imported } = specifier;
22936
- if (imported.type !== TSESTree11.AST_NODE_TYPES.Identifier)
23685
+ if (imported.type !== TSESTree12.AST_NODE_TYPES.Identifier)
22937
23686
  continue;
22938
23687
  if (isReactHook(imported.name))
22939
23688
  importSourceMap.set(specifier.local.name, source);
@@ -23106,6 +23855,12 @@ function createNoUselessUseSpringOptions(options3 = {}) {
23106
23855
  ...options3
23107
23856
  };
23108
23857
  }
23858
+ function createPreferPatternReplacementsOptions(patterns2 = []) {
23859
+ return { patterns: patterns2 };
23860
+ }
23861
+ function createRequireReactDisplayNamesOptions(options3 = {}) {
23862
+ return { environment: "roblox-ts", ...options3 };
23863
+ }
23109
23864
 
23110
23865
  // src/index.ts
23111
23866
  var rules = {
@@ -23127,6 +23882,7 @@ var rules = {
23127
23882
  "prefer-early-return": prefer_early_return_default,
23128
23883
  "prefer-module-scope-constants": prefer_module_scope_constants_default,
23129
23884
  "prefer-pascal-case-enums": prefer_pascal_case_enums_default,
23885
+ "prefer-pattern-replacements": prefer_pattern_replacements_default,
23130
23886
  "prefer-sequence-overloads": prefer_sequence_overloads_default,
23131
23887
  "prefer-singular-enums": prefer_singular_enums_default,
23132
23888
  "prefer-udim2-shorthand": prefer_udim2_shorthand_default,
@@ -23134,6 +23890,7 @@ var rules = {
23134
23890
  "require-named-effect-functions": require_named_effect_functions_default,
23135
23891
  "require-paired-calls": require_paired_calls_default,
23136
23892
  "require-react-component-keys": require_react_component_keys_default,
23893
+ "require-react-display-names": require_react_display_names_default,
23137
23894
  "strict-component-boundaries": strict_component_boundaries_default,
23138
23895
  "use-exhaustive-dependencies": use_exhaustive_dependencies_default,
23139
23896
  "use-hook-at-top-level": use_hook_at_top_level_default
@@ -23158,6 +23915,7 @@ var recommended = {
23158
23915
  "cease-nonsense/prefer-udim2-shorthand": "error",
23159
23916
  "cease-nonsense/require-named-effect-functions": "error",
23160
23917
  "cease-nonsense/require-react-component-keys": "error",
23918
+ "cease-nonsense/require-react-display-names": "error",
23161
23919
  "cease-nonsense/use-exhaustive-dependencies": "error",
23162
23920
  "cease-nonsense/use-hook-at-top-level": "error"
23163
23921
  }
@@ -23168,12 +23926,15 @@ var plugin = {
23168
23926
  };
23169
23927
  var src_default = plugin;
23170
23928
  export {
23929
+ pattern4 as pattern,
23171
23930
  defaultRobloxProfilePair,
23172
23931
  src_default as default,
23173
23932
  createUseHookAtTopLevelOptions,
23174
23933
  createUseExhaustiveDependenciesOptions,
23934
+ createRequireReactDisplayNamesOptions,
23175
23935
  createRequirePairedCallsOptions,
23176
23936
  createReactKeysOptions,
23937
+ createPreferPatternReplacementsOptions,
23177
23938
  createPairConfiguration,
23178
23939
  createNoUselessUseSpringOptions,
23179
23940
  createNoShorthandOptions,
@@ -23185,4 +23946,4 @@ export {
23185
23946
  createBanInstancesOptions
23186
23947
  };
23187
23948
 
23188
- //# debugId=CB943D9A894DADAF64756E2164756E21
23949
+ //# debugId=A19451816DAA8A5E64756E2164756E21