eslint-plugin-react-x 1.48.5 → 1.49.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -28,6 +28,7 @@ __export(recommended_exports, {
28
28
  });
29
29
  var name = "react-x/recommended";
30
30
  var rules = {
31
+ "react-x/jsx-key-before-spread": "warn",
31
32
  "react-x/jsx-no-duplicate-props": "warn",
32
33
  "react-x/jsx-uses-react": "warn",
33
34
  "react-x/jsx-uses-vars": "warn",
@@ -114,7 +115,7 @@ var settings3 = {
114
115
 
115
116
  // package.json
116
117
  var name4 = "eslint-plugin-react-x";
117
- var version = "1.48.5";
118
+ var version = "1.49.0-beta.1";
118
119
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
119
120
 
120
121
  // src/rules/avoid-shorthand-boolean.ts
@@ -190,17 +191,19 @@ function create2(context) {
190
191
  }
191
192
  };
192
193
  }
193
- var RULE_NAME3 = "jsx-no-duplicate-props";
194
- var RULE_FEATURES3 = [];
195
- var jsx_no_duplicate_props_default = createRule({
194
+ var RULE_NAME3 = "jsx-key-before-spread";
195
+ var RULE_FEATURES3 = [
196
+ "EXP"
197
+ ];
198
+ var jsx_key_before_spread_default = createRule({
196
199
  meta: {
197
200
  type: "problem",
198
201
  docs: {
199
- description: "Disallow duplicate props in JSX elements.",
202
+ description: "Enforces that the 'key' attribute is placed before the spread attribute in JSX elements.",
200
203
  [Symbol.for("rule_features")]: RULE_FEATURES3
201
204
  },
202
205
  messages: {
203
- jsxNoDuplicateProps: "This JSX property is assigned multiple times."
206
+ jsxKeyBeforeSpread: "The 'key' attribute must be placed before the spread attribute."
204
207
  },
205
208
  schema: []
206
209
  },
@@ -209,6 +212,43 @@ var jsx_no_duplicate_props_default = createRule({
209
212
  defaultOptions: []
210
213
  });
211
214
  function create3(context) {
215
+ return {
216
+ JSXOpeningElement(node) {
217
+ let firstSpreadAttributeIndex = null;
218
+ for (const [index, attr] of node.attributes.entries()) {
219
+ if (attr.type === AST_NODE_TYPES.JSXSpreadAttribute) {
220
+ firstSpreadAttributeIndex ??= index;
221
+ continue;
222
+ }
223
+ if (attr.name.name === "key" && firstSpreadAttributeIndex != null && index > firstSpreadAttributeIndex) {
224
+ context.report({
225
+ messageId: "jsxKeyBeforeSpread",
226
+ node: attr
227
+ });
228
+ }
229
+ }
230
+ }
231
+ };
232
+ }
233
+ var RULE_NAME4 = "jsx-no-duplicate-props";
234
+ var RULE_FEATURES4 = [];
235
+ var jsx_no_duplicate_props_default = createRule({
236
+ meta: {
237
+ type: "problem",
238
+ docs: {
239
+ description: "Disallow duplicate props in JSX elements.",
240
+ [Symbol.for("rule_features")]: RULE_FEATURES4
241
+ },
242
+ messages: {
243
+ jsxNoDuplicateProps: "This JSX property is assigned multiple times."
244
+ },
245
+ schema: []
246
+ },
247
+ name: RULE_NAME4,
248
+ create: create4,
249
+ defaultOptions: []
250
+ });
251
+ function create4(context) {
212
252
  return {
213
253
  JSXOpeningElement(node) {
214
254
  const props = [];
@@ -232,25 +272,25 @@ function create3(context) {
232
272
  }
233
273
  };
234
274
  }
235
- var RULE_NAME4 = "jsx-no-undef";
236
- var RULE_FEATURES4 = [];
275
+ var RULE_NAME5 = "jsx-no-undef";
276
+ var RULE_FEATURES5 = [];
237
277
  var jsx_no_undef_default = createRule({
238
278
  meta: {
239
279
  type: "problem",
240
280
  docs: {
241
281
  description: "Disallow undefined variables in JSX.",
242
- [Symbol.for("rule_features")]: RULE_FEATURES4
282
+ [Symbol.for("rule_features")]: RULE_FEATURES5
243
283
  },
244
284
  messages: {
245
285
  jsxNoUndef: "JSX variable '{{name}}' is not defined."
246
286
  },
247
287
  schema: []
248
288
  },
249
- name: RULE_NAME4,
250
- create: create4,
289
+ name: RULE_NAME5,
290
+ create: create5,
251
291
  defaultOptions: []
252
292
  });
253
- function create4(context) {
293
+ function create5(context) {
254
294
  return {
255
295
  JSXOpeningElement(node) {
256
296
  const name5 = match(node.name).with({ type: AST_NODE_TYPES.JSXIdentifier }, (n) => n.name).with({ type: AST_NODE_TYPES.JSXMemberExpression, object: { type: AST_NODE_TYPES.JSXIdentifier } }, (n) => n.object.name).otherwise(() => null);
@@ -270,25 +310,25 @@ function create4(context) {
270
310
  };
271
311
  }
272
312
  var { JsxEmit } = JsxConfig;
273
- var RULE_NAME5 = "jsx-uses-react";
274
- var RULE_FEATURES5 = [];
313
+ var RULE_NAME6 = "jsx-uses-react";
314
+ var RULE_FEATURES6 = [];
275
315
  var jsx_uses_react_default = createRule({
276
316
  meta: {
277
317
  type: "problem",
278
318
  docs: {
279
319
  description: "Marks React variables as used when JSX is used.",
280
- [Symbol.for("rule_features")]: RULE_FEATURES5
320
+ [Symbol.for("rule_features")]: RULE_FEATURES6
281
321
  },
282
322
  messages: {
283
323
  jsxUsesReact: "Marked {{name}} as used."
284
324
  },
285
325
  schema: []
286
326
  },
287
- name: RULE_NAME5,
288
- create: create5,
327
+ name: RULE_NAME6,
328
+ create: create6,
289
329
  defaultOptions: []
290
330
  });
291
- function create5(context) {
331
+ function create6(context) {
292
332
  const jsxConfig = {
293
333
  ...JsxConfig.getFromContext(context),
294
334
  ...JsxConfig.getFromAnnotation(context)
@@ -317,25 +357,25 @@ function debugReport(context, node, name5) {
317
357
  data: { name: name5 }
318
358
  });
319
359
  }
320
- var RULE_NAME6 = "jsx-uses-vars";
321
- var RULE_FEATURES6 = [];
360
+ var RULE_NAME7 = "jsx-uses-vars";
361
+ var RULE_FEATURES7 = [];
322
362
  var jsx_uses_vars_default = createRule({
323
363
  meta: {
324
364
  type: "problem",
325
365
  docs: {
326
366
  description: "Marks variables used in JSX elements as used.",
327
- [Symbol.for("rule_features")]: RULE_FEATURES6
367
+ [Symbol.for("rule_features")]: RULE_FEATURES7
328
368
  },
329
369
  messages: {
330
370
  jsxUsesVars: ""
331
371
  },
332
372
  schema: []
333
373
  },
334
- name: RULE_NAME6,
335
- create: create6,
374
+ name: RULE_NAME7,
375
+ create: create7,
336
376
  defaultOptions: []
337
377
  });
338
- function create6(context) {
378
+ function create7(context) {
339
379
  return {
340
380
  JSXOpeningElement(node) {
341
381
  switch (node.name.type) {
@@ -357,8 +397,8 @@ function create6(context) {
357
397
  }
358
398
  };
359
399
  }
360
- var RULE_NAME7 = "no-access-state-in-setstate";
361
- var RULE_FEATURES7 = [];
400
+ var RULE_NAME8 = "no-access-state-in-setstate";
401
+ var RULE_FEATURES8 = [];
362
402
  function isKeyLiteral(node, key) {
363
403
  return match(key).with({ type: AST_NODE_TYPES.Literal }, constTrue).with({ type: AST_NODE_TYPES.TemplateLiteral, expressions: [] }, constTrue).with({ type: AST_NODE_TYPES.Identifier }, () => !node.computed).otherwise(constFalse);
364
404
  }
@@ -367,18 +407,18 @@ var no_access_state_in_setstate_default = createRule({
367
407
  type: "problem",
368
408
  docs: {
369
409
  description: "Disallow accessing `this.state` inside `setState` calls.",
370
- [Symbol.for("rule_features")]: RULE_FEATURES7
410
+ [Symbol.for("rule_features")]: RULE_FEATURES8
371
411
  },
372
412
  messages: {
373
413
  noAccessStateInSetstate: "Do not access 'this.state' within 'setState'. Use the update function instead."
374
414
  },
375
415
  schema: []
376
416
  },
377
- name: RULE_NAME7,
378
- create: create7,
417
+ name: RULE_NAME8,
418
+ create: create8,
379
419
  defaultOptions: []
380
420
  });
381
- function create7(context) {
421
+ function create8(context) {
382
422
  if (!context.sourceCode.text.includes("setState")) {
383
423
  return {};
384
424
  }
@@ -469,8 +509,8 @@ function create7(context) {
469
509
  }
470
510
  };
471
511
  }
472
- var RULE_NAME8 = "no-array-index-key";
473
- var RULE_FEATURES8 = [];
512
+ var RULE_NAME9 = "no-array-index-key";
513
+ var RULE_FEATURES9 = [];
474
514
  var reactChildrenMethod = ["forEach", "map"];
475
515
  function isReactChildrenMethod(name5) {
476
516
  return reactChildrenMethod.some((method) => method === name5);
@@ -537,18 +577,18 @@ var no_array_index_key_default = createRule({
537
577
  type: "problem",
538
578
  docs: {
539
579
  description: "Disallow an item's index in the array as its key.",
540
- [Symbol.for("rule_features")]: RULE_FEATURES8
580
+ [Symbol.for("rule_features")]: RULE_FEATURES9
541
581
  },
542
582
  messages: {
543
583
  noArrayIndexKey: "Do not use item index in the array as its key."
544
584
  },
545
585
  schema: []
546
586
  },
547
- name: RULE_NAME8,
548
- create: create8,
587
+ name: RULE_NAME9,
588
+ create: create9,
549
589
  defaultOptions: []
550
590
  });
551
- function create8(context) {
591
+ function create9(context) {
552
592
  const report = Reporter.make(context);
553
593
  const indexParamNames = [];
554
594
  function isArrayIndex(node) {
@@ -650,25 +690,25 @@ function create8(context) {
650
690
  }
651
691
  };
652
692
  }
653
- var RULE_NAME9 = "no-children-count";
654
- var RULE_FEATURES9 = [];
693
+ var RULE_NAME10 = "no-children-count";
694
+ var RULE_FEATURES10 = [];
655
695
  var no_children_count_default = createRule({
656
696
  meta: {
657
697
  type: "problem",
658
698
  docs: {
659
699
  description: "Disallow `Children.count`.",
660
- [Symbol.for("rule_features")]: RULE_FEATURES9
700
+ [Symbol.for("rule_features")]: RULE_FEATURES10
661
701
  },
662
702
  messages: {
663
703
  noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead."
664
704
  },
665
705
  schema: []
666
706
  },
667
- name: RULE_NAME9,
668
- create: create9,
707
+ name: RULE_NAME10,
708
+ create: create10,
669
709
  defaultOptions: []
670
710
  });
671
- function create9(context) {
711
+ function create10(context) {
672
712
  return {
673
713
  MemberExpression(node) {
674
714
  if (ER25.isChildrenCount(context, node)) {
@@ -680,25 +720,25 @@ function create9(context) {
680
720
  }
681
721
  };
682
722
  }
683
- var RULE_NAME10 = "no-children-for-each";
684
- var RULE_FEATURES10 = [];
723
+ var RULE_NAME11 = "no-children-for-each";
724
+ var RULE_FEATURES11 = [];
685
725
  var no_children_for_each_default = createRule({
686
726
  meta: {
687
727
  type: "problem",
688
728
  docs: {
689
729
  description: "Disallow 'Children.forEach'.",
690
- [Symbol.for("rule_features")]: RULE_FEATURES10
730
+ [Symbol.for("rule_features")]: RULE_FEATURES11
691
731
  },
692
732
  messages: {
693
733
  noChildrenForEach: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead."
694
734
  },
695
735
  schema: []
696
736
  },
697
- name: RULE_NAME10,
698
- create: create10,
737
+ name: RULE_NAME11,
738
+ create: create11,
699
739
  defaultOptions: []
700
740
  });
701
- function create10(context) {
741
+ function create11(context) {
702
742
  return {
703
743
  MemberExpression(node) {
704
744
  if (ER25.isChildrenForEach(context, node)) {
@@ -710,25 +750,25 @@ function create10(context) {
710
750
  }
711
751
  };
712
752
  }
713
- var RULE_NAME11 = "no-children-map";
714
- var RULE_FEATURES11 = [];
753
+ var RULE_NAME12 = "no-children-map";
754
+ var RULE_FEATURES12 = [];
715
755
  var no_children_map_default = createRule({
716
756
  meta: {
717
757
  type: "problem",
718
758
  docs: {
719
759
  description: "Disallow `Children.map`.",
720
- [Symbol.for("rule_features")]: RULE_FEATURES11
760
+ [Symbol.for("rule_features")]: RULE_FEATURES12
721
761
  },
722
762
  messages: {
723
763
  noChildrenMap: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead."
724
764
  },
725
765
  schema: []
726
766
  },
727
- name: RULE_NAME11,
728
- create: create11,
767
+ name: RULE_NAME12,
768
+ create: create12,
729
769
  defaultOptions: []
730
770
  });
731
- function create11(context) {
771
+ function create12(context) {
732
772
  return {
733
773
  MemberExpression(node) {
734
774
  if (ER25.isChildrenMap(context, node)) {
@@ -740,25 +780,25 @@ function create11(context) {
740
780
  }
741
781
  };
742
782
  }
743
- var RULE_NAME12 = "no-children-only";
744
- var RULE_FEATURES12 = [];
783
+ var RULE_NAME13 = "no-children-only";
784
+ var RULE_FEATURES13 = [];
745
785
  var no_children_only_default = createRule({
746
786
  meta: {
747
787
  type: "problem",
748
788
  docs: {
749
789
  description: "Disallow `Children.only`.",
750
- [Symbol.for("rule_features")]: RULE_FEATURES12
790
+ [Symbol.for("rule_features")]: RULE_FEATURES13
751
791
  },
752
792
  messages: {
753
793
  noChildrenOnly: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead."
754
794
  },
755
795
  schema: []
756
796
  },
757
- name: RULE_NAME12,
758
- create: create12,
797
+ name: RULE_NAME13,
798
+ create: create13,
759
799
  defaultOptions: []
760
800
  });
761
- function create12(context) {
801
+ function create13(context) {
762
802
  return {
763
803
  MemberExpression(node) {
764
804
  if (ER25.isChildrenOnly(context, node)) {
@@ -770,25 +810,25 @@ function create12(context) {
770
810
  }
771
811
  };
772
812
  }
773
- var RULE_NAME13 = "no-children-prop";
774
- var RULE_FEATURES13 = [];
813
+ var RULE_NAME14 = "no-children-prop";
814
+ var RULE_FEATURES14 = [];
775
815
  var no_children_prop_default = createRule({
776
816
  meta: {
777
817
  type: "problem",
778
818
  docs: {
779
819
  description: "Disallow passing `children` as a prop.",
780
- [Symbol.for("rule_features")]: RULE_FEATURES13
820
+ [Symbol.for("rule_features")]: RULE_FEATURES14
781
821
  },
782
822
  messages: {
783
823
  noChildrenProp: "Do not pass 'children' as props."
784
824
  },
785
825
  schema: []
786
826
  },
787
- name: RULE_NAME13,
788
- create: create13,
827
+ name: RULE_NAME14,
828
+ create: create14,
789
829
  defaultOptions: []
790
830
  });
791
- function create13(context) {
831
+ function create14(context) {
792
832
  return {
793
833
  JSXElement(node) {
794
834
  const attributes = node.openingElement.attributes;
@@ -802,25 +842,25 @@ function create13(context) {
802
842
  }
803
843
  };
804
844
  }
805
- var RULE_NAME14 = "no-children-to-array";
806
- var RULE_FEATURES14 = [];
845
+ var RULE_NAME15 = "no-children-to-array";
846
+ var RULE_FEATURES15 = [];
807
847
  var no_children_to_array_default = createRule({
808
848
  meta: {
809
849
  type: "problem",
810
850
  docs: {
811
851
  description: "Disallow `Children.toArray`.",
812
- [Symbol.for("rule_features")]: RULE_FEATURES14
852
+ [Symbol.for("rule_features")]: RULE_FEATURES15
813
853
  },
814
854
  messages: {
815
855
  noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead."
816
856
  },
817
857
  schema: []
818
858
  },
819
- name: RULE_NAME14,
820
- create: create14,
859
+ name: RULE_NAME15,
860
+ create: create15,
821
861
  defaultOptions: []
822
862
  });
823
- function create14(context) {
863
+ function create15(context) {
824
864
  return {
825
865
  MemberExpression(node) {
826
866
  if (ER25.isChildrenToArray(context, node)) {
@@ -832,25 +872,25 @@ function create14(context) {
832
872
  }
833
873
  };
834
874
  }
835
- var RULE_NAME15 = "no-class-component";
836
- var RULE_FEATURES15 = [];
875
+ var RULE_NAME16 = "no-class-component";
876
+ var RULE_FEATURES16 = [];
837
877
  var no_class_component_default = createRule({
838
878
  meta: {
839
879
  type: "problem",
840
880
  docs: {
841
881
  description: "Disallow class components except for error boundaries.",
842
- [Symbol.for("rule_features")]: RULE_FEATURES15
882
+ [Symbol.for("rule_features")]: RULE_FEATURES16
843
883
  },
844
884
  messages: {
845
885
  noClassComponent: "Avoid using class components. Use function components instead."
846
886
  },
847
887
  schema: []
848
888
  },
849
- name: RULE_NAME15,
850
- create: create15,
889
+ name: RULE_NAME16,
890
+ create: create16,
851
891
  defaultOptions: []
852
892
  });
853
- function create15(context) {
893
+ function create16(context) {
854
894
  if (!context.sourceCode.text.includes("Component")) return {};
855
895
  const { ctx, listeners } = ER25.useComponentCollectorLegacy();
856
896
  return {
@@ -872,25 +912,25 @@ function create15(context) {
872
912
  }
873
913
  };
874
914
  }
875
- var RULE_NAME16 = "no-clone-element";
876
- var RULE_FEATURES16 = [];
915
+ var RULE_NAME17 = "no-clone-element";
916
+ var RULE_FEATURES17 = [];
877
917
  var no_clone_element_default = createRule({
878
918
  meta: {
879
919
  type: "problem",
880
920
  docs: {
881
921
  description: "Disallow `cloneElement`.",
882
- [Symbol.for("rule_features")]: RULE_FEATURES16
922
+ [Symbol.for("rule_features")]: RULE_FEATURES17
883
923
  },
884
924
  messages: {
885
925
  noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead."
886
926
  },
887
927
  schema: []
888
928
  },
889
- name: RULE_NAME16,
890
- create: create16,
929
+ name: RULE_NAME17,
930
+ create: create17,
891
931
  defaultOptions: []
892
932
  });
893
- function create16(context) {
933
+ function create17(context) {
894
934
  return {
895
935
  CallExpression(node) {
896
936
  if (ER25.isCloneElementCall(context, node)) {
@@ -902,25 +942,25 @@ function create16(context) {
902
942
  }
903
943
  };
904
944
  }
905
- var RULE_NAME17 = "no-comment-textnodes";
906
- var RULE_FEATURES17 = [];
945
+ var RULE_NAME18 = "no-comment-textnodes";
946
+ var RULE_FEATURES18 = [];
907
947
  var no_comment_textnodes_default = createRule({
908
948
  meta: {
909
949
  type: "problem",
910
950
  docs: {
911
951
  description: "Prevents comments from being inserted as text nodes.",
912
- [Symbol.for("rule_features")]: RULE_FEATURES17
952
+ [Symbol.for("rule_features")]: RULE_FEATURES18
913
953
  },
914
954
  messages: {
915
955
  noCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces."
916
956
  },
917
957
  schema: []
918
958
  },
919
- name: RULE_NAME17,
920
- create: create17,
959
+ name: RULE_NAME18,
960
+ create: create18,
921
961
  defaultOptions: []
922
962
  });
923
- function create17(context) {
963
+ function create18(context) {
924
964
  function hasCommentLike(node) {
925
965
  if (AST8.isOneOf([AST_NODE_TYPES.JSXAttribute, AST_NODE_TYPES.JSXExpressionContainer])(node.parent)) {
926
966
  return false;
@@ -948,8 +988,8 @@ function create17(context) {
948
988
  Literal: visitorFunction
949
989
  };
950
990
  }
951
- var RULE_NAME18 = "no-complex-conditional-rendering";
952
- var RULE_FEATURES18 = [
991
+ var RULE_NAME19 = "no-complex-conditional-rendering";
992
+ var RULE_FEATURES19 = [
953
993
  "EXP"
954
994
  ];
955
995
  var no_complex_conditional_rendering_default = createRule({
@@ -957,18 +997,18 @@ var no_complex_conditional_rendering_default = createRule({
957
997
  type: "problem",
958
998
  docs: {
959
999
  description: "Disallow complex conditional rendering in JSX expressions.",
960
- [Symbol.for("rule_features")]: RULE_FEATURES18
1000
+ [Symbol.for("rule_features")]: RULE_FEATURES19
961
1001
  },
962
1002
  messages: {
963
1003
  noComplexConditionalRendering: "Avoid complex conditional rendering. Extract the logic into separate elements or components."
964
1004
  },
965
1005
  schema: []
966
1006
  },
967
- name: RULE_NAME18,
968
- create: create18,
1007
+ name: RULE_NAME19,
1008
+ create: create19,
969
1009
  defaultOptions: []
970
1010
  });
971
- function create18(context) {
1011
+ function create19(context) {
972
1012
  const visitorFunction = (node) => {
973
1013
  const jsxExpContainer = node.parent?.parent;
974
1014
  if (!AST8.is(AST_NODE_TYPES.JSXExpressionContainer)(jsxExpContainer)) {
@@ -993,8 +1033,8 @@ function create18(context) {
993
1033
  "JSXExpressionContainer > LogicalExpression[operator='||'] > LogicalExpression[operator='&&']": visitorFunction
994
1034
  };
995
1035
  }
996
- var RULE_NAME19 = "no-component-will-mount";
997
- var RULE_FEATURES19 = [
1036
+ var RULE_NAME20 = "no-component-will-mount";
1037
+ var RULE_FEATURES20 = [
998
1038
  "MOD"
999
1039
  ];
1000
1040
  var no_component_will_mount_default = createRule({
@@ -1002,7 +1042,7 @@ var no_component_will_mount_default = createRule({
1002
1042
  type: "problem",
1003
1043
  docs: {
1004
1044
  description: "Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.",
1005
- [Symbol.for("rule_features")]: RULE_FEATURES19
1045
+ [Symbol.for("rule_features")]: RULE_FEATURES20
1006
1046
  },
1007
1047
  fixable: "code",
1008
1048
  messages: {
@@ -1010,11 +1050,11 @@ var no_component_will_mount_default = createRule({
1010
1050
  },
1011
1051
  schema: []
1012
1052
  },
1013
- name: RULE_NAME19,
1014
- create: create19,
1053
+ name: RULE_NAME20,
1054
+ create: create20,
1015
1055
  defaultOptions: []
1016
1056
  });
1017
- function create19(context) {
1057
+ function create20(context) {
1018
1058
  if (!context.sourceCode.text.includes("componentWillMount")) return {};
1019
1059
  const { ctx, listeners } = ER25.useComponentCollectorLegacy();
1020
1060
  return {
@@ -1041,8 +1081,8 @@ function create19(context) {
1041
1081
  }
1042
1082
  };
1043
1083
  }
1044
- var RULE_NAME20 = "no-component-will-receive-props";
1045
- var RULE_FEATURES20 = [
1084
+ var RULE_NAME21 = "no-component-will-receive-props";
1085
+ var RULE_FEATURES21 = [
1046
1086
  "MOD"
1047
1087
  ];
1048
1088
  var no_component_will_receive_props_default = createRule({
@@ -1050,7 +1090,7 @@ var no_component_will_receive_props_default = createRule({
1050
1090
  type: "problem",
1051
1091
  docs: {
1052
1092
  description: "Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.",
1053
- [Symbol.for("rule_features")]: RULE_FEATURES20
1093
+ [Symbol.for("rule_features")]: RULE_FEATURES21
1054
1094
  },
1055
1095
  fixable: "code",
1056
1096
  messages: {
@@ -1058,11 +1098,11 @@ var no_component_will_receive_props_default = createRule({
1058
1098
  },
1059
1099
  schema: []
1060
1100
  },
1061
- name: RULE_NAME20,
1062
- create: create20,
1101
+ name: RULE_NAME21,
1102
+ create: create21,
1063
1103
  defaultOptions: []
1064
1104
  });
1065
- function create20(context) {
1105
+ function create21(context) {
1066
1106
  if (!context.sourceCode.text.includes("componentWillReceiveProps")) return {};
1067
1107
  const { ctx, listeners } = ER25.useComponentCollectorLegacy();
1068
1108
  return {
@@ -1089,8 +1129,8 @@ function create20(context) {
1089
1129
  }
1090
1130
  };
1091
1131
  }
1092
- var RULE_NAME21 = "no-component-will-update";
1093
- var RULE_FEATURES21 = [
1132
+ var RULE_NAME22 = "no-component-will-update";
1133
+ var RULE_FEATURES22 = [
1094
1134
  "MOD"
1095
1135
  ];
1096
1136
  var no_component_will_update_default = createRule({
@@ -1098,7 +1138,7 @@ var no_component_will_update_default = createRule({
1098
1138
  type: "problem",
1099
1139
  docs: {
1100
1140
  description: "Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`.",
1101
- [Symbol.for("rule_features")]: RULE_FEATURES21
1141
+ [Symbol.for("rule_features")]: RULE_FEATURES22
1102
1142
  },
1103
1143
  fixable: "code",
1104
1144
  messages: {
@@ -1106,11 +1146,11 @@ var no_component_will_update_default = createRule({
1106
1146
  },
1107
1147
  schema: []
1108
1148
  },
1109
- name: RULE_NAME21,
1110
- create: create21,
1149
+ name: RULE_NAME22,
1150
+ create: create22,
1111
1151
  defaultOptions: []
1112
1152
  });
1113
- function create21(context) {
1153
+ function create22(context) {
1114
1154
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
1115
1155
  const { ctx, listeners } = ER25.useComponentCollectorLegacy();
1116
1156
  return {
@@ -1137,8 +1177,8 @@ function create21(context) {
1137
1177
  }
1138
1178
  };
1139
1179
  }
1140
- var RULE_NAME22 = "no-context-provider";
1141
- var RULE_FEATURES22 = [
1180
+ var RULE_NAME23 = "no-context-provider";
1181
+ var RULE_FEATURES23 = [
1142
1182
  "MOD"
1143
1183
  ];
1144
1184
  var no_context_provider_default = createRule({
@@ -1146,7 +1186,7 @@ var no_context_provider_default = createRule({
1146
1186
  type: "problem",
1147
1187
  docs: {
1148
1188
  description: "Replace usages of `<Context.Provider>` with `<Context>`.",
1149
- [Symbol.for("rule_features")]: RULE_FEATURES22
1189
+ [Symbol.for("rule_features")]: RULE_FEATURES23
1150
1190
  },
1151
1191
  fixable: "code",
1152
1192
  messages: {
@@ -1154,11 +1194,11 @@ var no_context_provider_default = createRule({
1154
1194
  },
1155
1195
  schema: []
1156
1196
  },
1157
- name: RULE_NAME22,
1158
- create: create22,
1197
+ name: RULE_NAME23,
1198
+ create: create23,
1159
1199
  defaultOptions: []
1160
1200
  });
1161
- function create22(context) {
1201
+ function create23(context) {
1162
1202
  if (!context.sourceCode.text.includes("Provider")) return {};
1163
1203
  const { version: version2 } = getSettingsFromContext(context);
1164
1204
  if (compare(version2, "19.0.0", "<")) return {};
@@ -1190,25 +1230,25 @@ function create22(context) {
1190
1230
  }
1191
1231
  };
1192
1232
  }
1193
- var RULE_NAME23 = "no-create-ref";
1194
- var RULE_FEATURES23 = [];
1233
+ var RULE_NAME24 = "no-create-ref";
1234
+ var RULE_FEATURES24 = [];
1195
1235
  var no_create_ref_default = createRule({
1196
1236
  meta: {
1197
1237
  type: "problem",
1198
1238
  docs: {
1199
1239
  description: "Disallow `createRef` in function components.",
1200
- [Symbol.for("rule_features")]: RULE_FEATURES23
1240
+ [Symbol.for("rule_features")]: RULE_FEATURES24
1201
1241
  },
1202
1242
  messages: {
1203
1243
  noCreateRef: "[Deprecated] Use 'useRef' instead."
1204
1244
  },
1205
1245
  schema: []
1206
1246
  },
1207
- name: RULE_NAME23,
1208
- create: create23,
1247
+ name: RULE_NAME24,
1248
+ create: create24,
1209
1249
  defaultOptions: []
1210
1250
  });
1211
- function create23(context) {
1251
+ function create24(context) {
1212
1252
  return {
1213
1253
  CallExpression(node) {
1214
1254
  if (ER25.isCreateRefCall(context, node) && AST8.findParentNode(node, ER25.isClassComponent) == null) {
@@ -1217,25 +1257,25 @@ function create23(context) {
1217
1257
  }
1218
1258
  };
1219
1259
  }
1220
- var RULE_NAME24 = "no-default-props";
1221
- var RULE_FEATURES24 = [];
1260
+ var RULE_NAME25 = "no-default-props";
1261
+ var RULE_FEATURES25 = [];
1222
1262
  var no_default_props_default = createRule({
1223
1263
  meta: {
1224
1264
  type: "problem",
1225
1265
  docs: {
1226
1266
  description: "Disallow `defaultProps` property in favor of ES6 default parameters.",
1227
- [Symbol.for("rule_features")]: RULE_FEATURES24
1267
+ [Symbol.for("rule_features")]: RULE_FEATURES25
1228
1268
  },
1229
1269
  messages: {
1230
1270
  noDefaultProps: "[Deprecated] Use ES6 default parameters instead."
1231
1271
  },
1232
1272
  schema: []
1233
1273
  },
1234
- name: RULE_NAME24,
1235
- create: create24,
1274
+ name: RULE_NAME25,
1275
+ create: create25,
1236
1276
  defaultOptions: []
1237
1277
  });
1238
- function create24(context) {
1278
+ function create25(context) {
1239
1279
  if (!context.sourceCode.text.includes("defaultProps")) return {};
1240
1280
  return {
1241
1281
  AssignmentExpression(node) {
@@ -1269,8 +1309,8 @@ function create24(context) {
1269
1309
  }
1270
1310
  };
1271
1311
  }
1272
- var RULE_NAME25 = "no-direct-mutation-state";
1273
- var RULE_FEATURES25 = [];
1312
+ var RULE_NAME26 = "no-direct-mutation-state";
1313
+ var RULE_FEATURES26 = [];
1274
1314
  function isConstructorFunction(node) {
1275
1315
  return AST8.isOneOf([AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.FunctionExpression])(node) && AST8.isMethodOrProperty(node.parent) && node.parent.key.type === AST_NODE_TYPES.Identifier && node.parent.key.name === "constructor";
1276
1316
  }
@@ -1279,18 +1319,18 @@ var no_direct_mutation_state_default = createRule({
1279
1319
  type: "problem",
1280
1320
  docs: {
1281
1321
  description: "Disallow direct mutation of `this.state`.",
1282
- [Symbol.for("rule_features")]: RULE_FEATURES25
1322
+ [Symbol.for("rule_features")]: RULE_FEATURES26
1283
1323
  },
1284
1324
  messages: {
1285
1325
  noDirectMutationState: "Do not mutate state directly. Use 'setState()' instead."
1286
1326
  },
1287
1327
  schema: []
1288
1328
  },
1289
- name: RULE_NAME25,
1290
- create: create25,
1329
+ name: RULE_NAME26,
1330
+ create: create26,
1291
1331
  defaultOptions: []
1292
1332
  });
1293
- function create25(context) {
1333
+ function create26(context) {
1294
1334
  return {
1295
1335
  AssignmentExpression(node) {
1296
1336
  if (!ER25.isAssignmentToThisState(node)) return;
@@ -1311,25 +1351,25 @@ function create25(context) {
1311
1351
  }
1312
1352
  };
1313
1353
  }
1314
- var RULE_NAME26 = "no-duplicate-key";
1315
- var RULE_FEATURES26 = [];
1354
+ var RULE_NAME27 = "no-duplicate-key";
1355
+ var RULE_FEATURES27 = [];
1316
1356
  var no_duplicate_key_default = createRule({
1317
1357
  meta: {
1318
1358
  type: "problem",
1319
1359
  docs: {
1320
1360
  description: "Disallow duplicate `key` on elements in the same array or a list of `children`.",
1321
- [Symbol.for("rule_features")]: RULE_FEATURES26
1361
+ [Symbol.for("rule_features")]: RULE_FEATURES27
1322
1362
  },
1323
1363
  messages: {
1324
1364
  noDuplicateKey: "A key must be unique. '{{value}}' is duplicated."
1325
1365
  },
1326
1366
  schema: []
1327
1367
  },
1328
- name: RULE_NAME26,
1329
- create: create26,
1368
+ name: RULE_NAME27,
1369
+ create: create27,
1330
1370
  defaultOptions: []
1331
1371
  });
1332
- function create26(context) {
1372
+ function create27(context) {
1333
1373
  if (!context.sourceCode.getText().includes("key=")) {
1334
1374
  return {};
1335
1375
  }
@@ -1393,8 +1433,8 @@ function create26(context) {
1393
1433
  }
1394
1434
  };
1395
1435
  }
1396
- var RULE_NAME27 = "no-forward-ref";
1397
- var RULE_FEATURES27 = [
1436
+ var RULE_NAME28 = "no-forward-ref";
1437
+ var RULE_FEATURES28 = [
1398
1438
  "MOD"
1399
1439
  ];
1400
1440
  var no_forward_ref_default = createRule({
@@ -1402,7 +1442,7 @@ var no_forward_ref_default = createRule({
1402
1442
  type: "problem",
1403
1443
  docs: {
1404
1444
  description: "Replaces usages of `forwardRef` with passing `ref` as a prop.",
1405
- [Symbol.for("rule_features")]: RULE_FEATURES27
1445
+ [Symbol.for("rule_features")]: RULE_FEATURES28
1406
1446
  },
1407
1447
  fixable: "code",
1408
1448
  messages: {
@@ -1410,11 +1450,11 @@ var no_forward_ref_default = createRule({
1410
1450
  },
1411
1451
  schema: []
1412
1452
  },
1413
- name: RULE_NAME27,
1414
- create: create27,
1453
+ name: RULE_NAME28,
1454
+ create: create28,
1415
1455
  defaultOptions: []
1416
1456
  });
1417
- function create27(context) {
1457
+ function create28(context) {
1418
1458
  if (!context.sourceCode.text.includes("forwardRef")) {
1419
1459
  return {};
1420
1460
  }
@@ -1503,8 +1543,8 @@ function getComponentPropsFixes(context, fixer, node, typeArguments) {
1503
1543
  ...arg1 == null ? [] : [fixer.remove(arg1), fixer.removeRange([arg0.range[1], arg1.range[0]])]
1504
1544
  ];
1505
1545
  }
1506
- var RULE_NAME28 = "no-implicit-key";
1507
- var RULE_FEATURES28 = [
1546
+ var RULE_NAME29 = "no-implicit-key";
1547
+ var RULE_FEATURES29 = [
1508
1548
  "EXP"
1509
1549
  ];
1510
1550
  var no_implicit_key_default = createRule({
@@ -1512,18 +1552,18 @@ var no_implicit_key_default = createRule({
1512
1552
  type: "problem",
1513
1553
  docs: {
1514
1554
  description: "Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).",
1515
- [Symbol.for("rule_features")]: RULE_FEATURES28
1555
+ [Symbol.for("rule_features")]: RULE_FEATURES29
1516
1556
  },
1517
1557
  messages: {
1518
1558
  noImplicitKey: "Do not use implicit 'key' props."
1519
1559
  },
1520
1560
  schema: []
1521
1561
  },
1522
- name: RULE_NAME28,
1523
- create: create28,
1562
+ name: RULE_NAME29,
1563
+ create: create29,
1524
1564
  defaultOptions: []
1525
1565
  });
1526
- function create28(context) {
1566
+ function create29(context) {
1527
1567
  return {
1528
1568
  JSXOpeningElement(node) {
1529
1569
  const initialScope = context.sourceCode.getScope(node);
@@ -1537,8 +1577,8 @@ function create28(context) {
1537
1577
  }
1538
1578
  };
1539
1579
  }
1540
- var RULE_NAME29 = "no-leaked-conditional-rendering";
1541
- var RULE_FEATURES29 = [
1580
+ var RULE_NAME30 = "no-leaked-conditional-rendering";
1581
+ var RULE_FEATURES30 = [
1542
1582
  "TSC"
1543
1583
  ];
1544
1584
  var tsHelpers = {
@@ -1624,18 +1664,18 @@ var no_leaked_conditional_rendering_default = createRule({
1624
1664
  type: "problem",
1625
1665
  docs: {
1626
1666
  description: "Prevents problematic leaked values from being rendered.",
1627
- [Symbol.for("rule_features")]: RULE_FEATURES29
1667
+ [Symbol.for("rule_features")]: RULE_FEATURES30
1628
1668
  },
1629
1669
  messages: {
1630
1670
  noLeakedConditionalRendering: "Potential leaked value {{value}} that might cause unintentionally rendered values or rendering crashes."
1631
1671
  },
1632
1672
  schema: []
1633
1673
  },
1634
- name: RULE_NAME29,
1635
- create: create29,
1674
+ name: RULE_NAME30,
1675
+ create: create30,
1636
1676
  defaultOptions: []
1637
1677
  });
1638
- function create29(context) {
1678
+ function create30(context) {
1639
1679
  if (!context.sourceCode.text.includes("&&")) return {};
1640
1680
  const { version: version2 } = getSettingsFromContext(context);
1641
1681
  const allowedVariants = [
@@ -1693,25 +1733,25 @@ function create29(context) {
1693
1733
  JSXExpressionContainer: flow(getReportDescriptor, Reporter.make(context).send)
1694
1734
  };
1695
1735
  }
1696
- var RULE_NAME30 = "no-missing-component-display-name";
1697
- var RULE_FEATURES30 = [];
1736
+ var RULE_NAME31 = "no-missing-component-display-name";
1737
+ var RULE_FEATURES31 = [];
1698
1738
  var no_missing_component_display_name_default = createRule({
1699
1739
  meta: {
1700
1740
  type: "problem",
1701
1741
  docs: {
1702
1742
  description: "Enforces that all components have a `displayName` which can be used in devtools.",
1703
- [Symbol.for("rule_features")]: RULE_FEATURES30
1743
+ [Symbol.for("rule_features")]: RULE_FEATURES31
1704
1744
  },
1705
1745
  messages: {
1706
1746
  noMissingComponentDisplayName: "Add missing 'displayName' for component."
1707
1747
  },
1708
1748
  schema: []
1709
1749
  },
1710
- name: RULE_NAME30,
1711
- create: create30,
1750
+ name: RULE_NAME31,
1751
+ create: create31,
1712
1752
  defaultOptions: []
1713
1753
  });
1714
- function create30(context) {
1754
+ function create31(context) {
1715
1755
  if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
1716
1756
  const {
1717
1757
  ctx,
@@ -1747,25 +1787,25 @@ function create30(context) {
1747
1787
  }
1748
1788
  };
1749
1789
  }
1750
- var RULE_NAME31 = "no-missing-context-display-name";
1751
- var RULE_FEATURES31 = [];
1790
+ var RULE_NAME32 = "no-missing-context-display-name";
1791
+ var RULE_FEATURES32 = [];
1752
1792
  var no_missing_context_display_name_default = createRule({
1753
1793
  meta: {
1754
1794
  type: "problem",
1755
1795
  docs: {
1756
1796
  description: "Enforces that all contexts have a `displayName` which can be used in devtools.",
1757
- [Symbol.for("rule_features")]: RULE_FEATURES31
1797
+ [Symbol.for("rule_features")]: RULE_FEATURES32
1758
1798
  },
1759
1799
  messages: {
1760
1800
  noMissingContextDisplayName: "Add missing 'displayName' for context."
1761
1801
  },
1762
1802
  schema: []
1763
1803
  },
1764
- name: RULE_NAME31,
1765
- create: create31,
1804
+ name: RULE_NAME32,
1805
+ create: create32,
1766
1806
  defaultOptions: []
1767
1807
  });
1768
- function create31(context) {
1808
+ function create32(context) {
1769
1809
  if (!context.sourceCode.text.includes("createContext")) return {};
1770
1810
  const createCalls = [];
1771
1811
  const displayNameAssignments = [];
@@ -1803,14 +1843,14 @@ function create31(context) {
1803
1843
  }
1804
1844
  };
1805
1845
  }
1806
- var RULE_NAME32 = "no-missing-key";
1807
- var RULE_FEATURES32 = [];
1846
+ var RULE_NAME33 = "no-missing-key";
1847
+ var RULE_FEATURES33 = [];
1808
1848
  var no_missing_key_default = createRule({
1809
1849
  meta: {
1810
1850
  type: "problem",
1811
1851
  docs: {
1812
1852
  description: "Disallow missing `key` on items in list rendering.",
1813
- [Symbol.for("rule_features")]: RULE_FEATURES32
1853
+ [Symbol.for("rule_features")]: RULE_FEATURES33
1814
1854
  },
1815
1855
  messages: {
1816
1856
  missingKey: "Missing 'key' for element when rendering list.",
@@ -1818,11 +1858,11 @@ var no_missing_key_default = createRule({
1818
1858
  },
1819
1859
  schema: []
1820
1860
  },
1821
- name: RULE_NAME32,
1822
- create: create32,
1861
+ name: RULE_NAME33,
1862
+ create: create33,
1823
1863
  defaultOptions: []
1824
1864
  });
1825
- function create32(context) {
1865
+ function create33(context) {
1826
1866
  const report = Reporter.make(context);
1827
1867
  const state = { isWithinChildrenToArray: false };
1828
1868
  function checkIteratorElement(node) {
@@ -1925,8 +1965,8 @@ function create32(context) {
1925
1965
  }
1926
1966
  };
1927
1967
  }
1928
- var RULE_NAME33 = "no-misused-capture-owner-stack";
1929
- var RULE_FEATURES33 = [
1968
+ var RULE_NAME34 = "no-misused-capture-owner-stack";
1969
+ var RULE_FEATURES34 = [
1930
1970
  "EXP"
1931
1971
  ];
1932
1972
  var no_misused_capture_owner_stack_default = createRule({
@@ -1934,7 +1974,7 @@ var no_misused_capture_owner_stack_default = createRule({
1934
1974
  type: "problem",
1935
1975
  docs: {
1936
1976
  description: "Prevents incorrect usage of `captureOwnerStack`.",
1937
- [Symbol.for("rule_features")]: RULE_FEATURES33
1977
+ [Symbol.for("rule_features")]: RULE_FEATURES34
1938
1978
  },
1939
1979
  fixable: "code",
1940
1980
  messages: {
@@ -1944,11 +1984,11 @@ var no_misused_capture_owner_stack_default = createRule({
1944
1984
  },
1945
1985
  schema: []
1946
1986
  },
1947
- name: RULE_NAME33,
1948
- create: create33,
1987
+ name: RULE_NAME34,
1988
+ create: create34,
1949
1989
  defaultOptions: []
1950
1990
  });
1951
- function create33(context) {
1991
+ function create34(context) {
1952
1992
  if (!context.sourceCode.text.includes("captureOwnerStack")) return {};
1953
1993
  const { importSource } = getSettingsFromContext(context);
1954
1994
  return {
@@ -1981,25 +2021,25 @@ function isDevelopmentOnlyCheck(node) {
1981
2021
  if (AST8.isProcessEnvNodeEnvCompare(node.test, "!==", "production")) return true;
1982
2022
  return false;
1983
2023
  }
1984
- var RULE_NAME34 = "no-nested-component-definitions";
1985
- var RULE_FEATURES34 = [];
2024
+ var RULE_NAME35 = "no-nested-component-definitions";
2025
+ var RULE_FEATURES35 = [];
1986
2026
  var no_nested_component_definitions_default = createRule({
1987
2027
  meta: {
1988
2028
  type: "problem",
1989
2029
  docs: {
1990
2030
  description: "Disallow nesting component definitions inside other components.",
1991
- [Symbol.for("rule_features")]: RULE_FEATURES34
2031
+ [Symbol.for("rule_features")]: RULE_FEATURES35
1992
2032
  },
1993
2033
  messages: {
1994
2034
  noNestedComponentDefinitions: "Do not nest component definitions inside other components or props. {{suggestion}}"
1995
2035
  },
1996
2036
  schema: []
1997
2037
  },
1998
- name: RULE_NAME34,
1999
- create: create34,
2038
+ name: RULE_NAME35,
2039
+ create: create35,
2000
2040
  defaultOptions: []
2001
2041
  });
2002
- function create34(context) {
2042
+ function create35(context) {
2003
2043
  const hint = ER25.ComponentDetectionHint.SkipArrayMapArgument | ER25.ComponentDetectionHint.SkipNullLiteral | ER25.ComponentDetectionHint.SkipUndefined | ER25.ComponentDetectionHint.SkipBooleanLiteral | ER25.ComponentDetectionHint.SkipStringLiteral | ER25.ComponentDetectionHint.SkipNumberLiteral | ER25.ComponentDetectionHint.StrictLogical | ER25.ComponentDetectionHint.StrictConditional;
2004
2044
  const collector = ER25.useComponentCollector(context, { hint });
2005
2045
  const collectorLegacy = ER25.useComponentCollectorLegacy();
@@ -2095,25 +2135,25 @@ function isInsideCreateElementProps(context, node) {
2095
2135
  if (prop == null) return false;
2096
2136
  return prop === call.arguments[1];
2097
2137
  }
2098
- var RULE_NAME35 = "no-nested-component-definitions";
2099
- var RULE_FEATURES35 = [];
2138
+ var RULE_NAME36 = "no-nested-component-definitions";
2139
+ var RULE_FEATURES36 = [];
2100
2140
  var no_nested_lazy_component_declarations_default = createRule({
2101
2141
  meta: {
2102
2142
  type: "problem",
2103
2143
  docs: {
2104
2144
  description: "Disallow nesting lazy component declarations inside other components.",
2105
- [Symbol.for("rule_features")]: RULE_FEATURES35
2145
+ [Symbol.for("rule_features")]: RULE_FEATURES36
2106
2146
  },
2107
2147
  messages: {
2108
2148
  noNestedComponentDefinitions: "Do not declare lazy components inside other components. Instead, always declare them at the top level of your module."
2109
2149
  },
2110
2150
  schema: []
2111
2151
  },
2112
- name: RULE_NAME35,
2113
- create: create35,
2152
+ name: RULE_NAME36,
2153
+ create: create36,
2114
2154
  defaultOptions: []
2115
2155
  });
2116
- function create35(context) {
2156
+ function create36(context) {
2117
2157
  const hint = ER25.ComponentDetectionHint.None;
2118
2158
  const collector = ER25.useComponentCollector(context, { hint });
2119
2159
  const collectorLegacy = ER25.useComponentCollectorLegacy();
@@ -2158,25 +2198,25 @@ function create35(context) {
2158
2198
  }
2159
2199
  };
2160
2200
  }
2161
- var RULE_NAME36 = "no-prop-types";
2162
- var RULE_FEATURES36 = [];
2201
+ var RULE_NAME37 = "no-prop-types";
2202
+ var RULE_FEATURES37 = [];
2163
2203
  var no_prop_types_default = createRule({
2164
2204
  meta: {
2165
2205
  type: "problem",
2166
2206
  docs: {
2167
2207
  description: "Disallow `propTypes` in favor of TypeScript or another type-checking solution.",
2168
- [Symbol.for("rule_features")]: RULE_FEATURES36
2208
+ [Symbol.for("rule_features")]: RULE_FEATURES37
2169
2209
  },
2170
2210
  messages: {
2171
2211
  noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead."
2172
2212
  },
2173
2213
  schema: []
2174
2214
  },
2175
- name: RULE_NAME36,
2176
- create: create36,
2215
+ name: RULE_NAME37,
2216
+ create: create37,
2177
2217
  defaultOptions: []
2178
2218
  });
2179
- function create36(context) {
2219
+ function create37(context) {
2180
2220
  if (!context.sourceCode.text.includes("propTypes")) {
2181
2221
  return {};
2182
2222
  }
@@ -2212,8 +2252,8 @@ function create36(context) {
2212
2252
  }
2213
2253
  };
2214
2254
  }
2215
- var RULE_NAME37 = "no-redundant-should-component-update";
2216
- var RULE_FEATURES37 = [];
2255
+ var RULE_NAME38 = "no-redundant-should-component-update";
2256
+ var RULE_FEATURES38 = [];
2217
2257
  function isShouldComponentUpdate(node) {
2218
2258
  return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
2219
2259
  }
@@ -2222,18 +2262,18 @@ var no_redundant_should_component_update_default = createRule({
2222
2262
  type: "problem",
2223
2263
  docs: {
2224
2264
  description: "Disallow `shouldComponentUpdate` when extending `React.PureComponent`.",
2225
- [Symbol.for("rule_features")]: RULE_FEATURES37
2265
+ [Symbol.for("rule_features")]: RULE_FEATURES38
2226
2266
  },
2227
2267
  messages: {
2228
2268
  noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'."
2229
2269
  },
2230
2270
  schema: []
2231
2271
  },
2232
- name: RULE_NAME37,
2233
- create: create37,
2272
+ name: RULE_NAME38,
2273
+ create: create38,
2234
2274
  defaultOptions: []
2235
2275
  });
2236
- function create37(context) {
2276
+ function create38(context) {
2237
2277
  if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
2238
2278
  const { ctx, listeners } = ER25.useComponentCollectorLegacy();
2239
2279
  return {
@@ -2260,25 +2300,25 @@ function create37(context) {
2260
2300
  }
2261
2301
  };
2262
2302
  }
2263
- var RULE_NAME38 = "no-set-state-in-component-did-mount";
2264
- var RULE_FEATURES38 = [];
2303
+ var RULE_NAME39 = "no-set-state-in-component-did-mount";
2304
+ var RULE_FEATURES39 = [];
2265
2305
  var no_set_state_in_component_did_mount_default = createRule({
2266
2306
  meta: {
2267
2307
  type: "problem",
2268
2308
  docs: {
2269
2309
  description: "Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks.",
2270
- [Symbol.for("rule_features")]: RULE_FEATURES38
2310
+ [Symbol.for("rule_features")]: RULE_FEATURES39
2271
2311
  },
2272
2312
  messages: {
2273
2313
  noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions, such as callbacks."
2274
2314
  },
2275
2315
  schema: []
2276
2316
  },
2277
- name: RULE_NAME38,
2278
- create: create38,
2317
+ name: RULE_NAME39,
2318
+ create: create39,
2279
2319
  defaultOptions: []
2280
2320
  });
2281
- function create38(context) {
2321
+ function create39(context) {
2282
2322
  if (!context.sourceCode.text.includes("componentDidMount")) return {};
2283
2323
  return {
2284
2324
  CallExpression(node) {
@@ -2299,25 +2339,25 @@ function create38(context) {
2299
2339
  }
2300
2340
  };
2301
2341
  }
2302
- var RULE_NAME39 = "no-set-state-in-component-did-update";
2303
- var RULE_FEATURES39 = [];
2342
+ var RULE_NAME40 = "no-set-state-in-component-did-update";
2343
+ var RULE_FEATURES40 = [];
2304
2344
  var no_set_state_in_component_did_update_default = createRule({
2305
2345
  meta: {
2306
2346
  type: "problem",
2307
2347
  docs: {
2308
2348
  description: "Disallow calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks.",
2309
- [Symbol.for("rule_features")]: RULE_FEATURES39
2349
+ [Symbol.for("rule_features")]: RULE_FEATURES40
2310
2350
  },
2311
2351
  messages: {
2312
2352
  noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions, such as callbacks."
2313
2353
  },
2314
2354
  schema: []
2315
2355
  },
2316
- name: RULE_NAME39,
2317
- create: create39,
2356
+ name: RULE_NAME40,
2357
+ create: create40,
2318
2358
  defaultOptions: []
2319
2359
  });
2320
- function create39(context) {
2360
+ function create40(context) {
2321
2361
  if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
2322
2362
  return {
2323
2363
  CallExpression(node) {
@@ -2338,25 +2378,25 @@ function create39(context) {
2338
2378
  }
2339
2379
  };
2340
2380
  }
2341
- var RULE_NAME40 = "no-set-state-in-component-will-update";
2342
- var RULE_FEATURES40 = [];
2381
+ var RULE_NAME41 = "no-set-state-in-component-will-update";
2382
+ var RULE_FEATURES41 = [];
2343
2383
  var no_set_state_in_component_will_update_default = createRule({
2344
2384
  meta: {
2345
2385
  type: "problem",
2346
2386
  docs: {
2347
2387
  description: "Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.",
2348
- [Symbol.for("rule_features")]: RULE_FEATURES40
2388
+ [Symbol.for("rule_features")]: RULE_FEATURES41
2349
2389
  },
2350
2390
  messages: {
2351
2391
  noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions, such as callbacks."
2352
2392
  },
2353
2393
  schema: []
2354
2394
  },
2355
- name: RULE_NAME40,
2356
- create: create40,
2395
+ name: RULE_NAME41,
2396
+ create: create41,
2357
2397
  defaultOptions: []
2358
2398
  });
2359
- function create40(context) {
2399
+ function create41(context) {
2360
2400
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
2361
2401
  return {
2362
2402
  CallExpression(node) {
@@ -2377,8 +2417,8 @@ function create40(context) {
2377
2417
  }
2378
2418
  };
2379
2419
  }
2380
- var RULE_NAME41 = "no-string-refs";
2381
- var RULE_FEATURES41 = [
2420
+ var RULE_NAME42 = "no-string-refs";
2421
+ var RULE_FEATURES42 = [
2382
2422
  "MOD"
2383
2423
  ];
2384
2424
  var no_string_refs_default = createRule({
@@ -2386,7 +2426,7 @@ var no_string_refs_default = createRule({
2386
2426
  type: "problem",
2387
2427
  docs: {
2388
2428
  description: "Replaces string refs with callback refs.",
2389
- [Symbol.for("rule_features")]: RULE_FEATURES41
2429
+ [Symbol.for("rule_features")]: RULE_FEATURES42
2390
2430
  },
2391
2431
  fixable: "code",
2392
2432
  messages: {
@@ -2394,11 +2434,11 @@ var no_string_refs_default = createRule({
2394
2434
  },
2395
2435
  schema: []
2396
2436
  },
2397
- name: RULE_NAME41,
2398
- create: create41,
2437
+ name: RULE_NAME42,
2438
+ create: create42,
2399
2439
  defaultOptions: []
2400
2440
  });
2401
- function create41(context) {
2441
+ function create42(context) {
2402
2442
  const state = {
2403
2443
  isWithinClassComponent: false
2404
2444
  };
@@ -2442,8 +2482,8 @@ function getAttributeValueText(context, node) {
2442
2482
  return null;
2443
2483
  }
2444
2484
  }
2445
- var RULE_NAME42 = "no-unsafe-component-will-mount";
2446
- var RULE_FEATURES42 = [];
2485
+ var RULE_NAME43 = "no-unsafe-component-will-mount";
2486
+ var RULE_FEATURES43 = [];
2447
2487
  function isUnsafeComponentWillMount(node) {
2448
2488
  return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
2449
2489
  }
@@ -2452,18 +2492,18 @@ var no_unsafe_component_will_mount_default = createRule({
2452
2492
  type: "problem",
2453
2493
  docs: {
2454
2494
  description: "Warns the usage of `UNSAFE_componentWillMount` in class components.",
2455
- [Symbol.for("rule_features")]: RULE_FEATURES42
2495
+ [Symbol.for("rule_features")]: RULE_FEATURES43
2456
2496
  },
2457
2497
  messages: {
2458
2498
  noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'."
2459
2499
  },
2460
2500
  schema: []
2461
2501
  },
2462
- name: RULE_NAME42,
2463
- create: create42,
2502
+ name: RULE_NAME43,
2503
+ create: create43,
2464
2504
  defaultOptions: []
2465
2505
  });
2466
- function create42(context) {
2506
+ function create43(context) {
2467
2507
  if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
2468
2508
  const { ctx, listeners } = ER25.useComponentCollectorLegacy();
2469
2509
  return {
@@ -2484,8 +2524,8 @@ function create42(context) {
2484
2524
  }
2485
2525
  };
2486
2526
  }
2487
- var RULE_NAME43 = "no-unsafe-component-will-receive-props";
2488
- var RULE_FEATURES43 = [];
2527
+ var RULE_NAME44 = "no-unsafe-component-will-receive-props";
2528
+ var RULE_FEATURES44 = [];
2489
2529
  function isUnsafeComponentWillReceiveProps(node) {
2490
2530
  return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
2491
2531
  }
@@ -2494,18 +2534,18 @@ var no_unsafe_component_will_receive_props_default = createRule({
2494
2534
  type: "problem",
2495
2535
  docs: {
2496
2536
  description: "Warns the usage of `UNSAFE_componentWillReceiveProps` in class components.",
2497
- [Symbol.for("rule_features")]: RULE_FEATURES43
2537
+ [Symbol.for("rule_features")]: RULE_FEATURES44
2498
2538
  },
2499
2539
  messages: {
2500
2540
  noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'."
2501
2541
  },
2502
2542
  schema: []
2503
2543
  },
2504
- name: RULE_NAME43,
2505
- create: create43,
2544
+ name: RULE_NAME44,
2545
+ create: create44,
2506
2546
  defaultOptions: []
2507
2547
  });
2508
- function create43(context) {
2548
+ function create44(context) {
2509
2549
  if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) {
2510
2550
  return {};
2511
2551
  }
@@ -2528,8 +2568,8 @@ function create43(context) {
2528
2568
  }
2529
2569
  };
2530
2570
  }
2531
- var RULE_NAME44 = "no-unsafe-component-will-update";
2532
- var RULE_FEATURES44 = [];
2571
+ var RULE_NAME45 = "no-unsafe-component-will-update";
2572
+ var RULE_FEATURES45 = [];
2533
2573
  function isUnsafeComponentWillUpdate(node) {
2534
2574
  return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
2535
2575
  }
@@ -2538,18 +2578,18 @@ var no_unsafe_component_will_update_default = createRule({
2538
2578
  type: "problem",
2539
2579
  docs: {
2540
2580
  description: "Warns the usage of `UNSAFE_componentWillUpdate` in class components.",
2541
- [Symbol.for("rule_features")]: RULE_FEATURES44
2581
+ [Symbol.for("rule_features")]: RULE_FEATURES45
2542
2582
  },
2543
2583
  messages: {
2544
2584
  noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'."
2545
2585
  },
2546
2586
  schema: []
2547
2587
  },
2548
- name: RULE_NAME44,
2549
- create: create44,
2588
+ name: RULE_NAME45,
2589
+ create: create45,
2550
2590
  defaultOptions: []
2551
2591
  });
2552
- function create44(context) {
2592
+ function create45(context) {
2553
2593
  if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
2554
2594
  const { ctx, listeners } = ER25.useComponentCollectorLegacy();
2555
2595
  return {
@@ -2570,25 +2610,25 @@ function create44(context) {
2570
2610
  }
2571
2611
  };
2572
2612
  }
2573
- var RULE_NAME45 = "no-unstable-context-value";
2574
- var RULE_FEATURES45 = [];
2613
+ var RULE_NAME46 = "no-unstable-context-value";
2614
+ var RULE_FEATURES46 = [];
2575
2615
  var no_unstable_context_value_default = createRule({
2576
2616
  meta: {
2577
2617
  type: "problem",
2578
2618
  docs: {
2579
2619
  description: "Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`.",
2580
- [Symbol.for("rule_features")]: RULE_FEATURES45
2620
+ [Symbol.for("rule_features")]: RULE_FEATURES46
2581
2621
  },
2582
2622
  messages: {
2583
2623
  unstableContextValue: "A/an '{{type}}' passed as the value prop to the context provider should not be constructed. It will change on every render. {{suggestion}}"
2584
2624
  },
2585
2625
  schema: []
2586
2626
  },
2587
- name: RULE_NAME45,
2588
- create: create45,
2627
+ name: RULE_NAME46,
2628
+ create: create46,
2589
2629
  defaultOptions: []
2590
2630
  });
2591
- function create45(context) {
2631
+ function create46(context) {
2592
2632
  const { version: version2 } = getSettingsFromContext(context);
2593
2633
  const isReact18OrBelow = compare(version2, "19.0.0", "<");
2594
2634
  const { ctx, listeners } = ER25.useComponentCollector(context);
@@ -2643,25 +2683,25 @@ function isContextName(name5, isReact18OrBelow) {
2643
2683
  }
2644
2684
  return false;
2645
2685
  }
2646
- var RULE_NAME46 = "no-unstable-default-props";
2647
- var RULE_FEATURES46 = [];
2686
+ var RULE_NAME47 = "no-unstable-default-props";
2687
+ var RULE_FEATURES47 = [];
2648
2688
  var no_unstable_default_props_default = createRule({
2649
2689
  meta: {
2650
2690
  type: "problem",
2651
2691
  docs: {
2652
2692
  description: "Prevents using referential-type values as default props in object destructuring.",
2653
- [Symbol.for("rule_features")]: RULE_FEATURES46
2693
+ [Symbol.for("rule_features")]: RULE_FEATURES47
2654
2694
  },
2655
2695
  messages: {
2656
2696
  noUnstableDefaultProps: "A/an '{{forbiddenType}}' as default prop. This could lead to potential infinite render loop in React. Use a variable instead of '{{forbiddenType}}'."
2657
2697
  },
2658
2698
  schema: []
2659
2699
  },
2660
- name: RULE_NAME46,
2661
- create: create46,
2700
+ name: RULE_NAME47,
2701
+ create: create47,
2662
2702
  defaultOptions: []
2663
2703
  });
2664
- function create46(context) {
2704
+ function create47(context) {
2665
2705
  const { ctx, listeners } = ER25.useComponentCollector(context);
2666
2706
  const declarators = /* @__PURE__ */ new WeakMap();
2667
2707
  return {
@@ -2717,8 +2757,8 @@ function create46(context) {
2717
2757
  }
2718
2758
  };
2719
2759
  }
2720
- var RULE_NAME47 = "no-unused-class-component-members";
2721
- var RULE_FEATURES47 = [];
2760
+ var RULE_NAME48 = "no-unused-class-component-members";
2761
+ var RULE_FEATURES48 = [];
2722
2762
  var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
2723
2763
  "componentDidCatch",
2724
2764
  "componentDidMount",
@@ -2744,18 +2784,18 @@ var no_unused_class_component_members_default = createRule({
2744
2784
  type: "problem",
2745
2785
  docs: {
2746
2786
  description: "Warns unused class component methods and properties.",
2747
- [Symbol.for("rule_features")]: RULE_FEATURES47
2787
+ [Symbol.for("rule_features")]: RULE_FEATURES48
2748
2788
  },
2749
2789
  messages: {
2750
2790
  noUnusedClassComponentMembers: "Unused method or property '{{methodName}}'' of class '{{className}}'."
2751
2791
  },
2752
2792
  schema: []
2753
2793
  },
2754
- name: RULE_NAME47,
2755
- create: create47,
2794
+ name: RULE_NAME48,
2795
+ create: create48,
2756
2796
  defaultOptions: []
2757
2797
  });
2758
- function create47(context) {
2798
+ function create48(context) {
2759
2799
  const classEntries = [];
2760
2800
  const methodEntries = [];
2761
2801
  const propertyDefs = /* @__PURE__ */ new WeakMap();
@@ -2865,8 +2905,8 @@ function create47(context) {
2865
2905
  }
2866
2906
  };
2867
2907
  }
2868
- var RULE_NAME48 = "no-unused-state";
2869
- var RULE_FEATURES48 = [];
2908
+ var RULE_NAME49 = "no-unused-state";
2909
+ var RULE_FEATURES49 = [];
2870
2910
  function isKeyLiteral3(node, key) {
2871
2911
  return match(key).with({ type: AST_NODE_TYPES.Literal }, constTrue).with({ type: AST_NODE_TYPES.TemplateLiteral, expressions: [] }, constTrue).with({ type: AST_NODE_TYPES.Identifier }, () => !node.computed).otherwise(constFalse);
2872
2912
  }
@@ -2875,18 +2915,18 @@ var no_unused_state_default = createRule({
2875
2915
  type: "problem",
2876
2916
  docs: {
2877
2917
  description: "Warns unused class component state.",
2878
- [Symbol.for("rule_features")]: RULE_FEATURES48
2918
+ [Symbol.for("rule_features")]: RULE_FEATURES49
2879
2919
  },
2880
2920
  messages: {
2881
2921
  noUnusedState: "Unused class component state in '{{className}}'"
2882
2922
  },
2883
2923
  schema: []
2884
2924
  },
2885
- name: RULE_NAME48,
2886
- create: create48,
2925
+ name: RULE_NAME49,
2926
+ create: create49,
2887
2927
  defaultOptions: []
2888
2928
  });
2889
- function create48(context) {
2929
+ function create49(context) {
2890
2930
  const classEntries = [];
2891
2931
  const methodEntries = [];
2892
2932
  const constructorEntries = [];
@@ -3020,8 +3060,8 @@ function create48(context) {
3020
3060
  }
3021
3061
  };
3022
3062
  }
3023
- var RULE_NAME49 = "no-use-context";
3024
- var RULE_FEATURES49 = [
3063
+ var RULE_NAME50 = "no-use-context";
3064
+ var RULE_FEATURES50 = [
3025
3065
  "MOD"
3026
3066
  ];
3027
3067
  var no_use_context_default = createRule({
@@ -3029,7 +3069,7 @@ var no_use_context_default = createRule({
3029
3069
  type: "problem",
3030
3070
  docs: {
3031
3071
  description: "Replaces usages of `useContext` with `use`.",
3032
- [Symbol.for("rule_features")]: RULE_FEATURES49
3072
+ [Symbol.for("rule_features")]: RULE_FEATURES50
3033
3073
  },
3034
3074
  fixable: "code",
3035
3075
  messages: {
@@ -3037,11 +3077,11 @@ var no_use_context_default = createRule({
3037
3077
  },
3038
3078
  schema: []
3039
3079
  },
3040
- name: RULE_NAME49,
3041
- create: create49,
3080
+ name: RULE_NAME50,
3081
+ create: create50,
3042
3082
  defaultOptions: []
3043
3083
  });
3044
- function create49(context) {
3084
+ function create50(context) {
3045
3085
  if (!context.sourceCode.text.includes("useContext")) return {};
3046
3086
  const settings4 = getSettingsFromContext(context);
3047
3087
  if (compare(settings4.version, "19.0.0", "<")) {
@@ -3124,25 +3164,25 @@ function getCorrelativeTokens(context, node) {
3124
3164
  }
3125
3165
  return tokens;
3126
3166
  }
3127
- var RULE_NAME50 = "no-useless-forward-ref";
3128
- var RULE_FEATURES50 = [];
3167
+ var RULE_NAME51 = "no-useless-forward-ref";
3168
+ var RULE_FEATURES51 = [];
3129
3169
  var no_useless_forward_ref_default = createRule({
3130
3170
  meta: {
3131
3171
  type: "problem",
3132
3172
  docs: {
3133
3173
  description: "Disallow useless `forwardRef` calls on components that don't use `ref`s.",
3134
- [Symbol.for("rule_features")]: RULE_FEATURES50
3174
+ [Symbol.for("rule_features")]: RULE_FEATURES51
3135
3175
  },
3136
3176
  messages: {
3137
3177
  noUselessForwardRef: "A 'forwardRef' is used with this component but no 'ref' parameter is set."
3138
3178
  },
3139
3179
  schema: []
3140
3180
  },
3141
- name: RULE_NAME50,
3142
- create: create50,
3181
+ name: RULE_NAME51,
3182
+ create: create51,
3143
3183
  defaultOptions: []
3144
3184
  });
3145
- function create50(context) {
3185
+ function create51(context) {
3146
3186
  return {
3147
3187
  CallExpression(node) {
3148
3188
  if (!ER25.isForwardRefCall(context, node)) {
@@ -3163,7 +3203,7 @@ function create50(context) {
3163
3203
  }
3164
3204
  };
3165
3205
  }
3166
- var RULE_NAME51 = "no-useless-fragment";
3206
+ var RULE_NAME52 = "no-useless-fragment";
3167
3207
  var defaultOptions = [{
3168
3208
  allowExpressions: true
3169
3209
  }];
@@ -3189,11 +3229,11 @@ var no_useless_fragment_default = createRule({
3189
3229
  }
3190
3230
  }]
3191
3231
  },
3192
- name: RULE_NAME51,
3193
- create: create51,
3232
+ name: RULE_NAME52,
3233
+ create: create52,
3194
3234
  defaultOptions
3195
3235
  });
3196
- function create51(context, [option]) {
3236
+ function create52(context, [option]) {
3197
3237
  const { allowExpressions = true } = option;
3198
3238
  return {
3199
3239
  JSXElement(node) {
@@ -3313,8 +3353,8 @@ function canFix(context, node) {
3313
3353
  }
3314
3354
  return true;
3315
3355
  }
3316
- var RULE_NAME52 = "prefer-destructuring-assignment";
3317
- var RULE_FEATURES51 = [];
3356
+ var RULE_NAME53 = "prefer-destructuring-assignment";
3357
+ var RULE_FEATURES52 = [];
3318
3358
  function isMemberExpressionWithObjectName(node) {
3319
3359
  return node.object.type === AST_NODE_TYPES.Identifier && "name" in node.object;
3320
3360
  }
@@ -3323,18 +3363,18 @@ var prefer_destructuring_assignment_default = createRule({
3323
3363
  type: "problem",
3324
3364
  docs: {
3325
3365
  description: "Enforces destructuring assignment for component props and context.",
3326
- [Symbol.for("rule_features")]: RULE_FEATURES51
3366
+ [Symbol.for("rule_features")]: RULE_FEATURES52
3327
3367
  },
3328
3368
  messages: {
3329
3369
  preferDestructuringAssignment: "Use destructuring assignment for {{name}}."
3330
3370
  },
3331
3371
  schema: []
3332
3372
  },
3333
- name: RULE_NAME52,
3334
- create: create52,
3373
+ name: RULE_NAME53,
3374
+ create: create53,
3335
3375
  defaultOptions: []
3336
3376
  });
3337
- function create52(context) {
3377
+ function create53(context) {
3338
3378
  const { ctx, listeners } = ER25.useComponentCollector(context);
3339
3379
  const memberExpressionWithNames = [];
3340
3380
  return {
@@ -3394,8 +3434,8 @@ function create52(context) {
3394
3434
  }
3395
3435
  };
3396
3436
  }
3397
- var RULE_NAME53 = "prefer-react-namespace-import";
3398
- var RULE_FEATURES52 = [
3437
+ var RULE_NAME54 = "prefer-react-namespace-import";
3438
+ var RULE_FEATURES53 = [
3399
3439
  "FIX"
3400
3440
  ];
3401
3441
  var prefer_react_namespace_import_default = createRule({
@@ -3403,7 +3443,7 @@ var prefer_react_namespace_import_default = createRule({
3403
3443
  type: "problem",
3404
3444
  docs: {
3405
3445
  description: "Enforces React is imported via a namespace import.",
3406
- [Symbol.for("rule_features")]: RULE_FEATURES52
3446
+ [Symbol.for("rule_features")]: RULE_FEATURES53
3407
3447
  },
3408
3448
  fixable: "code",
3409
3449
  messages: {
@@ -3411,11 +3451,11 @@ var prefer_react_namespace_import_default = createRule({
3411
3451
  },
3412
3452
  schema: []
3413
3453
  },
3414
- name: RULE_NAME53,
3415
- create: create53,
3454
+ name: RULE_NAME54,
3455
+ create: create54,
3416
3456
  defaultOptions: []
3417
3457
  });
3418
- function create53(context) {
3458
+ function create54(context) {
3419
3459
  const { importSource } = getSettingsFromContext(context);
3420
3460
  return {
3421
3461
  [`ImportDeclaration[source.value="${importSource}"] ImportDefaultSpecifier`](node) {
@@ -3450,8 +3490,8 @@ function create53(context) {
3450
3490
  }
3451
3491
  };
3452
3492
  }
3453
- var RULE_NAME54 = "prefer-read-only-props";
3454
- var RULE_FEATURES53 = [
3493
+ var RULE_NAME55 = "prefer-read-only-props";
3494
+ var RULE_FEATURES54 = [
3455
3495
  "TSC",
3456
3496
  "EXP"
3457
3497
  ];
@@ -3460,18 +3500,18 @@ var prefer_read_only_props_default = createRule({
3460
3500
  type: "problem",
3461
3501
  docs: {
3462
3502
  description: "Enforces read-only props in components.",
3463
- [Symbol.for("rule_features")]: RULE_FEATURES53
3503
+ [Symbol.for("rule_features")]: RULE_FEATURES54
3464
3504
  },
3465
3505
  messages: {
3466
3506
  preferReadOnlyProps: "A function component's props should be read-only."
3467
3507
  },
3468
3508
  schema: []
3469
3509
  },
3470
- name: RULE_NAME54,
3471
- create: create54,
3510
+ name: RULE_NAME55,
3511
+ create: create55,
3472
3512
  defaultOptions: []
3473
3513
  });
3474
- function create54(context) {
3514
+ function create55(context) {
3475
3515
  const services = ESLintUtils.getParserServices(context, false);
3476
3516
  const { ctx, listeners } = ER25.useComponentCollector(context);
3477
3517
  return {
@@ -3501,8 +3541,8 @@ function isTypeReadonlyLoose(services, type) {
3501
3541
  return true;
3502
3542
  }
3503
3543
  }
3504
- var RULE_NAME55 = "prefer-shorthand-boolean";
3505
- var RULE_FEATURES54 = [
3544
+ var RULE_NAME56 = "prefer-shorthand-boolean";
3545
+ var RULE_FEATURES55 = [
3506
3546
  "FIX"
3507
3547
  ];
3508
3548
  var prefer_shorthand_boolean_default = createRule({
@@ -3510,7 +3550,7 @@ var prefer_shorthand_boolean_default = createRule({
3510
3550
  type: "problem",
3511
3551
  docs: {
3512
3552
  description: "Enforces shorthand syntax for boolean attributes.",
3513
- [Symbol.for("rule_features")]: RULE_FEATURES54
3553
+ [Symbol.for("rule_features")]: RULE_FEATURES55
3514
3554
  },
3515
3555
  fixable: "code",
3516
3556
  messages: {
@@ -3518,11 +3558,11 @@ var prefer_shorthand_boolean_default = createRule({
3518
3558
  },
3519
3559
  schema: []
3520
3560
  },
3521
- name: RULE_NAME55,
3522
- create: create55,
3561
+ name: RULE_NAME56,
3562
+ create: create56,
3523
3563
  defaultOptions: []
3524
3564
  });
3525
- function create55(context) {
3565
+ function create56(context) {
3526
3566
  return {
3527
3567
  JSXAttribute(node) {
3528
3568
  const { value } = node;
@@ -3542,8 +3582,8 @@ function create55(context) {
3542
3582
  }
3543
3583
  };
3544
3584
  }
3545
- var RULE_NAME56 = "prefer-shorthand-fragment";
3546
- var RULE_FEATURES55 = [
3585
+ var RULE_NAME57 = "prefer-shorthand-fragment";
3586
+ var RULE_FEATURES56 = [
3547
3587
  "FIX"
3548
3588
  ];
3549
3589
  var prefer_shorthand_fragment_default = createRule({
@@ -3551,7 +3591,7 @@ var prefer_shorthand_fragment_default = createRule({
3551
3591
  type: "problem",
3552
3592
  docs: {
3553
3593
  description: "Enforces shorthand syntax for fragments.",
3554
- [Symbol.for("rule_features")]: RULE_FEATURES55
3594
+ [Symbol.for("rule_features")]: RULE_FEATURES56
3555
3595
  },
3556
3596
  fixable: "code",
3557
3597
  messages: {
@@ -3559,11 +3599,11 @@ var prefer_shorthand_fragment_default = createRule({
3559
3599
  },
3560
3600
  schema: []
3561
3601
  },
3562
- name: RULE_NAME56,
3563
- create: create56,
3602
+ name: RULE_NAME57,
3603
+ create: create57,
3564
3604
  defaultOptions: []
3565
3605
  });
3566
- function create56(context) {
3606
+ function create57(context) {
3567
3607
  return {
3568
3608
  JSXElement(node) {
3569
3609
  if (!ER25.isFragmentElement(context, node)) return;
@@ -3649,6 +3689,7 @@ var plugin = {
3649
3689
  "prefer-shorthand-boolean": prefer_shorthand_boolean_default,
3650
3690
  "prefer-shorthand-fragment": prefer_shorthand_fragment_default,
3651
3691
  // Part: JSX only rules
3692
+ "jsx-key-before-spread": jsx_key_before_spread_default,
3652
3693
  "jsx-no-duplicate-props": jsx_no_duplicate_props_default,
3653
3694
  "jsx-no-undef": jsx_no_undef_default,
3654
3695
  "jsx-uses-react": jsx_uses_react_default,