eslint-plugin-react-x 3.0.0-next.19 → 3.0.0-next.20

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 (2) hide show
  1. package/dist/index.js +458 -329
  2. package/package.json +7 -6
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ import { getConstrainedTypeAtLocation, isTypeReadonly } from "@typescript-eslint
13
13
  import { isPropertyReadonlyInType, unionConstituents } from "ts-api-utils";
14
14
  import { getStaticValue, isIdentifier, isVariableDeclarator } from "@typescript-eslint/utils/ast-utils";
15
15
  import { getTypeImmutability, isImmutable, isReadonlyDeep, isReadonlyShallow, isUnknown } from "is-immutable-type";
16
+ import { snakeCase } from "string-ts";
16
17
 
17
18
  //#region \0rolldown/runtime.js
18
19
  var __defProp = Object.defineProperty;
@@ -69,7 +70,7 @@ const rules$7 = {
69
70
  //#endregion
70
71
  //#region package.json
71
72
  var name$6 = "eslint-plugin-react-x";
72
- var version = "3.0.0-next.19";
73
+ var version = "3.0.0-next.20";
73
74
 
74
75
  //#endregion
75
76
  //#region src/utils/create-rule.ts
@@ -226,7 +227,7 @@ function getTypeVariants(types) {
226
227
 
227
228
  //#endregion
228
229
  //#region src/rules/component-hook-factories.ts
229
- const RULE_NAME$65 = "component-hook-factories";
230
+ const RULE_NAME$66 = "component-hook-factories";
230
231
  var component_hook_factories_default = createRule({
231
232
  meta: {
232
233
  type: "problem",
@@ -237,11 +238,11 @@ var component_hook_factories_default = createRule({
237
238
  },
238
239
  schema: []
239
240
  },
240
- name: RULE_NAME$65,
241
- create: create$65,
241
+ name: RULE_NAME$66,
242
+ create: create$66,
242
243
  defaultOptions: []
243
244
  });
244
- function create$65(context) {
245
+ function create$66(context) {
245
246
  const hint = core.ComponentDetectionHint.DoNotIncludeJsxWithNumberValue | core.ComponentDetectionHint.DoNotIncludeJsxWithBooleanValue | core.ComponentDetectionHint.DoNotIncludeJsxWithNullValue | core.ComponentDetectionHint.DoNotIncludeJsxWithStringValue | core.ComponentDetectionHint.DoNotIncludeJsxWithUndefinedValue | core.ComponentDetectionHint.RequireBothSidesOfLogicalExpressionToBeJsx | core.ComponentDetectionHint.RequireBothBranchesOfConditionalExpressionToBeJsx | core.ComponentDetectionHint.DoNotIncludeFunctionDefinedInArrayPattern | core.ComponentDetectionHint.DoNotIncludeFunctionDefinedInArrayExpression | core.ComponentDetectionHint.DoNotIncludeFunctionDefinedAsArrayMapCallback;
246
247
  const fCollector = core.useComponentCollector(context, { hint });
247
248
  const cCollector = core.useComponentCollectorLegacy(context);
@@ -285,7 +286,7 @@ function create$65(context) {
285
286
 
286
287
  //#endregion
287
288
  //#region src/rules/error-boundaries.ts
288
- const RULE_NAME$64 = "error-boundaries";
289
+ const RULE_NAME$65 = "error-boundaries";
289
290
  var error_boundaries_default = createRule({
290
291
  meta: {
291
292
  type: "problem",
@@ -296,11 +297,11 @@ var error_boundaries_default = createRule({
296
297
  },
297
298
  schema: []
298
299
  },
299
- name: RULE_NAME$64,
300
- create: create$64,
300
+ name: RULE_NAME$65,
301
+ create: create$65,
301
302
  defaultOptions: []
302
303
  });
303
- function create$64(context) {
304
+ function create$65(context) {
304
305
  if (!context.sourceCode.text.includes("try")) return {};
305
306
  const { ctx, visitor } = core.useComponentCollector(context);
306
307
  const reported = /* @__PURE__ */ new Set();
@@ -334,7 +335,7 @@ function create$64(context) {
334
335
 
335
336
  //#endregion
336
337
  //#region src/rules/exhaustive-deps.ts
337
- const RULE_NAME$63 = "exhaustive-deps";
338
+ const RULE_NAME$64 = "exhaustive-deps";
338
339
  /**
339
340
  * Built-in hooks that accept dependency arrays.
340
341
  * Maps hook name to the index of the callback argument.
@@ -513,11 +514,11 @@ var exhaustive_deps_default = createRule({
513
514
  properties: { additionalHooks: { type: "string" } }
514
515
  }]
515
516
  },
516
- name: RULE_NAME$63,
517
- create: create$63,
517
+ name: RULE_NAME$64,
518
+ create: create$64,
518
519
  defaultOptions: [{}]
519
520
  });
520
- function create$63(context) {
521
+ function create$64(context) {
521
522
  const additionalHooks = context.options[0]?.additionalHooks;
522
523
  const additionalHooksRegex = additionalHooks != null && additionalHooks.length > 0 ? new RegExp(additionalHooks) : null;
523
524
  /** Collected hook calls for later analysis. */
@@ -729,7 +730,7 @@ function create$63(context) {
729
730
 
730
731
  //#endregion
731
732
  //#region src/rules/jsx-dollar.ts
732
- const RULE_NAME$62 = "jsx-dollar";
733
+ const RULE_NAME$63 = "jsx-dollar";
733
734
  var jsx_dollar_default = createRule({
734
735
  meta: {
735
736
  type: "problem",
@@ -742,11 +743,11 @@ var jsx_dollar_default = createRule({
742
743
  },
743
744
  schema: []
744
745
  },
745
- name: RULE_NAME$62,
746
- create: create$62,
746
+ name: RULE_NAME$63,
747
+ create: create$63,
747
748
  defaultOptions: []
748
749
  });
749
- function create$62(context) {
750
+ function create$63(context) {
750
751
  /**
751
752
  * Visitor function for JSXElement and JSXFragment nodes
752
753
  * @param node The JSXElement or JSXFragment node to be checked
@@ -787,7 +788,7 @@ function create$62(context) {
787
788
 
788
789
  //#endregion
789
790
  //#region src/rules/jsx-key-before-spread.ts
790
- const RULE_NAME$61 = "jsx-key-before-spread";
791
+ const RULE_NAME$62 = "jsx-key-before-spread";
791
792
  var jsx_key_before_spread_default = createRule({
792
793
  meta: {
793
794
  type: "problem",
@@ -795,11 +796,11 @@ var jsx_key_before_spread_default = createRule({
795
796
  messages: { default: "The 'key' prop must be placed before any spread props when using the new JSX transform." },
796
797
  schema: []
797
798
  },
798
- name: RULE_NAME$61,
799
- create: create$61,
799
+ name: RULE_NAME$62,
800
+ create: create$62,
800
801
  defaultOptions: []
801
802
  });
802
- function create$61(context) {
803
+ function create$62(context) {
803
804
  const { jsx } = {
804
805
  ...core.getJsxConfigFromContext(context),
805
806
  ...core.getJsxConfigFromAnnotation(context)
@@ -823,7 +824,7 @@ function create$61(context) {
823
824
 
824
825
  //#endregion
825
826
  //#region src/rules/jsx-no-comment-textnodes.ts
826
- const RULE_NAME$60 = "jsx-no-comment-textnodes";
827
+ const RULE_NAME$61 = "jsx-no-comment-textnodes";
827
828
  var jsx_no_comment_textnodes_default = createRule({
828
829
  meta: {
829
830
  type: "problem",
@@ -831,11 +832,11 @@ var jsx_no_comment_textnodes_default = createRule({
831
832
  messages: { default: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces." },
832
833
  schema: []
833
834
  },
834
- name: RULE_NAME$60,
835
- create: create$60,
835
+ name: RULE_NAME$61,
836
+ create: create$61,
836
837
  defaultOptions: []
837
838
  });
838
- function create$60(context) {
839
+ function create$61(context) {
839
840
  function hasCommentLike(node) {
840
841
  if (ast.isOneOf([AST_NODE_TYPES.JSXAttribute, AST_NODE_TYPES.JSXExpressionContainer])(node.parent)) return false;
841
842
  return /^\s*\/(?:\/|\*)/mu.test(context.sourceCode.getText(node));
@@ -856,7 +857,7 @@ function create$60(context) {
856
857
 
857
858
  //#endregion
858
859
  //#region src/rules/jsx-no-duplicate-props.ts
859
- const RULE_NAME$59 = "jsx-no-duplicate-props";
860
+ const RULE_NAME$60 = "jsx-no-duplicate-props";
860
861
  var jsx_no_duplicate_props_default = createRule({
861
862
  meta: {
862
863
  type: "problem",
@@ -864,11 +865,11 @@ var jsx_no_duplicate_props_default = createRule({
864
865
  messages: { default: "This JSX property is assigned multiple times." },
865
866
  schema: []
866
867
  },
867
- name: RULE_NAME$59,
868
- create: create$59,
868
+ name: RULE_NAME$60,
869
+ create: create$60,
869
870
  defaultOptions: []
870
871
  });
871
- function create$59(context) {
872
+ function create$60(context) {
872
873
  return defineRuleListener({ JSXOpeningElement(node) {
873
874
  const props = [];
874
875
  for (const attr of node.attributes) {
@@ -889,7 +890,7 @@ function create$59(context) {
889
890
 
890
891
  //#endregion
891
892
  //#region src/rules/jsx-no-undef.ts
892
- const RULE_NAME$58 = "jsx-no-undef";
893
+ const RULE_NAME$59 = "jsx-no-undef";
893
894
  var jsx_no_undef_default = createRule({
894
895
  meta: {
895
896
  type: "problem",
@@ -897,11 +898,11 @@ var jsx_no_undef_default = createRule({
897
898
  messages: { default: "JSX variable '{{name}}' is not defined." },
898
899
  schema: []
899
900
  },
900
- name: RULE_NAME$58,
901
- create: create$58,
901
+ name: RULE_NAME$59,
902
+ create: create$59,
902
903
  defaultOptions: []
903
904
  });
904
- function create$58(context) {
905
+ function create$59(context) {
905
906
  return defineRuleListener({ JSXOpeningElement(node) {
906
907
  const name = match(node.name).with({ type: AST_NODE_TYPES.JSXIdentifier }, (n) => n.name).with({
907
908
  type: AST_NODE_TYPES.JSXMemberExpression,
@@ -920,9 +921,9 @@ function create$58(context) {
920
921
 
921
922
  //#endregion
922
923
  //#region src/rules/jsx-shorthand-boolean.ts
923
- const RULE_NAME$57 = "jsx-shorthand-boolean";
924
- const defaultOptions$3 = [1];
925
- const schema$3 = [{
924
+ const RULE_NAME$58 = "jsx-shorthand-boolean";
925
+ const defaultOptions$4 = [1];
926
+ const schema$4 = [{
926
927
  type: "integer",
927
928
  enum: [-1, 1]
928
929
  }];
@@ -932,14 +933,14 @@ var jsx_shorthand_boolean_default = createRule({
932
933
  docs: { description: "Enforces shorthand syntax for boolean props." },
933
934
  fixable: "code",
934
935
  messages: { default: "{{message}}" },
935
- schema: schema$3
936
+ schema: schema$4
936
937
  },
937
- name: RULE_NAME$57,
938
- create: create$57,
939
- defaultOptions: defaultOptions$3
938
+ name: RULE_NAME$58,
939
+ create: create$58,
940
+ defaultOptions: defaultOptions$4
940
941
  });
941
- function create$57(context) {
942
- const policy = context.options[0] ?? defaultOptions$3[0];
942
+ function create$58(context) {
943
+ const policy = context.options[0] ?? defaultOptions$4[0];
943
944
  return defineRuleListener({ JSXAttribute(node) {
944
945
  const { value } = node;
945
946
  const propName = core.getJsxAttributeName(context, node);
@@ -966,9 +967,9 @@ function create$57(context) {
966
967
 
967
968
  //#endregion
968
969
  //#region src/rules/jsx-shorthand-fragment.ts
969
- const RULE_NAME$56 = "jsx-shorthand-fragment";
970
- const defaultOptions$2 = [1];
971
- const schema$2 = [{
970
+ const RULE_NAME$57 = "jsx-shorthand-fragment";
971
+ const defaultOptions$3 = [1];
972
+ const schema$3 = [{
972
973
  type: "integer",
973
974
  enum: [-1, 1]
974
975
  }];
@@ -978,14 +979,14 @@ var jsx_shorthand_fragment_default = createRule({
978
979
  docs: { description: "Enforces shorthand syntax for fragment elements." },
979
980
  fixable: "code",
980
981
  messages: { default: "{{message}}" },
981
- schema: schema$2
982
+ schema: schema$3
982
983
  },
983
- name: RULE_NAME$56,
984
- create: create$56,
985
- defaultOptions: defaultOptions$2
984
+ name: RULE_NAME$57,
985
+ create: create$57,
986
+ defaultOptions: defaultOptions$3
986
987
  });
987
- function create$56(context) {
988
- const policy = context.options[0] ?? defaultOptions$2[0];
988
+ function create$57(context) {
989
+ const policy = context.options[0] ?? defaultOptions$3[0];
989
990
  const jsxConfig = {
990
991
  ...core.getJsxConfigFromContext(context),
991
992
  ...core.getJsxConfigFromAnnotation(context)
@@ -1019,7 +1020,7 @@ function create$56(context) {
1019
1020
 
1020
1021
  //#endregion
1021
1022
  //#region src/rules/jsx-uses-react.ts
1022
- const RULE_NAME$55 = "jsx-uses-react";
1023
+ const RULE_NAME$56 = "jsx-uses-react";
1023
1024
  var jsx_uses_react_default = createRule({
1024
1025
  meta: {
1025
1026
  type: "problem",
@@ -1027,11 +1028,11 @@ var jsx_uses_react_default = createRule({
1027
1028
  messages: { default: "Marked {{name}} as used." },
1028
1029
  schema: []
1029
1030
  },
1030
- name: RULE_NAME$55,
1031
- create: create$55,
1031
+ name: RULE_NAME$56,
1032
+ create: create$56,
1032
1033
  defaultOptions: []
1033
1034
  });
1034
- function create$55(context) {
1035
+ function create$56(context) {
1035
1036
  const { jsx, jsxFactory, jsxFragmentFactory } = {
1036
1037
  ...core.getJsxConfigFromContext(context),
1037
1038
  ...core.getJsxConfigFromAnnotation(context)
@@ -1062,7 +1063,7 @@ function debugReport(context, node, name) {
1062
1063
 
1063
1064
  //#endregion
1064
1065
  //#region src/rules/jsx-uses-vars.ts
1065
- const RULE_NAME$54 = "jsx-uses-vars";
1066
+ const RULE_NAME$55 = "jsx-uses-vars";
1066
1067
  var jsx_uses_vars_default = createRule({
1067
1068
  meta: {
1068
1069
  type: "problem",
@@ -1070,11 +1071,11 @@ var jsx_uses_vars_default = createRule({
1070
1071
  messages: { default: "An identifier in JSX is marked as used." },
1071
1072
  schema: []
1072
1073
  },
1073
- name: RULE_NAME$54,
1074
- create: create$54,
1074
+ name: RULE_NAME$55,
1075
+ create: create$55,
1075
1076
  defaultOptions: []
1076
1077
  });
1077
- function create$54(context) {
1078
+ function create$55(context) {
1078
1079
  return defineRuleListener({ JSXOpeningElement(node) {
1079
1080
  switch (node.name.type) {
1080
1081
  case AST_NODE_TYPES.JSXIdentifier:
@@ -1092,7 +1093,7 @@ function create$54(context) {
1092
1093
 
1093
1094
  //#endregion
1094
1095
  //#region src/rules/no-access-state-in-setstate.ts
1095
- const RULE_NAME$53 = "no-access-state-in-setstate";
1096
+ const RULE_NAME$54 = "no-access-state-in-setstate";
1096
1097
  function isKeyLiteral$2(node, key) {
1097
1098
  return match(key).with({ type: AST_NODE_TYPES.Literal }, constTrue).with({
1098
1099
  type: AST_NODE_TYPES.TemplateLiteral,
@@ -1106,11 +1107,11 @@ var no_access_state_in_setstate_default = createRule({
1106
1107
  messages: { default: "Do not access 'this.state' within 'setState'. Use the update function instead." },
1107
1108
  schema: []
1108
1109
  },
1109
- name: RULE_NAME$53,
1110
- create: create$53,
1110
+ name: RULE_NAME$54,
1111
+ create: create$54,
1111
1112
  defaultOptions: []
1112
1113
  });
1113
- function create$53(context) {
1114
+ function create$54(context) {
1114
1115
  if (!context.sourceCode.text.includes("setState")) return {};
1115
1116
  const classStack = [];
1116
1117
  const methodStack = [];
@@ -1181,7 +1182,7 @@ function create$53(context) {
1181
1182
 
1182
1183
  //#endregion
1183
1184
  //#region src/rules/no-array-index-key.ts
1184
- const RULE_NAME$52 = "no-array-index-key";
1185
+ const RULE_NAME$53 = "no-array-index-key";
1185
1186
  const REACT_CHILDREN_METHOD = ["forEach", "map"];
1186
1187
  function getIndexParamPosition(methodName) {
1187
1188
  switch (methodName) {
@@ -1240,11 +1241,11 @@ var no_array_index_key_default = createRule({
1240
1241
  messages: { default: "Do not use item index in the array as its key." },
1241
1242
  schema: []
1242
1243
  },
1243
- name: RULE_NAME$52,
1244
- create: create$52,
1244
+ name: RULE_NAME$53,
1245
+ create: create$53,
1245
1246
  defaultOptions: []
1246
1247
  });
1247
- function create$52(context) {
1248
+ function create$53(context) {
1248
1249
  const indexParamNames = [];
1249
1250
  function isArrayIndex(node) {
1250
1251
  return node.type === AST_NODE_TYPES.Identifier && indexParamNames.some((name) => name != null && name === node.name);
@@ -1310,7 +1311,7 @@ function create$52(context) {
1310
1311
 
1311
1312
  //#endregion
1312
1313
  //#region src/rules/no-children-count.ts
1313
- const RULE_NAME$51 = "no-children-count";
1314
+ const RULE_NAME$52 = "no-children-count";
1314
1315
  var no_children_count_default = createRule({
1315
1316
  meta: {
1316
1317
  type: "problem",
@@ -1318,11 +1319,11 @@ var no_children_count_default = createRule({
1318
1319
  messages: { default: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead." },
1319
1320
  schema: []
1320
1321
  },
1321
- name: RULE_NAME$51,
1322
- create: create$51,
1322
+ name: RULE_NAME$52,
1323
+ create: create$52,
1323
1324
  defaultOptions: []
1324
1325
  });
1325
- function create$51(context) {
1326
+ function create$52(context) {
1326
1327
  return defineRuleListener({ MemberExpression(node) {
1327
1328
  if (core.isChildrenCount(context, node)) context.report({
1328
1329
  messageId: "default",
@@ -1333,7 +1334,7 @@ function create$51(context) {
1333
1334
 
1334
1335
  //#endregion
1335
1336
  //#region src/rules/no-children-for-each.ts
1336
- const RULE_NAME$50 = "no-children-for-each";
1337
+ const RULE_NAME$51 = "no-children-for-each";
1337
1338
  var no_children_for_each_default = createRule({
1338
1339
  meta: {
1339
1340
  type: "problem",
@@ -1341,11 +1342,11 @@ var no_children_for_each_default = createRule({
1341
1342
  messages: { default: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead." },
1342
1343
  schema: []
1343
1344
  },
1344
- name: RULE_NAME$50,
1345
- create: create$50,
1345
+ name: RULE_NAME$51,
1346
+ create: create$51,
1346
1347
  defaultOptions: []
1347
1348
  });
1348
- function create$50(context) {
1349
+ function create$51(context) {
1349
1350
  return defineRuleListener({ MemberExpression(node) {
1350
1351
  if (core.isChildrenForEach(context, node)) context.report({
1351
1352
  messageId: "default",
@@ -1356,7 +1357,7 @@ function create$50(context) {
1356
1357
 
1357
1358
  //#endregion
1358
1359
  //#region src/rules/no-children-map.ts
1359
- const RULE_NAME$49 = "no-children-map";
1360
+ const RULE_NAME$50 = "no-children-map";
1360
1361
  var no_children_map_default = createRule({
1361
1362
  meta: {
1362
1363
  type: "problem",
@@ -1364,11 +1365,11 @@ var no_children_map_default = createRule({
1364
1365
  messages: { default: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead." },
1365
1366
  schema: []
1366
1367
  },
1367
- name: RULE_NAME$49,
1368
- create: create$49,
1368
+ name: RULE_NAME$50,
1369
+ create: create$50,
1369
1370
  defaultOptions: []
1370
1371
  });
1371
- function create$49(context) {
1372
+ function create$50(context) {
1372
1373
  return defineRuleListener({ MemberExpression(node) {
1373
1374
  if (core.isChildrenMap(context, node)) context.report({
1374
1375
  messageId: "default",
@@ -1379,7 +1380,7 @@ function create$49(context) {
1379
1380
 
1380
1381
  //#endregion
1381
1382
  //#region src/rules/no-children-only.ts
1382
- const RULE_NAME$48 = "no-children-only";
1383
+ const RULE_NAME$49 = "no-children-only";
1383
1384
  var no_children_only_default = createRule({
1384
1385
  meta: {
1385
1386
  type: "problem",
@@ -1387,11 +1388,11 @@ var no_children_only_default = createRule({
1387
1388
  messages: { default: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead." },
1388
1389
  schema: []
1389
1390
  },
1390
- name: RULE_NAME$48,
1391
- create: create$48,
1391
+ name: RULE_NAME$49,
1392
+ create: create$49,
1392
1393
  defaultOptions: []
1393
1394
  });
1394
- function create$48(context) {
1395
+ function create$49(context) {
1395
1396
  return defineRuleListener({ MemberExpression(node) {
1396
1397
  if (core.isChildrenOnly(context, node)) context.report({
1397
1398
  messageId: "default",
@@ -1402,7 +1403,7 @@ function create$48(context) {
1402
1403
 
1403
1404
  //#endregion
1404
1405
  //#region src/rules/no-children-prop.ts
1405
- const RULE_NAME$47 = "no-children-prop";
1406
+ const RULE_NAME$48 = "no-children-prop";
1406
1407
  var no_children_prop_default = createRule({
1407
1408
  meta: {
1408
1409
  type: "problem",
@@ -1410,11 +1411,11 @@ var no_children_prop_default = createRule({
1410
1411
  messages: { default: "Do not pass 'children' as props." },
1411
1412
  schema: []
1412
1413
  },
1413
- name: RULE_NAME$47,
1414
- create: create$47,
1414
+ name: RULE_NAME$48,
1415
+ create: create$48,
1415
1416
  defaultOptions: []
1416
1417
  });
1417
- function create$47(context) {
1418
+ function create$48(context) {
1418
1419
  return defineRuleListener({ JSXElement(node) {
1419
1420
  const childrenProp = core.getJsxAttribute(context, node)("children");
1420
1421
  if (childrenProp != null) context.report({
@@ -1426,7 +1427,7 @@ function create$47(context) {
1426
1427
 
1427
1428
  //#endregion
1428
1429
  //#region src/rules/no-children-to-array.ts
1429
- const RULE_NAME$46 = "no-children-to-array";
1430
+ const RULE_NAME$47 = "no-children-to-array";
1430
1431
  var no_children_to_array_default = createRule({
1431
1432
  meta: {
1432
1433
  type: "problem",
@@ -1434,11 +1435,11 @@ var no_children_to_array_default = createRule({
1434
1435
  messages: { default: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead." },
1435
1436
  schema: []
1436
1437
  },
1437
- name: RULE_NAME$46,
1438
- create: create$46,
1438
+ name: RULE_NAME$47,
1439
+ create: create$47,
1439
1440
  defaultOptions: []
1440
1441
  });
1441
- function create$46(context) {
1442
+ function create$47(context) {
1442
1443
  return defineRuleListener({ MemberExpression(node) {
1443
1444
  if (core.isChildrenToArray(context, node)) context.report({
1444
1445
  messageId: "default",
@@ -1449,7 +1450,7 @@ function create$46(context) {
1449
1450
 
1450
1451
  //#endregion
1451
1452
  //#region src/rules/no-class-component.ts
1452
- const RULE_NAME$45 = "no-class-component";
1453
+ const RULE_NAME$46 = "no-class-component";
1453
1454
  var no_class_component_default = createRule({
1454
1455
  meta: {
1455
1456
  type: "problem",
@@ -1457,11 +1458,11 @@ var no_class_component_default = createRule({
1457
1458
  messages: { default: "Avoid using class components. Use function components instead." },
1458
1459
  schema: []
1459
1460
  },
1460
- name: RULE_NAME$45,
1461
- create: create$45,
1461
+ name: RULE_NAME$46,
1462
+ create: create$46,
1462
1463
  defaultOptions: []
1463
1464
  });
1464
- function create$45(context) {
1465
+ function create$46(context) {
1465
1466
  if (!context.sourceCode.text.includes("Component")) return {};
1466
1467
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
1467
1468
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -1478,7 +1479,7 @@ function create$45(context) {
1478
1479
 
1479
1480
  //#endregion
1480
1481
  //#region src/rules/no-clone-element.ts
1481
- const RULE_NAME$44 = "no-clone-element";
1482
+ const RULE_NAME$45 = "no-clone-element";
1482
1483
  var no_clone_element_default = createRule({
1483
1484
  meta: {
1484
1485
  type: "problem",
@@ -1486,11 +1487,11 @@ var no_clone_element_default = createRule({
1486
1487
  messages: { default: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead." },
1487
1488
  schema: []
1488
1489
  },
1489
- name: RULE_NAME$44,
1490
- create: create$44,
1490
+ name: RULE_NAME$45,
1491
+ create: create$45,
1491
1492
  defaultOptions: []
1492
1493
  });
1493
- function create$44(context) {
1494
+ function create$45(context) {
1494
1495
  return defineRuleListener({ CallExpression(node) {
1495
1496
  if (core.isCloneElementCall(context, node)) context.report({
1496
1497
  messageId: "default",
@@ -1501,7 +1502,7 @@ function create$44(context) {
1501
1502
 
1502
1503
  //#endregion
1503
1504
  //#region src/rules/no-component-will-mount.ts
1504
- const RULE_NAME$43 = "no-component-will-mount";
1505
+ const RULE_NAME$44 = "no-component-will-mount";
1505
1506
  var no_component_will_mount_default = createRule({
1506
1507
  meta: {
1507
1508
  type: "problem",
@@ -1510,11 +1511,11 @@ var no_component_will_mount_default = createRule({
1510
1511
  messages: { default: "[Deprecated] Use 'UNSAFE_componentWillMount' instead." },
1511
1512
  schema: []
1512
1513
  },
1513
- name: RULE_NAME$43,
1514
- create: create$43,
1514
+ name: RULE_NAME$44,
1515
+ create: create$44,
1515
1516
  defaultOptions: []
1516
1517
  });
1517
- function create$43(context) {
1518
+ function create$44(context) {
1518
1519
  if (!context.sourceCode.text.includes("componentWillMount")) return {};
1519
1520
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
1520
1521
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -1534,7 +1535,7 @@ function create$43(context) {
1534
1535
 
1535
1536
  //#endregion
1536
1537
  //#region src/rules/no-component-will-receive-props.ts
1537
- const RULE_NAME$42 = "no-component-will-receive-props";
1538
+ const RULE_NAME$43 = "no-component-will-receive-props";
1538
1539
  var no_component_will_receive_props_default = createRule({
1539
1540
  meta: {
1540
1541
  type: "problem",
@@ -1543,11 +1544,11 @@ var no_component_will_receive_props_default = createRule({
1543
1544
  messages: { default: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead." },
1544
1545
  schema: []
1545
1546
  },
1546
- name: RULE_NAME$42,
1547
- create: create$42,
1547
+ name: RULE_NAME$43,
1548
+ create: create$43,
1548
1549
  defaultOptions: []
1549
1550
  });
1550
- function create$42(context) {
1551
+ function create$43(context) {
1551
1552
  if (!context.sourceCode.text.includes("componentWillReceiveProps")) return {};
1552
1553
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
1553
1554
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -1567,7 +1568,7 @@ function create$42(context) {
1567
1568
 
1568
1569
  //#endregion
1569
1570
  //#region src/rules/no-component-will-update.ts
1570
- const RULE_NAME$41 = "no-component-will-update";
1571
+ const RULE_NAME$42 = "no-component-will-update";
1571
1572
  var no_component_will_update_default = createRule({
1572
1573
  meta: {
1573
1574
  type: "problem",
@@ -1576,11 +1577,11 @@ var no_component_will_update_default = createRule({
1576
1577
  messages: { default: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead." },
1577
1578
  schema: []
1578
1579
  },
1579
- name: RULE_NAME$41,
1580
- create: create$41,
1580
+ name: RULE_NAME$42,
1581
+ create: create$42,
1581
1582
  defaultOptions: []
1582
1583
  });
1583
- function create$41(context) {
1584
+ function create$42(context) {
1584
1585
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
1585
1586
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
1586
1587
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -1600,7 +1601,7 @@ function create$41(context) {
1600
1601
 
1601
1602
  //#endregion
1602
1603
  //#region src/rules/no-context-provider.ts
1603
- const RULE_NAME$40 = "no-context-provider";
1604
+ const RULE_NAME$41 = "no-context-provider";
1604
1605
  var no_context_provider_default = createRule({
1605
1606
  meta: {
1606
1607
  type: "problem",
@@ -1609,11 +1610,11 @@ var no_context_provider_default = createRule({
1609
1610
  messages: { default: "In React 19, you can render '<Context>' as a provider instead of '<Context.Provider>'." },
1610
1611
  schema: []
1611
1612
  },
1612
- name: RULE_NAME$40,
1613
- create: create$40,
1613
+ name: RULE_NAME$41,
1614
+ create: create$41,
1614
1615
  defaultOptions: []
1615
1616
  });
1616
- function create$40(context) {
1617
+ function create$41(context) {
1617
1618
  if (!context.sourceCode.text.includes("Provider")) return {};
1618
1619
  const { version } = getSettingsFromContext(context);
1619
1620
  if (compare(version, "19.0.0", "<")) return {};
@@ -1640,7 +1641,7 @@ function create$40(context) {
1640
1641
 
1641
1642
  //#endregion
1642
1643
  //#region src/rules/no-create-ref.ts
1643
- const RULE_NAME$39 = "no-create-ref";
1644
+ const RULE_NAME$40 = "no-create-ref";
1644
1645
  var no_create_ref_default = createRule({
1645
1646
  meta: {
1646
1647
  type: "problem",
@@ -1648,11 +1649,11 @@ var no_create_ref_default = createRule({
1648
1649
  messages: { default: "[Deprecated] Use 'useRef' instead." },
1649
1650
  schema: []
1650
1651
  },
1651
- name: RULE_NAME$39,
1652
- create: create$39,
1652
+ name: RULE_NAME$40,
1653
+ create: create$40,
1653
1654
  defaultOptions: []
1654
1655
  });
1655
- function create$39(context) {
1656
+ function create$40(context) {
1656
1657
  return defineRuleListener({ CallExpression(node) {
1657
1658
  if (core.isCreateRefCall(context, node) && ast.findParentNode(node, core.isClassComponent) == null) context.report({
1658
1659
  messageId: "default",
@@ -1663,7 +1664,7 @@ function create$39(context) {
1663
1664
 
1664
1665
  //#endregion
1665
1666
  //#region src/rules/no-direct-mutation-state.ts
1666
- const RULE_NAME$38 = "no-direct-mutation-state";
1667
+ const RULE_NAME$39 = "no-direct-mutation-state";
1667
1668
  function isConstructorFunction(node) {
1668
1669
  return ast.isOneOf([AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.FunctionExpression])(node) && ast.isMethodOrProperty(node.parent) && node.parent.key.type === AST_NODE_TYPES.Identifier && node.parent.key.name === "constructor";
1669
1670
  }
@@ -1674,11 +1675,11 @@ var no_direct_mutation_state_default = createRule({
1674
1675
  messages: { default: "Do not mutate state directly. Use 'setState()' instead." },
1675
1676
  schema: []
1676
1677
  },
1677
- name: RULE_NAME$38,
1678
- create: create$38,
1678
+ name: RULE_NAME$39,
1679
+ create: create$39,
1679
1680
  defaultOptions: []
1680
1681
  });
1681
- function create$38(context) {
1682
+ function create$39(context) {
1682
1683
  return defineRuleListener({ AssignmentExpression(node) {
1683
1684
  if (!core.isAssignmentToThisState(node)) return;
1684
1685
  const parentClass = ast.findParentNode(node, ast.isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression]));
@@ -1692,7 +1693,7 @@ function create$38(context) {
1692
1693
 
1693
1694
  //#endregion
1694
1695
  //#region src/rules/no-duplicate-key.ts
1695
- const RULE_NAME$37 = "no-duplicate-key";
1696
+ const RULE_NAME$38 = "no-duplicate-key";
1696
1697
  var no_duplicate_key_default = createRule({
1697
1698
  meta: {
1698
1699
  type: "problem",
@@ -1700,11 +1701,11 @@ var no_duplicate_key_default = createRule({
1700
1701
  messages: { default: "The 'key' prop must be unique to its sibling elements." },
1701
1702
  schema: []
1702
1703
  },
1703
- name: RULE_NAME$37,
1704
- create: create$37,
1704
+ name: RULE_NAME$38,
1705
+ create: create$38,
1705
1706
  defaultOptions: []
1706
1707
  });
1707
- function create$37(context) {
1708
+ function create$38(context) {
1708
1709
  if (!context.sourceCode.text.includes("key=")) return {};
1709
1710
  const keyedEntries = /* @__PURE__ */ new Map();
1710
1711
  function isKeyValueEqual(a, b) {
@@ -1759,7 +1760,7 @@ function create$37(context) {
1759
1760
 
1760
1761
  //#endregion
1761
1762
  //#region src/rules/no-forward-ref.ts
1762
- const RULE_NAME$36 = "no-forward-ref";
1763
+ const RULE_NAME$37 = "no-forward-ref";
1763
1764
  var no_forward_ref_default = createRule({
1764
1765
  meta: {
1765
1766
  type: "problem",
@@ -1768,11 +1769,11 @@ var no_forward_ref_default = createRule({
1768
1769
  messages: { default: "In React 19, 'forwardRef' is no longer necessary. Pass 'ref' as a prop instead." },
1769
1770
  schema: []
1770
1771
  },
1771
- name: RULE_NAME$36,
1772
- create: create$36,
1772
+ name: RULE_NAME$37,
1773
+ create: create$37,
1773
1774
  defaultOptions: []
1774
1775
  });
1775
- function create$36(context) {
1776
+ function create$37(context) {
1776
1777
  if (!context.sourceCode.text.includes("forwardRef")) return {};
1777
1778
  const { version } = getSettingsFromContext(context);
1778
1779
  if (compare(version, "19.0.0", "<")) return {};
@@ -1867,7 +1868,7 @@ function getComponentPropsFixes(context, fixer, node, typeArguments) {
1867
1868
 
1868
1869
  //#endregion
1869
1870
  //#region src/rules/no-implicit-key.ts
1870
- const RULE_NAME$35 = "no-implicit-key";
1871
+ const RULE_NAME$36 = "no-implicit-key";
1871
1872
  var no_implicit_key_default = createRule({
1872
1873
  meta: {
1873
1874
  type: "problem",
@@ -1875,11 +1876,11 @@ var no_implicit_key_default = createRule({
1875
1876
  messages: { default: "This spread attribute implicitly passes the 'key' prop to a component, this could lead to unexpected behavior. If you intend to pass the 'key' prop, use 'key={value}'." },
1876
1877
  schema: []
1877
1878
  },
1878
- name: RULE_NAME$35,
1879
- create: create$35,
1879
+ name: RULE_NAME$36,
1880
+ create: create$36,
1880
1881
  defaultOptions: []
1881
1882
  });
1882
- function create$35(context) {
1883
+ function create$36(context) {
1883
1884
  const services = ESLintUtils.getParserServices(context, false);
1884
1885
  const checker = services.program.getTypeChecker();
1885
1886
  return defineRuleListener({ JSXSpreadAttribute(node) {
@@ -1897,7 +1898,7 @@ function create$35(context) {
1897
1898
 
1898
1899
  //#endregion
1899
1900
  //#region src/rules/no-leaked-conditional-rendering.ts
1900
- const RULE_NAME$34 = "no-leaked-conditional-rendering";
1901
+ const RULE_NAME$35 = "no-leaked-conditional-rendering";
1901
1902
  var no_leaked_conditional_rendering_default = createRule({
1902
1903
  meta: {
1903
1904
  type: "problem",
@@ -1905,11 +1906,11 @@ var no_leaked_conditional_rendering_default = createRule({
1905
1906
  messages: { default: "Potential leaked value {{value}} that might cause unintentionally rendered values or rendering crashes." },
1906
1907
  schema: []
1907
1908
  },
1908
- name: RULE_NAME$34,
1909
- create: create$34,
1909
+ name: RULE_NAME$35,
1910
+ create: create$35,
1910
1911
  defaultOptions: []
1911
1912
  });
1912
- function create$34(context) {
1913
+ function create$35(context) {
1913
1914
  if (!context.sourceCode.text.includes("&&")) return {};
1914
1915
  const { version } = getSettingsFromContext(context);
1915
1916
  const allowedVariants = [
@@ -1966,7 +1967,7 @@ function create$34(context) {
1966
1967
 
1967
1968
  //#endregion
1968
1969
  //#region src/rules/no-missing-component-display-name.ts
1969
- const RULE_NAME$33 = "no-missing-component-display-name";
1970
+ const RULE_NAME$34 = "no-missing-component-display-name";
1970
1971
  var no_missing_component_display_name_default = createRule({
1971
1972
  meta: {
1972
1973
  type: "problem",
@@ -1974,11 +1975,11 @@ var no_missing_component_display_name_default = createRule({
1974
1975
  messages: { default: "Add missing 'displayName' for component." },
1975
1976
  schema: []
1976
1977
  },
1977
- name: RULE_NAME$33,
1978
- create: create$33,
1978
+ name: RULE_NAME$34,
1979
+ create: create$34,
1979
1980
  defaultOptions: []
1980
1981
  });
1981
- function create$33(context) {
1982
+ function create$34(context) {
1982
1983
  if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
1983
1984
  const { ctx, visitor } = core.useComponentCollector(context, {
1984
1985
  collectDisplayName: true,
@@ -2000,7 +2001,7 @@ function create$33(context) {
2000
2001
 
2001
2002
  //#endregion
2002
2003
  //#region src/rules/no-missing-context-display-name.ts
2003
- const RULE_NAME$32 = "no-missing-context-display-name";
2004
+ const RULE_NAME$33 = "no-missing-context-display-name";
2004
2005
  var no_missing_context_display_name_default = createRule({
2005
2006
  meta: {
2006
2007
  type: "problem",
@@ -2009,11 +2010,11 @@ var no_missing_context_display_name_default = createRule({
2009
2010
  messages: { default: "Add missing 'displayName' for context." },
2010
2011
  schema: []
2011
2012
  },
2012
- name: RULE_NAME$32,
2013
- create: create$32,
2013
+ name: RULE_NAME$33,
2014
+ create: create$33,
2014
2015
  defaultOptions: []
2015
2016
  });
2016
- function create$32(context) {
2017
+ function create$33(context) {
2017
2018
  if (!context.sourceCode.text.includes("createContext")) return {};
2018
2019
  const createCalls = [];
2019
2020
  const displayNameAssignments = [];
@@ -2065,7 +2066,7 @@ function create$32(context) {
2065
2066
 
2066
2067
  //#endregion
2067
2068
  //#region src/rules/no-missing-key.ts
2068
- const RULE_NAME$31 = "no-missing-key";
2069
+ const RULE_NAME$32 = "no-missing-key";
2069
2070
  var no_missing_key_default = createRule({
2070
2071
  meta: {
2071
2072
  type: "problem",
@@ -2076,11 +2077,11 @@ var no_missing_key_default = createRule({
2076
2077
  },
2077
2078
  schema: []
2078
2079
  },
2079
- name: RULE_NAME$31,
2080
- create: create$31,
2080
+ name: RULE_NAME$32,
2081
+ create: create$32,
2081
2082
  defaultOptions: []
2082
2083
  });
2083
- function create$31(ctx) {
2084
+ function create$32(ctx) {
2084
2085
  let inChildrenToArray = false;
2085
2086
  function check(node) {
2086
2087
  if (node.type === AST_NODE_TYPES.JSXElement) return core.getJsxAttribute(ctx, node)("key") == null ? {
@@ -2144,7 +2145,7 @@ function create$31(ctx) {
2144
2145
 
2145
2146
  //#endregion
2146
2147
  //#region src/rules/no-misused-capture-owner-stack.ts
2147
- const RULE_NAME$30 = "no-misused-capture-owner-stack";
2148
+ const RULE_NAME$31 = "no-misused-capture-owner-stack";
2148
2149
  var no_misused_capture_owner_stack_default = createRule({
2149
2150
  meta: {
2150
2151
  type: "problem",
@@ -2155,11 +2156,11 @@ var no_misused_capture_owner_stack_default = createRule({
2155
2156
  },
2156
2157
  schema: []
2157
2158
  },
2158
- name: RULE_NAME$30,
2159
- create: create$30,
2159
+ name: RULE_NAME$31,
2160
+ create: create$31,
2160
2161
  defaultOptions: []
2161
2162
  });
2162
- function create$30(context) {
2163
+ function create$31(context) {
2163
2164
  if (!context.sourceCode.text.includes("captureOwnerStack")) return {};
2164
2165
  const { importSource } = getSettingsFromContext(context);
2165
2166
  return defineRuleListener({
@@ -2190,7 +2191,7 @@ function isDevelopmentOnlyCheck(node) {
2190
2191
 
2191
2192
  //#endregion
2192
2193
  //#region src/rules/no-nested-component-definitions.ts
2193
- const RULE_NAME$29 = "no-nested-component-definitions";
2194
+ const RULE_NAME$30 = "no-nested-component-definitions";
2194
2195
  var no_nested_component_definitions_default = createRule({
2195
2196
  meta: {
2196
2197
  type: "problem",
@@ -2198,11 +2199,11 @@ var no_nested_component_definitions_default = createRule({
2198
2199
  messages: { default: "Do not nest component definitions inside other components or props. {{suggestion}}" },
2199
2200
  schema: []
2200
2201
  },
2201
- name: RULE_NAME$29,
2202
- create: create$29,
2202
+ name: RULE_NAME$30,
2203
+ create: create$30,
2203
2204
  defaultOptions: []
2204
2205
  });
2205
- function create$29(context) {
2206
+ function create$30(context) {
2206
2207
  const hint = core.ComponentDetectionHint.DoNotIncludeJsxWithNumberValue | core.ComponentDetectionHint.DoNotIncludeJsxWithBooleanValue | core.ComponentDetectionHint.DoNotIncludeJsxWithNullValue | core.ComponentDetectionHint.DoNotIncludeJsxWithStringValue | core.ComponentDetectionHint.DoNotIncludeJsxWithUndefinedValue | core.ComponentDetectionHint.RequireBothSidesOfLogicalExpressionToBeJsx | core.ComponentDetectionHint.RequireBothBranchesOfConditionalExpressionToBeJsx | core.ComponentDetectionHint.DoNotIncludeFunctionDefinedInArrayPattern | core.ComponentDetectionHint.DoNotIncludeFunctionDefinedInArrayExpression | core.ComponentDetectionHint.DoNotIncludeFunctionDefinedAsArrayMapCallback;
2207
2208
  const fCollector = core.useComponentCollector(context, { hint });
2208
2209
  const cCollector = core.useComponentCollectorLegacy(context);
@@ -2307,7 +2308,7 @@ function isInsideCreateElementProps(context, node) {
2307
2308
 
2308
2309
  //#endregion
2309
2310
  //#region src/rules/no-nested-lazy-component-declarations.ts
2310
- const RULE_NAME$28 = "no-nested-lazy-component-declarations";
2311
+ const RULE_NAME$29 = "no-nested-lazy-component-declarations";
2311
2312
  var no_nested_lazy_component_declarations_default = createRule({
2312
2313
  meta: {
2313
2314
  type: "problem",
@@ -2315,11 +2316,11 @@ var no_nested_lazy_component_declarations_default = createRule({
2315
2316
  messages: { default: "Do not declare lazy components inside other components. Instead, always declare them at the top level of your module." },
2316
2317
  schema: []
2317
2318
  },
2318
- name: RULE_NAME$28,
2319
- create: create$28,
2319
+ name: RULE_NAME$29,
2320
+ create: create$29,
2320
2321
  defaultOptions: []
2321
2322
  });
2322
- function create$28(context) {
2323
+ function create$29(context) {
2323
2324
  const hint = core.ComponentDetectionHint.None;
2324
2325
  const collector = core.useComponentCollector(context, { hint });
2325
2326
  const collectorLegacy = core.useComponentCollectorLegacy(context);
@@ -2348,7 +2349,7 @@ function create$28(context) {
2348
2349
 
2349
2350
  //#endregion
2350
2351
  //#region src/rules/no-redundant-should-component-update.ts
2351
- const RULE_NAME$27 = "no-redundant-should-component-update";
2352
+ const RULE_NAME$28 = "no-redundant-should-component-update";
2352
2353
  function isShouldComponentUpdate(node) {
2353
2354
  return ast.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
2354
2355
  }
@@ -2359,11 +2360,11 @@ var no_redundant_should_component_update_default = createRule({
2359
2360
  messages: { default: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'." },
2360
2361
  schema: []
2361
2362
  },
2362
- name: RULE_NAME$27,
2363
- create: create$27,
2363
+ name: RULE_NAME$28,
2364
+ create: create$28,
2364
2365
  defaultOptions: []
2365
2366
  });
2366
- function create$27(context) {
2367
+ function create$28(context) {
2367
2368
  if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
2368
2369
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
2369
2370
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -2381,7 +2382,7 @@ function create$27(context) {
2381
2382
 
2382
2383
  //#endregion
2383
2384
  //#region src/rules/no-set-state-in-component-did-mount.ts
2384
- const RULE_NAME$26 = "no-set-state-in-component-did-mount";
2385
+ const RULE_NAME$27 = "no-set-state-in-component-did-mount";
2385
2386
  var no_set_state_in_component_did_mount_default = createRule({
2386
2387
  meta: {
2387
2388
  type: "problem",
@@ -2389,11 +2390,11 @@ var no_set_state_in_component_did_mount_default = createRule({
2389
2390
  messages: { default: "Do not call `this.setState` in `componentDidMount` outside functions such as callbacks." },
2390
2391
  schema: []
2391
2392
  },
2392
- name: RULE_NAME$26,
2393
- create: create$26,
2393
+ name: RULE_NAME$27,
2394
+ create: create$27,
2394
2395
  defaultOptions: []
2395
2396
  });
2396
- function create$26(context) {
2397
+ function create$27(context) {
2397
2398
  if (!context.sourceCode.text.includes("componentDidMount")) return {};
2398
2399
  return defineRuleListener({ CallExpression(node) {
2399
2400
  if (!core.isThisSetState(node)) return;
@@ -2411,7 +2412,7 @@ function create$26(context) {
2411
2412
 
2412
2413
  //#endregion
2413
2414
  //#region src/rules/no-set-state-in-component-did-update.ts
2414
- const RULE_NAME$25 = "no-set-state-in-component-did-update";
2415
+ const RULE_NAME$26 = "no-set-state-in-component-did-update";
2415
2416
  var no_set_state_in_component_did_update_default = createRule({
2416
2417
  meta: {
2417
2418
  type: "problem",
@@ -2419,11 +2420,11 @@ var no_set_state_in_component_did_update_default = createRule({
2419
2420
  messages: { default: "Do not call `this.setState` in `componentDidUpdate` outside functions such as callbacks." },
2420
2421
  schema: []
2421
2422
  },
2422
- name: RULE_NAME$25,
2423
- create: create$25,
2423
+ name: RULE_NAME$26,
2424
+ create: create$26,
2424
2425
  defaultOptions: []
2425
2426
  });
2426
- function create$25(context) {
2427
+ function create$26(context) {
2427
2428
  if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
2428
2429
  return defineRuleListener({ CallExpression(node) {
2429
2430
  if (!core.isThisSetState(node)) return;
@@ -2441,7 +2442,7 @@ function create$25(context) {
2441
2442
 
2442
2443
  //#endregion
2443
2444
  //#region src/rules/no-set-state-in-component-will-update.ts
2444
- const RULE_NAME$24 = "no-set-state-in-component-will-update";
2445
+ const RULE_NAME$25 = "no-set-state-in-component-will-update";
2445
2446
  var no_set_state_in_component_will_update_default = createRule({
2446
2447
  meta: {
2447
2448
  type: "problem",
@@ -2449,11 +2450,11 @@ var no_set_state_in_component_will_update_default = createRule({
2449
2450
  messages: { default: "Do not call `this.setState` in `componentWillUpdate` outside functions such as callbacks." },
2450
2451
  schema: []
2451
2452
  },
2452
- name: RULE_NAME$24,
2453
- create: create$24,
2453
+ name: RULE_NAME$25,
2454
+ create: create$25,
2454
2455
  defaultOptions: []
2455
2456
  });
2456
- function create$24(context) {
2457
+ function create$25(context) {
2457
2458
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
2458
2459
  return defineRuleListener({ CallExpression(node) {
2459
2460
  if (!core.isThisSetState(node)) return;
@@ -2471,7 +2472,7 @@ function create$24(context) {
2471
2472
 
2472
2473
  //#endregion
2473
2474
  //#region src/rules/no-unnecessary-use-callback.ts
2474
- const RULE_NAME$23 = "no-unnecessary-use-callback";
2475
+ const RULE_NAME$24 = "no-unnecessary-use-callback";
2475
2476
  var no_unnecessary_use_callback_default = createRule({
2476
2477
  meta: {
2477
2478
  type: "problem",
@@ -2482,11 +2483,11 @@ var no_unnecessary_use_callback_default = createRule({
2482
2483
  },
2483
2484
  schema: []
2484
2485
  },
2485
- name: RULE_NAME$23,
2486
- create: create$23,
2486
+ name: RULE_NAME$24,
2487
+ create: create$24,
2487
2488
  defaultOptions: []
2488
2489
  });
2489
- function create$23(context) {
2490
+ function create$24(context) {
2490
2491
  if (!context.sourceCode.text.includes("useCallback")) return {};
2491
2492
  return defineRuleListener({ VariableDeclarator(node) {
2492
2493
  const { id, init } = node;
@@ -2548,7 +2549,7 @@ function checkForUsageInsideUseEffect$1(sourceCode, node) {
2548
2549
 
2549
2550
  //#endregion
2550
2551
  //#region src/rules/no-unnecessary-use-memo.ts
2551
- const RULE_NAME$22 = "no-unnecessary-use-memo";
2552
+ const RULE_NAME$23 = "no-unnecessary-use-memo";
2552
2553
  var no_unnecessary_use_memo_default = createRule({
2553
2554
  meta: {
2554
2555
  type: "problem",
@@ -2559,11 +2560,11 @@ var no_unnecessary_use_memo_default = createRule({
2559
2560
  },
2560
2561
  schema: []
2561
2562
  },
2562
- name: RULE_NAME$22,
2563
- create: create$22,
2563
+ name: RULE_NAME$23,
2564
+ create: create$23,
2564
2565
  defaultOptions: []
2565
2566
  });
2566
- function create$22(context) {
2567
+ function create$23(context) {
2567
2568
  if (!context.sourceCode.text.includes("useMemo")) return {};
2568
2569
  return defineRuleListener({ VariableDeclarator(node) {
2569
2570
  const { id, init } = node;
@@ -2629,7 +2630,7 @@ function checkForUsageInsideUseEffect(sourceCode, node) {
2629
2630
 
2630
2631
  //#endregion
2631
2632
  //#region src/rules/no-unnecessary-use-prefix.ts
2632
- const RULE_NAME$21 = "no-unnecessary-use-prefix";
2633
+ const RULE_NAME$22 = "no-unnecessary-use-prefix";
2633
2634
  const WELL_KNOWN_HOOKS = ["useMDXComponents"];
2634
2635
  function containsUseComments(context, node) {
2635
2636
  return context.sourceCode.getCommentsInside(node).some(({ value }) => /use\([\s\S]*?\)/u.test(value) || /use[A-Z0-9]\w*\([\s\S]*?\)/u.test(value));
@@ -2641,11 +2642,11 @@ var no_unnecessary_use_prefix_default = createRule({
2641
2642
  messages: { default: "If your function doesn't call any Hooks, avoid the 'use' prefix. Instead, write it as a regular function without the 'use' prefix." },
2642
2643
  schema: []
2643
2644
  },
2644
- name: RULE_NAME$21,
2645
- create: create$21,
2645
+ name: RULE_NAME$22,
2646
+ create: create$22,
2646
2647
  defaultOptions: []
2647
2648
  });
2648
- function create$21(context) {
2649
+ function create$22(context) {
2649
2650
  const { ctx, visitor } = core.useHookCollector(context);
2650
2651
  return defineRuleListener(visitor, { "Program:exit"(program) {
2651
2652
  for (const { id, name, node, hookCalls } of ctx.getAllHooks(program)) {
@@ -2665,7 +2666,7 @@ function create$21(context) {
2665
2666
 
2666
2667
  //#endregion
2667
2668
  //#region src/rules/no-unsafe-component-will-mount.ts
2668
- const RULE_NAME$20 = "no-unsafe-component-will-mount";
2669
+ const RULE_NAME$21 = "no-unsafe-component-will-mount";
2669
2670
  var no_unsafe_component_will_mount_default = createRule({
2670
2671
  meta: {
2671
2672
  type: "problem",
@@ -2673,11 +2674,11 @@ var no_unsafe_component_will_mount_default = createRule({
2673
2674
  messages: { default: "Do not use 'UNSAFE_componentWillMount'." },
2674
2675
  schema: []
2675
2676
  },
2676
- name: RULE_NAME$20,
2677
- create: create$20,
2677
+ name: RULE_NAME$21,
2678
+ create: create$21,
2678
2679
  defaultOptions: []
2679
2680
  });
2680
- function create$20(context) {
2681
+ function create$21(context) {
2681
2682
  if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
2682
2683
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
2683
2684
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -2693,7 +2694,7 @@ function create$20(context) {
2693
2694
 
2694
2695
  //#endregion
2695
2696
  //#region src/rules/no-unsafe-component-will-receive-props.ts
2696
- const RULE_NAME$19 = "no-unsafe-component-will-receive-props";
2697
+ const RULE_NAME$20 = "no-unsafe-component-will-receive-props";
2697
2698
  var no_unsafe_component_will_receive_props_default = createRule({
2698
2699
  meta: {
2699
2700
  type: "problem",
@@ -2701,11 +2702,11 @@ var no_unsafe_component_will_receive_props_default = createRule({
2701
2702
  messages: { default: "Do not use 'UNSAFE_componentWillReceiveProps'." },
2702
2703
  schema: []
2703
2704
  },
2704
- name: RULE_NAME$19,
2705
- create: create$19,
2705
+ name: RULE_NAME$20,
2706
+ create: create$20,
2706
2707
  defaultOptions: []
2707
2708
  });
2708
- function create$19(context) {
2709
+ function create$20(context) {
2709
2710
  if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) return {};
2710
2711
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
2711
2712
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -2721,7 +2722,7 @@ function create$19(context) {
2721
2722
 
2722
2723
  //#endregion
2723
2724
  //#region src/rules/no-unsafe-component-will-update.ts
2724
- const RULE_NAME$18 = "no-unsafe-component-will-update";
2725
+ const RULE_NAME$19 = "no-unsafe-component-will-update";
2725
2726
  var no_unsafe_component_will_update_default = createRule({
2726
2727
  meta: {
2727
2728
  type: "problem",
@@ -2729,11 +2730,11 @@ var no_unsafe_component_will_update_default = createRule({
2729
2730
  messages: { default: "Do not use 'UNSAFE_componentWillUpdate'." },
2730
2731
  schema: []
2731
2732
  },
2732
- name: RULE_NAME$18,
2733
- create: create$18,
2733
+ name: RULE_NAME$19,
2734
+ create: create$19,
2734
2735
  defaultOptions: []
2735
2736
  });
2736
- function create$18(context) {
2737
+ function create$19(context) {
2737
2738
  if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
2738
2739
  const { ctx, visitor } = core.useComponentCollectorLegacy(context);
2739
2740
  return defineRuleListener(visitor, { "Program:exit"(program) {
@@ -2749,7 +2750,7 @@ function create$18(context) {
2749
2750
 
2750
2751
  //#endregion
2751
2752
  //#region src/rules/no-unstable-context-value.ts
2752
- const RULE_NAME$17 = "no-unstable-context-value";
2753
+ const RULE_NAME$18 = "no-unstable-context-value";
2753
2754
  var no_unstable_context_value_default = createRule({
2754
2755
  meta: {
2755
2756
  type: "problem",
@@ -2757,11 +2758,11 @@ var no_unstable_context_value_default = createRule({
2757
2758
  messages: { unstableContextValue: "A/an '{{kind}}' passed as the value prop to the context provider should not be constructed. It will change on every render. {{suggestion}}" },
2758
2759
  schema: []
2759
2760
  },
2760
- name: RULE_NAME$17,
2761
- create: create$17,
2761
+ name: RULE_NAME$18,
2762
+ create: create$18,
2762
2763
  defaultOptions: []
2763
2764
  });
2764
- function create$17(context) {
2765
+ function create$18(context) {
2765
2766
  const { compilationMode, version } = getSettingsFromContext(context);
2766
2767
  if (compilationMode === "infer" || compilationMode === "all") return {};
2767
2768
  if (compilationMode === "annotation" && ast.isDirectiveInFile(context.sourceCode.ast, "use memo")) return {};
@@ -2813,9 +2814,9 @@ function isContextName(name, isReact18OrBelow) {
2813
2814
 
2814
2815
  //#endregion
2815
2816
  //#region src/rules/no-unstable-default-props.ts
2816
- const RULE_NAME$16 = "no-unstable-default-props";
2817
- const defaultOptions$1 = [{ safeDefaultProps: [] }];
2818
- const schema$1 = [{
2817
+ const RULE_NAME$17 = "no-unstable-default-props";
2818
+ const defaultOptions$2 = [{ safeDefaultProps: [] }];
2819
+ const schema$2 = [{
2819
2820
  type: "object",
2820
2821
  additionalProperties: false,
2821
2822
  properties: { safeDefaultProps: {
@@ -2828,11 +2829,11 @@ var no_unstable_default_props_default = createRule({
2828
2829
  type: "problem",
2829
2830
  docs: { description: "Prevents using referential-type values as default props in object destructuring." },
2830
2831
  messages: { default: "A/an '{{kind}}' as default prop. This could lead to potential infinite render loop in React. Use a variable instead of '{{kind}}'." },
2831
- schema: schema$1
2832
+ schema: schema$2
2832
2833
  },
2833
- name: RULE_NAME$16,
2834
- create: create$16,
2835
- defaultOptions: defaultOptions$1
2834
+ name: RULE_NAME$17,
2835
+ create: create$17,
2836
+ defaultOptions: defaultOptions$2
2836
2837
  });
2837
2838
  function extractIdentifier(node) {
2838
2839
  if (node.type === AST_NODE_TYPES.NewExpression && node.callee.type === AST_NODE_TYPES.Identifier) return node.callee.name;
@@ -2842,7 +2843,7 @@ function extractIdentifier(node) {
2842
2843
  }
2843
2844
  return null;
2844
2845
  }
2845
- function create$16(context, [options]) {
2846
+ function create$17(context, [options]) {
2846
2847
  const { compilationMode } = getSettingsFromContext(context);
2847
2848
  if (compilationMode === "infer" || compilationMode === "all") return {};
2848
2849
  if (compilationMode === "annotation" && ast.isDirectiveInFile(context.sourceCode.ast, "use memo")) return {};
@@ -2888,7 +2889,7 @@ function create$16(context, [options]) {
2888
2889
 
2889
2890
  //#endregion
2890
2891
  //#region src/rules/no-unused-class-component-members.ts
2891
- const RULE_NAME$15 = "no-unused-class-component-members";
2892
+ const RULE_NAME$16 = "no-unused-class-component-members";
2892
2893
  const LIFECYCLE_METHODS = new Set([
2893
2894
  "componentDidCatch",
2894
2895
  "componentDidMount",
@@ -2919,11 +2920,11 @@ var no_unused_class_component_members_default = createRule({
2919
2920
  messages: { default: "Unused method or property '{{methodName}}'' of class '{{className}}'." },
2920
2921
  schema: []
2921
2922
  },
2922
- name: RULE_NAME$15,
2923
- create: create$15,
2923
+ name: RULE_NAME$16,
2924
+ create: create$16,
2924
2925
  defaultOptions: []
2925
2926
  });
2926
- function create$15(context) {
2927
+ function create$16(context) {
2927
2928
  const classStack = [];
2928
2929
  const methodStack = [];
2929
2930
  const propertyDefs = /* @__PURE__ */ new WeakMap();
@@ -3004,7 +3005,7 @@ function create$15(context) {
3004
3005
 
3005
3006
  //#endregion
3006
3007
  //#region src/rules/no-unused-props.ts
3007
- const RULE_NAME$14 = "no-unused-props";
3008
+ const RULE_NAME$15 = "no-unused-props";
3008
3009
  var no_unused_props_default = createRule({
3009
3010
  meta: {
3010
3011
  type: "problem",
@@ -3012,11 +3013,11 @@ var no_unused_props_default = createRule({
3012
3013
  messages: { default: "Prop `{{name}}` is declared but never used" },
3013
3014
  schema: []
3014
3015
  },
3015
- name: RULE_NAME$14,
3016
- create: create$14,
3016
+ name: RULE_NAME$15,
3017
+ create: create$15,
3017
3018
  defaultOptions: []
3018
3019
  });
3019
- function create$14(context) {
3020
+ function create$15(context) {
3020
3021
  const services = ESLintUtils.getParserServices(context, false);
3021
3022
  const checker = services.program.getTypeChecker();
3022
3023
  const { ctx, visitor } = core.useComponentCollector(context);
@@ -3116,7 +3117,7 @@ function reportUnusedProp(context, services, prop) {
3116
3117
 
3117
3118
  //#endregion
3118
3119
  //#region src/rules/no-unused-state.ts
3119
- const RULE_NAME$13 = "no-unused-state";
3120
+ const RULE_NAME$14 = "no-unused-state";
3120
3121
  function isKeyLiteral(node, key) {
3121
3122
  return match(key).with({ type: AST_NODE_TYPES.Literal }, constTrue).with({
3122
3123
  type: AST_NODE_TYPES.TemplateLiteral,
@@ -3130,11 +3131,11 @@ var no_unused_state_default = createRule({
3130
3131
  messages: { default: "Unused class component state in '{{className}}'" },
3131
3132
  schema: []
3132
3133
  },
3133
- name: RULE_NAME$13,
3134
- create: create$13,
3134
+ name: RULE_NAME$14,
3135
+ create: create$14,
3135
3136
  defaultOptions: []
3136
3137
  });
3137
- function create$13(context) {
3138
+ function create$14(context) {
3138
3139
  const classStack = [];
3139
3140
  const methodStack = [];
3140
3141
  const constructorStack = [];
@@ -3243,7 +3244,7 @@ function create$13(context) {
3243
3244
 
3244
3245
  //#endregion
3245
3246
  //#region src/rules/no-use-context.ts
3246
- const RULE_NAME$12 = "no-use-context";
3247
+ const RULE_NAME$13 = "no-use-context";
3247
3248
  var no_use_context_default = createRule({
3248
3249
  meta: {
3249
3250
  type: "problem",
@@ -3252,11 +3253,11 @@ var no_use_context_default = createRule({
3252
3253
  messages: { default: "In React 19, 'use' is preferred over 'useContext' because it is more flexible." },
3253
3254
  schema: []
3254
3255
  },
3255
- name: RULE_NAME$12,
3256
- create: create$12,
3256
+ name: RULE_NAME$13,
3257
+ create: create$13,
3257
3258
  defaultOptions: []
3258
3259
  });
3259
- function create$12(context) {
3260
+ function create$13(context) {
3260
3261
  if (!context.sourceCode.text.includes("useContext")) return {};
3261
3262
  const settings = getSettingsFromContext(context);
3262
3263
  if (compare(settings.version, "19.0.0", "<")) return {};
@@ -3321,7 +3322,7 @@ function getCorrelativeTokens(context, node) {
3321
3322
 
3322
3323
  //#endregion
3323
3324
  //#region src/rules/no-useless-forward-ref.ts
3324
- const RULE_NAME$11 = "no-useless-forward-ref";
3325
+ const RULE_NAME$12 = "no-useless-forward-ref";
3325
3326
  var no_useless_forward_ref_default = createRule({
3326
3327
  meta: {
3327
3328
  type: "problem",
@@ -3329,11 +3330,11 @@ var no_useless_forward_ref_default = createRule({
3329
3330
  messages: { default: "A 'forwardRef' is used with this component but no 'ref' parameter is set." },
3330
3331
  schema: []
3331
3332
  },
3332
- name: RULE_NAME$11,
3333
- create: create$11,
3333
+ name: RULE_NAME$12,
3334
+ create: create$12,
3334
3335
  defaultOptions: []
3335
3336
  });
3336
- function create$11(context) {
3337
+ function create$12(context) {
3337
3338
  return defineRuleListener({ CallExpression(node) {
3338
3339
  if (!core.isForwardRefCall(context, node)) return;
3339
3340
  const [component] = node.arguments;
@@ -3348,12 +3349,12 @@ function create$11(context) {
3348
3349
 
3349
3350
  //#endregion
3350
3351
  //#region src/rules/no-useless-fragment.ts
3351
- const RULE_NAME$10 = "no-useless-fragment";
3352
- const defaultOptions = [{
3352
+ const RULE_NAME$11 = "no-useless-fragment";
3353
+ const defaultOptions$1 = [{
3353
3354
  allowEmptyFragment: false,
3354
3355
  allowExpressions: true
3355
3356
  }];
3356
- const schema = [{
3357
+ const schema$1 = [{
3357
3358
  type: "object",
3358
3359
  additionalProperties: false,
3359
3360
  properties: {
@@ -3370,17 +3371,17 @@ const schema = [{
3370
3371
  var no_useless_fragment_default = createRule({
3371
3372
  meta: {
3372
3373
  type: "problem",
3373
- defaultOptions: [...defaultOptions],
3374
+ defaultOptions: [...defaultOptions$1],
3374
3375
  docs: { description: "Disallows useless fragment elements." },
3375
3376
  fixable: "code",
3376
3377
  messages: { default: "A fragment {{reason}} is useless." },
3377
- schema
3378
+ schema: schema$1
3378
3379
  },
3379
- name: RULE_NAME$10,
3380
- create: create$10,
3381
- defaultOptions
3380
+ name: RULE_NAME$11,
3381
+ create: create$11,
3382
+ defaultOptions: defaultOptions$1
3382
3383
  });
3383
- function create$10(context, [option]) {
3384
+ function create$11(context, [option]) {
3384
3385
  const { allowEmptyFragment = false, allowExpressions = true } = option;
3385
3386
  const jsxConfig = {
3386
3387
  ...core.getJsxConfigFromContext(context),
@@ -3488,7 +3489,7 @@ function trimLikeReact(text) {
3488
3489
 
3489
3490
  //#endregion
3490
3491
  //#region src/rules/prefer-destructuring-assignment.ts
3491
- const RULE_NAME$9 = "prefer-destructuring-assignment";
3492
+ const RULE_NAME$10 = "prefer-destructuring-assignment";
3492
3493
  var prefer_destructuring_assignment_default = createRule({
3493
3494
  meta: {
3494
3495
  type: "problem",
@@ -3496,11 +3497,11 @@ var prefer_destructuring_assignment_default = createRule({
3496
3497
  messages: { default: "Use destructuring assignment for component props." },
3497
3498
  schema: []
3498
3499
  },
3499
- name: RULE_NAME$9,
3500
- create: create$9,
3500
+ name: RULE_NAME$10,
3501
+ create: create$10,
3501
3502
  defaultOptions: []
3502
3503
  });
3503
- function create$9(context) {
3504
+ function create$10(context) {
3504
3505
  const { ctx, visitor } = core.useComponentCollector(context);
3505
3506
  return defineRuleListener(visitor, { "Program:exit"(program) {
3506
3507
  for (const component of ctx.getAllComponents(program)) {
@@ -3524,7 +3525,7 @@ function create$9(context) {
3524
3525
 
3525
3526
  //#endregion
3526
3527
  //#region src/rules/prefer-namespace-import.ts
3527
- const RULE_NAME$8 = "prefer-namespace-import";
3528
+ const RULE_NAME$9 = "prefer-namespace-import";
3528
3529
  var prefer_namespace_import_default = createRule({
3529
3530
  meta: {
3530
3531
  type: "problem",
@@ -3533,11 +3534,11 @@ var prefer_namespace_import_default = createRule({
3533
3534
  messages: { default: "Prefer importing React as 'import * as React from \"{{importSource}}\"';" },
3534
3535
  schema: []
3535
3536
  },
3536
- name: RULE_NAME$8,
3537
- create: create$8,
3537
+ name: RULE_NAME$9,
3538
+ create: create$9,
3538
3539
  defaultOptions: []
3539
3540
  });
3540
- function create$8(context) {
3541
+ function create$9(context) {
3541
3542
  const { importSource } = getSettingsFromContext(context);
3542
3543
  return defineRuleListener({ [`ImportDeclaration[source.value="${importSource}"] ImportDefaultSpecifier`](node) {
3543
3544
  const hasOtherSpecifiers = node.parent.specifiers.length > 1;
@@ -3561,7 +3562,7 @@ function create$8(context) {
3561
3562
 
3562
3563
  //#endregion
3563
3564
  //#region src/rules/prefer-read-only-props.ts
3564
- const RULE_NAME$7 = "prefer-read-only-props";
3565
+ const RULE_NAME$8 = "prefer-read-only-props";
3565
3566
  var prefer_read_only_props_default = createRule({
3566
3567
  meta: {
3567
3568
  type: "problem",
@@ -3569,11 +3570,11 @@ var prefer_read_only_props_default = createRule({
3569
3570
  messages: { default: "A function component's props should be read-only." },
3570
3571
  schema: []
3571
3572
  },
3572
- name: RULE_NAME$7,
3573
- create: create$7,
3573
+ name: RULE_NAME$8,
3574
+ create: create$8,
3574
3575
  defaultOptions: []
3575
3576
  });
3576
- function create$7(context) {
3577
+ function create$8(context) {
3577
3578
  const services = ESLintUtils.getParserServices(context, false);
3578
3579
  const checker = services.program.getTypeChecker();
3579
3580
  const { ctx, visitor } = core.useComponentCollector(context);
@@ -3612,55 +3613,9 @@ function isClassOrInterfaceReadonlyLoose(checker, type) {
3612
3613
  });
3613
3614
  }
3614
3615
 
3615
- //#endregion
3616
- //#region src/rules/prefer-use-state-lazy-initialization.ts
3617
- const RULE_NAME$6 = "prefer-use-state-lazy-initialization";
3618
- const ALLOW_LIST = [
3619
- "Boolean",
3620
- "String",
3621
- "Number"
3622
- ];
3623
- var prefer_use_state_lazy_initialization_default = createRule({
3624
- meta: {
3625
- type: "problem",
3626
- docs: { description: "Enforces wrapping function calls made inside 'useState' in an 'initializer function'." },
3627
- messages: { default: "To prevent re-computation, consider using lazy initial state for useState calls that involve function calls. Ex: 'useState(() => getValue())'." },
3628
- schema: []
3629
- },
3630
- name: RULE_NAME$6,
3631
- create: create$6,
3632
- defaultOptions: []
3633
- });
3634
- function create$6(context) {
3635
- return defineRuleListener({ CallExpression(node) {
3636
- if (!core.isUseStateCall(node)) return;
3637
- const [useStateInput] = node.arguments;
3638
- if (useStateInput == null) return;
3639
- for (const expr of ast.getNestedNewExpressions(useStateInput)) {
3640
- if (!("name" in expr.callee)) continue;
3641
- if (ALLOW_LIST.includes(expr.callee.name)) continue;
3642
- if (ast.findParentNode(expr, core.isUseCall) != null) continue;
3643
- context.report({
3644
- messageId: "default",
3645
- node: expr
3646
- });
3647
- }
3648
- for (const expr of ast.getNestedCallExpressions(useStateInput)) {
3649
- if (!("name" in expr.callee)) continue;
3650
- if (core.isHookName(expr.callee.name)) continue;
3651
- if (ALLOW_LIST.includes(expr.callee.name)) continue;
3652
- if (ast.findParentNode(expr, core.isUseCall) != null) continue;
3653
- context.report({
3654
- messageId: "default",
3655
- node: expr
3656
- });
3657
- }
3658
- } });
3659
- }
3660
-
3661
3616
  //#endregion
3662
3617
  //#region src/rules/purity.ts
3663
- const RULE_NAME$5 = "purity";
3618
+ const RULE_NAME$7 = "purity";
3664
3619
  function isImpureMemberCall(node) {
3665
3620
  if (node.callee.type !== AST_NODE_TYPES.MemberExpression) return false;
3666
3621
  const { object, property } = node.callee;
@@ -3692,11 +3647,11 @@ var purity_default = createRule({
3692
3647
  messages: { default: "Do not call '{{name}}' during render. Components and hooks must be pure. Move this call into an event handler, effect, or state initializer." },
3693
3648
  schema: []
3694
3649
  },
3695
- name: RULE_NAME$5,
3696
- create: create$5,
3650
+ name: RULE_NAME$7,
3651
+ create: create$7,
3697
3652
  defaultOptions: []
3698
3653
  });
3699
- function create$5(context) {
3654
+ function create$7(context) {
3700
3655
  const hCollector = core.useHookCollector(context);
3701
3656
  const cCollector = core.useComponentCollector(context);
3702
3657
  const cExprs = [];
@@ -3744,7 +3699,7 @@ function create$5(context) {
3744
3699
 
3745
3700
  //#endregion
3746
3701
  //#region src/rules/refs.ts
3747
- const RULE_NAME$4 = "refs";
3702
+ const RULE_NAME$6 = "refs";
3748
3703
  function isWriteAccess(node) {
3749
3704
  const { parent } = node;
3750
3705
  if (parent.type === AST_NODE_TYPES.AssignmentExpression && parent.left === node) return true;
@@ -3875,11 +3830,11 @@ var refs_default = createRule({
3875
3830
  },
3876
3831
  schema: []
3877
3832
  },
3878
- name: RULE_NAME$4,
3879
- create: create$4,
3833
+ name: RULE_NAME$6,
3834
+ create: create$6,
3880
3835
  defaultOptions: []
3881
3836
  });
3882
- function create$4(context) {
3837
+ function create$6(context) {
3883
3838
  const hCollector = core.useHookCollector(context);
3884
3839
  const cCollector = core.useComponentCollector(context);
3885
3840
  const refAccesses = [];
@@ -3923,7 +3878,7 @@ function create$4(context) {
3923
3878
 
3924
3879
  //#endregion
3925
3880
  //#region src/rules/rules-of-hooks.ts
3926
- const RULE_NAME$3 = "rules-of-hooks";
3881
+ const RULE_NAME$5 = "rules-of-hooks";
3927
3882
  var rules_of_hooks_default = createRule({
3928
3883
  meta: {
3929
3884
  type: "problem",
@@ -3941,8 +3896,8 @@ var rules_of_hooks_default = createRule({
3941
3896
  },
3942
3897
  schema: []
3943
3898
  },
3944
- name: RULE_NAME$3,
3945
- create: create$3,
3899
+ name: RULE_NAME$5,
3900
+ create: create$5,
3946
3901
  defaultOptions: []
3947
3902
  });
3948
3903
  function getHookName(node) {
@@ -3977,7 +3932,7 @@ function isLoopNode(node) {
3977
3932
  function isTryCatchNode(node) {
3978
3933
  return node.type === AST_NODE_TYPES.TryStatement;
3979
3934
  }
3980
- function create$3(context) {
3935
+ function create$5(context) {
3981
3936
  const functionStack = [];
3982
3937
  function findEnclosingComponentOrHook() {
3983
3938
  for (let i = functionStack.length - 1; i >= 0; i--) {
@@ -4130,7 +4085,7 @@ function create$3(context) {
4130
4085
 
4131
4086
  //#endregion
4132
4087
  //#region src/rules/set-state-in-effect.ts
4133
- const RULE_NAME$2 = "set-state-in-effect";
4088
+ const RULE_NAME$4 = "set-state-in-effect";
4134
4089
  var set_state_in_effect_default = createRule({
4135
4090
  meta: {
4136
4091
  type: "problem",
@@ -4138,11 +4093,11 @@ var set_state_in_effect_default = createRule({
4138
4093
  messages: { default: "Do not call the 'set' function '{{name}}' of 'useState' synchronously in an effect. This can lead to unnecessary re-renders and performance issues." },
4139
4094
  schema: []
4140
4095
  },
4141
- name: RULE_NAME$2,
4142
- create: create$2,
4096
+ name: RULE_NAME$4,
4097
+ create: create$4,
4143
4098
  defaultOptions: []
4144
4099
  });
4145
- function create$2(context) {
4100
+ function create$4(context) {
4146
4101
  if (!/use\w*Effect/u.test(context.sourceCode.text)) return {};
4147
4102
  const { additionalStateHooks } = getSettingsFromContext(context);
4148
4103
  const functionEntries = [];
@@ -4348,7 +4303,7 @@ function create$2(context) {
4348
4303
 
4349
4304
  //#endregion
4350
4305
  //#region src/rules/set-state-in-render.ts
4351
- const RULE_NAME$1 = "set-state-in-render";
4306
+ const RULE_NAME$3 = "set-state-in-render";
4352
4307
  var set_state_in_render_default = createRule({
4353
4308
  meta: {
4354
4309
  type: "problem",
@@ -4356,11 +4311,11 @@ var set_state_in_render_default = createRule({
4356
4311
  messages: { default: "Do not call the 'set' function '{{name}}' unconditionally during render. This will trigger an infinite render loop." },
4357
4312
  schema: []
4358
4313
  },
4359
- name: RULE_NAME$1,
4360
- create: create$1,
4314
+ name: RULE_NAME$3,
4315
+ create: create$3,
4361
4316
  defaultOptions: []
4362
4317
  });
4363
- function create$1(context) {
4318
+ function create$3(context) {
4364
4319
  const { additionalStateHooks } = getSettingsFromContext(context);
4365
4320
  const functionEntries = [];
4366
4321
  const componentFnRef = { current: null };
@@ -4485,7 +4440,7 @@ function create$1(context) {
4485
4440
 
4486
4441
  //#endregion
4487
4442
  //#region src/rules/unsupported-syntax.ts
4488
- const RULE_NAME = "unsupported-syntax";
4443
+ const RULE_NAME$2 = "unsupported-syntax";
4489
4444
  var unsupported_syntax_default = createRule({
4490
4445
  meta: {
4491
4446
  type: "problem",
@@ -4497,8 +4452,8 @@ var unsupported_syntax_default = createRule({
4497
4452
  },
4498
4453
  schema: []
4499
4454
  },
4500
- name: RULE_NAME,
4501
- create,
4455
+ name: RULE_NAME$2,
4456
+ create: create$2,
4502
4457
  defaultOptions: []
4503
4458
  });
4504
4459
  function isEvalCall(node) {
@@ -4507,7 +4462,7 @@ function isEvalCall(node) {
4507
4462
  function isIifeCall(node) {
4508
4463
  return node.parent.type === AST_NODE_TYPES.CallExpression && node.parent.callee === node;
4509
4464
  }
4510
- function create(context) {
4465
+ function create$2(context) {
4511
4466
  const hCollector = core.useHookCollector(context);
4512
4467
  const cCollector = core.useComponentCollector(context);
4513
4468
  const evalCalls = [];
@@ -4564,6 +4519,178 @@ function create(context) {
4564
4519
  });
4565
4520
  }
4566
4521
 
4522
+ //#endregion
4523
+ //#region src/rules/use-memo.ts
4524
+ const RULE_NAME$1 = "use-memo";
4525
+ var use_memo_default = createRule({
4526
+ meta: {
4527
+ type: "problem",
4528
+ docs: { description: "Validates that 'useMemo' is called with a callback that returns a value." },
4529
+ messages: {
4530
+ missingReturnValue: "The callback passed to 'useMemo' must return a value. Without a return value, 'useMemo' always returns 'undefined', which defeats its purpose.",
4531
+ notAssignedToVariable: "The return value of 'useMemo' must be assigned to a variable. Calling 'useMemo' without capturing its return value is likely a mistake — use 'useEffect' for side effects instead."
4532
+ },
4533
+ schema: []
4534
+ },
4535
+ name: RULE_NAME$1,
4536
+ create: create$1,
4537
+ defaultOptions: []
4538
+ });
4539
+ function create$1(context) {
4540
+ if (!context.sourceCode.text.includes("useMemo")) return {};
4541
+ return defineRuleListener({ CallExpression(node) {
4542
+ if (!core.isUseMemoCall(node)) return;
4543
+ const parent = node.parent;
4544
+ if (!(parent.type === AST_NODE_TYPES.VariableDeclarator || parent.type === AST_NODE_TYPES.AssignmentExpression || parent.type === AST_NODE_TYPES.AssignmentPattern || parent.type === AST_NODE_TYPES.Property || parent.type === AST_NODE_TYPES.ReturnStatement || parent.type === AST_NODE_TYPES.JSXExpressionContainer || parent.type === AST_NODE_TYPES.CallExpression || parent.type === AST_NODE_TYPES.NewExpression || parent.type === AST_NODE_TYPES.ArrayExpression || parent.type === AST_NODE_TYPES.ConditionalExpression || parent.type === AST_NODE_TYPES.LogicalExpression || parent.type === AST_NODE_TYPES.SequenceExpression || parent.type === AST_NODE_TYPES.SpreadElement || parent.type === AST_NODE_TYPES.TemplateLiteral || parent.type === AST_NODE_TYPES.BinaryExpression || parent.type === AST_NODE_TYPES.UnaryExpression || parent.type === AST_NODE_TYPES.MemberExpression || parent.type === AST_NODE_TYPES.TaggedTemplateExpression || parent.type === AST_NODE_TYPES.ChainExpression)) {
4545
+ context.report({
4546
+ messageId: "notAssignedToVariable",
4547
+ node
4548
+ });
4549
+ return;
4550
+ }
4551
+ const [callbackArg] = node.arguments;
4552
+ if (callbackArg == null) return;
4553
+ if (!ast.isFunction(callbackArg)) return;
4554
+ if (callbackArg.type === AST_NODE_TYPES.ArrowFunctionExpression && callbackArg.body.type !== AST_NODE_TYPES.BlockStatement) return;
4555
+ if (callbackArg.body.type !== AST_NODE_TYPES.BlockStatement) return;
4556
+ const returnStatements = ast.getNestedReturnStatements(callbackArg);
4557
+ if (returnStatements.length === 0) {
4558
+ context.report({
4559
+ messageId: "missingReturnValue",
4560
+ node: callbackArg
4561
+ });
4562
+ return;
4563
+ }
4564
+ if (!returnStatements.some((stmt) => stmt.argument != null)) context.report({
4565
+ messageId: "missingReturnValue",
4566
+ node: callbackArg
4567
+ });
4568
+ } });
4569
+ }
4570
+
4571
+ //#endregion
4572
+ //#region src/rules/use-state.ts
4573
+ const RULE_NAME = "use-state";
4574
+ const defaultOptions = [{
4575
+ enforceAssignment: true,
4576
+ enforceLazyInitialization: true,
4577
+ enforceSetterName: true
4578
+ }];
4579
+ const schema = [{
4580
+ type: "object",
4581
+ additionalProperties: false,
4582
+ properties: {
4583
+ enforceAssignment: {
4584
+ type: "boolean",
4585
+ default: true
4586
+ },
4587
+ enforceLazyInitialization: {
4588
+ type: "boolean",
4589
+ default: true
4590
+ },
4591
+ enforceSetterName: {
4592
+ type: "boolean",
4593
+ default: true
4594
+ }
4595
+ }
4596
+ }];
4597
+ const LAZY_INIT_ALLOW_LIST = [
4598
+ "Boolean",
4599
+ "String",
4600
+ "Number"
4601
+ ];
4602
+ var use_state_default = createRule({
4603
+ meta: {
4604
+ type: "suggestion",
4605
+ docs: { description: "Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function." },
4606
+ messages: {
4607
+ invalidAssignment: "useState should be destructured into a value and setter pair, e.g., const [state, setState] = useState(...).",
4608
+ invalidInitialization: "To prevent re-computation, consider using lazy initial state for useState calls that involve function calls. Ex: 'useState(() => getValue())'.",
4609
+ invalidSetterName: "The setter should be named 'set' followed by the capitalized state variable name, e.g., 'setState' for 'state'."
4610
+ },
4611
+ schema
4612
+ },
4613
+ name: RULE_NAME,
4614
+ create,
4615
+ defaultOptions
4616
+ });
4617
+ function create(context) {
4618
+ if (!context.sourceCode.text.includes("useState")) return {};
4619
+ const { enforceAssignment = true, enforceLazyInitialization = true, enforceSetterName = true } = context.options[0] ?? defaultOptions[0];
4620
+ return defineRuleListener({ CallExpression(node) {
4621
+ if (!core.isUseStateCall(node)) return;
4622
+ if (enforceLazyInitialization) {
4623
+ const [useStateInput] = node.arguments;
4624
+ if (useStateInput != null) {
4625
+ for (const expr of ast.getNestedNewExpressions(useStateInput)) {
4626
+ if (!("name" in expr.callee)) continue;
4627
+ if (LAZY_INIT_ALLOW_LIST.includes(expr.callee.name)) continue;
4628
+ if (ast.findParentNode(expr, core.isUseCall) != null) continue;
4629
+ context.report({
4630
+ messageId: "invalidInitialization",
4631
+ node: expr
4632
+ });
4633
+ }
4634
+ for (const expr of ast.getNestedCallExpressions(useStateInput)) {
4635
+ if (!("name" in expr.callee)) continue;
4636
+ if (core.isHookName(expr.callee.name)) continue;
4637
+ if (LAZY_INIT_ALLOW_LIST.includes(expr.callee.name)) continue;
4638
+ if (ast.findParentNode(expr, core.isUseCall) != null) continue;
4639
+ context.report({
4640
+ messageId: "invalidInitialization",
4641
+ node: expr
4642
+ });
4643
+ }
4644
+ }
4645
+ }
4646
+ if (node.parent.type !== AST_NODE_TYPES.VariableDeclarator) {
4647
+ if (!enforceAssignment) return;
4648
+ context.report({
4649
+ messageId: "invalidAssignment",
4650
+ node
4651
+ });
4652
+ return;
4653
+ }
4654
+ const id = findEnclosingAssignmentTarget(node);
4655
+ if (id?.type !== AST_NODE_TYPES.ArrayPattern) {
4656
+ if (!enforceAssignment) return;
4657
+ context.report({
4658
+ messageId: "invalidAssignment",
4659
+ node: id ?? node
4660
+ });
4661
+ return;
4662
+ }
4663
+ const [value, setter] = id.elements;
4664
+ if (value == null) {
4665
+ if (!enforceAssignment) return;
4666
+ context.report({
4667
+ messageId: "invalidAssignment",
4668
+ node: id
4669
+ });
4670
+ return;
4671
+ }
4672
+ if (setter == null || !enforceSetterName) return;
4673
+ if (value.type !== AST_NODE_TYPES.Identifier) {
4674
+ context.report({
4675
+ messageId: "invalidAssignment",
4676
+ node: value
4677
+ });
4678
+ return;
4679
+ }
4680
+ if (setter.type !== AST_NODE_TYPES.Identifier || !setter.name.startsWith("set")) {
4681
+ context.report({
4682
+ messageId: "invalidSetterName",
4683
+ node: setter
4684
+ });
4685
+ return;
4686
+ }
4687
+ if (snakeCase(setter.name) !== `set_${snakeCase(value.name)}`) context.report({
4688
+ messageId: "invalidSetterName",
4689
+ node: setter
4690
+ });
4691
+ } });
4692
+ }
4693
+
4567
4694
  //#endregion
4568
4695
  //#region src/plugin.ts
4569
4696
  const plugin = {
@@ -4607,6 +4734,7 @@ const plugin = {
4607
4734
  "no-missing-component-display-name": no_missing_component_display_name_default,
4608
4735
  "no-missing-context-display-name": no_missing_context_display_name_default,
4609
4736
  "no-missing-key": no_missing_key_default,
4737
+ "use-memo": use_memo_default,
4610
4738
  "no-misused-capture-owner-stack": no_misused_capture_owner_stack_default,
4611
4739
  "no-nested-component-definitions": no_nested_component_definitions_default,
4612
4740
  "no-nested-lazy-component-declarations": no_nested_lazy_component_declarations_default,
@@ -4631,13 +4759,13 @@ const plugin = {
4631
4759
  "prefer-destructuring-assignment": prefer_destructuring_assignment_default,
4632
4760
  "prefer-namespace-import": prefer_namespace_import_default,
4633
4761
  "prefer-read-only-props": prefer_read_only_props_default,
4634
- "prefer-use-state-lazy-initialization": prefer_use_state_lazy_initialization_default,
4635
4762
  purity: purity_default,
4636
4763
  refs: refs_default,
4637
4764
  "rules-of-hooks": rules_of_hooks_default,
4638
4765
  "set-state-in-effect": set_state_in_effect_default,
4639
4766
  "set-state-in-render": set_state_in_render_default,
4640
- "unsupported-syntax": unsupported_syntax_default
4767
+ "unsupported-syntax": unsupported_syntax_default,
4768
+ "use-state": use_state_default
4641
4769
  }
4642
4770
  };
4643
4771
 
@@ -4675,6 +4803,8 @@ const rules$6 = {
4675
4803
  "react-x/no-direct-mutation-state": "error",
4676
4804
  "react-x/no-forward-ref": "warn",
4677
4805
  "react-x/no-missing-key": "error",
4806
+ "react-x/use-memo": "error",
4807
+ "react-x/use-state": "warn",
4678
4808
  "react-x/no-nested-component-definitions": "error",
4679
4809
  "react-x/no-nested-lazy-component-declarations": "error",
4680
4810
  "react-x/no-redundant-should-component-update": "error",
@@ -4687,7 +4817,6 @@ const rules$6 = {
4687
4817
  "react-x/no-unsafe-component-will-update": "warn",
4688
4818
  "react-x/no-use-context": "warn",
4689
4819
  "react-x/no-useless-forward-ref": "warn",
4690
- "react-x/prefer-use-state-lazy-initialization": "warn",
4691
4820
  "react-x/purity": "warn",
4692
4821
  "react-x/rules-of-hooks": "error",
4693
4822
  "react-x/set-state-in-effect": "warn",