eslint-plugin-react-x 1.21.1-next.0 → 1.22.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
14
14
 
15
15
  // package.json
16
16
  var name = "eslint-plugin-react-x";
17
- var version = "1.21.1-next.0";
17
+ var version = "1.22.0-beta.0";
18
18
  var createRule = createRuleForPlugin("x");
19
19
 
20
20
  // src/rules/avoid-shorthand-boolean.ts
@@ -118,88 +118,10 @@ var ensure_forward_ref_using_ref_default = createRule({
118
118
  },
119
119
  defaultOptions: []
120
120
  });
121
- var RULE_NAME4 = "jsx-no-duplicate-props";
121
+ var RULE_NAME4 = "no-access-state-in-setstate";
122
122
  var RULE_FEATURES4 = [
123
123
  "CHK"
124
124
  ];
125
- var jsx_no_duplicate_props_default = createRule({
126
- meta: {
127
- type: "problem",
128
- docs: {
129
- description: "disallow duplicate props",
130
- [Symbol.for("rule_features")]: RULE_FEATURES4
131
- },
132
- messages: {
133
- jsxNoDuplicateProps: "Duplicate prop '{{name}}'"
134
- },
135
- schema: []
136
- },
137
- name: RULE_NAME4,
138
- create(context) {
139
- return {
140
- JSXOpeningElement(node) {
141
- const props = [];
142
- for (const attr of node.attributes) {
143
- if (attr.type === AST_NODE_TYPES.JSXSpreadAttribute) continue;
144
- const name2 = attr.name.name;
145
- if (!isString(name2)) continue;
146
- if (!props.includes(name2)) {
147
- props.push(name2);
148
- continue;
149
- }
150
- context.report({
151
- messageId: "jsxNoDuplicateProps",
152
- node: attr,
153
- data: { name: name2 }
154
- });
155
- }
156
- }
157
- };
158
- },
159
- defaultOptions: []
160
- });
161
- var RULE_NAME5 = "jsx-uses-vars";
162
- var RULE_FEATURES5 = [];
163
- var jsx_uses_vars_default = createRule({
164
- meta: {
165
- type: "problem",
166
- docs: {
167
- // eslint-disable-next-line eslint-plugin/require-meta-docs-description
168
- description: "a helper rule to mark variables as used",
169
- [Symbol.for("rule_features")]: RULE_FEATURES5
170
- },
171
- messages: {
172
- jsxUsesVars: ""
173
- },
174
- schema: []
175
- },
176
- name: RULE_NAME5,
177
- create(context) {
178
- function getName5(node) {
179
- switch (node.type) {
180
- case AST_NODE_TYPES.JSXIdentifier:
181
- return O.some(node.name);
182
- case AST_NODE_TYPES.JSXMemberExpression:
183
- return getName5(node.object);
184
- default:
185
- return O.none();
186
- }
187
- }
188
- return {
189
- JSXOpeningElement(node) {
190
- if (node.name.type === AST_NODE_TYPES.JSXIdentifier && /^[a-z]/u.test(node.name.name)) return;
191
- O.map(getName5(node.name), (name2) => {
192
- context.sourceCode.markVariableAsUsed(name2, node);
193
- });
194
- }
195
- };
196
- },
197
- defaultOptions: []
198
- });
199
- var RULE_NAME6 = "no-access-state-in-setstate";
200
- var RULE_FEATURES6 = [
201
- "CHK"
202
- ];
203
125
  function getName(node) {
204
126
  if (node.type === AST_NODE_TYPES.TSAsExpression) {
205
127
  return getName(node.expression);
@@ -220,14 +142,14 @@ var no_access_state_in_setstate_default = createRule({
220
142
  type: "problem",
221
143
  docs: {
222
144
  description: "disallow accessing 'this.state' within 'setState'",
223
- [Symbol.for("rule_features")]: RULE_FEATURES6
145
+ [Symbol.for("rule_features")]: RULE_FEATURES4
224
146
  },
225
147
  messages: {
226
148
  noAccessStateInSetstate: "Do not access 'this.state' within 'setState'. Use the update function instead."
227
149
  },
228
150
  schema: []
229
151
  },
230
- name: RULE_NAME6,
152
+ name: RULE_NAME4,
231
153
  create(context) {
232
154
  if (!context.sourceCode.text.includes("setState")) return {};
233
155
  const classStack = [];
@@ -298,8 +220,8 @@ var no_access_state_in_setstate_default = createRule({
298
220
  },
299
221
  defaultOptions: []
300
222
  });
301
- var RULE_NAME7 = "no-array-index-key";
302
- var RULE_FEATURES7 = [
223
+ var RULE_NAME5 = "no-array-index-key";
224
+ var RULE_FEATURES5 = [
303
225
  "CHK"
304
226
  ];
305
227
  var reactChildrenMethod = ["forEach", "map"];
@@ -367,14 +289,14 @@ var no_array_index_key_default = createRule({
367
289
  type: "problem",
368
290
  docs: {
369
291
  description: "disallow using Array index as 'key'",
370
- [Symbol.for("rule_features")]: RULE_FEATURES7
292
+ [Symbol.for("rule_features")]: RULE_FEATURES5
371
293
  },
372
294
  messages: {
373
295
  noArrayIndexKey: "Do not use Array index as 'key'."
374
296
  },
375
297
  schema: []
376
298
  },
377
- name: RULE_NAME7,
299
+ name: RULE_NAME5,
378
300
  create(context) {
379
301
  const indexParamNames = [];
380
302
  function isArrayIndex(node) {
@@ -442,8 +364,8 @@ var no_array_index_key_default = createRule({
442
364
  },
443
365
  defaultOptions: []
444
366
  });
445
- var RULE_NAME8 = "no-children-count";
446
- var RULE_FEATURES8 = [
367
+ var RULE_NAME6 = "no-children-count";
368
+ var RULE_FEATURES6 = [
447
369
  "CHK"
448
370
  ];
449
371
  var no_children_count_default = createRule({
@@ -451,14 +373,14 @@ var no_children_count_default = createRule({
451
373
  type: "problem",
452
374
  docs: {
453
375
  description: "disallow using 'Children.count'",
454
- [Symbol.for("rule_features")]: RULE_FEATURES8
376
+ [Symbol.for("rule_features")]: RULE_FEATURES6
455
377
  },
456
378
  messages: {
457
379
  noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead."
458
380
  },
459
381
  schema: []
460
382
  },
461
- name: RULE_NAME8,
383
+ name: RULE_NAME6,
462
384
  create(context) {
463
385
  return {
464
386
  MemberExpression(node) {
@@ -473,8 +395,8 @@ var no_children_count_default = createRule({
473
395
  },
474
396
  defaultOptions: []
475
397
  });
476
- var RULE_NAME9 = "no-children-for-each";
477
- var RULE_FEATURES9 = [
398
+ var RULE_NAME7 = "no-children-for-each";
399
+ var RULE_FEATURES7 = [
478
400
  "CHK"
479
401
  ];
480
402
  var no_children_for_each_default = createRule({
@@ -482,14 +404,14 @@ var no_children_for_each_default = createRule({
482
404
  type: "problem",
483
405
  docs: {
484
406
  description: "disallow using 'Children.forEach'",
485
- [Symbol.for("rule_features")]: RULE_FEATURES9
407
+ [Symbol.for("rule_features")]: RULE_FEATURES7
486
408
  },
487
409
  messages: {
488
410
  noChildrenForEach: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead."
489
411
  },
490
412
  schema: []
491
413
  },
492
- name: RULE_NAME9,
414
+ name: RULE_NAME7,
493
415
  create(context) {
494
416
  return {
495
417
  MemberExpression(node) {
@@ -504,8 +426,8 @@ var no_children_for_each_default = createRule({
504
426
  },
505
427
  defaultOptions: []
506
428
  });
507
- var RULE_NAME10 = "no-children-map";
508
- var RULE_FEATURES10 = [
429
+ var RULE_NAME8 = "no-children-map";
430
+ var RULE_FEATURES8 = [
509
431
  "CHK"
510
432
  ];
511
433
  var no_children_map_default = createRule({
@@ -513,14 +435,14 @@ var no_children_map_default = createRule({
513
435
  type: "problem",
514
436
  docs: {
515
437
  description: "disallow using 'Children.map'",
516
- [Symbol.for("rule_features")]: RULE_FEATURES10
438
+ [Symbol.for("rule_features")]: RULE_FEATURES8
517
439
  },
518
440
  messages: {
519
441
  noChildrenMap: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead."
520
442
  },
521
443
  schema: []
522
444
  },
523
- name: RULE_NAME10,
445
+ name: RULE_NAME8,
524
446
  create(context) {
525
447
  return {
526
448
  MemberExpression(node) {
@@ -535,8 +457,8 @@ var no_children_map_default = createRule({
535
457
  },
536
458
  defaultOptions: []
537
459
  });
538
- var RULE_NAME11 = "no-children-only";
539
- var RULE_FEATURES11 = [
460
+ var RULE_NAME9 = "no-children-only";
461
+ var RULE_FEATURES9 = [
540
462
  "CHK"
541
463
  ];
542
464
  var no_children_only_default = createRule({
@@ -544,14 +466,14 @@ var no_children_only_default = createRule({
544
466
  type: "problem",
545
467
  docs: {
546
468
  description: "disallow using 'Children.only'",
547
- [Symbol.for("rule_features")]: RULE_FEATURES11
469
+ [Symbol.for("rule_features")]: RULE_FEATURES9
548
470
  },
549
471
  messages: {
550
472
  noChildrenOnly: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead."
551
473
  },
552
474
  schema: []
553
475
  },
554
- name: RULE_NAME11,
476
+ name: RULE_NAME9,
555
477
  create(context) {
556
478
  return {
557
479
  MemberExpression(node) {
@@ -566,8 +488,8 @@ var no_children_only_default = createRule({
566
488
  },
567
489
  defaultOptions: []
568
490
  });
569
- var RULE_NAME12 = "no-children-prop";
570
- var RULE_FEATURES12 = [
491
+ var RULE_NAME10 = "no-children-prop";
492
+ var RULE_FEATURES10 = [
571
493
  "CHK"
572
494
  ];
573
495
  var no_children_prop_default = createRule({
@@ -575,14 +497,14 @@ var no_children_prop_default = createRule({
575
497
  type: "problem",
576
498
  docs: {
577
499
  description: "disallow passing 'children' as props",
578
- [Symbol.for("rule_features")]: RULE_FEATURES12
500
+ [Symbol.for("rule_features")]: RULE_FEATURES10
579
501
  },
580
502
  messages: {
581
503
  noChildrenProp: "Do not pass 'children' as props."
582
504
  },
583
505
  schema: []
584
506
  },
585
- name: RULE_NAME12,
507
+ name: RULE_NAME10,
586
508
  create(context) {
587
509
  return {
588
510
  JSXElement(node) {
@@ -595,8 +517,8 @@ var no_children_prop_default = createRule({
595
517
  },
596
518
  defaultOptions: []
597
519
  });
598
- var RULE_NAME13 = "no-children-to-array";
599
- var RULE_FEATURES13 = [
520
+ var RULE_NAME11 = "no-children-to-array";
521
+ var RULE_FEATURES11 = [
600
522
  "CHK"
601
523
  ];
602
524
  var no_children_to_array_default = createRule({
@@ -604,14 +526,14 @@ var no_children_to_array_default = createRule({
604
526
  type: "problem",
605
527
  docs: {
606
528
  description: "disallow using 'Children.toArray'",
607
- [Symbol.for("rule_features")]: RULE_FEATURES13
529
+ [Symbol.for("rule_features")]: RULE_FEATURES11
608
530
  },
609
531
  messages: {
610
532
  noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead."
611
533
  },
612
534
  schema: []
613
535
  },
614
- name: RULE_NAME13,
536
+ name: RULE_NAME11,
615
537
  create(context) {
616
538
  return {
617
539
  MemberExpression(node) {
@@ -626,8 +548,8 @@ var no_children_to_array_default = createRule({
626
548
  },
627
549
  defaultOptions: []
628
550
  });
629
- var RULE_NAME14 = "no-class-component";
630
- var RULE_FEATURES14 = [
551
+ var RULE_NAME12 = "no-class-component";
552
+ var RULE_FEATURES12 = [
631
553
  "CHK"
632
554
  ];
633
555
  var isComponentDidCatch = isMatching({
@@ -651,14 +573,14 @@ var no_class_component_default = createRule({
651
573
  type: "problem",
652
574
  docs: {
653
575
  description: "disallow using class components",
654
- [Symbol.for("rule_features")]: RULE_FEATURES14
576
+ [Symbol.for("rule_features")]: RULE_FEATURES12
655
577
  },
656
578
  messages: {
657
579
  noClassComponent: "Do not use class components. Use function components instead."
658
580
  },
659
581
  schema: []
660
582
  },
661
- name: RULE_NAME14,
583
+ name: RULE_NAME12,
662
584
  create(context) {
663
585
  if (!context.sourceCode.text.includes("Component")) return {};
664
586
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -682,8 +604,8 @@ var no_class_component_default = createRule({
682
604
  },
683
605
  defaultOptions: []
684
606
  });
685
- var RULE_NAME15 = "no-clone-element";
686
- var RULE_FEATURES15 = [
607
+ var RULE_NAME13 = "no-clone-element";
608
+ var RULE_FEATURES13 = [
687
609
  "CHK"
688
610
  ];
689
611
  var no_clone_element_default = createRule({
@@ -691,14 +613,14 @@ var no_clone_element_default = createRule({
691
613
  type: "problem",
692
614
  docs: {
693
615
  description: "disallow using 'cloneElement'",
694
- [Symbol.for("rule_features")]: RULE_FEATURES15
616
+ [Symbol.for("rule_features")]: RULE_FEATURES13
695
617
  },
696
618
  messages: {
697
619
  noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead."
698
620
  },
699
621
  schema: []
700
622
  },
701
- name: RULE_NAME15,
623
+ name: RULE_NAME13,
702
624
  create(context) {
703
625
  return {
704
626
  CallExpression(node) {
@@ -712,8 +634,8 @@ var no_clone_element_default = createRule({
712
634
  },
713
635
  defaultOptions: []
714
636
  });
715
- var RULE_NAME16 = "no-comment-textnodes";
716
- var RULE_FEATURES16 = [
637
+ var RULE_NAME14 = "no-comment-textnodes";
638
+ var RULE_FEATURES14 = [
717
639
  "CHK"
718
640
  ];
719
641
  var no_comment_textnodes_default = createRule({
@@ -721,14 +643,14 @@ var no_comment_textnodes_default = createRule({
721
643
  type: "problem",
722
644
  docs: {
723
645
  description: "disallow comments from being inserted as text nodes",
724
- [Symbol.for("rule_features")]: RULE_FEATURES16
646
+ [Symbol.for("rule_features")]: RULE_FEATURES14
725
647
  },
726
648
  messages: {
727
649
  noCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces."
728
650
  },
729
651
  schema: []
730
652
  },
731
- name: RULE_NAME16,
653
+ name: RULE_NAME14,
732
654
  create(context) {
733
655
  function hasCommentLike(node) {
734
656
  if (AST11.isOneOf([AST_NODE_TYPES.JSXAttribute, AST_NODE_TYPES.JSXExpressionContainer])(node.parent)) return false;
@@ -752,8 +674,8 @@ var no_comment_textnodes_default = createRule({
752
674
  },
753
675
  defaultOptions: []
754
676
  });
755
- var RULE_NAME17 = "no-complex-conditional-rendering";
756
- var RULE_FEATURES17 = [
677
+ var RULE_NAME15 = "no-complex-conditional-rendering";
678
+ var RULE_FEATURES15 = [
757
679
  "CHK"
758
680
  ];
759
681
  var no_complex_conditional_rendering_default = createRule({
@@ -761,14 +683,14 @@ var no_complex_conditional_rendering_default = createRule({
761
683
  type: "problem",
762
684
  docs: {
763
685
  description: "disallow complex conditional rendering",
764
- [Symbol.for("rule_features")]: RULE_FEATURES17
686
+ [Symbol.for("rule_features")]: RULE_FEATURES15
765
687
  },
766
688
  messages: {
767
689
  noComplexConditionalRendering: "Avoid complex conditional rendering. Extract the logic into separate elements or components."
768
690
  },
769
691
  schema: []
770
692
  },
771
- name: RULE_NAME17,
693
+ name: RULE_NAME15,
772
694
  create(context) {
773
695
  function getReportDescriptor(node) {
774
696
  const jsxExpContainer = node.parent?.parent;
@@ -790,8 +712,8 @@ var no_complex_conditional_rendering_default = createRule({
790
712
  },
791
713
  defaultOptions: []
792
714
  });
793
- var RULE_NAME18 = "no-component-will-mount";
794
- var RULE_FEATURES18 = [
715
+ var RULE_NAME16 = "no-component-will-mount";
716
+ var RULE_FEATURES16 = [
795
717
  "CHK",
796
718
  "MOD"
797
719
  ];
@@ -803,7 +725,7 @@ var no_component_will_mount_default = createRule({
803
725
  type: "problem",
804
726
  docs: {
805
727
  description: "disallow using 'componentWillMount'",
806
- [Symbol.for("rule_features")]: RULE_FEATURES18
728
+ [Symbol.for("rule_features")]: RULE_FEATURES16
807
729
  },
808
730
  fixable: "code",
809
731
  messages: {
@@ -811,7 +733,7 @@ var no_component_will_mount_default = createRule({
811
733
  },
812
734
  schema: []
813
735
  },
814
- name: RULE_NAME18,
736
+ name: RULE_NAME16,
815
737
  create(context) {
816
738
  if (!context.sourceCode.text.includes("componentWillMount")) return {};
817
739
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -839,8 +761,8 @@ var no_component_will_mount_default = createRule({
839
761
  },
840
762
  defaultOptions: []
841
763
  });
842
- var RULE_NAME19 = "no-component-will-receive-props";
843
- var RULE_FEATURES19 = [
764
+ var RULE_NAME17 = "no-component-will-receive-props";
765
+ var RULE_FEATURES17 = [
844
766
  "CHK",
845
767
  "MOD"
846
768
  ];
@@ -852,7 +774,7 @@ var no_component_will_receive_props_default = createRule({
852
774
  type: "problem",
853
775
  docs: {
854
776
  description: "disallow using 'componentWillReceiveProps'",
855
- [Symbol.for("rule_features")]: RULE_FEATURES19
777
+ [Symbol.for("rule_features")]: RULE_FEATURES17
856
778
  },
857
779
  fixable: "code",
858
780
  messages: {
@@ -860,7 +782,7 @@ var no_component_will_receive_props_default = createRule({
860
782
  },
861
783
  schema: []
862
784
  },
863
- name: RULE_NAME19,
785
+ name: RULE_NAME17,
864
786
  create(context) {
865
787
  if (!context.sourceCode.text.includes("componentWillReceiveProps")) return {};
866
788
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -888,8 +810,8 @@ var no_component_will_receive_props_default = createRule({
888
810
  },
889
811
  defaultOptions: []
890
812
  });
891
- var RULE_NAME20 = "no-component-will-update";
892
- var RULE_FEATURES20 = [
813
+ var RULE_NAME18 = "no-component-will-update";
814
+ var RULE_FEATURES18 = [
893
815
  "CHK",
894
816
  "MOD"
895
817
  ];
@@ -901,7 +823,7 @@ var no_component_will_update_default = createRule({
901
823
  type: "problem",
902
824
  docs: {
903
825
  description: "disallow using 'componentWillReceiveProps'",
904
- [Symbol.for("rule_features")]: RULE_FEATURES20
826
+ [Symbol.for("rule_features")]: RULE_FEATURES18
905
827
  },
906
828
  fixable: "code",
907
829
  messages: {
@@ -909,7 +831,7 @@ var no_component_will_update_default = createRule({
909
831
  },
910
832
  schema: []
911
833
  },
912
- name: RULE_NAME20,
834
+ name: RULE_NAME18,
913
835
  create(context) {
914
836
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
915
837
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -937,8 +859,8 @@ var no_component_will_update_default = createRule({
937
859
  },
938
860
  defaultOptions: []
939
861
  });
940
- var RULE_NAME21 = "no-context-provider";
941
- var RULE_FEATURES21 = [
862
+ var RULE_NAME19 = "no-context-provider";
863
+ var RULE_FEATURES19 = [
942
864
  "CHK",
943
865
  "MOD"
944
866
  ];
@@ -947,7 +869,7 @@ var no_context_provider_default = createRule({
947
869
  type: "problem",
948
870
  docs: {
949
871
  description: "disallow the use of '<Context.Provider>'",
950
- [Symbol.for("rule_features")]: RULE_FEATURES21
872
+ [Symbol.for("rule_features")]: RULE_FEATURES19
951
873
  },
952
874
  fixable: "code",
953
875
  messages: {
@@ -955,7 +877,7 @@ var no_context_provider_default = createRule({
955
877
  },
956
878
  schema: []
957
879
  },
958
- name: RULE_NAME21,
880
+ name: RULE_NAME19,
959
881
  create(context) {
960
882
  if (!context.sourceCode.text.includes(".Provider")) return {};
961
883
  const { version: version2 } = normalizeSettings(decodeSettings(context.settings));
@@ -983,8 +905,8 @@ var no_context_provider_default = createRule({
983
905
  },
984
906
  defaultOptions: []
985
907
  });
986
- var RULE_NAME22 = "no-create-ref";
987
- var RULE_FEATURES22 = [
908
+ var RULE_NAME20 = "no-create-ref";
909
+ var RULE_FEATURES20 = [
988
910
  "CHK"
989
911
  ];
990
912
  var no_create_ref_default = createRule({
@@ -992,14 +914,14 @@ var no_create_ref_default = createRule({
992
914
  type: "problem",
993
915
  docs: {
994
916
  description: "disallow using 'createRef' in function components",
995
- [Symbol.for("rule_features")]: RULE_FEATURES22
917
+ [Symbol.for("rule_features")]: RULE_FEATURES20
996
918
  },
997
919
  messages: {
998
920
  noCreateRef: "[Deprecated] Use 'useRef' instead."
999
921
  },
1000
922
  schema: []
1001
923
  },
1002
- name: RULE_NAME22,
924
+ name: RULE_NAME20,
1003
925
  create(context) {
1004
926
  return {
1005
927
  CallExpression(node) {
@@ -1011,8 +933,8 @@ var no_create_ref_default = createRule({
1011
933
  },
1012
934
  defaultOptions: []
1013
935
  });
1014
- var RULE_NAME23 = "no-default-props";
1015
- var RULE_FEATURES23 = [
936
+ var RULE_NAME21 = "no-default-props";
937
+ var RULE_FEATURES21 = [
1016
938
  "CHK"
1017
939
  ];
1018
940
  var no_default_props_default = createRule({
@@ -1020,14 +942,14 @@ var no_default_props_default = createRule({
1020
942
  type: "problem",
1021
943
  docs: {
1022
944
  description: "disallow using 'defaultProps' property in components",
1023
- [Symbol.for("rule_features")]: RULE_FEATURES23
945
+ [Symbol.for("rule_features")]: RULE_FEATURES21
1024
946
  },
1025
947
  messages: {
1026
948
  noDefaultProps: "[Deprecated] Use ES6 default parameters instead."
1027
949
  },
1028
950
  schema: []
1029
951
  },
1030
- name: RULE_NAME23,
952
+ name: RULE_NAME21,
1031
953
  create(context) {
1032
954
  if (!context.sourceCode.text.includes("defaultProps")) return {};
1033
955
  return {
@@ -1054,8 +976,8 @@ var no_default_props_default = createRule({
1054
976
  },
1055
977
  defaultOptions: []
1056
978
  });
1057
- var RULE_NAME24 = "no-direct-mutation-state";
1058
- var RULE_FEATURES24 = [
979
+ var RULE_NAME22 = "no-direct-mutation-state";
980
+ var RULE_FEATURES22 = [
1059
981
  "CHK"
1060
982
  ];
1061
983
  function getName2(node) {
@@ -1085,14 +1007,14 @@ var no_direct_mutation_state_default = createRule({
1085
1007
  type: "problem",
1086
1008
  docs: {
1087
1009
  description: "disallow direct mutation of state",
1088
- [Symbol.for("rule_features")]: RULE_FEATURES24
1010
+ [Symbol.for("rule_features")]: RULE_FEATURES22
1089
1011
  },
1090
1012
  messages: {
1091
1013
  noDirectMutationState: "Do not mutate state directly. Use 'setState()' instead."
1092
1014
  },
1093
1015
  schema: []
1094
1016
  },
1095
- name: RULE_NAME24,
1017
+ name: RULE_NAME22,
1096
1018
  create(context) {
1097
1019
  function getReportDescriptor(node) {
1098
1020
  if (!isAssignmentToThisState(node)) return O.none();
@@ -1116,8 +1038,47 @@ var no_direct_mutation_state_default = createRule({
1116
1038
  },
1117
1039
  defaultOptions: []
1118
1040
  });
1119
- var RULE_NAME25 = "no-duplicate-key";
1120
- var RULE_FEATURES25 = [
1041
+ var RULE_NAME23 = "no-duplicate-jsx-props";
1042
+ var RULE_FEATURES23 = [
1043
+ "CHK"
1044
+ ];
1045
+ var no_duplicate_jsx_props_default = createRule({
1046
+ meta: {
1047
+ type: "problem",
1048
+ docs: {
1049
+ description: "disallow duplicate props",
1050
+ [Symbol.for("rule_features")]: RULE_FEATURES23
1051
+ },
1052
+ messages: {
1053
+ noDuplicateJsxProps: "This JSX property is assigned multiple times."
1054
+ },
1055
+ schema: []
1056
+ },
1057
+ name: RULE_NAME23,
1058
+ create(context) {
1059
+ return {
1060
+ JSXOpeningElement(node) {
1061
+ const props = [];
1062
+ for (const attr of node.attributes) {
1063
+ if (attr.type === AST_NODE_TYPES.JSXSpreadAttribute) continue;
1064
+ const name2 = attr.name.name;
1065
+ if (!isString(name2)) continue;
1066
+ if (!props.includes(name2)) {
1067
+ props.push(name2);
1068
+ continue;
1069
+ }
1070
+ context.report({
1071
+ messageId: "noDuplicateJsxProps",
1072
+ node: attr
1073
+ });
1074
+ }
1075
+ }
1076
+ };
1077
+ },
1078
+ defaultOptions: []
1079
+ });
1080
+ var RULE_NAME24 = "no-duplicate-key";
1081
+ var RULE_FEATURES24 = [
1121
1082
  "CHK"
1122
1083
  ];
1123
1084
  var no_duplicate_key_default = createRule({
@@ -1125,14 +1086,14 @@ var no_duplicate_key_default = createRule({
1125
1086
  type: "problem",
1126
1087
  docs: {
1127
1088
  description: "disallow duplicate keys when rendering list",
1128
- [Symbol.for("rule_features")]: RULE_FEATURES25
1089
+ [Symbol.for("rule_features")]: RULE_FEATURES24
1129
1090
  },
1130
1091
  messages: {
1131
1092
  noDuplicateKey: "A key must be unique. '{{value}}' is duplicated."
1132
1093
  },
1133
1094
  schema: []
1134
1095
  },
1135
- name: RULE_NAME25,
1096
+ name: RULE_NAME24,
1136
1097
  create(context) {
1137
1098
  const isWithinChildrenToArrayRef = MutRef.make(false);
1138
1099
  function isKeyEqual(a, b) {
@@ -1249,8 +1210,8 @@ var no_duplicate_key_default = createRule({
1249
1210
  },
1250
1211
  defaultOptions: []
1251
1212
  });
1252
- var RULE_NAME26 = "no-forward-ref";
1253
- var RULE_FEATURES26 = [
1213
+ var RULE_NAME25 = "no-forward-ref";
1214
+ var RULE_FEATURES25 = [
1254
1215
  "CHK",
1255
1216
  "MOD"
1256
1217
  ];
@@ -1259,7 +1220,7 @@ var no_forward_ref_default = createRule({
1259
1220
  type: "problem",
1260
1221
  docs: {
1261
1222
  description: "disallow the use of 'forwardRef'",
1262
- [Symbol.for("rule_features")]: RULE_FEATURES26
1223
+ [Symbol.for("rule_features")]: RULE_FEATURES25
1263
1224
  },
1264
1225
  fixable: "code",
1265
1226
  messages: {
@@ -1267,7 +1228,7 @@ var no_forward_ref_default = createRule({
1267
1228
  },
1268
1229
  schema: []
1269
1230
  },
1270
- name: RULE_NAME26,
1231
+ name: RULE_NAME25,
1271
1232
  create(context) {
1272
1233
  if (!context.sourceCode.text.includes("forwardRef")) return {};
1273
1234
  const { version: version2 } = normalizeSettings(decodeSettings(context.settings));
@@ -1346,8 +1307,8 @@ function getComponentPropsFixes(node, typeArguments, fixer, context) {
1346
1307
  ...arg1 ? [fixer.remove(arg1), fixer.removeRange([arg0.range[1], arg1.range[0]])] : []
1347
1308
  ];
1348
1309
  }
1349
- var RULE_NAME27 = "no-implicit-key";
1350
- var RULE_FEATURES27 = [
1310
+ var RULE_NAME26 = "no-implicit-key";
1311
+ var RULE_FEATURES26 = [
1351
1312
  "CHK"
1352
1313
  ];
1353
1314
  var no_implicit_key_default = createRule({
@@ -1355,14 +1316,14 @@ var no_implicit_key_default = createRule({
1355
1316
  type: "problem",
1356
1317
  docs: {
1357
1318
  description: "disallow implicit 'key' props",
1358
- [Symbol.for("rule_features")]: RULE_FEATURES27
1319
+ [Symbol.for("rule_features")]: RULE_FEATURES26
1359
1320
  },
1360
1321
  messages: {
1361
1322
  noImplicitKey: "Do not use implicit 'key' props."
1362
1323
  },
1363
1324
  schema: []
1364
1325
  },
1365
- name: RULE_NAME27,
1326
+ name: RULE_NAME26,
1366
1327
  create(context) {
1367
1328
  function getReportDescriptor(node) {
1368
1329
  const initialScope = context.sourceCode.getScope(node);
@@ -1405,8 +1366,8 @@ function isTrueLiteralType(type) {
1405
1366
  function unionTypeParts(type) {
1406
1367
  return isUnionType(type) ? type.types : [type];
1407
1368
  }
1408
- var RULE_NAME28 = "no-leaked-conditional-rendering";
1409
- var RULE_FEATURES28 = [
1369
+ var RULE_NAME27 = "no-leaked-conditional-rendering";
1370
+ var RULE_FEATURES27 = [
1410
1371
  "CHK",
1411
1372
  "TSC"
1412
1373
  ];
@@ -1507,14 +1468,14 @@ var no_leaked_conditional_rendering_default = createRule({
1507
1468
  type: "problem",
1508
1469
  docs: {
1509
1470
  description: "disallow problematic leaked values from being rendered",
1510
- [Symbol.for("rule_features")]: RULE_FEATURES28
1471
+ [Symbol.for("rule_features")]: RULE_FEATURES27
1511
1472
  },
1512
1473
  messages: {
1513
1474
  noLeakedConditionalRendering: "Potential leaked value {{value}} that might cause unintentionally rendered values or rendering crashes."
1514
1475
  },
1515
1476
  schema: []
1516
1477
  },
1517
- name: RULE_NAME28,
1478
+ name: RULE_NAME27,
1518
1479
  create(context) {
1519
1480
  if (!context.sourceCode.text.includes("&&") && !context.sourceCode.text.includes("?")) return {};
1520
1481
  const { version: version2 } = normalizeSettings(decodeSettings(context.settings));
@@ -1571,8 +1532,8 @@ var no_leaked_conditional_rendering_default = createRule({
1571
1532
  },
1572
1533
  defaultOptions: []
1573
1534
  });
1574
- var RULE_NAME29 = "no-missing-component-display-name";
1575
- var RULE_FEATURES29 = [
1535
+ var RULE_NAME28 = "no-missing-component-display-name";
1536
+ var RULE_FEATURES28 = [
1576
1537
  "CHK"
1577
1538
  ];
1578
1539
  var no_missing_component_display_name_default = createRule({
@@ -1580,14 +1541,14 @@ var no_missing_component_display_name_default = createRule({
1580
1541
  type: "problem",
1581
1542
  docs: {
1582
1543
  description: "require 'displayName' for 'memo' and 'forwardRef' components",
1583
- [Symbol.for("rule_features")]: RULE_FEATURES29
1544
+ [Symbol.for("rule_features")]: RULE_FEATURES28
1584
1545
  },
1585
1546
  messages: {
1586
1547
  noMissingComponentDisplayName: "Add missing 'displayName' for component."
1587
1548
  },
1588
1549
  schema: []
1589
1550
  },
1590
- name: RULE_NAME29,
1551
+ name: RULE_NAME28,
1591
1552
  create(context) {
1592
1553
  if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
1593
1554
  const { ctx, listeners } = useComponentCollector(context);
@@ -1611,8 +1572,8 @@ var no_missing_component_display_name_default = createRule({
1611
1572
  },
1612
1573
  defaultOptions: []
1613
1574
  });
1614
- var RULE_NAME30 = "no-missing-key";
1615
- var RULE_FEATURES30 = [
1575
+ var RULE_NAME29 = "no-missing-key";
1576
+ var RULE_FEATURES29 = [
1616
1577
  "CHK"
1617
1578
  ];
1618
1579
  var no_missing_key_default = createRule({
@@ -1620,7 +1581,7 @@ var no_missing_key_default = createRule({
1620
1581
  type: "problem",
1621
1582
  docs: {
1622
1583
  description: "require 'key' when rendering list",
1623
- [Symbol.for("rule_features")]: RULE_FEATURES30
1584
+ [Symbol.for("rule_features")]: RULE_FEATURES29
1624
1585
  },
1625
1586
  messages: {
1626
1587
  noMissingKey: "Missing 'key' for element when rendering list.",
@@ -1628,7 +1589,7 @@ var no_missing_key_default = createRule({
1628
1589
  },
1629
1590
  schema: []
1630
1591
  },
1631
- name: RULE_NAME30,
1592
+ name: RULE_NAME29,
1632
1593
  create(context) {
1633
1594
  const isWithinChildrenToArrayRef = MutRef.make(false);
1634
1595
  function checkIteratorElement(node) {
@@ -1732,8 +1693,8 @@ var no_missing_key_default = createRule({
1732
1693
  },
1733
1694
  defaultOptions: []
1734
1695
  });
1735
- var RULE_NAME31 = "no-nested-components";
1736
- var RULE_FEATURES31 = [
1696
+ var RULE_NAME30 = "no-nested-components";
1697
+ var RULE_FEATURES30 = [
1737
1698
  "CHK"
1738
1699
  ];
1739
1700
  var no_nested_components_default = createRule({
@@ -1741,7 +1702,7 @@ var no_nested_components_default = createRule({
1741
1702
  type: "problem",
1742
1703
  docs: {
1743
1704
  description: "disallow using unstable nested components",
1744
- [Symbol.for("rule_features")]: RULE_FEATURES31
1705
+ [Symbol.for("rule_features")]: RULE_FEATURES30
1745
1706
  },
1746
1707
  messages: {
1747
1708
  nestedComponent: "Do not nest components inside other components. Move it to the top level.",
@@ -1749,7 +1710,7 @@ var no_nested_components_default = createRule({
1749
1710
  },
1750
1711
  schema: []
1751
1712
  },
1752
- name: RULE_NAME31,
1713
+ name: RULE_NAME30,
1753
1714
  create(context) {
1754
1715
  const hint = ERComponentHint.SkipMapCallback | ERComponentHint.SkipNullLiteral | ERComponentHint.SkipUndefinedLiteral | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipStringLiteral | ERComponentHint.SkipNumberLiteral | ERComponentHint.StrictLogical | ERComponentHint.StrictConditional;
1755
1716
  const collector = useComponentCollector(context, hint);
@@ -1833,8 +1794,8 @@ var no_nested_components_default = createRule({
1833
1794
  },
1834
1795
  defaultOptions: []
1835
1796
  });
1836
- var RULE_NAME32 = "no-prop-types";
1837
- var RULE_FEATURES32 = [
1797
+ var RULE_NAME31 = "no-prop-types";
1798
+ var RULE_FEATURES31 = [
1838
1799
  "CHK"
1839
1800
  ];
1840
1801
  var no_prop_types_default = createRule({
@@ -1842,14 +1803,14 @@ var no_prop_types_default = createRule({
1842
1803
  type: "problem",
1843
1804
  docs: {
1844
1805
  description: "disallow using 'propTypes' property in components",
1845
- [Symbol.for("rule_features")]: RULE_FEATURES32
1806
+ [Symbol.for("rule_features")]: RULE_FEATURES31
1846
1807
  },
1847
1808
  messages: {
1848
1809
  noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead."
1849
1810
  },
1850
1811
  schema: []
1851
1812
  },
1852
- name: RULE_NAME32,
1813
+ name: RULE_NAME31,
1853
1814
  create(context) {
1854
1815
  if (!context.sourceCode.text.includes("propTypes")) return {};
1855
1816
  return {
@@ -1876,8 +1837,8 @@ var no_prop_types_default = createRule({
1876
1837
  },
1877
1838
  defaultOptions: []
1878
1839
  });
1879
- var RULE_NAME33 = "no-redundant-should-component-update";
1880
- var RULE_FEATURES33 = [
1840
+ var RULE_NAME32 = "no-redundant-should-component-update";
1841
+ var RULE_FEATURES32 = [
1881
1842
  "CHK"
1882
1843
  ];
1883
1844
  function isShouldComponentUpdate(node) {
@@ -1888,14 +1849,14 @@ var no_redundant_should_component_update_default = createRule({
1888
1849
  type: "problem",
1889
1850
  docs: {
1890
1851
  description: "disallow using 'shouldComponentUpdate' in class component extends 'React.PureComponent'",
1891
- [Symbol.for("rule_features")]: RULE_FEATURES33
1852
+ [Symbol.for("rule_features")]: RULE_FEATURES32
1892
1853
  },
1893
1854
  messages: {
1894
1855
  noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'."
1895
1856
  },
1896
1857
  schema: []
1897
1858
  },
1898
- name: RULE_NAME33,
1859
+ name: RULE_NAME32,
1899
1860
  create(context) {
1900
1861
  if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
1901
1862
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -1923,8 +1884,8 @@ var no_redundant_should_component_update_default = createRule({
1923
1884
  },
1924
1885
  defaultOptions: []
1925
1886
  });
1926
- var RULE_NAME34 = "no-set-state-in-component-did-mount";
1927
- var RULE_FEATURES34 = [
1887
+ var RULE_NAME33 = "no-set-state-in-component-did-mount";
1888
+ var RULE_FEATURES33 = [
1928
1889
  "CHK"
1929
1890
  ];
1930
1891
  function isComponentDidMount(node) {
@@ -1935,14 +1896,14 @@ var no_set_state_in_component_did_mount_default = createRule({
1935
1896
  type: "problem",
1936
1897
  docs: {
1937
1898
  description: "disallow using 'setState' in 'componentDidMount'",
1938
- [Symbol.for("rule_features")]: RULE_FEATURES34
1899
+ [Symbol.for("rule_features")]: RULE_FEATURES33
1939
1900
  },
1940
1901
  messages: {
1941
1902
  noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions, such as callbacks."
1942
1903
  },
1943
1904
  schema: []
1944
1905
  },
1945
- name: RULE_NAME34,
1906
+ name: RULE_NAME33,
1946
1907
  create(context) {
1947
1908
  if (!context.sourceCode.text.includes("componentDidMount")) return {};
1948
1909
  function getReportDescriptor(node) {
@@ -1970,8 +1931,8 @@ var no_set_state_in_component_did_mount_default = createRule({
1970
1931
  },
1971
1932
  defaultOptions: []
1972
1933
  });
1973
- var RULE_NAME35 = "no-set-state-in-component-did-update";
1974
- var RULE_FEATURES35 = [
1934
+ var RULE_NAME34 = "no-set-state-in-component-did-update";
1935
+ var RULE_FEATURES34 = [
1975
1936
  "CHK"
1976
1937
  ];
1977
1938
  function isComponentDidUpdate(node) {
@@ -1982,14 +1943,14 @@ var no_set_state_in_component_did_update_default = createRule({
1982
1943
  type: "problem",
1983
1944
  docs: {
1984
1945
  description: "disallow using 'setState' in 'componentDidUpdate'",
1985
- [Symbol.for("rule_features")]: RULE_FEATURES35
1946
+ [Symbol.for("rule_features")]: RULE_FEATURES34
1986
1947
  },
1987
1948
  messages: {
1988
1949
  noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions, such as callbacks."
1989
1950
  },
1990
1951
  schema: []
1991
1952
  },
1992
- name: RULE_NAME35,
1953
+ name: RULE_NAME34,
1993
1954
  create(context) {
1994
1955
  if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
1995
1956
  function getReportDescriptor(node) {
@@ -2017,8 +1978,8 @@ var no_set_state_in_component_did_update_default = createRule({
2017
1978
  },
2018
1979
  defaultOptions: []
2019
1980
  });
2020
- var RULE_NAME36 = "no-set-state-in-component-will-update";
2021
- var RULE_FEATURES36 = [
1981
+ var RULE_NAME35 = "no-set-state-in-component-will-update";
1982
+ var RULE_FEATURES35 = [
2022
1983
  "CHK"
2023
1984
  ];
2024
1985
  function isComponentWillUpdate3(node) {
@@ -2029,14 +1990,14 @@ var no_set_state_in_component_will_update_default = createRule({
2029
1990
  type: "problem",
2030
1991
  docs: {
2031
1992
  description: "disallow using 'setState' in 'componentWillUpdate'",
2032
- [Symbol.for("rule_features")]: RULE_FEATURES36
1993
+ [Symbol.for("rule_features")]: RULE_FEATURES35
2033
1994
  },
2034
1995
  messages: {
2035
1996
  noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions, such as callbacks."
2036
1997
  },
2037
1998
  schema: []
2038
1999
  },
2039
- name: RULE_NAME36,
2000
+ name: RULE_NAME35,
2040
2001
  create(context) {
2041
2002
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
2042
2003
  function getReportDescriptor(node) {
@@ -2064,8 +2025,8 @@ var no_set_state_in_component_will_update_default = createRule({
2064
2025
  },
2065
2026
  defaultOptions: []
2066
2027
  });
2067
- var RULE_NAME37 = "no-string-refs";
2068
- var RULE_FEATURES37 = [
2028
+ var RULE_NAME36 = "no-string-refs";
2029
+ var RULE_FEATURES36 = [
2069
2030
  "CHK"
2070
2031
  ];
2071
2032
  function containsStringLiteral({ value }) {
@@ -2081,14 +2042,14 @@ var no_string_refs_default = createRule({
2081
2042
  type: "problem",
2082
2043
  docs: {
2083
2044
  description: "disallow using deprecated string refs",
2084
- [Symbol.for("rule_features")]: RULE_FEATURES37
2045
+ [Symbol.for("rule_features")]: RULE_FEATURES36
2085
2046
  },
2086
2047
  messages: {
2087
2048
  noStringRefs: "[Deprecated] Use callback refs instead."
2088
2049
  },
2089
2050
  schema: []
2090
2051
  },
2091
- name: RULE_NAME37,
2052
+ name: RULE_NAME36,
2092
2053
  create(context) {
2093
2054
  return {
2094
2055
  JSXAttribute(node) {
@@ -2104,8 +2065,8 @@ var no_string_refs_default = createRule({
2104
2065
  },
2105
2066
  defaultOptions: []
2106
2067
  });
2107
- var RULE_NAME38 = "no-unsafe-component-will-mount";
2108
- var RULE_FEATURES38 = [
2068
+ var RULE_NAME37 = "no-unsafe-component-will-mount";
2069
+ var RULE_FEATURES37 = [
2109
2070
  "CHK"
2110
2071
  ];
2111
2072
  function isUnsafeComponentWillMount(node) {
@@ -2116,14 +2077,14 @@ var no_unsafe_component_will_mount_default = createRule({
2116
2077
  type: "problem",
2117
2078
  docs: {
2118
2079
  description: "disallow using 'UNSAFE_componentWillMount'",
2119
- [Symbol.for("rule_features")]: RULE_FEATURES38
2080
+ [Symbol.for("rule_features")]: RULE_FEATURES37
2120
2081
  },
2121
2082
  messages: {
2122
2083
  noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'."
2123
2084
  },
2124
2085
  schema: []
2125
2086
  },
2126
- name: RULE_NAME38,
2087
+ name: RULE_NAME37,
2127
2088
  create(context) {
2128
2089
  if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
2129
2090
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -2147,8 +2108,8 @@ var no_unsafe_component_will_mount_default = createRule({
2147
2108
  },
2148
2109
  defaultOptions: []
2149
2110
  });
2150
- var RULE_NAME39 = "no-unsafe-component-will-receive-props";
2151
- var RULE_FEATURES39 = [
2111
+ var RULE_NAME38 = "no-unsafe-component-will-receive-props";
2112
+ var RULE_FEATURES38 = [
2152
2113
  "CHK"
2153
2114
  ];
2154
2115
  function isUnsafeComponentWillReceiveProps(node) {
@@ -2159,14 +2120,14 @@ var no_unsafe_component_will_receive_props_default = createRule({
2159
2120
  type: "problem",
2160
2121
  docs: {
2161
2122
  description: "disallow using 'UNSAFE_componentWillReceiveProps'",
2162
- [Symbol.for("rule_features")]: RULE_FEATURES39
2123
+ [Symbol.for("rule_features")]: RULE_FEATURES38
2163
2124
  },
2164
2125
  messages: {
2165
2126
  noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'."
2166
2127
  },
2167
2128
  schema: []
2168
2129
  },
2169
- name: RULE_NAME39,
2130
+ name: RULE_NAME38,
2170
2131
  create(context) {
2171
2132
  if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) return {};
2172
2133
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -2190,8 +2151,8 @@ var no_unsafe_component_will_receive_props_default = createRule({
2190
2151
  },
2191
2152
  defaultOptions: []
2192
2153
  });
2193
- var RULE_NAME40 = "no-unsafe-component-will-update";
2194
- var RULE_FEATURES40 = [
2154
+ var RULE_NAME39 = "no-unsafe-component-will-update";
2155
+ var RULE_FEATURES39 = [
2195
2156
  "CHK"
2196
2157
  ];
2197
2158
  function isUnsafeComponentWillUpdate(node) {
@@ -2202,14 +2163,14 @@ var no_unsafe_component_will_update_default = createRule({
2202
2163
  type: "problem",
2203
2164
  docs: {
2204
2165
  description: "disallow using 'UNSAFE_componentWillUpdate'",
2205
- [Symbol.for("rule_features")]: RULE_FEATURES40
2166
+ [Symbol.for("rule_features")]: RULE_FEATURES39
2206
2167
  },
2207
2168
  messages: {
2208
2169
  noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'."
2209
2170
  },
2210
2171
  schema: []
2211
2172
  },
2212
- name: RULE_NAME40,
2173
+ name: RULE_NAME39,
2213
2174
  create(context) {
2214
2175
  if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
2215
2176
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -2233,8 +2194,8 @@ var no_unsafe_component_will_update_default = createRule({
2233
2194
  },
2234
2195
  defaultOptions: []
2235
2196
  });
2236
- var RULE_NAME41 = "no-unstable-context-value";
2237
- var RULE_FEATURES41 = [
2197
+ var RULE_NAME40 = "no-unstable-context-value";
2198
+ var RULE_FEATURES40 = [
2238
2199
  "CHK"
2239
2200
  ];
2240
2201
  var no_unstable_context_value_default = createRule({
@@ -2242,7 +2203,7 @@ var no_unstable_context_value_default = createRule({
2242
2203
  type: "problem",
2243
2204
  docs: {
2244
2205
  description: "disallow passing constructed values to context providers",
2245
- [Symbol.for("rule_features")]: RULE_FEATURES41
2206
+ [Symbol.for("rule_features")]: RULE_FEATURES40
2246
2207
  },
2247
2208
  messages: {
2248
2209
  noUnstableContextValue: "A/an '{{type}}' passed as the value prop to the context provider should not be constructed. It will change on every render.",
@@ -2251,7 +2212,7 @@ var no_unstable_context_value_default = createRule({
2251
2212
  },
2252
2213
  schema: []
2253
2214
  },
2254
- name: RULE_NAME41,
2215
+ name: RULE_NAME40,
2255
2216
  create(context) {
2256
2217
  const { ctx, listeners } = useComponentCollector(context);
2257
2218
  const possibleValueConstructions = /* @__PURE__ */ new Map();
@@ -2304,8 +2265,8 @@ var no_unstable_context_value_default = createRule({
2304
2265
  },
2305
2266
  defaultOptions: []
2306
2267
  });
2307
- var RULE_NAME42 = "no-unstable-default-props";
2308
- var RULE_FEATURES42 = [
2268
+ var RULE_NAME41 = "no-unstable-default-props";
2269
+ var RULE_FEATURES41 = [
2309
2270
  "CHK"
2310
2271
  ];
2311
2272
  var no_unstable_default_props_default = createRule({
@@ -2313,14 +2274,14 @@ var no_unstable_default_props_default = createRule({
2313
2274
  type: "problem",
2314
2275
  docs: {
2315
2276
  description: "disallow using unstable value as default param in function component",
2316
- [Symbol.for("rule_features")]: RULE_FEATURES42
2277
+ [Symbol.for("rule_features")]: RULE_FEATURES41
2317
2278
  },
2318
2279
  messages: {
2319
2280
  noUnstableDefaultProps: "A/an '{{forbiddenType}}' as default prop. This could lead to potential infinite render loop in React. Use a variable instead of '{{forbiddenType}}'."
2320
2281
  },
2321
2282
  schema: []
2322
2283
  },
2323
- name: RULE_NAME42,
2284
+ name: RULE_NAME41,
2324
2285
  create(context) {
2325
2286
  const { ctx, listeners } = useComponentCollector(context);
2326
2287
  const possibleDestructuringDeclarators = /* @__PURE__ */ new WeakMap();
@@ -2373,8 +2334,8 @@ var no_unstable_default_props_default = createRule({
2373
2334
  },
2374
2335
  defaultOptions: []
2375
2336
  });
2376
- var RULE_NAME43 = "no-unused-class-component-members";
2377
- var RULE_FEATURES43 = [
2337
+ var RULE_NAME42 = "no-unused-class-component-members";
2338
+ var RULE_FEATURES42 = [
2378
2339
  "CHK"
2379
2340
  ];
2380
2341
  var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
@@ -2414,14 +2375,14 @@ var no_unused_class_component_members_default = createRule({
2414
2375
  type: "problem",
2415
2376
  docs: {
2416
2377
  description: "disallow unused class component members",
2417
- [Symbol.for("rule_features")]: RULE_FEATURES43
2378
+ [Symbol.for("rule_features")]: RULE_FEATURES42
2418
2379
  },
2419
2380
  messages: {
2420
2381
  noUnusedClassComponentMembers: "Unused method or property '{{methodName}}'' of class '{{className}}'."
2421
2382
  },
2422
2383
  schema: []
2423
2384
  },
2424
- name: RULE_NAME43,
2385
+ name: RULE_NAME42,
2425
2386
  create(context) {
2426
2387
  const classStack = [];
2427
2388
  const methodStack = [];
@@ -2504,8 +2465,8 @@ var no_unused_class_component_members_default = createRule({
2504
2465
  },
2505
2466
  defaultOptions: []
2506
2467
  });
2507
- var RULE_NAME44 = "no-unused-state";
2508
- var RULE_FEATURES44 = [
2468
+ var RULE_NAME43 = "no-unused-state";
2469
+ var RULE_FEATURES43 = [
2509
2470
  "CHK"
2510
2471
  ];
2511
2472
  function getName4(node) {
@@ -2541,14 +2502,14 @@ var no_unused_state_default = createRule({
2541
2502
  type: "problem",
2542
2503
  docs: {
2543
2504
  description: "disallow unused state of class component",
2544
- [Symbol.for("rule_features")]: RULE_FEATURES44
2505
+ [Symbol.for("rule_features")]: RULE_FEATURES43
2545
2506
  },
2546
2507
  messages: {
2547
2508
  noUnusedState: "Unused class component state in '{{className}}'"
2548
2509
  },
2549
2510
  schema: []
2550
2511
  },
2551
- name: RULE_NAME44,
2512
+ name: RULE_NAME43,
2552
2513
  create(context) {
2553
2514
  const classStack = [];
2554
2515
  const methodStack = [];
@@ -2649,7 +2610,7 @@ var no_unused_state_default = createRule({
2649
2610
  },
2650
2611
  defaultOptions: []
2651
2612
  });
2652
- var RULE_NAME45 = "no-useless-fragment";
2613
+ var RULE_NAME44 = "no-useless-fragment";
2653
2614
  function check(node, context, allowExpressions) {
2654
2615
  const initialScope = context.sourceCode.getScope(node);
2655
2616
  if (JSX8.isKeyedElement(node, initialScope)) return;
@@ -2695,7 +2656,7 @@ var no_useless_fragment_default = createRule({
2695
2656
  }
2696
2657
  }]
2697
2658
  },
2698
- name: RULE_NAME45,
2659
+ name: RULE_NAME44,
2699
2660
  create(context, [option]) {
2700
2661
  const { allowExpressions = true } = option;
2701
2662
  return {
@@ -2710,8 +2671,8 @@ var no_useless_fragment_default = createRule({
2710
2671
  },
2711
2672
  defaultOptions
2712
2673
  });
2713
- var RULE_NAME46 = "prefer-destructuring-assignment";
2714
- var RULE_FEATURES45 = [
2674
+ var RULE_NAME45 = "prefer-destructuring-assignment";
2675
+ var RULE_FEATURES44 = [
2715
2676
  "CHK"
2716
2677
  ];
2717
2678
  function isMemberExpressionWithObjectName(node) {
@@ -2722,14 +2683,14 @@ var prefer_destructuring_assignment_default = createRule({
2722
2683
  type: "problem",
2723
2684
  docs: {
2724
2685
  description: "enforce using destructuring assignment in component props and context",
2725
- [Symbol.for("rule_features")]: RULE_FEATURES45
2686
+ [Symbol.for("rule_features")]: RULE_FEATURES44
2726
2687
  },
2727
2688
  messages: {
2728
2689
  preferDestructuringAssignment: "Use destructuring assignment for {{name}}."
2729
2690
  },
2730
2691
  schema: []
2731
2692
  },
2732
- name: RULE_NAME46,
2693
+ name: RULE_NAME45,
2733
2694
  create(context) {
2734
2695
  const { ctx, listeners } = useComponentCollector(context);
2735
2696
  const memberExpressionWithNames = [];
@@ -2784,8 +2745,8 @@ var prefer_destructuring_assignment_default = createRule({
2784
2745
  },
2785
2746
  defaultOptions: []
2786
2747
  });
2787
- var RULE_NAME47 = "prefer-react-namespace-import";
2788
- var RULE_FEATURES46 = [
2748
+ var RULE_NAME46 = "prefer-react-namespace-import";
2749
+ var RULE_FEATURES45 = [
2789
2750
  "CHK",
2790
2751
  "FIX"
2791
2752
  ];
@@ -2794,7 +2755,7 @@ var prefer_react_namespace_import_default = createRule({
2794
2755
  type: "problem",
2795
2756
  docs: {
2796
2757
  description: "enforce React is imported via a namespace import",
2797
- [Symbol.for("rule_features")]: RULE_FEATURES46
2758
+ [Symbol.for("rule_features")]: RULE_FEATURES45
2798
2759
  },
2799
2760
  fixable: "code",
2800
2761
  messages: {
@@ -2802,7 +2763,7 @@ var prefer_react_namespace_import_default = createRule({
2802
2763
  },
2803
2764
  schema: []
2804
2765
  },
2805
- name: RULE_NAME47,
2766
+ name: RULE_NAME46,
2806
2767
  create(context) {
2807
2768
  const importSource = decodeSettings(context.settings).importSource ?? "react";
2808
2769
  return {
@@ -2838,8 +2799,8 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
2838
2799
  },
2839
2800
  defaultOptions: []
2840
2801
  });
2841
- var RULE_NAME48 = "prefer-read-only-props";
2842
- var RULE_FEATURES47 = [
2802
+ var RULE_NAME47 = "prefer-read-only-props";
2803
+ var RULE_FEATURES46 = [
2843
2804
  "CHK",
2844
2805
  "TSC"
2845
2806
  ];
@@ -2856,14 +2817,14 @@ var prefer_read_only_props_default = createRule({
2856
2817
  type: "problem",
2857
2818
  docs: {
2858
2819
  description: "enforce read-only props in components",
2859
- [Symbol.for("rule_features")]: RULE_FEATURES47
2820
+ [Symbol.for("rule_features")]: RULE_FEATURES46
2860
2821
  },
2861
2822
  messages: {
2862
2823
  preferReadOnlyProps: "A function component's props should be read-only."
2863
2824
  },
2864
2825
  schema: []
2865
2826
  },
2866
- name: RULE_NAME48,
2827
+ name: RULE_NAME47,
2867
2828
  create(context) {
2868
2829
  const services = ESLintUtils.getParserServices(context, false);
2869
2830
  const { ctx, listeners } = useComponentCollector(context);
@@ -2883,8 +2844,8 @@ var prefer_read_only_props_default = createRule({
2883
2844
  },
2884
2845
  defaultOptions: []
2885
2846
  });
2886
- var RULE_NAME49 = "prefer-shorthand-boolean";
2887
- var RULE_FEATURES48 = [
2847
+ var RULE_NAME48 = "prefer-shorthand-boolean";
2848
+ var RULE_FEATURES47 = [
2888
2849
  "CHK",
2889
2850
  "FIX"
2890
2851
  ];
@@ -2893,7 +2854,7 @@ var prefer_shorthand_boolean_default = createRule({
2893
2854
  type: "problem",
2894
2855
  docs: {
2895
2856
  description: "enforce using shorthand boolean attributes",
2896
- [Symbol.for("rule_features")]: RULE_FEATURES48
2857
+ [Symbol.for("rule_features")]: RULE_FEATURES47
2897
2858
  },
2898
2859
  fixable: "code",
2899
2860
  messages: {
@@ -2901,7 +2862,7 @@ var prefer_shorthand_boolean_default = createRule({
2901
2862
  },
2902
2863
  schema: []
2903
2864
  },
2904
- name: RULE_NAME49,
2865
+ name: RULE_NAME48,
2905
2866
  create(context) {
2906
2867
  function getReportDescriptor(node) {
2907
2868
  const { value } = node;
@@ -2923,8 +2884,8 @@ var prefer_shorthand_boolean_default = createRule({
2923
2884
  },
2924
2885
  defaultOptions: []
2925
2886
  });
2926
- var RULE_NAME50 = "prefer-shorthand-fragment";
2927
- var RULE_FEATURES49 = [
2887
+ var RULE_NAME49 = "prefer-shorthand-fragment";
2888
+ var RULE_FEATURES48 = [
2928
2889
  "CHK"
2929
2890
  ];
2930
2891
  var prefer_shorthand_fragment_default = createRule({
@@ -2932,14 +2893,14 @@ var prefer_shorthand_fragment_default = createRule({
2932
2893
  type: "problem",
2933
2894
  docs: {
2934
2895
  description: "enforce using fragment syntax instead of 'Fragment' component",
2935
- [Symbol.for("rule_features")]: RULE_FEATURES49
2896
+ [Symbol.for("rule_features")]: RULE_FEATURES48
2936
2897
  },
2937
2898
  messages: {
2938
2899
  preferShorthandFragment: "Use fragment shorthand syntax instead of 'Fragment' component."
2939
2900
  },
2940
2901
  schema: []
2941
2902
  },
2942
- name: RULE_NAME50,
2903
+ name: RULE_NAME49,
2943
2904
  create(context) {
2944
2905
  function getReportDescriptor(node) {
2945
2906
  if (!isFragmentElement(node, context)) return O.none();
@@ -2956,9 +2917,47 @@ var prefer_shorthand_fragment_default = createRule({
2956
2917
  },
2957
2918
  defaultOptions: []
2958
2919
  });
2920
+ var RULE_NAME50 = "use-jsx-vars";
2921
+ var RULE_FEATURES49 = [];
2922
+ var use_jsx_vars_default = createRule({
2923
+ meta: {
2924
+ type: "problem",
2925
+ docs: {
2926
+ // eslint-disable-next-line eslint-plugin/require-meta-docs-description
2927
+ description: "a helper rule to mark variables as used",
2928
+ [Symbol.for("rule_features")]: RULE_FEATURES49
2929
+ },
2930
+ messages: {
2931
+ useJsxVars: ""
2932
+ },
2933
+ schema: []
2934
+ },
2935
+ name: RULE_NAME50,
2936
+ create(context) {
2937
+ function getName5(node) {
2938
+ switch (node.type) {
2939
+ case AST_NODE_TYPES.JSXIdentifier:
2940
+ return O.some(node.name);
2941
+ case AST_NODE_TYPES.JSXMemberExpression:
2942
+ return getName5(node.object);
2943
+ default:
2944
+ return O.none();
2945
+ }
2946
+ }
2947
+ return {
2948
+ JSXOpeningElement(node) {
2949
+ if (node.name.type === AST_NODE_TYPES.JSXIdentifier && /^[a-z]/u.test(node.name.name)) return;
2950
+ O.map(getName5(node.name), (name2) => {
2951
+ context.sourceCode.markVariableAsUsed(name2, node);
2952
+ });
2953
+ }
2954
+ };
2955
+ },
2956
+ defaultOptions: []
2957
+ });
2959
2958
 
2960
2959
  // src/index.ts
2961
- var src_default = {
2960
+ var index_default = {
2962
2961
  meta: {
2963
2962
  name,
2964
2963
  version
@@ -2967,8 +2966,6 @@ var src_default = {
2967
2966
  "avoid-shorthand-boolean": avoid_shorthand_boolean_default,
2968
2967
  "avoid-shorthand-fragment": avoid_shorthand_fragment_default,
2969
2968
  "ensure-forward-ref-using-ref": ensure_forward_ref_using_ref_default,
2970
- "jsx-no-duplicate-props": jsx_no_duplicate_props_default,
2971
- "jsx-uses-vars": jsx_uses_vars_default,
2972
2969
  "no-access-state-in-setstate": no_access_state_in_setstate_default,
2973
2970
  "no-array-index-key": no_array_index_key_default,
2974
2971
  "no-children-count": no_children_count_default,
@@ -2988,6 +2985,7 @@ var src_default = {
2988
2985
  "no-create-ref": no_create_ref_default,
2989
2986
  "no-default-props": no_default_props_default,
2990
2987
  "no-direct-mutation-state": no_direct_mutation_state_default,
2988
+ "no-duplicate-jsx-props": no_duplicate_jsx_props_default,
2991
2989
  "no-duplicate-key": no_duplicate_key_default,
2992
2990
  "no-forward-ref": no_forward_ref_default,
2993
2991
  "no-implicit-key": no_implicit_key_default,
@@ -3014,10 +3012,15 @@ var src_default = {
3014
3012
  "prefer-read-only-props": prefer_read_only_props_default,
3015
3013
  "prefer-shorthand-boolean": prefer_shorthand_boolean_default,
3016
3014
  "prefer-shorthand-fragment": prefer_shorthand_fragment_default,
3017
- // Deprecated rules
3015
+ "use-jsx-vars": use_jsx_vars_default,
3016
+ // Part: deprecated rules
3017
+ /** @deprecated Use `no-duplicate-jsx-props` instead. */
3018
+ "jsx-no-duplicate-props": no_duplicate_jsx_props_default,
3019
+ /** @deprecated Use `use-jsx-vars` instead. */
3020
+ "jsx-uses-vars": use_jsx_vars_default,
3018
3021
  /** @deprecated Use `no-complex-conditional-rendering` instead. */
3019
3022
  "no-complicated-conditional-rendering": no_complex_conditional_rendering_default
3020
3023
  }
3021
3024
  };
3022
3025
 
3023
- export { src_default as default };
3026
+ export { index_default as default };