eslint-plugin-react-x 1.38.0-beta.4 → 1.38.0-beta.7

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
@@ -1,10 +1,10 @@
1
1
  import { getDocsUrl, getSettingsFromContext, unsafeDecodeSettings, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
2
2
  import * as JSX8 from '@eslint-react/jsx';
3
3
  import { ESLintUtils } from '@typescript-eslint/utils';
4
+ import { AST_NODE_TYPES } from '@typescript-eslint/types';
4
5
  import * as AST11 from '@eslint-react/ast';
5
6
  import { isClassComponent, isThisSetState, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy, isComponentDidCatch, isGetDerivedStateFromError, isCloneElementCall, isComponentNameLoose, isCreateRefCall, isAssignmentToThisState, isForwardRefCall, useComponentCollector, DEFAULT_COMPONENT_HINT, ERComponentFlag, getInstanceId, isInstanceIdEqual, DISPLAY_NAME_ASSIGNMENT_SELECTOR, isCreateContextCall, isChildrenToArrayCall, ERComponentHint, isDirectValueOfRenderPropertyLoose, isDeclaredInRenderPropLoose, isInsideRenderMethod, isCreateElementCall, isReactHookCall, isReactHookCallWithNameAlias, isGetDerivedStateFromProps, isInitializedFromReact } from '@eslint-react/core';
6
7
  import { _, flow, getOrUpdate, constTrue, constFalse } from '@eslint-react/eff';
7
- import { AST_NODE_TYPES } from '@typescript-eslint/types';
8
8
  import { isMatching, match, P } from 'ts-pattern';
9
9
  import { createReport } from '@eslint-react/kit';
10
10
  import { compare } from 'compare-versions';
@@ -45,7 +45,7 @@ var rules = {
45
45
  "react-x/no-create-ref": "error",
46
46
  "react-x/no-default-props": "error",
47
47
  "react-x/no-direct-mutation-state": "error",
48
- "react-x/no-duplicate-jsx-props": "warn",
48
+ "react-x/jsx-no-duplicate-props": "warn",
49
49
  "react-x/no-duplicate-key": "warn",
50
50
  "react-x/no-forward-ref": "warn",
51
51
  "react-x/no-implicit-key": "warn",
@@ -66,7 +66,7 @@ var rules = {
66
66
  "react-x/no-unused-state": "warn",
67
67
  "react-x/no-use-context": "warn",
68
68
  "react-x/no-useless-forward-ref": "warn",
69
- "react-x/use-jsx-vars": "warn"
69
+ "react-x/jsx-uses-vars": "warn"
70
70
  };
71
71
  var settings = {
72
72
  "react-x": DEFAULT_ESLINT_REACT_SETTINGS
@@ -90,8 +90,8 @@ __export(recommended_typescript_exports, {
90
90
  var name2 = "react-x/recommended-typescript";
91
91
  var rules2 = {
92
92
  ...rules,
93
- "react-x/no-duplicate-jsx-props": "off",
94
- "react-x/use-jsx-vars": "off"
93
+ "react-x/jsx-no-duplicate-props": "off",
94
+ "react-x/jsx-uses-vars": "off"
95
95
  };
96
96
  var settings2 = {
97
97
  ...settings
@@ -110,7 +110,7 @@ var settings3 = {
110
110
 
111
111
  // package.json
112
112
  var name4 = "eslint-plugin-react-x";
113
- var version = "1.38.0-beta.4";
113
+ var version = "1.38.0-beta.7";
114
114
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
115
115
 
116
116
  // src/rules/avoid-shorthand-boolean.ts
@@ -179,8 +179,90 @@ function create2(context) {
179
179
  }
180
180
  };
181
181
  }
182
- var RULE_NAME3 = "no-access-state-in-setstate";
182
+ var RULE_NAME3 = "jsx-no-duplicate-props";
183
183
  var RULE_FEATURES3 = [];
184
+ var jsx_no_duplicate_props_default = createRule({
185
+ meta: {
186
+ type: "problem",
187
+ docs: {
188
+ description: "Disallow duplicate props in JSX elements.",
189
+ [Symbol.for("rule_features")]: RULE_FEATURES3
190
+ },
191
+ messages: {
192
+ jsxNoDuplicateProps: "This JSX property is assigned multiple times."
193
+ },
194
+ schema: []
195
+ },
196
+ name: RULE_NAME3,
197
+ create: create3,
198
+ defaultOptions: []
199
+ });
200
+ function create3(context) {
201
+ return {
202
+ JSXOpeningElement(node) {
203
+ const props = [];
204
+ for (const attr of node.attributes) {
205
+ if (attr.type === AST_NODE_TYPES.JSXSpreadAttribute) {
206
+ continue;
207
+ }
208
+ const name5 = attr.name.name;
209
+ if (typeof name5 !== "string") {
210
+ continue;
211
+ }
212
+ if (!props.includes(name5)) {
213
+ props.push(name5);
214
+ continue;
215
+ }
216
+ context.report({
217
+ messageId: "jsxNoDuplicateProps",
218
+ node: attr
219
+ });
220
+ }
221
+ }
222
+ };
223
+ }
224
+ var RULE_NAME4 = "jsx-uses-vars";
225
+ var RULE_FEATURES4 = [];
226
+ var jsx_uses_vars_default = createRule({
227
+ meta: {
228
+ type: "problem",
229
+ docs: {
230
+ description: "Marks variables used in JSX as used.",
231
+ [Symbol.for("rule_features")]: RULE_FEATURES4
232
+ },
233
+ messages: {
234
+ jsxUsesVars: "JSX variables should be marked as used."
235
+ },
236
+ schema: []
237
+ },
238
+ name: RULE_NAME4,
239
+ create: create4,
240
+ defaultOptions: []
241
+ });
242
+ function create4(context) {
243
+ return {
244
+ JSXOpeningElement(node) {
245
+ switch (node.name.type) {
246
+ case AST_NODE_TYPES.JSXIdentifier: {
247
+ if (/^[a-z]/u.test(node.name.name)) {
248
+ return;
249
+ }
250
+ context.sourceCode.markVariableAsUsed(node.name.name, node);
251
+ break;
252
+ }
253
+ case AST_NODE_TYPES.JSXMemberExpression: {
254
+ const { object } = node.name;
255
+ if (object.type === AST_NODE_TYPES.JSXIdentifier) {
256
+ context.sourceCode.markVariableAsUsed(object.name, node);
257
+ }
258
+ break;
259
+ }
260
+ }
261
+ }
262
+ };
263
+ }
264
+ var RULE_NAME5 = "no-access-state-in-setstate";
265
+ var RULE_FEATURES5 = [];
184
266
  function isKeyLiteral(node, key) {
185
267
  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);
186
268
  }
@@ -189,18 +271,18 @@ var no_access_state_in_setstate_default = createRule({
189
271
  type: "problem",
190
272
  docs: {
191
273
  description: "Disallow accessing `this.state` inside `setState` calls.",
192
- [Symbol.for("rule_features")]: RULE_FEATURES3
274
+ [Symbol.for("rule_features")]: RULE_FEATURES5
193
275
  },
194
276
  messages: {
195
277
  noAccessStateInSetstate: "Do not access 'this.state' within 'setState'. Use the update function instead."
196
278
  },
197
279
  schema: []
198
280
  },
199
- name: RULE_NAME3,
200
- create: create3,
281
+ name: RULE_NAME5,
282
+ create: create5,
201
283
  defaultOptions: []
202
284
  });
203
- function create3(context) {
285
+ function create5(context) {
204
286
  if (!context.sourceCode.text.includes("setState")) {
205
287
  return {};
206
288
  }
@@ -291,8 +373,8 @@ function create3(context) {
291
373
  }
292
374
  };
293
375
  }
294
- var RULE_NAME4 = "no-array-index-key";
295
- var RULE_FEATURES4 = [];
376
+ var RULE_NAME6 = "no-array-index-key";
377
+ var RULE_FEATURES6 = [];
296
378
  var reactChildrenMethod = ["forEach", "map"];
297
379
  var iteratorFunctionIndexParamPosition = /* @__PURE__ */ new Map([
298
380
  ["every", 1],
@@ -376,18 +458,18 @@ var no_array_index_key_default = createRule({
376
458
  type: "problem",
377
459
  docs: {
378
460
  description: "Disallow an item's index in the array as its key.",
379
- [Symbol.for("rule_features")]: RULE_FEATURES4
461
+ [Symbol.for("rule_features")]: RULE_FEATURES6
380
462
  },
381
463
  messages: {
382
464
  noArrayIndexKey: "Do not use item index in the array as its key."
383
465
  },
384
466
  schema: []
385
467
  },
386
- name: RULE_NAME4,
387
- create: create4,
468
+ name: RULE_NAME6,
469
+ create: create6,
388
470
  defaultOptions: []
389
471
  });
390
- function create4(context) {
472
+ function create6(context) {
391
473
  const report = createReport(context);
392
474
  const indexParamNames = [];
393
475
  function isArrayIndex(node) {
@@ -485,25 +567,25 @@ function create4(context) {
485
567
  }
486
568
  };
487
569
  }
488
- var RULE_NAME5 = "no-children-count";
489
- var RULE_FEATURES5 = [];
570
+ var RULE_NAME7 = "no-children-count";
571
+ var RULE_FEATURES7 = [];
490
572
  var no_children_count_default = createRule({
491
573
  meta: {
492
574
  type: "problem",
493
575
  docs: {
494
576
  description: "Disallow `Children.count`.",
495
- [Symbol.for("rule_features")]: RULE_FEATURES5
577
+ [Symbol.for("rule_features")]: RULE_FEATURES7
496
578
  },
497
579
  messages: {
498
580
  noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead."
499
581
  },
500
582
  schema: []
501
583
  },
502
- name: RULE_NAME5,
503
- create: create5,
584
+ name: RULE_NAME7,
585
+ create: create7,
504
586
  defaultOptions: []
505
587
  });
506
- function create5(context) {
588
+ function create7(context) {
507
589
  return {
508
590
  MemberExpression(node) {
509
591
  if (isChildrenCount(context, node)) {
@@ -515,25 +597,25 @@ function create5(context) {
515
597
  }
516
598
  };
517
599
  }
518
- var RULE_NAME6 = "no-children-for-each";
519
- var RULE_FEATURES6 = [];
600
+ var RULE_NAME8 = "no-children-for-each";
601
+ var RULE_FEATURES8 = [];
520
602
  var no_children_for_each_default = createRule({
521
603
  meta: {
522
604
  type: "problem",
523
605
  docs: {
524
606
  description: "Disallow 'Children.forEach'.",
525
- [Symbol.for("rule_features")]: RULE_FEATURES6
607
+ [Symbol.for("rule_features")]: RULE_FEATURES8
526
608
  },
527
609
  messages: {
528
610
  noChildrenForEach: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead."
529
611
  },
530
612
  schema: []
531
613
  },
532
- name: RULE_NAME6,
533
- create: create6,
614
+ name: RULE_NAME8,
615
+ create: create8,
534
616
  defaultOptions: []
535
617
  });
536
- function create6(context) {
618
+ function create8(context) {
537
619
  return {
538
620
  MemberExpression(node) {
539
621
  if (isChildrenForEach(context, node)) {
@@ -545,25 +627,25 @@ function create6(context) {
545
627
  }
546
628
  };
547
629
  }
548
- var RULE_NAME7 = "no-children-map";
549
- var RULE_FEATURES7 = [];
630
+ var RULE_NAME9 = "no-children-map";
631
+ var RULE_FEATURES9 = [];
550
632
  var no_children_map_default = createRule({
551
633
  meta: {
552
634
  type: "problem",
553
635
  docs: {
554
636
  description: "Disallow `Children.map`.",
555
- [Symbol.for("rule_features")]: RULE_FEATURES7
637
+ [Symbol.for("rule_features")]: RULE_FEATURES9
556
638
  },
557
639
  messages: {
558
640
  noChildrenMap: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead."
559
641
  },
560
642
  schema: []
561
643
  },
562
- name: RULE_NAME7,
563
- create: create7,
644
+ name: RULE_NAME9,
645
+ create: create9,
564
646
  defaultOptions: []
565
647
  });
566
- function create7(context) {
648
+ function create9(context) {
567
649
  return {
568
650
  MemberExpression(node) {
569
651
  if (isChildrenMap(context, node)) {
@@ -575,25 +657,25 @@ function create7(context) {
575
657
  }
576
658
  };
577
659
  }
578
- var RULE_NAME8 = "no-children-only";
579
- var RULE_FEATURES8 = [];
660
+ var RULE_NAME10 = "no-children-only";
661
+ var RULE_FEATURES10 = [];
580
662
  var no_children_only_default = createRule({
581
663
  meta: {
582
664
  type: "problem",
583
665
  docs: {
584
666
  description: "Disallow `Children.only`.",
585
- [Symbol.for("rule_features")]: RULE_FEATURES8
667
+ [Symbol.for("rule_features")]: RULE_FEATURES10
586
668
  },
587
669
  messages: {
588
670
  noChildrenOnly: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead."
589
671
  },
590
672
  schema: []
591
673
  },
592
- name: RULE_NAME8,
593
- create: create8,
674
+ name: RULE_NAME10,
675
+ create: create10,
594
676
  defaultOptions: []
595
677
  });
596
- function create8(context) {
678
+ function create10(context) {
597
679
  return {
598
680
  MemberExpression(node) {
599
681
  if (isChildrenOnly(context, node)) {
@@ -605,25 +687,25 @@ function create8(context) {
605
687
  }
606
688
  };
607
689
  }
608
- var RULE_NAME9 = "no-children-prop";
609
- var RULE_FEATURES9 = [];
690
+ var RULE_NAME11 = "no-children-prop";
691
+ var RULE_FEATURES11 = [];
610
692
  var no_children_prop_default = createRule({
611
693
  meta: {
612
694
  type: "problem",
613
695
  docs: {
614
696
  description: "Disallow passing `children` as a prop.",
615
- [Symbol.for("rule_features")]: RULE_FEATURES9
697
+ [Symbol.for("rule_features")]: RULE_FEATURES11
616
698
  },
617
699
  messages: {
618
700
  noChildrenProp: "Do not pass 'children' as props."
619
701
  },
620
702
  schema: []
621
703
  },
622
- name: RULE_NAME9,
623
- create: create9,
704
+ name: RULE_NAME11,
705
+ create: create11,
624
706
  defaultOptions: []
625
707
  });
626
- function create9(context) {
708
+ function create11(context) {
627
709
  return {
628
710
  JSXElement(node) {
629
711
  const attribute = JSX8.getAttribute(
@@ -640,25 +722,25 @@ function create9(context) {
640
722
  }
641
723
  };
642
724
  }
643
- var RULE_NAME10 = "no-children-to-array";
644
- var RULE_FEATURES10 = [];
725
+ var RULE_NAME12 = "no-children-to-array";
726
+ var RULE_FEATURES12 = [];
645
727
  var no_children_to_array_default = createRule({
646
728
  meta: {
647
729
  type: "problem",
648
730
  docs: {
649
731
  description: "Disallow `Children.toArray`.",
650
- [Symbol.for("rule_features")]: RULE_FEATURES10
732
+ [Symbol.for("rule_features")]: RULE_FEATURES12
651
733
  },
652
734
  messages: {
653
735
  noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead."
654
736
  },
655
737
  schema: []
656
738
  },
657
- name: RULE_NAME10,
658
- create: create10,
739
+ name: RULE_NAME12,
740
+ create: create12,
659
741
  defaultOptions: []
660
742
  });
661
- function create10(context) {
743
+ function create12(context) {
662
744
  return {
663
745
  MemberExpression(node) {
664
746
  if (isChildrenToArray(context, node)) {
@@ -670,25 +752,25 @@ function create10(context) {
670
752
  }
671
753
  };
672
754
  }
673
- var RULE_NAME11 = "no-class-component";
674
- var RULE_FEATURES11 = [];
755
+ var RULE_NAME13 = "no-class-component";
756
+ var RULE_FEATURES13 = [];
675
757
  var no_class_component_default = createRule({
676
758
  meta: {
677
759
  type: "problem",
678
760
  docs: {
679
761
  description: "Disallow class components.",
680
- [Symbol.for("rule_features")]: RULE_FEATURES11
762
+ [Symbol.for("rule_features")]: RULE_FEATURES13
681
763
  },
682
764
  messages: {
683
765
  noClassComponent: "Do not use class components. Use function components instead."
684
766
  },
685
767
  schema: []
686
768
  },
687
- name: RULE_NAME11,
688
- create: create11,
769
+ name: RULE_NAME13,
770
+ create: create13,
689
771
  defaultOptions: []
690
772
  });
691
- function create11(context) {
773
+ function create13(context) {
692
774
  if (!context.sourceCode.text.includes("Component")) return {};
693
775
  const { ctx, listeners } = useComponentCollectorLegacy();
694
776
  return {
@@ -710,25 +792,25 @@ function create11(context) {
710
792
  }
711
793
  };
712
794
  }
713
- var RULE_NAME12 = "no-clone-element";
714
- var RULE_FEATURES12 = [];
795
+ var RULE_NAME14 = "no-clone-element";
796
+ var RULE_FEATURES14 = [];
715
797
  var no_clone_element_default = createRule({
716
798
  meta: {
717
799
  type: "problem",
718
800
  docs: {
719
801
  description: "Disallow `cloneElement`.",
720
- [Symbol.for("rule_features")]: RULE_FEATURES12
802
+ [Symbol.for("rule_features")]: RULE_FEATURES14
721
803
  },
722
804
  messages: {
723
805
  noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead."
724
806
  },
725
807
  schema: []
726
808
  },
727
- name: RULE_NAME12,
728
- create: create12,
809
+ name: RULE_NAME14,
810
+ create: create14,
729
811
  defaultOptions: []
730
812
  });
731
- function create12(context) {
813
+ function create14(context) {
732
814
  return {
733
815
  CallExpression(node) {
734
816
  if (!isCloneElementCall(context, node)) {
@@ -741,25 +823,25 @@ function create12(context) {
741
823
  }
742
824
  };
743
825
  }
744
- var RULE_NAME13 = "no-comment-textnodes";
745
- var RULE_FEATURES13 = [];
826
+ var RULE_NAME15 = "no-comment-textnodes";
827
+ var RULE_FEATURES15 = [];
746
828
  var no_comment_textnodes_default = createRule({
747
829
  meta: {
748
830
  type: "problem",
749
831
  docs: {
750
832
  description: "Prevents comments from being inserted as text nodes.",
751
- [Symbol.for("rule_features")]: RULE_FEATURES13
833
+ [Symbol.for("rule_features")]: RULE_FEATURES15
752
834
  },
753
835
  messages: {
754
836
  noCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces."
755
837
  },
756
838
  schema: []
757
839
  },
758
- name: RULE_NAME13,
759
- create: create13,
840
+ name: RULE_NAME15,
841
+ create: create15,
760
842
  defaultOptions: []
761
843
  });
762
- function create13(context) {
844
+ function create15(context) {
763
845
  function hasCommentLike(node) {
764
846
  if (AST11.isOneOf([AST_NODE_TYPES.JSXAttribute, AST_NODE_TYPES.JSXExpressionContainer])(node.parent)) {
765
847
  return false;
@@ -787,25 +869,27 @@ function create13(context) {
787
869
  Literal: visitorFunction
788
870
  };
789
871
  }
790
- var RULE_NAME14 = "no-complex-conditional-rendering";
791
- var RULE_FEATURES14 = [];
872
+ var RULE_NAME16 = "no-complex-conditional-rendering";
873
+ var RULE_FEATURES16 = [
874
+ "EXP"
875
+ ];
792
876
  var no_complex_conditional_rendering_default = createRule({
793
877
  meta: {
794
878
  type: "problem",
795
879
  docs: {
796
880
  description: "Disallow complex conditional rendering in JSX expressions.",
797
- [Symbol.for("rule_features")]: RULE_FEATURES14
881
+ [Symbol.for("rule_features")]: RULE_FEATURES16
798
882
  },
799
883
  messages: {
800
884
  noComplexConditionalRendering: "Avoid complex conditional rendering. Extract the logic into separate elements or components."
801
885
  },
802
886
  schema: []
803
887
  },
804
- name: RULE_NAME14,
805
- create: create14,
888
+ name: RULE_NAME16,
889
+ create: create16,
806
890
  defaultOptions: []
807
891
  });
808
- function create14(context) {
892
+ function create16(context) {
809
893
  const visitorFunction = (node) => {
810
894
  const jsxExpContainer = node.parent?.parent;
811
895
  if (!AST11.is(AST_NODE_TYPES.JSXExpressionContainer)(jsxExpContainer)) {
@@ -830,8 +914,8 @@ function create14(context) {
830
914
  "JSXExpressionContainer > LogicalExpression[operator='||'] > LogicalExpression[operator='&&']": visitorFunction
831
915
  };
832
916
  }
833
- var RULE_NAME15 = "no-component-will-mount";
834
- var RULE_FEATURES15 = [
917
+ var RULE_NAME17 = "no-component-will-mount";
918
+ var RULE_FEATURES17 = [
835
919
  "MOD"
836
920
  ];
837
921
  function isComponentWillMount(node) {
@@ -842,7 +926,7 @@ var no_component_will_mount_default = createRule({
842
926
  type: "problem",
843
927
  docs: {
844
928
  description: "Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.",
845
- [Symbol.for("rule_features")]: RULE_FEATURES15
929
+ [Symbol.for("rule_features")]: RULE_FEATURES17
846
930
  },
847
931
  fixable: "code",
848
932
  messages: {
@@ -850,11 +934,11 @@ var no_component_will_mount_default = createRule({
850
934
  },
851
935
  schema: []
852
936
  },
853
- name: RULE_NAME15,
854
- create: create15,
937
+ name: RULE_NAME17,
938
+ create: create17,
855
939
  defaultOptions: []
856
940
  });
857
- function create15(context) {
941
+ function create17(context) {
858
942
  if (!context.sourceCode.text.includes("componentWillMount")) return {};
859
943
  const { ctx, listeners } = useComponentCollectorLegacy();
860
944
  return {
@@ -881,8 +965,8 @@ function create15(context) {
881
965
  }
882
966
  };
883
967
  }
884
- var RULE_NAME16 = "no-component-will-receive-props";
885
- var RULE_FEATURES16 = [
968
+ var RULE_NAME18 = "no-component-will-receive-props";
969
+ var RULE_FEATURES18 = [
886
970
  "MOD"
887
971
  ];
888
972
  function isComponentWillUpdate(node) {
@@ -893,7 +977,7 @@ var no_component_will_receive_props_default = createRule({
893
977
  type: "problem",
894
978
  docs: {
895
979
  description: "Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.",
896
- [Symbol.for("rule_features")]: RULE_FEATURES16
980
+ [Symbol.for("rule_features")]: RULE_FEATURES18
897
981
  },
898
982
  fixable: "code",
899
983
  messages: {
@@ -901,11 +985,11 @@ var no_component_will_receive_props_default = createRule({
901
985
  },
902
986
  schema: []
903
987
  },
904
- name: RULE_NAME16,
905
- create: create16,
988
+ name: RULE_NAME18,
989
+ create: create18,
906
990
  defaultOptions: []
907
991
  });
908
- function create16(context) {
992
+ function create18(context) {
909
993
  if (!context.sourceCode.text.includes("componentWillReceiveProps")) return {};
910
994
  const { ctx, listeners } = useComponentCollectorLegacy();
911
995
  return {
@@ -932,8 +1016,8 @@ function create16(context) {
932
1016
  }
933
1017
  };
934
1018
  }
935
- var RULE_NAME17 = "no-component-will-update";
936
- var RULE_FEATURES17 = [
1019
+ var RULE_NAME19 = "no-component-will-update";
1020
+ var RULE_FEATURES19 = [
937
1021
  "MOD"
938
1022
  ];
939
1023
  function isComponentWillUpdate2(node) {
@@ -944,7 +1028,7 @@ var no_component_will_update_default = createRule({
944
1028
  type: "problem",
945
1029
  docs: {
946
1030
  description: "Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`.",
947
- [Symbol.for("rule_features")]: RULE_FEATURES17
1031
+ [Symbol.for("rule_features")]: RULE_FEATURES19
948
1032
  },
949
1033
  fixable: "code",
950
1034
  messages: {
@@ -952,11 +1036,11 @@ var no_component_will_update_default = createRule({
952
1036
  },
953
1037
  schema: []
954
1038
  },
955
- name: RULE_NAME17,
956
- create: create17,
1039
+ name: RULE_NAME19,
1040
+ create: create19,
957
1041
  defaultOptions: []
958
1042
  });
959
- function create17(context) {
1043
+ function create19(context) {
960
1044
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
961
1045
  const { ctx, listeners } = useComponentCollectorLegacy();
962
1046
  return {
@@ -983,8 +1067,8 @@ function create17(context) {
983
1067
  }
984
1068
  };
985
1069
  }
986
- var RULE_NAME18 = "no-context-provider";
987
- var RULE_FEATURES18 = [
1070
+ var RULE_NAME20 = "no-context-provider";
1071
+ var RULE_FEATURES20 = [
988
1072
  "MOD"
989
1073
  ];
990
1074
  var no_context_provider_default = createRule({
@@ -992,7 +1076,7 @@ var no_context_provider_default = createRule({
992
1076
  type: "problem",
993
1077
  docs: {
994
1078
  description: "Replace usages of `<Context.Provider>` with `<Context>`.",
995
- [Symbol.for("rule_features")]: RULE_FEATURES18
1079
+ [Symbol.for("rule_features")]: RULE_FEATURES20
996
1080
  },
997
1081
  fixable: "code",
998
1082
  messages: {
@@ -1000,11 +1084,11 @@ var no_context_provider_default = createRule({
1000
1084
  },
1001
1085
  schema: []
1002
1086
  },
1003
- name: RULE_NAME18,
1004
- create: create18,
1087
+ name: RULE_NAME20,
1088
+ create: create20,
1005
1089
  defaultOptions: []
1006
1090
  });
1007
- function create18(context) {
1091
+ function create20(context) {
1008
1092
  if (!context.sourceCode.text.includes("Provider")) return {};
1009
1093
  const { version: version2 } = getSettingsFromContext(context);
1010
1094
  if (compare(version2, "19.0.0", "<")) return {};
@@ -1036,25 +1120,25 @@ function create18(context) {
1036
1120
  }
1037
1121
  };
1038
1122
  }
1039
- var RULE_NAME19 = "no-create-ref";
1040
- var RULE_FEATURES19 = [];
1123
+ var RULE_NAME21 = "no-create-ref";
1124
+ var RULE_FEATURES21 = [];
1041
1125
  var no_create_ref_default = createRule({
1042
1126
  meta: {
1043
1127
  type: "problem",
1044
1128
  docs: {
1045
1129
  description: "Disallow `createRef` in function components.",
1046
- [Symbol.for("rule_features")]: RULE_FEATURES19
1130
+ [Symbol.for("rule_features")]: RULE_FEATURES21
1047
1131
  },
1048
1132
  messages: {
1049
1133
  noCreateRef: "[Deprecated] Use 'useRef' instead."
1050
1134
  },
1051
1135
  schema: []
1052
1136
  },
1053
- name: RULE_NAME19,
1054
- create: create19,
1137
+ name: RULE_NAME21,
1138
+ create: create21,
1055
1139
  defaultOptions: []
1056
1140
  });
1057
- function create19(context) {
1141
+ function create21(context) {
1058
1142
  return {
1059
1143
  CallExpression(node) {
1060
1144
  if (isCreateRefCall(context, node) && AST11.findParentNode(node, isClassComponent) == null) {
@@ -1063,25 +1147,25 @@ function create19(context) {
1063
1147
  }
1064
1148
  };
1065
1149
  }
1066
- var RULE_NAME20 = "no-default-props";
1067
- var RULE_FEATURES20 = [];
1150
+ var RULE_NAME22 = "no-default-props";
1151
+ var RULE_FEATURES22 = [];
1068
1152
  var no_default_props_default = createRule({
1069
1153
  meta: {
1070
1154
  type: "problem",
1071
1155
  docs: {
1072
1156
  description: "Disallow `defaultProps` property in favor of ES6 default parameters.",
1073
- [Symbol.for("rule_features")]: RULE_FEATURES20
1157
+ [Symbol.for("rule_features")]: RULE_FEATURES22
1074
1158
  },
1075
1159
  messages: {
1076
1160
  noDefaultProps: "[Deprecated] Use ES6 default parameters instead."
1077
1161
  },
1078
1162
  schema: []
1079
1163
  },
1080
- name: RULE_NAME20,
1081
- create: create20,
1164
+ name: RULE_NAME22,
1165
+ create: create22,
1082
1166
  defaultOptions: []
1083
1167
  });
1084
- function create20(context) {
1168
+ function create22(context) {
1085
1169
  if (!context.sourceCode.text.includes("defaultProps")) return {};
1086
1170
  return {
1087
1171
  AssignmentExpression(node) {
@@ -1115,8 +1199,8 @@ function create20(context) {
1115
1199
  }
1116
1200
  };
1117
1201
  }
1118
- var RULE_NAME21 = "no-direct-mutation-state";
1119
- var RULE_FEATURES21 = [];
1202
+ var RULE_NAME23 = "no-direct-mutation-state";
1203
+ var RULE_FEATURES23 = [];
1120
1204
  function isConstructorFunction(node) {
1121
1205
  return AST11.isOneOf([AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.FunctionExpression])(node) && AST11.isMethodOrProperty(node.parent) && node.parent.key.type === AST_NODE_TYPES.Identifier && node.parent.key.name === "constructor";
1122
1206
  }
@@ -1125,18 +1209,18 @@ var no_direct_mutation_state_default = createRule({
1125
1209
  type: "problem",
1126
1210
  docs: {
1127
1211
  description: "Disallow direct mutation of `this.state`.",
1128
- [Symbol.for("rule_features")]: RULE_FEATURES21
1212
+ [Symbol.for("rule_features")]: RULE_FEATURES23
1129
1213
  },
1130
1214
  messages: {
1131
1215
  noDirectMutationState: "Do not mutate state directly. Use 'setState()' instead."
1132
1216
  },
1133
1217
  schema: []
1134
1218
  },
1135
- name: RULE_NAME21,
1136
- create: create21,
1219
+ name: RULE_NAME23,
1220
+ create: create23,
1137
1221
  defaultOptions: []
1138
1222
  });
1139
- function create21(context) {
1223
+ function create23(context) {
1140
1224
  return {
1141
1225
  AssignmentExpression(node) {
1142
1226
  if (!isAssignmentToThisState(node)) return;
@@ -1157,67 +1241,25 @@ function create21(context) {
1157
1241
  }
1158
1242
  };
1159
1243
  }
1160
- var RULE_NAME22 = "no-duplicate-jsx-props";
1161
- var RULE_FEATURES22 = [];
1162
- var no_duplicate_jsx_props_default = createRule({
1163
- meta: {
1164
- type: "problem",
1165
- docs: {
1166
- description: "Disallow duplicate props in JSX elements.",
1167
- [Symbol.for("rule_features")]: RULE_FEATURES22
1168
- },
1169
- messages: {
1170
- noDuplicateJsxProps: "This JSX property is assigned multiple times."
1171
- },
1172
- schema: []
1173
- },
1174
- name: RULE_NAME22,
1175
- create: create22,
1176
- defaultOptions: []
1177
- });
1178
- function create22(context) {
1179
- return {
1180
- JSXOpeningElement(node) {
1181
- const props = [];
1182
- for (const attr of node.attributes) {
1183
- if (attr.type === AST_NODE_TYPES.JSXSpreadAttribute) {
1184
- continue;
1185
- }
1186
- const name5 = attr.name.name;
1187
- if (typeof name5 !== "string") {
1188
- continue;
1189
- }
1190
- if (!props.includes(name5)) {
1191
- props.push(name5);
1192
- continue;
1193
- }
1194
- context.report({
1195
- messageId: "noDuplicateJsxProps",
1196
- node: attr
1197
- });
1198
- }
1199
- }
1200
- };
1201
- }
1202
- var RULE_NAME23 = "no-duplicate-key";
1203
- var RULE_FEATURES23 = [];
1244
+ var RULE_NAME24 = "no-duplicate-key";
1245
+ var RULE_FEATURES24 = [];
1204
1246
  var no_duplicate_key_default = createRule({
1205
1247
  meta: {
1206
1248
  type: "problem",
1207
1249
  docs: {
1208
1250
  description: "Disallow duplicate `key` on elements in the same array or a list of `children`.",
1209
- [Symbol.for("rule_features")]: RULE_FEATURES23
1251
+ [Symbol.for("rule_features")]: RULE_FEATURES24
1210
1252
  },
1211
1253
  messages: {
1212
1254
  noDuplicateKey: "A key must be unique. '{{value}}' is duplicated."
1213
1255
  },
1214
1256
  schema: []
1215
1257
  },
1216
- name: RULE_NAME23,
1217
- create: create23,
1258
+ name: RULE_NAME24,
1259
+ create: create24,
1218
1260
  defaultOptions: []
1219
1261
  });
1220
- function create23(context) {
1262
+ function create24(context) {
1221
1263
  if (!context.sourceCode.getText().includes("key=")) {
1222
1264
  return {};
1223
1265
  }
@@ -1281,8 +1323,8 @@ function create23(context) {
1281
1323
  }
1282
1324
  };
1283
1325
  }
1284
- var RULE_NAME24 = "no-forward-ref";
1285
- var RULE_FEATURES24 = [
1326
+ var RULE_NAME25 = "no-forward-ref";
1327
+ var RULE_FEATURES25 = [
1286
1328
  "MOD"
1287
1329
  ];
1288
1330
  var no_forward_ref_default = createRule({
@@ -1290,7 +1332,7 @@ var no_forward_ref_default = createRule({
1290
1332
  type: "problem",
1291
1333
  docs: {
1292
1334
  description: "Replaces usages of `forwardRef` with passing `ref` as a prop.",
1293
- [Symbol.for("rule_features")]: RULE_FEATURES24
1335
+ [Symbol.for("rule_features")]: RULE_FEATURES25
1294
1336
  },
1295
1337
  fixable: "code",
1296
1338
  messages: {
@@ -1298,11 +1340,11 @@ var no_forward_ref_default = createRule({
1298
1340
  },
1299
1341
  schema: []
1300
1342
  },
1301
- name: RULE_NAME24,
1302
- create: create24,
1343
+ name: RULE_NAME25,
1344
+ create: create25,
1303
1345
  defaultOptions: []
1304
1346
  });
1305
- function create24(context) {
1347
+ function create25(context) {
1306
1348
  if (!context.sourceCode.text.includes("forwardRef")) {
1307
1349
  return {};
1308
1350
  }
@@ -1390,25 +1432,27 @@ function getComponentPropsFixes(context, fixer, node, typeArguments) {
1390
1432
  ...arg1 == null ? [] : [fixer.remove(arg1), fixer.removeRange([arg0.range[1], arg1.range[0]])]
1391
1433
  ];
1392
1434
  }
1393
- var RULE_NAME25 = "no-implicit-key";
1394
- var RULE_FEATURES25 = [];
1435
+ var RULE_NAME26 = "no-implicit-key";
1436
+ var RULE_FEATURES26 = [
1437
+ "EXP"
1438
+ ];
1395
1439
  var no_implicit_key_default = createRule({
1396
1440
  meta: {
1397
1441
  type: "problem",
1398
1442
  docs: {
1399
1443
  description: "Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).",
1400
- [Symbol.for("rule_features")]: RULE_FEATURES25
1444
+ [Symbol.for("rule_features")]: RULE_FEATURES26
1401
1445
  },
1402
1446
  messages: {
1403
1447
  noImplicitKey: "Do not use implicit 'key' props."
1404
1448
  },
1405
1449
  schema: []
1406
1450
  },
1407
- name: RULE_NAME25,
1408
- create: create25,
1451
+ name: RULE_NAME26,
1452
+ create: create26,
1409
1453
  defaultOptions: []
1410
1454
  });
1411
- function create25(context) {
1455
+ function create26(context) {
1412
1456
  return {
1413
1457
  JSXOpeningElement(node) {
1414
1458
  const initialScope = context.sourceCode.getScope(node);
@@ -1422,8 +1466,8 @@ function create25(context) {
1422
1466
  }
1423
1467
  };
1424
1468
  }
1425
- var RULE_NAME26 = "no-leaked-conditional-rendering";
1426
- var RULE_FEATURES26 = [
1469
+ var RULE_NAME27 = "no-leaked-conditional-rendering";
1470
+ var RULE_FEATURES27 = [
1427
1471
  "TSC"
1428
1472
  ];
1429
1473
  var tsHelpers = {
@@ -1509,18 +1553,18 @@ var no_leaked_conditional_rendering_default = createRule({
1509
1553
  type: "problem",
1510
1554
  docs: {
1511
1555
  description: "Prevents problematic leaked values from being rendered.",
1512
- [Symbol.for("rule_features")]: RULE_FEATURES26
1556
+ [Symbol.for("rule_features")]: RULE_FEATURES27
1513
1557
  },
1514
1558
  messages: {
1515
1559
  noLeakedConditionalRendering: "Potential leaked value {{value}} that might cause unintentionally rendered values or rendering crashes."
1516
1560
  },
1517
1561
  schema: []
1518
1562
  },
1519
- name: RULE_NAME26,
1520
- create: create26,
1563
+ name: RULE_NAME27,
1564
+ create: create27,
1521
1565
  defaultOptions: []
1522
1566
  });
1523
- function create26(context) {
1567
+ function create27(context) {
1524
1568
  if (!context.sourceCode.text.includes("&&") && !context.sourceCode.text.includes("?")) return {};
1525
1569
  const { version: version2 } = getSettingsFromContext(context);
1526
1570
  const allowedVariants = [
@@ -1577,25 +1621,25 @@ function create26(context) {
1577
1621
  "JSXExpressionContainer > LogicalExpression": visitorFunction
1578
1622
  };
1579
1623
  }
1580
- var RULE_NAME27 = "no-missing-component-display-name";
1581
- var RULE_FEATURES27 = [];
1624
+ var RULE_NAME28 = "no-missing-component-display-name";
1625
+ var RULE_FEATURES28 = [];
1582
1626
  var no_missing_component_display_name_default = createRule({
1583
1627
  meta: {
1584
1628
  type: "problem",
1585
1629
  docs: {
1586
1630
  description: "Enforces that all components have a `displayName` which can be used in devtools.",
1587
- [Symbol.for("rule_features")]: RULE_FEATURES27
1631
+ [Symbol.for("rule_features")]: RULE_FEATURES28
1588
1632
  },
1589
1633
  messages: {
1590
1634
  noMissingComponentDisplayName: "Add missing 'displayName' for component."
1591
1635
  },
1592
1636
  schema: []
1593
1637
  },
1594
- name: RULE_NAME27,
1595
- create: create27,
1638
+ name: RULE_NAME28,
1639
+ create: create28,
1596
1640
  defaultOptions: []
1597
1641
  });
1598
- function create27(context) {
1642
+ function create28(context) {
1599
1643
  if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
1600
1644
  const {
1601
1645
  ctx,
@@ -1630,25 +1674,25 @@ function create27(context) {
1630
1674
  }
1631
1675
  };
1632
1676
  }
1633
- var RULE_NAME28 = "no-missing-context-display-name";
1634
- var RULE_FEATURES28 = [];
1677
+ var RULE_NAME29 = "no-missing-context-display-name";
1678
+ var RULE_FEATURES29 = [];
1635
1679
  var no_missing_context_display_name_default = createRule({
1636
1680
  meta: {
1637
1681
  type: "problem",
1638
1682
  docs: {
1639
1683
  description: "Enforces that all contexts have a `displayName` which can be used in devtools.",
1640
- [Symbol.for("rule_features")]: RULE_FEATURES28
1684
+ [Symbol.for("rule_features")]: RULE_FEATURES29
1641
1685
  },
1642
1686
  messages: {
1643
1687
  noMissingContextDisplayName: "Add missing 'displayName' for context."
1644
1688
  },
1645
1689
  schema: []
1646
1690
  },
1647
- name: RULE_NAME28,
1648
- create: create28,
1691
+ name: RULE_NAME29,
1692
+ create: create29,
1649
1693
  defaultOptions: []
1650
1694
  });
1651
- function create28(context) {
1695
+ function create29(context) {
1652
1696
  if (!context.sourceCode.text.includes("createContext")) return {};
1653
1697
  const createCalls = [];
1654
1698
  const displayNameAssignments = [];
@@ -1686,14 +1730,14 @@ function create28(context) {
1686
1730
  }
1687
1731
  };
1688
1732
  }
1689
- var RULE_NAME29 = "no-missing-key";
1690
- var RULE_FEATURES29 = [];
1733
+ var RULE_NAME30 = "no-missing-key";
1734
+ var RULE_FEATURES30 = [];
1691
1735
  var no_missing_key_default = createRule({
1692
1736
  meta: {
1693
1737
  type: "problem",
1694
1738
  docs: {
1695
1739
  description: "Disallow missing `key` on items in list rendering.",
1696
- [Symbol.for("rule_features")]: RULE_FEATURES29
1740
+ [Symbol.for("rule_features")]: RULE_FEATURES30
1697
1741
  },
1698
1742
  messages: {
1699
1743
  missingKey: "Missing 'key' for element when rendering list.",
@@ -1701,11 +1745,11 @@ var no_missing_key_default = createRule({
1701
1745
  },
1702
1746
  schema: []
1703
1747
  },
1704
- name: RULE_NAME29,
1705
- create: create29,
1748
+ name: RULE_NAME30,
1749
+ create: create30,
1706
1750
  defaultOptions: []
1707
1751
  });
1708
- function create29(context) {
1752
+ function create30(context) {
1709
1753
  const report = createReport(context);
1710
1754
  const state = { isWithinChildrenToArray: false };
1711
1755
  function checkIteratorElement(node) {
@@ -1818,26 +1862,25 @@ function create29(context) {
1818
1862
  function isArrayFromCall(node) {
1819
1863
  return node.type === AST_NODE_TYPES.CallExpression && node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && node.callee.property.name === "from";
1820
1864
  }
1821
- var RULE_NAME30 = "no-nested-component-definitions";
1822
- var RULE_FEATURES30 = [];
1865
+ var RULE_NAME31 = "no-nested-component-definitions";
1866
+ var RULE_FEATURES31 = [];
1823
1867
  var no_nested_component_definitions_default = createRule({
1824
1868
  meta: {
1825
1869
  type: "problem",
1826
1870
  docs: {
1827
1871
  description: "Disallow nesting component definitions inside other components.",
1828
- [Symbol.for("rule_features")]: RULE_FEATURES30
1872
+ [Symbol.for("rule_features")]: RULE_FEATURES31
1829
1873
  },
1830
1874
  messages: {
1831
- noNestedComponentDefinition: "Do not nest component definitions inside other components. Move it to the top level.",
1832
- noNestedComponentDefinitionInProps: "Do not nest component definitions inside props. Move it to the top level or pass it as a prop."
1875
+ noNestedComponentDefinitions: "Do not nest component definitions inside other components or props. {{suggestion}}"
1833
1876
  },
1834
1877
  schema: []
1835
1878
  },
1836
- name: RULE_NAME30,
1837
- create: create30,
1879
+ name: RULE_NAME31,
1880
+ create: create31,
1838
1881
  defaultOptions: []
1839
1882
  });
1840
- function create30(context) {
1883
+ function create31(context) {
1841
1884
  const hint = ERComponentHint.SkipMapCallback | ERComponentHint.SkipNullLiteral | ERComponentHint.SkipUndefined | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipStringLiteral | ERComponentHint.SkipNumberLiteral | ERComponentHint.StrictLogical | ERComponentHint.StrictConditional;
1842
1885
  const collector = useComponentCollector(context, { hint });
1843
1886
  const collectorLegacy = useComponentCollectorLegacy();
@@ -1863,10 +1906,11 @@ function create30(context) {
1863
1906
  if (isInsideJSXAttributeValue(component)) {
1864
1907
  if (!isDeclaredInRenderPropLoose(component)) {
1865
1908
  context.report({
1866
- messageId: "noNestedComponentDefinitionInProps",
1909
+ messageId: "noNestedComponentDefinitions",
1867
1910
  node: component,
1868
1911
  data: {
1869
- name: name5
1912
+ name: name5,
1913
+ suggestion: "Move it to the top level or pass it as a prop."
1870
1914
  }
1871
1915
  });
1872
1916
  }
@@ -1874,10 +1918,11 @@ function create30(context) {
1874
1918
  }
1875
1919
  if (isInsideCreateElementProps(context, component)) {
1876
1920
  context.report({
1877
- messageId: "noNestedComponentDefinitionInProps",
1921
+ messageId: "noNestedComponentDefinitions",
1878
1922
  node: component,
1879
1923
  data: {
1880
- name: name5
1924
+ name: name5,
1925
+ suggestion: "Move it to the top level or pass it as a prop."
1881
1926
  }
1882
1927
  });
1883
1928
  continue;
@@ -1885,20 +1930,22 @@ function create30(context) {
1885
1930
  const parentComponent = AST11.findParentNode(component, isFunctionComponent);
1886
1931
  if (parentComponent != null && !isDirectValueOfRenderPropertyLoose(parentComponent)) {
1887
1932
  context.report({
1888
- messageId: component.parent.type === AST_NODE_TYPES.Property ? "noNestedComponentDefinitionInProps" : "noNestedComponentDefinition",
1933
+ messageId: "noNestedComponentDefinitions",
1889
1934
  node: component,
1890
1935
  data: {
1891
- name: name5
1936
+ name: name5,
1937
+ suggestion: component.parent.type === AST_NODE_TYPES.Property ? "Move it to the top level or pass it as a prop." : "Move it to the top level."
1892
1938
  }
1893
1939
  });
1894
1940
  continue;
1895
1941
  }
1896
1942
  if (isInsideRenderMethod(component)) {
1897
1943
  context.report({
1898
- messageId: "noNestedComponentDefinition",
1944
+ messageId: "noNestedComponentDefinitions",
1899
1945
  node: component,
1900
1946
  data: {
1901
- name: name5
1947
+ name: name5,
1948
+ suggestion: "Move it to the top level."
1902
1949
  }
1903
1950
  });
1904
1951
  }
@@ -1908,10 +1955,11 @@ function create30(context) {
1908
1955
  continue;
1909
1956
  }
1910
1957
  context.report({
1911
- messageId: "noNestedComponentDefinition",
1958
+ messageId: "noNestedComponentDefinitions",
1912
1959
  node: component,
1913
1960
  data: {
1914
- name: name5
1961
+ name: name5,
1962
+ suggestion: component.parent.type === AST_NODE_TYPES.Property ? "Move it to the top level or pass it as a prop." : "Move it to the top level."
1915
1963
  }
1916
1964
  });
1917
1965
  }
@@ -1928,25 +1976,25 @@ function isInsideCreateElementProps(context, node) {
1928
1976
  if (prop == null) return false;
1929
1977
  return prop === call.arguments[1];
1930
1978
  }
1931
- var RULE_NAME31 = "no-prop-types";
1932
- var RULE_FEATURES31 = [];
1979
+ var RULE_NAME32 = "no-prop-types";
1980
+ var RULE_FEATURES32 = [];
1933
1981
  var no_prop_types_default = createRule({
1934
1982
  meta: {
1935
1983
  type: "problem",
1936
1984
  docs: {
1937
1985
  description: "Disallow `propTypes` in favor of TypeScript or another type-checking solution.",
1938
- [Symbol.for("rule_features")]: RULE_FEATURES31
1986
+ [Symbol.for("rule_features")]: RULE_FEATURES32
1939
1987
  },
1940
1988
  messages: {
1941
1989
  noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead."
1942
1990
  },
1943
1991
  schema: []
1944
1992
  },
1945
- name: RULE_NAME31,
1946
- create: create31,
1993
+ name: RULE_NAME32,
1994
+ create: create32,
1947
1995
  defaultOptions: []
1948
1996
  });
1949
- function create31(context) {
1997
+ function create32(context) {
1950
1998
  if (!context.sourceCode.text.includes("propTypes")) {
1951
1999
  return {};
1952
2000
  }
@@ -1982,8 +2030,8 @@ function create31(context) {
1982
2030
  }
1983
2031
  };
1984
2032
  }
1985
- var RULE_NAME32 = "no-redundant-should-component-update";
1986
- var RULE_FEATURES32 = [];
2033
+ var RULE_NAME33 = "no-redundant-should-component-update";
2034
+ var RULE_FEATURES33 = [];
1987
2035
  function isShouldComponentUpdate(node) {
1988
2036
  return AST11.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
1989
2037
  }
@@ -1992,18 +2040,18 @@ var no_redundant_should_component_update_default = createRule({
1992
2040
  type: "problem",
1993
2041
  docs: {
1994
2042
  description: "Disallow `shouldComponentUpdate` when extending `React.PureComponent`.",
1995
- [Symbol.for("rule_features")]: RULE_FEATURES32
2043
+ [Symbol.for("rule_features")]: RULE_FEATURES33
1996
2044
  },
1997
2045
  messages: {
1998
2046
  noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'."
1999
2047
  },
2000
2048
  schema: []
2001
2049
  },
2002
- name: RULE_NAME32,
2003
- create: create32,
2050
+ name: RULE_NAME33,
2051
+ create: create33,
2004
2052
  defaultOptions: []
2005
2053
  });
2006
- function create32(context) {
2054
+ function create33(context) {
2007
2055
  if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
2008
2056
  const { ctx, listeners } = useComponentCollectorLegacy();
2009
2057
  return {
@@ -2030,8 +2078,8 @@ function create32(context) {
2030
2078
  }
2031
2079
  };
2032
2080
  }
2033
- var RULE_NAME33 = "no-set-state-in-component-did-mount";
2034
- var RULE_FEATURES33 = [];
2081
+ var RULE_NAME34 = "no-set-state-in-component-did-mount";
2082
+ var RULE_FEATURES34 = [];
2035
2083
  function isComponentDidMount(node) {
2036
2084
  return AST11.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
2037
2085
  }
@@ -2040,18 +2088,18 @@ var no_set_state_in_component_did_mount_default = createRule({
2040
2088
  type: "problem",
2041
2089
  docs: {
2042
2090
  description: "Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks.",
2043
- [Symbol.for("rule_features")]: RULE_FEATURES33
2091
+ [Symbol.for("rule_features")]: RULE_FEATURES34
2044
2092
  },
2045
2093
  messages: {
2046
2094
  noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions, such as callbacks."
2047
2095
  },
2048
2096
  schema: []
2049
2097
  },
2050
- name: RULE_NAME33,
2051
- create: create33,
2098
+ name: RULE_NAME34,
2099
+ create: create34,
2052
2100
  defaultOptions: []
2053
2101
  });
2054
- function create33(context) {
2102
+ function create34(context) {
2055
2103
  if (!context.sourceCode.text.includes("componentDidMount")) return {};
2056
2104
  return {
2057
2105
  CallExpression(node) {
@@ -2072,8 +2120,8 @@ function create33(context) {
2072
2120
  }
2073
2121
  };
2074
2122
  }
2075
- var RULE_NAME34 = "no-set-state-in-component-did-update";
2076
- var RULE_FEATURES34 = [];
2123
+ var RULE_NAME35 = "no-set-state-in-component-did-update";
2124
+ var RULE_FEATURES35 = [];
2077
2125
  function isComponentDidUpdate(node) {
2078
2126
  return AST11.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
2079
2127
  }
@@ -2082,18 +2130,18 @@ var no_set_state_in_component_did_update_default = createRule({
2082
2130
  type: "problem",
2083
2131
  docs: {
2084
2132
  description: "Disallows calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks.",
2085
- [Symbol.for("rule_features")]: RULE_FEATURES34
2133
+ [Symbol.for("rule_features")]: RULE_FEATURES35
2086
2134
  },
2087
2135
  messages: {
2088
2136
  noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions, such as callbacks."
2089
2137
  },
2090
2138
  schema: []
2091
2139
  },
2092
- name: RULE_NAME34,
2093
- create: create34,
2140
+ name: RULE_NAME35,
2141
+ create: create35,
2094
2142
  defaultOptions: []
2095
2143
  });
2096
- function create34(context) {
2144
+ function create35(context) {
2097
2145
  if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
2098
2146
  return {
2099
2147
  CallExpression(node) {
@@ -2114,8 +2162,8 @@ function create34(context) {
2114
2162
  }
2115
2163
  };
2116
2164
  }
2117
- var RULE_NAME35 = "no-set-state-in-component-will-update";
2118
- var RULE_FEATURES35 = [];
2165
+ var RULE_NAME36 = "no-set-state-in-component-will-update";
2166
+ var RULE_FEATURES36 = [];
2119
2167
  function isComponentWillUpdate3(node) {
2120
2168
  return AST11.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
2121
2169
  }
@@ -2124,18 +2172,18 @@ var no_set_state_in_component_will_update_default = createRule({
2124
2172
  type: "problem",
2125
2173
  docs: {
2126
2174
  description: "Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.",
2127
- [Symbol.for("rule_features")]: RULE_FEATURES35
2175
+ [Symbol.for("rule_features")]: RULE_FEATURES36
2128
2176
  },
2129
2177
  messages: {
2130
2178
  noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions, such as callbacks."
2131
2179
  },
2132
2180
  schema: []
2133
2181
  },
2134
- name: RULE_NAME35,
2135
- create: create35,
2182
+ name: RULE_NAME36,
2183
+ create: create36,
2136
2184
  defaultOptions: []
2137
2185
  });
2138
- function create35(context) {
2186
+ function create36(context) {
2139
2187
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
2140
2188
  return {
2141
2189
  CallExpression(node) {
@@ -2156,8 +2204,8 @@ function create35(context) {
2156
2204
  }
2157
2205
  };
2158
2206
  }
2159
- var RULE_NAME36 = "no-string-refs";
2160
- var RULE_FEATURES36 = [];
2207
+ var RULE_NAME37 = "no-string-refs";
2208
+ var RULE_FEATURES37 = [];
2161
2209
  function containsStringLiteral({ value }) {
2162
2210
  return value?.type === AST_NODE_TYPES.Literal && typeof value.value === "string";
2163
2211
  }
@@ -2175,18 +2223,18 @@ var no_string_refs_default = createRule({
2175
2223
  type: "problem",
2176
2224
  docs: {
2177
2225
  description: "Disallow deprecated string `refs`.",
2178
- [Symbol.for("rule_features")]: RULE_FEATURES36
2226
+ [Symbol.for("rule_features")]: RULE_FEATURES37
2179
2227
  },
2180
2228
  messages: {
2181
2229
  noStringRefs: "[Deprecated] Use callback refs instead."
2182
2230
  },
2183
2231
  schema: []
2184
2232
  },
2185
- name: RULE_NAME36,
2186
- create: create36,
2233
+ name: RULE_NAME37,
2234
+ create: create37,
2187
2235
  defaultOptions: []
2188
2236
  });
2189
- function create36(context) {
2237
+ function create37(context) {
2190
2238
  return {
2191
2239
  JSXAttribute(node) {
2192
2240
  if (node.name.name !== "ref") {
@@ -2201,8 +2249,8 @@ function create36(context) {
2201
2249
  }
2202
2250
  };
2203
2251
  }
2204
- var RULE_NAME37 = "no-unsafe-component-will-mount";
2205
- var RULE_FEATURES37 = [];
2252
+ var RULE_NAME38 = "no-unsafe-component-will-mount";
2253
+ var RULE_FEATURES38 = [];
2206
2254
  function isUnsafeComponentWillMount(node) {
2207
2255
  return AST11.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
2208
2256
  }
@@ -2211,18 +2259,18 @@ var no_unsafe_component_will_mount_default = createRule({
2211
2259
  type: "problem",
2212
2260
  docs: {
2213
2261
  description: "Warns the usage of `UNSAFE_componentWillMount` in class components.",
2214
- [Symbol.for("rule_features")]: RULE_FEATURES37
2262
+ [Symbol.for("rule_features")]: RULE_FEATURES38
2215
2263
  },
2216
2264
  messages: {
2217
2265
  noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'."
2218
2266
  },
2219
2267
  schema: []
2220
2268
  },
2221
- name: RULE_NAME37,
2222
- create: create37,
2269
+ name: RULE_NAME38,
2270
+ create: create38,
2223
2271
  defaultOptions: []
2224
2272
  });
2225
- function create37(context) {
2273
+ function create38(context) {
2226
2274
  if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
2227
2275
  const { ctx, listeners } = useComponentCollectorLegacy();
2228
2276
  return {
@@ -2243,8 +2291,8 @@ function create37(context) {
2243
2291
  }
2244
2292
  };
2245
2293
  }
2246
- var RULE_NAME38 = "no-unsafe-component-will-receive-props";
2247
- var RULE_FEATURES38 = [];
2294
+ var RULE_NAME39 = "no-unsafe-component-will-receive-props";
2295
+ var RULE_FEATURES39 = [];
2248
2296
  function isUnsafeComponentWillReceiveProps(node) {
2249
2297
  return AST11.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
2250
2298
  }
@@ -2253,18 +2301,18 @@ var no_unsafe_component_will_receive_props_default = createRule({
2253
2301
  type: "problem",
2254
2302
  docs: {
2255
2303
  description: "Warns the usage of `UNSAFE_componentWillReceiveProps` in class components.",
2256
- [Symbol.for("rule_features")]: RULE_FEATURES38
2304
+ [Symbol.for("rule_features")]: RULE_FEATURES39
2257
2305
  },
2258
2306
  messages: {
2259
2307
  noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'."
2260
2308
  },
2261
2309
  schema: []
2262
2310
  },
2263
- name: RULE_NAME38,
2264
- create: create38,
2311
+ name: RULE_NAME39,
2312
+ create: create39,
2265
2313
  defaultOptions: []
2266
2314
  });
2267
- function create38(context) {
2315
+ function create39(context) {
2268
2316
  if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) {
2269
2317
  return {};
2270
2318
  }
@@ -2287,8 +2335,8 @@ function create38(context) {
2287
2335
  }
2288
2336
  };
2289
2337
  }
2290
- var RULE_NAME39 = "no-unsafe-component-will-update";
2291
- var RULE_FEATURES39 = [];
2338
+ var RULE_NAME40 = "no-unsafe-component-will-update";
2339
+ var RULE_FEATURES40 = [];
2292
2340
  function isUnsafeComponentWillUpdate(node) {
2293
2341
  return AST11.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
2294
2342
  }
@@ -2297,18 +2345,18 @@ var no_unsafe_component_will_update_default = createRule({
2297
2345
  type: "problem",
2298
2346
  docs: {
2299
2347
  description: "Warns the usage of `UNSAFE_componentWillUpdate` in class components.",
2300
- [Symbol.for("rule_features")]: RULE_FEATURES39
2348
+ [Symbol.for("rule_features")]: RULE_FEATURES40
2301
2349
  },
2302
2350
  messages: {
2303
2351
  noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'."
2304
2352
  },
2305
2353
  schema: []
2306
2354
  },
2307
- name: RULE_NAME39,
2308
- create: create39,
2355
+ name: RULE_NAME40,
2356
+ create: create40,
2309
2357
  defaultOptions: []
2310
2358
  });
2311
- function create39(context) {
2359
+ function create40(context) {
2312
2360
  if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
2313
2361
  const { ctx, listeners } = useComponentCollectorLegacy();
2314
2362
  return {
@@ -2329,25 +2377,25 @@ function create39(context) {
2329
2377
  }
2330
2378
  };
2331
2379
  }
2332
- var RULE_NAME40 = "no-unstable-context-value";
2333
- var RULE_FEATURES40 = [];
2380
+ var RULE_NAME41 = "no-unstable-context-value";
2381
+ var RULE_FEATURES41 = [];
2334
2382
  var no_unstable_context_value_default = createRule({
2335
2383
  meta: {
2336
2384
  type: "problem",
2337
2385
  docs: {
2338
2386
  description: "Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`.",
2339
- [Symbol.for("rule_features")]: RULE_FEATURES40
2387
+ [Symbol.for("rule_features")]: RULE_FEATURES41
2340
2388
  },
2341
2389
  messages: {
2342
2390
  unstableContextValue: "A/an '{{type}}' passed as the value prop to the context provider should not be constructed. It will change on every render. {{suggestion}}"
2343
2391
  },
2344
2392
  schema: []
2345
2393
  },
2346
- name: RULE_NAME40,
2347
- create: create40,
2394
+ name: RULE_NAME41,
2395
+ create: create41,
2348
2396
  defaultOptions: []
2349
2397
  });
2350
- function create40(context) {
2398
+ function create41(context) {
2351
2399
  const { version: version2 } = getSettingsFromContext(context);
2352
2400
  const isReact18OrBelow = compare(version2, "19.0.0", "<");
2353
2401
  const { ctx, listeners } = useComponentCollector(context);
@@ -2402,25 +2450,25 @@ function isContextName(name5, isReact18OrBelow) {
2402
2450
  }
2403
2451
  return false;
2404
2452
  }
2405
- var RULE_NAME41 = "no-unstable-default-props";
2406
- var RULE_FEATURES41 = [];
2453
+ var RULE_NAME42 = "no-unstable-default-props";
2454
+ var RULE_FEATURES42 = [];
2407
2455
  var no_unstable_default_props_default = createRule({
2408
2456
  meta: {
2409
2457
  type: "problem",
2410
2458
  docs: {
2411
2459
  description: "Prevents using referential-type values as default props in object destructuring.",
2412
- [Symbol.for("rule_features")]: RULE_FEATURES41
2460
+ [Symbol.for("rule_features")]: RULE_FEATURES42
2413
2461
  },
2414
2462
  messages: {
2415
2463
  noUnstableDefaultProps: "A/an '{{forbiddenType}}' as default prop. This could lead to potential infinite render loop in React. Use a variable instead of '{{forbiddenType}}'."
2416
2464
  },
2417
2465
  schema: []
2418
2466
  },
2419
- name: RULE_NAME41,
2420
- create: create41,
2467
+ name: RULE_NAME42,
2468
+ create: create42,
2421
2469
  defaultOptions: []
2422
2470
  });
2423
- function create41(context) {
2471
+ function create42(context) {
2424
2472
  const { ctx, listeners } = useComponentCollector(context);
2425
2473
  const declarators = /* @__PURE__ */ new Map();
2426
2474
  return {
@@ -2476,8 +2524,8 @@ function create41(context) {
2476
2524
  }
2477
2525
  };
2478
2526
  }
2479
- var RULE_NAME42 = "no-unused-class-component-members";
2480
- var RULE_FEATURES42 = [];
2527
+ var RULE_NAME43 = "no-unused-class-component-members";
2528
+ var RULE_FEATURES43 = [];
2481
2529
  var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
2482
2530
  "componentDidCatch",
2483
2531
  "componentDidMount",
@@ -2503,18 +2551,18 @@ var no_unused_class_component_members_default = createRule({
2503
2551
  type: "problem",
2504
2552
  docs: {
2505
2553
  description: "Warns unused class component methods and properties.",
2506
- [Symbol.for("rule_features")]: RULE_FEATURES42
2554
+ [Symbol.for("rule_features")]: RULE_FEATURES43
2507
2555
  },
2508
2556
  messages: {
2509
2557
  noUnusedClassComponentMembers: "Unused method or property '{{methodName}}'' of class '{{className}}'."
2510
2558
  },
2511
2559
  schema: []
2512
2560
  },
2513
- name: RULE_NAME42,
2514
- create: create42,
2561
+ name: RULE_NAME43,
2562
+ create: create43,
2515
2563
  defaultOptions: []
2516
2564
  });
2517
- function create42(context) {
2565
+ function create43(context) {
2518
2566
  const classEntries = [];
2519
2567
  const methodEntries = [];
2520
2568
  const propertyDefs = /* @__PURE__ */ new WeakMap();
@@ -2624,8 +2672,8 @@ function create42(context) {
2624
2672
  }
2625
2673
  };
2626
2674
  }
2627
- var RULE_NAME43 = "no-unused-state";
2628
- var RULE_FEATURES43 = [];
2675
+ var RULE_NAME44 = "no-unused-state";
2676
+ var RULE_FEATURES44 = [];
2629
2677
  function isKeyLiteral3(node, key) {
2630
2678
  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);
2631
2679
  }
@@ -2634,18 +2682,18 @@ var no_unused_state_default = createRule({
2634
2682
  type: "problem",
2635
2683
  docs: {
2636
2684
  description: "Warns unused class component state.",
2637
- [Symbol.for("rule_features")]: RULE_FEATURES43
2685
+ [Symbol.for("rule_features")]: RULE_FEATURES44
2638
2686
  },
2639
2687
  messages: {
2640
2688
  noUnusedState: "Unused class component state in '{{className}}'"
2641
2689
  },
2642
2690
  schema: []
2643
2691
  },
2644
- name: RULE_NAME43,
2645
- create: create43,
2692
+ name: RULE_NAME44,
2693
+ create: create44,
2646
2694
  defaultOptions: []
2647
2695
  });
2648
- function create43(context) {
2696
+ function create44(context) {
2649
2697
  const classEntries = [];
2650
2698
  const methodEntries = [];
2651
2699
  const constructorEntries = [];
@@ -2779,8 +2827,8 @@ function create43(context) {
2779
2827
  }
2780
2828
  };
2781
2829
  }
2782
- var RULE_NAME44 = "no-use-context";
2783
- var RULE_FEATURES44 = [
2830
+ var RULE_NAME45 = "no-use-context";
2831
+ var RULE_FEATURES45 = [
2784
2832
  "MOD"
2785
2833
  ];
2786
2834
  var no_use_context_default = createRule({
@@ -2788,7 +2836,7 @@ var no_use_context_default = createRule({
2788
2836
  type: "problem",
2789
2837
  docs: {
2790
2838
  description: "Replaces usages of `useContext` with `use`.",
2791
- [Symbol.for("rule_features")]: RULE_FEATURES44
2839
+ [Symbol.for("rule_features")]: RULE_FEATURES45
2792
2840
  },
2793
2841
  fixable: "code",
2794
2842
  messages: {
@@ -2796,11 +2844,11 @@ var no_use_context_default = createRule({
2796
2844
  },
2797
2845
  schema: []
2798
2846
  },
2799
- name: RULE_NAME44,
2800
- create: create44,
2847
+ name: RULE_NAME45,
2848
+ create: create45,
2801
2849
  defaultOptions: []
2802
2850
  });
2803
- function create44(context) {
2851
+ function create45(context) {
2804
2852
  if (!context.sourceCode.text.includes("useContext")) return {};
2805
2853
  const settings4 = getSettingsFromContext(context);
2806
2854
  const useContextAlias = /* @__PURE__ */ new Set();
@@ -2878,25 +2926,25 @@ function getAssociatedTokens(context, node) {
2878
2926
  return tokens;
2879
2927
  }
2880
2928
  }
2881
- var RULE_NAME45 = "no-useless-forward-ref";
2882
- var RULE_FEATURES45 = [];
2929
+ var RULE_NAME46 = "no-useless-forward-ref";
2930
+ var RULE_FEATURES46 = [];
2883
2931
  var no_useless_forward_ref_default = createRule({
2884
2932
  meta: {
2885
2933
  type: "problem",
2886
2934
  docs: {
2887
2935
  description: "Disallow useless `forwardRef` calls on components that don't use `ref`s.",
2888
- [Symbol.for("rule_features")]: RULE_FEATURES45
2936
+ [Symbol.for("rule_features")]: RULE_FEATURES46
2889
2937
  },
2890
2938
  messages: {
2891
2939
  noUselessForwardRef: "A 'forwardRef' is used with this component but no 'ref' parameter is set."
2892
2940
  },
2893
2941
  schema: []
2894
2942
  },
2895
- name: RULE_NAME45,
2896
- create: create45,
2943
+ name: RULE_NAME46,
2944
+ create: create46,
2897
2945
  defaultOptions: []
2898
2946
  });
2899
- function create45(context) {
2947
+ function create46(context) {
2900
2948
  return {
2901
2949
  CallExpression(node) {
2902
2950
  if (!isForwardRefCall(context, node)) {
@@ -2917,7 +2965,7 @@ function create45(context) {
2917
2965
  }
2918
2966
  };
2919
2967
  }
2920
- var RULE_NAME46 = "no-useless-fragment";
2968
+ var RULE_NAME47 = "no-useless-fragment";
2921
2969
  var defaultOptions = [{
2922
2970
  allowExpressions: true
2923
2971
  }];
@@ -2943,11 +2991,11 @@ var no_useless_fragment_default = createRule({
2943
2991
  }
2944
2992
  }]
2945
2993
  },
2946
- name: RULE_NAME46,
2947
- create: create46,
2994
+ name: RULE_NAME47,
2995
+ create: create47,
2948
2996
  defaultOptions
2949
2997
  });
2950
- function create46(context, [option]) {
2998
+ function create47(context, [option]) {
2951
2999
  const { allowExpressions = true } = option;
2952
3000
  return {
2953
3001
  JSXElement(node) {
@@ -3059,8 +3107,8 @@ function doCheck(context, node, allowExpressions) {
3059
3107
  }
3060
3108
  return;
3061
3109
  }
3062
- var RULE_NAME47 = "prefer-destructuring-assignment";
3063
- var RULE_FEATURES46 = [];
3110
+ var RULE_NAME48 = "prefer-destructuring-assignment";
3111
+ var RULE_FEATURES47 = [];
3064
3112
  function isMemberExpressionWithObjectName(node) {
3065
3113
  return node.object.type === AST_NODE_TYPES.Identifier && "name" in node.object;
3066
3114
  }
@@ -3069,18 +3117,18 @@ var prefer_destructuring_assignment_default = createRule({
3069
3117
  type: "problem",
3070
3118
  docs: {
3071
3119
  description: "Enforces destructuring assignment for component props and context.",
3072
- [Symbol.for("rule_features")]: RULE_FEATURES46
3120
+ [Symbol.for("rule_features")]: RULE_FEATURES47
3073
3121
  },
3074
3122
  messages: {
3075
3123
  preferDestructuringAssignment: "Use destructuring assignment for {{name}}."
3076
3124
  },
3077
3125
  schema: []
3078
3126
  },
3079
- name: RULE_NAME47,
3080
- create: create47,
3127
+ name: RULE_NAME48,
3128
+ create: create48,
3081
3129
  defaultOptions: []
3082
3130
  });
3083
- function create47(context) {
3131
+ function create48(context) {
3084
3132
  const { ctx, listeners } = useComponentCollector(context);
3085
3133
  const memberExpressionWithNames = [];
3086
3134
  return {
@@ -3140,16 +3188,17 @@ function create47(context) {
3140
3188
  }
3141
3189
  };
3142
3190
  }
3143
- var RULE_NAME48 = "prefer-react-namespace-import";
3144
- var RULE_FEATURES47 = [
3145
- "FIX"
3191
+ var RULE_NAME49 = "prefer-react-namespace-import";
3192
+ var RULE_FEATURES48 = [
3193
+ "FIX",
3194
+ "EXP"
3146
3195
  ];
3147
3196
  var prefer_react_namespace_import_default = createRule({
3148
3197
  meta: {
3149
3198
  type: "problem",
3150
3199
  docs: {
3151
3200
  description: "Enforces React is imported via a namespace import.",
3152
- [Symbol.for("rule_features")]: RULE_FEATURES47
3201
+ [Symbol.for("rule_features")]: RULE_FEATURES48
3153
3202
  },
3154
3203
  fixable: "code",
3155
3204
  messages: {
@@ -3157,11 +3206,11 @@ var prefer_react_namespace_import_default = createRule({
3157
3206
  },
3158
3207
  schema: []
3159
3208
  },
3160
- name: RULE_NAME48,
3161
- create: create48,
3209
+ name: RULE_NAME49,
3210
+ create: create49,
3162
3211
  defaultOptions: []
3163
3212
  });
3164
- function create48(context) {
3213
+ function create49(context) {
3165
3214
  const { importSource } = getSettingsFromContext(context);
3166
3215
  return {
3167
3216
  [`ImportDeclaration[source.value="${importSource}"] ImportDefaultSpecifier`](node) {
@@ -3194,27 +3243,28 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
3194
3243
  }
3195
3244
  };
3196
3245
  }
3197
- var RULE_NAME49 = "prefer-read-only-props";
3198
- var RULE_FEATURES48 = [
3199
- "TSC"
3246
+ var RULE_NAME50 = "prefer-read-only-props";
3247
+ var RULE_FEATURES49 = [
3248
+ "TSC",
3249
+ "EXP"
3200
3250
  ];
3201
3251
  var prefer_read_only_props_default = createRule({
3202
3252
  meta: {
3203
3253
  type: "problem",
3204
3254
  docs: {
3205
3255
  description: "Enforces read-only props in components.",
3206
- [Symbol.for("rule_features")]: RULE_FEATURES48
3256
+ [Symbol.for("rule_features")]: RULE_FEATURES49
3207
3257
  },
3208
3258
  messages: {
3209
3259
  preferReadOnlyProps: "A function component's props should be read-only."
3210
3260
  },
3211
3261
  schema: []
3212
3262
  },
3213
- name: RULE_NAME49,
3214
- create: create49,
3263
+ name: RULE_NAME50,
3264
+ create: create50,
3215
3265
  defaultOptions: []
3216
3266
  });
3217
- function create49(context) {
3267
+ function create50(context) {
3218
3268
  const services = ESLintUtils.getParserServices(context, false);
3219
3269
  const { ctx, listeners } = useComponentCollector(context);
3220
3270
  return {
@@ -3244,8 +3294,8 @@ function isTypeReadonlyLoose(services, type) {
3244
3294
  return true;
3245
3295
  }
3246
3296
  }
3247
- var RULE_NAME50 = "prefer-shorthand-boolean";
3248
- var RULE_FEATURES49 = [
3297
+ var RULE_NAME51 = "prefer-shorthand-boolean";
3298
+ var RULE_FEATURES50 = [
3249
3299
  "FIX"
3250
3300
  ];
3251
3301
  var prefer_shorthand_boolean_default = createRule({
@@ -3253,7 +3303,7 @@ var prefer_shorthand_boolean_default = createRule({
3253
3303
  type: "problem",
3254
3304
  docs: {
3255
3305
  description: "Enforces shorthand syntax for boolean attributes.",
3256
- [Symbol.for("rule_features")]: RULE_FEATURES49
3306
+ [Symbol.for("rule_features")]: RULE_FEATURES50
3257
3307
  },
3258
3308
  fixable: "code",
3259
3309
  messages: {
@@ -3261,11 +3311,11 @@ var prefer_shorthand_boolean_default = createRule({
3261
3311
  },
3262
3312
  schema: []
3263
3313
  },
3264
- name: RULE_NAME50,
3265
- create: create50,
3314
+ name: RULE_NAME51,
3315
+ create: create51,
3266
3316
  defaultOptions: []
3267
3317
  });
3268
- function create50(context) {
3318
+ function create51(context) {
3269
3319
  return {
3270
3320
  JSXAttribute(node) {
3271
3321
  const { value } = node;
@@ -3285,8 +3335,8 @@ function create50(context) {
3285
3335
  }
3286
3336
  };
3287
3337
  }
3288
- var RULE_NAME51 = "prefer-shorthand-fragment";
3289
- var RULE_FEATURES50 = [
3338
+ var RULE_NAME52 = "prefer-shorthand-fragment";
3339
+ var RULE_FEATURES51 = [
3290
3340
  "FIX"
3291
3341
  ];
3292
3342
  var prefer_shorthand_fragment_default = createRule({
@@ -3294,7 +3344,7 @@ var prefer_shorthand_fragment_default = createRule({
3294
3344
  type: "problem",
3295
3345
  docs: {
3296
3346
  description: "Enforces shorthand syntax for fragments.",
3297
- [Symbol.for("rule_features")]: RULE_FEATURES50
3347
+ [Symbol.for("rule_features")]: RULE_FEATURES51
3298
3348
  },
3299
3349
  fixable: "code",
3300
3350
  messages: {
@@ -3302,11 +3352,11 @@ var prefer_shorthand_fragment_default = createRule({
3302
3352
  },
3303
3353
  schema: []
3304
3354
  },
3305
- name: RULE_NAME51,
3306
- create: create51,
3355
+ name: RULE_NAME52,
3356
+ create: create52,
3307
3357
  defaultOptions: []
3308
3358
  });
3309
- function create51(context) {
3359
+ function create52(context) {
3310
3360
  return {
3311
3361
  JSXElement(node) {
3312
3362
  if (!JSX8.isFragmentElement(node)) return;
@@ -3331,46 +3381,6 @@ function create51(context) {
3331
3381
  }
3332
3382
  };
3333
3383
  }
3334
- var RULE_NAME52 = "use-jsx-vars";
3335
- var RULE_FEATURES51 = [];
3336
- var use_jsx_vars_default = createRule({
3337
- meta: {
3338
- type: "problem",
3339
- docs: {
3340
- description: "Marks variables used in JSX as used.",
3341
- [Symbol.for("rule_features")]: RULE_FEATURES51
3342
- },
3343
- messages: {
3344
- useJsxVars: ""
3345
- },
3346
- schema: []
3347
- },
3348
- name: RULE_NAME52,
3349
- create: create52,
3350
- defaultOptions: []
3351
- });
3352
- function create52(context) {
3353
- return {
3354
- JSXOpeningElement(node) {
3355
- switch (node.name.type) {
3356
- case AST_NODE_TYPES.JSXIdentifier: {
3357
- if (/^[a-z]/u.test(node.name.name)) {
3358
- return;
3359
- }
3360
- context.sourceCode.markVariableAsUsed(node.name.name, node);
3361
- break;
3362
- }
3363
- case AST_NODE_TYPES.JSXMemberExpression: {
3364
- const { object } = node.name;
3365
- if (object.type === AST_NODE_TYPES.JSXIdentifier) {
3366
- context.sourceCode.markVariableAsUsed(object.name, node);
3367
- }
3368
- break;
3369
- }
3370
- }
3371
- }
3372
- };
3373
- }
3374
3384
 
3375
3385
  // src/plugin.ts
3376
3386
  var plugin = {
@@ -3400,7 +3410,6 @@ var plugin = {
3400
3410
  "no-create-ref": no_create_ref_default,
3401
3411
  "no-default-props": no_default_props_default,
3402
3412
  "no-direct-mutation-state": no_direct_mutation_state_default,
3403
- "no-duplicate-jsx-props": no_duplicate_jsx_props_default,
3404
3413
  "no-duplicate-key": no_duplicate_key_default,
3405
3414
  "no-forward-ref": no_forward_ref_default,
3406
3415
  "no-implicit-key": no_implicit_key_default,
@@ -3430,18 +3439,20 @@ var plugin = {
3430
3439
  "prefer-read-only-props": prefer_read_only_props_default,
3431
3440
  "prefer-shorthand-boolean": prefer_shorthand_boolean_default,
3432
3441
  "prefer-shorthand-fragment": prefer_shorthand_fragment_default,
3433
- "use-jsx-vars": use_jsx_vars_default,
3442
+ // Part: JSX only rules
3443
+ "jsx-no-duplicate-props": jsx_no_duplicate_props_default,
3444
+ "jsx-uses-vars": jsx_uses_vars_default,
3434
3445
  // Part: deprecated rules
3435
3446
  /** @deprecated Use `no-useless-forward-ref` instead */
3436
3447
  "ensure-forward-ref-using-ref": no_useless_forward_ref_default,
3437
- /** @deprecated Use `no-duplicate-jsx-props` instead */
3438
- "jsx-no-duplicate-props": no_duplicate_jsx_props_default,
3439
- /** @deprecated Use `use-jsx-vars` instead */
3440
- "jsx-uses-vars": use_jsx_vars_default,
3441
3448
  /** @deprecated Use `no-complex-conditional-rendering` instead */
3442
3449
  "no-complicated-conditional-rendering": no_complex_conditional_rendering_default,
3450
+ /** @deprecated Use `jsx-no-duplicate-props` instead */
3451
+ "no-duplicate-jsx-props": jsx_no_duplicate_props_default,
3443
3452
  /** @deprecated Use `no-nested-component-definitions` instead */
3444
- "no-nested-components": no_nested_component_definitions_default
3453
+ "no-nested-components": no_nested_component_definitions_default,
3454
+ /** @deprecated Use `jsx-uses-vars` instead */
3455
+ "use-jsx-vars": jsx_uses_vars_default
3445
3456
  }
3446
3457
  };
3447
3458