eslint-plugin-react-x 1.20.0-next.6 → 1.20.0-next.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.js +253 -50
- package/dist/index.mjs +253 -50
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -41,16 +41,20 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
43
|
var name = "eslint-plugin-react-x";
|
|
44
|
-
var version = "1.20.0-next.
|
|
44
|
+
var version = "1.20.0-next.7";
|
|
45
45
|
var createRule = shared.createRuleForPlugin("x");
|
|
46
46
|
|
|
47
47
|
// src/rules/avoid-shorthand-boolean.ts
|
|
48
48
|
var RULE_NAME = "avoid-shorthand-boolean";
|
|
49
|
+
var RULE_FEATURES = [
|
|
50
|
+
"LNT"
|
|
51
|
+
];
|
|
49
52
|
var avoid_shorthand_boolean_default = createRule({
|
|
50
53
|
meta: {
|
|
51
54
|
type: "problem",
|
|
52
55
|
docs: {
|
|
53
|
-
description: "disallow using shorthand boolean attributes"
|
|
56
|
+
description: "disallow using shorthand boolean attributes",
|
|
57
|
+
[Symbol.for("rule_features")]: RULE_FEATURES
|
|
54
58
|
},
|
|
55
59
|
fixable: "code",
|
|
56
60
|
messages: {
|
|
@@ -79,11 +83,15 @@ var avoid_shorthand_boolean_default = createRule({
|
|
|
79
83
|
|
|
80
84
|
// src/rules/avoid-shorthand-fragment.ts
|
|
81
85
|
var RULE_NAME2 = "avoid-shorthand-fragment";
|
|
86
|
+
var RULE_FEATURES2 = [
|
|
87
|
+
"LNT"
|
|
88
|
+
];
|
|
82
89
|
var avoid_shorthand_fragment_default = createRule({
|
|
83
90
|
meta: {
|
|
84
91
|
type: "problem",
|
|
85
92
|
docs: {
|
|
86
|
-
description: "disallow using shorthand fragment syntax"
|
|
93
|
+
description: "disallow using shorthand fragment syntax",
|
|
94
|
+
[Symbol.for("rule_features")]: RULE_FEATURES2
|
|
87
95
|
},
|
|
88
96
|
messages: {
|
|
89
97
|
avoidShorthandFragment: "Avoid using shorthand fragment syntax. Use 'Fragment' component instead."
|
|
@@ -104,11 +112,15 @@ var avoid_shorthand_fragment_default = createRule({
|
|
|
104
112
|
defaultOptions: []
|
|
105
113
|
});
|
|
106
114
|
var RULE_NAME3 = "ensure-forward-ref-using-ref";
|
|
115
|
+
var RULE_FEATURES3 = [
|
|
116
|
+
"LNT"
|
|
117
|
+
];
|
|
107
118
|
var ensure_forward_ref_using_ref_default = createRule({
|
|
108
119
|
meta: {
|
|
109
120
|
type: "problem",
|
|
110
121
|
docs: {
|
|
111
|
-
description: "require a 'ref' parameter to be set when using 'forwardRef'"
|
|
122
|
+
description: "require a 'ref' parameter to be set when using 'forwardRef'",
|
|
123
|
+
[Symbol.for("rule_features")]: RULE_FEATURES3
|
|
112
124
|
},
|
|
113
125
|
messages: {
|
|
114
126
|
ensureForwardRefUsingRef: "A 'forwardRef' is used with this component but no 'ref' parameter is set."
|
|
@@ -134,11 +146,15 @@ var ensure_forward_ref_using_ref_default = createRule({
|
|
|
134
146
|
defaultOptions: []
|
|
135
147
|
});
|
|
136
148
|
var RULE_NAME4 = "jsx-no-duplicate-props";
|
|
149
|
+
var RULE_FEATURES4 = [
|
|
150
|
+
"LNT"
|
|
151
|
+
];
|
|
137
152
|
var jsx_no_duplicate_props_default = createRule({
|
|
138
153
|
meta: {
|
|
139
154
|
type: "problem",
|
|
140
155
|
docs: {
|
|
141
|
-
description: "disallow duplicate props"
|
|
156
|
+
description: "disallow duplicate props",
|
|
157
|
+
[Symbol.for("rule_features")]: RULE_FEATURES4
|
|
142
158
|
},
|
|
143
159
|
messages: {
|
|
144
160
|
jsxNoDuplicateProps: "Duplicate prop '{{name}}'"
|
|
@@ -170,12 +186,16 @@ var jsx_no_duplicate_props_default = createRule({
|
|
|
170
186
|
defaultOptions: []
|
|
171
187
|
});
|
|
172
188
|
var RULE_NAME5 = "jsx-uses-vars";
|
|
189
|
+
var RULE_FEATURES5 = [
|
|
190
|
+
"LNT"
|
|
191
|
+
];
|
|
173
192
|
var jsx_uses_vars_default = createRule({
|
|
174
193
|
meta: {
|
|
175
194
|
type: "problem",
|
|
176
195
|
docs: {
|
|
177
196
|
// eslint-disable-next-line eslint-plugin/require-meta-docs-description
|
|
178
|
-
description: "a helper rule to mark variables as used"
|
|
197
|
+
description: "a helper rule to mark variables as used",
|
|
198
|
+
[Symbol.for("rule_features")]: RULE_FEATURES5
|
|
179
199
|
},
|
|
180
200
|
messages: {
|
|
181
201
|
jsxUsesVars: ""
|
|
@@ -206,6 +226,9 @@ var jsx_uses_vars_default = createRule({
|
|
|
206
226
|
defaultOptions: []
|
|
207
227
|
});
|
|
208
228
|
var RULE_NAME6 = "no-access-state-in-setstate";
|
|
229
|
+
var RULE_FEATURES6 = [
|
|
230
|
+
"LNT"
|
|
231
|
+
];
|
|
209
232
|
function getName(node) {
|
|
210
233
|
if (node.type === types.AST_NODE_TYPES.TSAsExpression) {
|
|
211
234
|
return getName(node.expression);
|
|
@@ -225,7 +248,8 @@ var no_access_state_in_setstate_default = createRule({
|
|
|
225
248
|
meta: {
|
|
226
249
|
type: "problem",
|
|
227
250
|
docs: {
|
|
228
|
-
description: "disallow accessing 'this.state' within 'setState'"
|
|
251
|
+
description: "disallow accessing 'this.state' within 'setState'",
|
|
252
|
+
[Symbol.for("rule_features")]: RULE_FEATURES6
|
|
229
253
|
},
|
|
230
254
|
messages: {
|
|
231
255
|
noAccessStateInSetstate: "Do not access 'this.state' within 'setState'. Use the update function instead."
|
|
@@ -304,6 +328,9 @@ var no_access_state_in_setstate_default = createRule({
|
|
|
304
328
|
defaultOptions: []
|
|
305
329
|
});
|
|
306
330
|
var RULE_NAME7 = "no-array-index-key";
|
|
331
|
+
var RULE_FEATURES7 = [
|
|
332
|
+
"LNT"
|
|
333
|
+
];
|
|
307
334
|
var reactChildrenMethod = ["forEach", "map"];
|
|
308
335
|
var iteratorFunctionIndexParamPosition = /* @__PURE__ */ new Map([
|
|
309
336
|
["every", 1],
|
|
@@ -368,7 +395,8 @@ var no_array_index_key_default = createRule({
|
|
|
368
395
|
meta: {
|
|
369
396
|
type: "problem",
|
|
370
397
|
docs: {
|
|
371
|
-
description: "disallow using Array index as 'key'"
|
|
398
|
+
description: "disallow using Array index as 'key'",
|
|
399
|
+
[Symbol.for("rule_features")]: RULE_FEATURES7
|
|
372
400
|
},
|
|
373
401
|
messages: {
|
|
374
402
|
noArrayIndexKey: "Do not use Array index as 'key'."
|
|
@@ -444,11 +472,15 @@ var no_array_index_key_default = createRule({
|
|
|
444
472
|
defaultOptions: []
|
|
445
473
|
});
|
|
446
474
|
var RULE_NAME8 = "no-children-count";
|
|
475
|
+
var RULE_FEATURES8 = [
|
|
476
|
+
"LNT"
|
|
477
|
+
];
|
|
447
478
|
var no_children_count_default = createRule({
|
|
448
479
|
meta: {
|
|
449
480
|
type: "problem",
|
|
450
481
|
docs: {
|
|
451
|
-
description: "disallow using 'Children.count'"
|
|
482
|
+
description: "disallow using 'Children.count'",
|
|
483
|
+
[Symbol.for("rule_features")]: RULE_FEATURES8
|
|
452
484
|
},
|
|
453
485
|
messages: {
|
|
454
486
|
noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
@@ -471,11 +503,15 @@ var no_children_count_default = createRule({
|
|
|
471
503
|
defaultOptions: []
|
|
472
504
|
});
|
|
473
505
|
var RULE_NAME9 = "no-children-for-each";
|
|
506
|
+
var RULE_FEATURES9 = [
|
|
507
|
+
"LNT"
|
|
508
|
+
];
|
|
474
509
|
var no_children_for_each_default = createRule({
|
|
475
510
|
meta: {
|
|
476
511
|
type: "problem",
|
|
477
512
|
docs: {
|
|
478
|
-
description: "disallow using 'Children.forEach'"
|
|
513
|
+
description: "disallow using 'Children.forEach'",
|
|
514
|
+
[Symbol.for("rule_features")]: RULE_FEATURES9
|
|
479
515
|
},
|
|
480
516
|
messages: {
|
|
481
517
|
noChildrenForEach: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
@@ -498,11 +534,15 @@ var no_children_for_each_default = createRule({
|
|
|
498
534
|
defaultOptions: []
|
|
499
535
|
});
|
|
500
536
|
var RULE_NAME10 = "no-children-map";
|
|
537
|
+
var RULE_FEATURES10 = [
|
|
538
|
+
"LNT"
|
|
539
|
+
];
|
|
501
540
|
var no_children_map_default = createRule({
|
|
502
541
|
meta: {
|
|
503
542
|
type: "problem",
|
|
504
543
|
docs: {
|
|
505
|
-
description: "disallow using 'Children.map'"
|
|
544
|
+
description: "disallow using 'Children.map'",
|
|
545
|
+
[Symbol.for("rule_features")]: RULE_FEATURES10
|
|
506
546
|
},
|
|
507
547
|
messages: {
|
|
508
548
|
noChildrenMap: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
@@ -525,11 +565,15 @@ var no_children_map_default = createRule({
|
|
|
525
565
|
defaultOptions: []
|
|
526
566
|
});
|
|
527
567
|
var RULE_NAME11 = "no-children-only";
|
|
568
|
+
var RULE_FEATURES11 = [
|
|
569
|
+
"LNT"
|
|
570
|
+
];
|
|
528
571
|
var no_children_only_default = createRule({
|
|
529
572
|
meta: {
|
|
530
573
|
type: "problem",
|
|
531
574
|
docs: {
|
|
532
|
-
description: "disallow using 'Children.only'"
|
|
575
|
+
description: "disallow using 'Children.only'",
|
|
576
|
+
[Symbol.for("rule_features")]: RULE_FEATURES11
|
|
533
577
|
},
|
|
534
578
|
messages: {
|
|
535
579
|
noChildrenOnly: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
@@ -552,11 +596,15 @@ var no_children_only_default = createRule({
|
|
|
552
596
|
defaultOptions: []
|
|
553
597
|
});
|
|
554
598
|
var RULE_NAME12 = "no-children-prop";
|
|
599
|
+
var RULE_FEATURES12 = [
|
|
600
|
+
"LNT"
|
|
601
|
+
];
|
|
555
602
|
var no_children_prop_default = createRule({
|
|
556
603
|
meta: {
|
|
557
604
|
type: "problem",
|
|
558
605
|
docs: {
|
|
559
|
-
description: "disallow passing 'children' as props"
|
|
606
|
+
description: "disallow passing 'children' as props",
|
|
607
|
+
[Symbol.for("rule_features")]: RULE_FEATURES12
|
|
560
608
|
},
|
|
561
609
|
messages: {
|
|
562
610
|
noChildrenProp: "Do not pass 'children' as props."
|
|
@@ -577,11 +625,15 @@ var no_children_prop_default = createRule({
|
|
|
577
625
|
defaultOptions: []
|
|
578
626
|
});
|
|
579
627
|
var RULE_NAME13 = "no-children-to-array";
|
|
628
|
+
var RULE_FEATURES13 = [
|
|
629
|
+
"LNT"
|
|
630
|
+
];
|
|
580
631
|
var no_children_to_array_default = createRule({
|
|
581
632
|
meta: {
|
|
582
633
|
type: "problem",
|
|
583
634
|
docs: {
|
|
584
|
-
description: "disallow using 'Children.toArray'"
|
|
635
|
+
description: "disallow using 'Children.toArray'",
|
|
636
|
+
[Symbol.for("rule_features")]: RULE_FEATURES13
|
|
585
637
|
},
|
|
586
638
|
messages: {
|
|
587
639
|
noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
@@ -604,6 +656,9 @@ var no_children_to_array_default = createRule({
|
|
|
604
656
|
defaultOptions: []
|
|
605
657
|
});
|
|
606
658
|
var RULE_NAME14 = "no-class-component";
|
|
659
|
+
var RULE_FEATURES14 = [
|
|
660
|
+
"LNT"
|
|
661
|
+
];
|
|
607
662
|
var isComponentDidCatch = tsPattern.isMatching({
|
|
608
663
|
key: {
|
|
609
664
|
type: types.AST_NODE_TYPES.Identifier,
|
|
@@ -624,7 +679,8 @@ var no_class_component_default = createRule({
|
|
|
624
679
|
meta: {
|
|
625
680
|
type: "problem",
|
|
626
681
|
docs: {
|
|
627
|
-
description: "disallow using class components"
|
|
682
|
+
description: "disallow using class components",
|
|
683
|
+
[Symbol.for("rule_features")]: RULE_FEATURES14
|
|
628
684
|
},
|
|
629
685
|
messages: {
|
|
630
686
|
noClassComponent: "Do not use class components. Use function components instead."
|
|
@@ -656,11 +712,15 @@ var no_class_component_default = createRule({
|
|
|
656
712
|
defaultOptions: []
|
|
657
713
|
});
|
|
658
714
|
var RULE_NAME15 = "no-clone-element";
|
|
715
|
+
var RULE_FEATURES15 = [
|
|
716
|
+
"LNT"
|
|
717
|
+
];
|
|
659
718
|
var no_clone_element_default = createRule({
|
|
660
719
|
meta: {
|
|
661
720
|
type: "problem",
|
|
662
721
|
docs: {
|
|
663
|
-
description: "disallow using 'cloneElement'"
|
|
722
|
+
description: "disallow using 'cloneElement'",
|
|
723
|
+
[Symbol.for("rule_features")]: RULE_FEATURES15
|
|
664
724
|
},
|
|
665
725
|
messages: {
|
|
666
726
|
noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
@@ -682,11 +742,15 @@ var no_clone_element_default = createRule({
|
|
|
682
742
|
defaultOptions: []
|
|
683
743
|
});
|
|
684
744
|
var RULE_NAME16 = "no-comment-textnodes";
|
|
745
|
+
var RULE_FEATURES16 = [
|
|
746
|
+
"LNT"
|
|
747
|
+
];
|
|
685
748
|
var no_comment_textnodes_default = createRule({
|
|
686
749
|
meta: {
|
|
687
750
|
type: "problem",
|
|
688
751
|
docs: {
|
|
689
|
-
description: "disallow comments from being inserted as text nodes"
|
|
752
|
+
description: "disallow comments from being inserted as text nodes",
|
|
753
|
+
[Symbol.for("rule_features")]: RULE_FEATURES16
|
|
690
754
|
},
|
|
691
755
|
messages: {
|
|
692
756
|
noCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces."
|
|
@@ -718,11 +782,15 @@ var no_comment_textnodes_default = createRule({
|
|
|
718
782
|
defaultOptions: []
|
|
719
783
|
});
|
|
720
784
|
var RULE_NAME17 = "no-complex-conditional-rendering";
|
|
785
|
+
var RULE_FEATURES17 = [
|
|
786
|
+
"LNT"
|
|
787
|
+
];
|
|
721
788
|
var no_complex_conditional_rendering_default = createRule({
|
|
722
789
|
meta: {
|
|
723
790
|
type: "problem",
|
|
724
791
|
docs: {
|
|
725
|
-
description: "disallow complex conditional rendering"
|
|
792
|
+
description: "disallow complex conditional rendering",
|
|
793
|
+
[Symbol.for("rule_features")]: RULE_FEATURES17
|
|
726
794
|
},
|
|
727
795
|
messages: {
|
|
728
796
|
noComplexConditionalRendering: "Avoid complex conditional rendering. Extract the logic into separate elements or components."
|
|
@@ -752,6 +820,9 @@ var no_complex_conditional_rendering_default = createRule({
|
|
|
752
820
|
defaultOptions: []
|
|
753
821
|
});
|
|
754
822
|
var RULE_NAME18 = "no-component-will-mount";
|
|
823
|
+
var RULE_FEATURES18 = [
|
|
824
|
+
"LNT"
|
|
825
|
+
];
|
|
755
826
|
function isComponentWillMount(node) {
|
|
756
827
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillMount";
|
|
757
828
|
}
|
|
@@ -759,7 +830,8 @@ var no_component_will_mount_default = createRule({
|
|
|
759
830
|
meta: {
|
|
760
831
|
type: "problem",
|
|
761
832
|
docs: {
|
|
762
|
-
description: "disallow using 'componentWillMount'"
|
|
833
|
+
description: "disallow using 'componentWillMount'",
|
|
834
|
+
[Symbol.for("rule_features")]: RULE_FEATURES18
|
|
763
835
|
},
|
|
764
836
|
messages: {
|
|
765
837
|
noComponentWillMount: "[Deprecated] Use 'UNSAFE_componentWillMount' instead."
|
|
@@ -791,6 +863,9 @@ var no_component_will_mount_default = createRule({
|
|
|
791
863
|
defaultOptions: []
|
|
792
864
|
});
|
|
793
865
|
var RULE_NAME19 = "no-component-will-receive-props";
|
|
866
|
+
var RULE_FEATURES19 = [
|
|
867
|
+
"LNT"
|
|
868
|
+
];
|
|
794
869
|
function isComponentWillUpdate(node) {
|
|
795
870
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillReceiveProps";
|
|
796
871
|
}
|
|
@@ -798,7 +873,8 @@ var no_component_will_receive_props_default = createRule({
|
|
|
798
873
|
meta: {
|
|
799
874
|
type: "problem",
|
|
800
875
|
docs: {
|
|
801
|
-
description: "disallow using 'componentWillReceiveProps'"
|
|
876
|
+
description: "disallow using 'componentWillReceiveProps'",
|
|
877
|
+
[Symbol.for("rule_features")]: RULE_FEATURES19
|
|
802
878
|
},
|
|
803
879
|
messages: {
|
|
804
880
|
noComponentWillReceiveProps: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead."
|
|
@@ -830,6 +906,9 @@ var no_component_will_receive_props_default = createRule({
|
|
|
830
906
|
defaultOptions: []
|
|
831
907
|
});
|
|
832
908
|
var RULE_NAME20 = "no-component-will-update";
|
|
909
|
+
var RULE_FEATURES20 = [
|
|
910
|
+
"LNT"
|
|
911
|
+
];
|
|
833
912
|
function isComponentWillUpdate2(node) {
|
|
834
913
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
835
914
|
}
|
|
@@ -837,7 +916,8 @@ var no_component_will_update_default = createRule({
|
|
|
837
916
|
meta: {
|
|
838
917
|
type: "problem",
|
|
839
918
|
docs: {
|
|
840
|
-
description: "disallow using 'componentWillReceiveProps'"
|
|
919
|
+
description: "disallow using 'componentWillReceiveProps'",
|
|
920
|
+
[Symbol.for("rule_features")]: RULE_FEATURES20
|
|
841
921
|
},
|
|
842
922
|
messages: {
|
|
843
923
|
noComponentWillUpdate: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead."
|
|
@@ -869,11 +949,16 @@ var no_component_will_update_default = createRule({
|
|
|
869
949
|
defaultOptions: []
|
|
870
950
|
});
|
|
871
951
|
var RULE_NAME21 = "no-context-provider";
|
|
952
|
+
var RULE_FEATURES21 = [
|
|
953
|
+
"LNT",
|
|
954
|
+
"FIX"
|
|
955
|
+
];
|
|
872
956
|
var no_context_provider_default = createRule({
|
|
873
957
|
meta: {
|
|
874
958
|
type: "problem",
|
|
875
959
|
docs: {
|
|
876
|
-
description: "disallow the use of '<Context.Provider>'"
|
|
960
|
+
description: "disallow the use of '<Context.Provider>'",
|
|
961
|
+
[Symbol.for("rule_features")]: RULE_FEATURES21
|
|
877
962
|
},
|
|
878
963
|
fixable: "code",
|
|
879
964
|
messages: {
|
|
@@ -910,11 +995,15 @@ var no_context_provider_default = createRule({
|
|
|
910
995
|
defaultOptions: []
|
|
911
996
|
});
|
|
912
997
|
var RULE_NAME22 = "no-create-ref";
|
|
998
|
+
var RULE_FEATURES22 = [
|
|
999
|
+
"LNT"
|
|
1000
|
+
];
|
|
913
1001
|
var no_create_ref_default = createRule({
|
|
914
1002
|
meta: {
|
|
915
1003
|
type: "problem",
|
|
916
1004
|
docs: {
|
|
917
|
-
description: "disallow using 'createRef' in function components"
|
|
1005
|
+
description: "disallow using 'createRef' in function components",
|
|
1006
|
+
[Symbol.for("rule_features")]: RULE_FEATURES22
|
|
918
1007
|
},
|
|
919
1008
|
messages: {
|
|
920
1009
|
noCreateRef: "[Deprecated] Use 'useRef' instead."
|
|
@@ -934,11 +1023,15 @@ var no_create_ref_default = createRule({
|
|
|
934
1023
|
defaultOptions: []
|
|
935
1024
|
});
|
|
936
1025
|
var RULE_NAME23 = "no-default-props";
|
|
1026
|
+
var RULE_FEATURES23 = [
|
|
1027
|
+
"LNT"
|
|
1028
|
+
];
|
|
937
1029
|
var no_default_props_default = createRule({
|
|
938
1030
|
meta: {
|
|
939
1031
|
type: "problem",
|
|
940
1032
|
docs: {
|
|
941
|
-
description: "disallow using 'defaultProps' property in components"
|
|
1033
|
+
description: "disallow using 'defaultProps' property in components",
|
|
1034
|
+
[Symbol.for("rule_features")]: RULE_FEATURES23
|
|
942
1035
|
},
|
|
943
1036
|
messages: {
|
|
944
1037
|
noDefaultProps: "[Deprecated] Use ES6 default parameters instead."
|
|
@@ -973,6 +1066,9 @@ var no_default_props_default = createRule({
|
|
|
973
1066
|
defaultOptions: []
|
|
974
1067
|
});
|
|
975
1068
|
var RULE_NAME24 = "no-direct-mutation-state";
|
|
1069
|
+
var RULE_FEATURES24 = [
|
|
1070
|
+
"LNT"
|
|
1071
|
+
];
|
|
976
1072
|
function getName2(node) {
|
|
977
1073
|
if (node.type === types.AST_NODE_TYPES.TSAsExpression) {
|
|
978
1074
|
return getName2(node.expression);
|
|
@@ -999,7 +1095,8 @@ var no_direct_mutation_state_default = createRule({
|
|
|
999
1095
|
meta: {
|
|
1000
1096
|
type: "problem",
|
|
1001
1097
|
docs: {
|
|
1002
|
-
description: "disallow direct mutation of state"
|
|
1098
|
+
description: "disallow direct mutation of state",
|
|
1099
|
+
[Symbol.for("rule_features")]: RULE_FEATURES24
|
|
1003
1100
|
},
|
|
1004
1101
|
messages: {
|
|
1005
1102
|
noDirectMutationState: "Do not mutate state directly. Use 'setState()' instead."
|
|
@@ -1031,11 +1128,15 @@ var no_direct_mutation_state_default = createRule({
|
|
|
1031
1128
|
defaultOptions: []
|
|
1032
1129
|
});
|
|
1033
1130
|
var RULE_NAME25 = "no-duplicate-key";
|
|
1131
|
+
var RULE_FEATURES25 = [
|
|
1132
|
+
"LNT"
|
|
1133
|
+
];
|
|
1034
1134
|
var no_duplicate_key_default = createRule({
|
|
1035
1135
|
meta: {
|
|
1036
1136
|
type: "problem",
|
|
1037
1137
|
docs: {
|
|
1038
|
-
description: "disallow duplicate keys when rendering list"
|
|
1138
|
+
description: "disallow duplicate keys when rendering list",
|
|
1139
|
+
[Symbol.for("rule_features")]: RULE_FEATURES25
|
|
1039
1140
|
},
|
|
1040
1141
|
messages: {
|
|
1041
1142
|
noDuplicateKey: "A key must be unique. '{{value}}' is duplicated."
|
|
@@ -1160,11 +1261,16 @@ var no_duplicate_key_default = createRule({
|
|
|
1160
1261
|
defaultOptions: []
|
|
1161
1262
|
});
|
|
1162
1263
|
var RULE_NAME26 = "no-forward-ref";
|
|
1264
|
+
var RULE_FEATURES26 = [
|
|
1265
|
+
"LNT",
|
|
1266
|
+
"FIX"
|
|
1267
|
+
];
|
|
1163
1268
|
var no_forward_ref_default = createRule({
|
|
1164
1269
|
meta: {
|
|
1165
1270
|
type: "problem",
|
|
1166
1271
|
docs: {
|
|
1167
|
-
description: "disallow the use of 'forwardRef'"
|
|
1272
|
+
description: "disallow the use of 'forwardRef'",
|
|
1273
|
+
[Symbol.for("rule_features")]: RULE_FEATURES26
|
|
1168
1274
|
},
|
|
1169
1275
|
fixable: "code",
|
|
1170
1276
|
messages: {
|
|
@@ -1252,11 +1358,15 @@ function getComponentPropsFixes(node, typeArguments, fixer, context) {
|
|
|
1252
1358
|
];
|
|
1253
1359
|
}
|
|
1254
1360
|
var RULE_NAME27 = "no-implicit-key";
|
|
1361
|
+
var RULE_FEATURES27 = [
|
|
1362
|
+
"LNT"
|
|
1363
|
+
];
|
|
1255
1364
|
var no_implicit_key_default = createRule({
|
|
1256
1365
|
meta: {
|
|
1257
1366
|
type: "problem",
|
|
1258
1367
|
docs: {
|
|
1259
|
-
description: "disallow implicit 'key' props"
|
|
1368
|
+
description: "disallow implicit 'key' props",
|
|
1369
|
+
[Symbol.for("rule_features")]: RULE_FEATURES27
|
|
1260
1370
|
},
|
|
1261
1371
|
messages: {
|
|
1262
1372
|
noImplicitKey: "Do not use implicit 'key' props."
|
|
@@ -1307,6 +1417,10 @@ function unionTypeParts(type) {
|
|
|
1307
1417
|
return isUnionType(type) ? type.types : [type];
|
|
1308
1418
|
}
|
|
1309
1419
|
var RULE_NAME28 = "no-leaked-conditional-rendering";
|
|
1420
|
+
var RULE_FEATURES28 = [
|
|
1421
|
+
"LNT",
|
|
1422
|
+
"TSC"
|
|
1423
|
+
];
|
|
1310
1424
|
var tsHelpers = {
|
|
1311
1425
|
isAnyType: (type) => isTypeFlagSet(type, ts__default.default.TypeFlags.TypeParameter | ts__default.default.TypeFlags.Any),
|
|
1312
1426
|
isBigIntType: (type) => isTypeFlagSet(type, ts__default.default.TypeFlags.BigIntLike),
|
|
@@ -1403,7 +1517,8 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1403
1517
|
meta: {
|
|
1404
1518
|
type: "problem",
|
|
1405
1519
|
docs: {
|
|
1406
|
-
description: "disallow problematic leaked values from being rendered"
|
|
1520
|
+
description: "disallow problematic leaked values from being rendered",
|
|
1521
|
+
[Symbol.for("rule_features")]: RULE_FEATURES28
|
|
1407
1522
|
},
|
|
1408
1523
|
messages: {
|
|
1409
1524
|
noLeakedConditionalRendering: "Potential leaked value {{value}} that might cause unintentionally rendered values or rendering crashes."
|
|
@@ -1468,11 +1583,15 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1468
1583
|
defaultOptions: []
|
|
1469
1584
|
});
|
|
1470
1585
|
var RULE_NAME29 = "no-missing-component-display-name";
|
|
1586
|
+
var RULE_FEATURES29 = [
|
|
1587
|
+
"LNT"
|
|
1588
|
+
];
|
|
1471
1589
|
var no_missing_component_display_name_default = createRule({
|
|
1472
1590
|
meta: {
|
|
1473
1591
|
type: "problem",
|
|
1474
1592
|
docs: {
|
|
1475
|
-
description: "require 'displayName' for 'memo' and 'forwardRef' components"
|
|
1593
|
+
description: "require 'displayName' for 'memo' and 'forwardRef' components",
|
|
1594
|
+
[Symbol.for("rule_features")]: RULE_FEATURES29
|
|
1476
1595
|
},
|
|
1477
1596
|
messages: {
|
|
1478
1597
|
noMissingComponentDisplayName: "Add missing 'displayName' for component."
|
|
@@ -1504,11 +1623,15 @@ var no_missing_component_display_name_default = createRule({
|
|
|
1504
1623
|
defaultOptions: []
|
|
1505
1624
|
});
|
|
1506
1625
|
var RULE_NAME30 = "no-missing-key";
|
|
1626
|
+
var RULE_FEATURES30 = [
|
|
1627
|
+
"LNT"
|
|
1628
|
+
];
|
|
1507
1629
|
var no_missing_key_default = createRule({
|
|
1508
1630
|
meta: {
|
|
1509
1631
|
type: "problem",
|
|
1510
1632
|
docs: {
|
|
1511
|
-
description: "require 'key' when rendering list"
|
|
1633
|
+
description: "require 'key' when rendering list",
|
|
1634
|
+
[Symbol.for("rule_features")]: RULE_FEATURES30
|
|
1512
1635
|
},
|
|
1513
1636
|
messages: {
|
|
1514
1637
|
noMissingKey: "Missing 'key' for element when rendering list.",
|
|
@@ -1621,11 +1744,15 @@ var no_missing_key_default = createRule({
|
|
|
1621
1744
|
defaultOptions: []
|
|
1622
1745
|
});
|
|
1623
1746
|
var RULE_NAME31 = "no-nested-components";
|
|
1747
|
+
var RULE_FEATURES31 = [
|
|
1748
|
+
"LNT"
|
|
1749
|
+
];
|
|
1624
1750
|
var no_nested_components_default = createRule({
|
|
1625
1751
|
meta: {
|
|
1626
1752
|
type: "problem",
|
|
1627
1753
|
docs: {
|
|
1628
|
-
description: "disallow using unstable nested components"
|
|
1754
|
+
description: "disallow using unstable nested components",
|
|
1755
|
+
[Symbol.for("rule_features")]: RULE_FEATURES31
|
|
1629
1756
|
},
|
|
1630
1757
|
messages: {
|
|
1631
1758
|
nestedComponent: "Do not nest components inside other components. Move it to the top level.",
|
|
@@ -1718,11 +1845,15 @@ var no_nested_components_default = createRule({
|
|
|
1718
1845
|
defaultOptions: []
|
|
1719
1846
|
});
|
|
1720
1847
|
var RULE_NAME32 = "no-prop-types";
|
|
1848
|
+
var RULE_FEATURES32 = [
|
|
1849
|
+
"LNT"
|
|
1850
|
+
];
|
|
1721
1851
|
var no_prop_types_default = createRule({
|
|
1722
1852
|
meta: {
|
|
1723
1853
|
type: "problem",
|
|
1724
1854
|
docs: {
|
|
1725
|
-
description: "disallow using 'propTypes' property in components"
|
|
1855
|
+
description: "disallow using 'propTypes' property in components",
|
|
1856
|
+
[Symbol.for("rule_features")]: RULE_FEATURES32
|
|
1726
1857
|
},
|
|
1727
1858
|
messages: {
|
|
1728
1859
|
noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead."
|
|
@@ -1757,6 +1888,9 @@ var no_prop_types_default = createRule({
|
|
|
1757
1888
|
defaultOptions: []
|
|
1758
1889
|
});
|
|
1759
1890
|
var RULE_NAME33 = "no-redundant-should-component-update";
|
|
1891
|
+
var RULE_FEATURES33 = [
|
|
1892
|
+
"LNT"
|
|
1893
|
+
];
|
|
1760
1894
|
function isShouldComponentUpdate(node) {
|
|
1761
1895
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
|
|
1762
1896
|
}
|
|
@@ -1764,7 +1898,8 @@ var no_redundant_should_component_update_default = createRule({
|
|
|
1764
1898
|
meta: {
|
|
1765
1899
|
type: "problem",
|
|
1766
1900
|
docs: {
|
|
1767
|
-
description: "disallow using 'shouldComponentUpdate' in class component extends 'React.PureComponent'"
|
|
1901
|
+
description: "disallow using 'shouldComponentUpdate' in class component extends 'React.PureComponent'",
|
|
1902
|
+
[Symbol.for("rule_features")]: RULE_FEATURES33
|
|
1768
1903
|
},
|
|
1769
1904
|
messages: {
|
|
1770
1905
|
noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'."
|
|
@@ -1800,6 +1935,9 @@ var no_redundant_should_component_update_default = createRule({
|
|
|
1800
1935
|
defaultOptions: []
|
|
1801
1936
|
});
|
|
1802
1937
|
var RULE_NAME34 = "no-set-state-in-component-did-mount";
|
|
1938
|
+
var RULE_FEATURES34 = [
|
|
1939
|
+
"LNT"
|
|
1940
|
+
];
|
|
1803
1941
|
function isComponentDidMount(node) {
|
|
1804
1942
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
1805
1943
|
}
|
|
@@ -1807,7 +1945,8 @@ var no_set_state_in_component_did_mount_default = createRule({
|
|
|
1807
1945
|
meta: {
|
|
1808
1946
|
type: "problem",
|
|
1809
1947
|
docs: {
|
|
1810
|
-
description: "disallow using 'setState' in 'componentDidMount'"
|
|
1948
|
+
description: "disallow using 'setState' in 'componentDidMount'",
|
|
1949
|
+
[Symbol.for("rule_features")]: RULE_FEATURES34
|
|
1811
1950
|
},
|
|
1812
1951
|
messages: {
|
|
1813
1952
|
noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions, such as callbacks."
|
|
@@ -1843,6 +1982,9 @@ var no_set_state_in_component_did_mount_default = createRule({
|
|
|
1843
1982
|
defaultOptions: []
|
|
1844
1983
|
});
|
|
1845
1984
|
var RULE_NAME35 = "no-set-state-in-component-did-update";
|
|
1985
|
+
var RULE_FEATURES35 = [
|
|
1986
|
+
"LNT"
|
|
1987
|
+
];
|
|
1846
1988
|
function isComponentDidUpdate(node) {
|
|
1847
1989
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
|
|
1848
1990
|
}
|
|
@@ -1850,7 +1992,8 @@ var no_set_state_in_component_did_update_default = createRule({
|
|
|
1850
1992
|
meta: {
|
|
1851
1993
|
type: "problem",
|
|
1852
1994
|
docs: {
|
|
1853
|
-
description: "disallow using 'setState' in 'componentDidUpdate'"
|
|
1995
|
+
description: "disallow using 'setState' in 'componentDidUpdate'",
|
|
1996
|
+
[Symbol.for("rule_features")]: RULE_FEATURES35
|
|
1854
1997
|
},
|
|
1855
1998
|
messages: {
|
|
1856
1999
|
noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions, such as callbacks."
|
|
@@ -1886,6 +2029,9 @@ var no_set_state_in_component_did_update_default = createRule({
|
|
|
1886
2029
|
defaultOptions: []
|
|
1887
2030
|
});
|
|
1888
2031
|
var RULE_NAME36 = "no-set-state-in-component-will-update";
|
|
2032
|
+
var RULE_FEATURES36 = [
|
|
2033
|
+
"LNT"
|
|
2034
|
+
];
|
|
1889
2035
|
function isComponentWillUpdate3(node) {
|
|
1890
2036
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
1891
2037
|
}
|
|
@@ -1893,7 +2039,8 @@ var no_set_state_in_component_will_update_default = createRule({
|
|
|
1893
2039
|
meta: {
|
|
1894
2040
|
type: "problem",
|
|
1895
2041
|
docs: {
|
|
1896
|
-
description: "disallow using 'setState' in 'componentWillUpdate'"
|
|
2042
|
+
description: "disallow using 'setState' in 'componentWillUpdate'",
|
|
2043
|
+
[Symbol.for("rule_features")]: RULE_FEATURES36
|
|
1897
2044
|
},
|
|
1898
2045
|
messages: {
|
|
1899
2046
|
noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions, such as callbacks."
|
|
@@ -1929,6 +2076,9 @@ var no_set_state_in_component_will_update_default = createRule({
|
|
|
1929
2076
|
defaultOptions: []
|
|
1930
2077
|
});
|
|
1931
2078
|
var RULE_NAME37 = "no-string-refs";
|
|
2079
|
+
var RULE_FEATURES37 = [
|
|
2080
|
+
"LNT"
|
|
2081
|
+
];
|
|
1932
2082
|
function containsStringLiteral({ value }) {
|
|
1933
2083
|
return value?.type === types.AST_NODE_TYPES.Literal && tools.isString(value.value);
|
|
1934
2084
|
}
|
|
@@ -1941,7 +2091,8 @@ var no_string_refs_default = createRule({
|
|
|
1941
2091
|
meta: {
|
|
1942
2092
|
type: "problem",
|
|
1943
2093
|
docs: {
|
|
1944
|
-
description: "disallow using deprecated string refs"
|
|
2094
|
+
description: "disallow using deprecated string refs",
|
|
2095
|
+
[Symbol.for("rule_features")]: RULE_FEATURES37
|
|
1945
2096
|
},
|
|
1946
2097
|
messages: {
|
|
1947
2098
|
noStringRefs: "[Deprecated] Use callback refs instead."
|
|
@@ -1965,6 +2116,9 @@ var no_string_refs_default = createRule({
|
|
|
1965
2116
|
defaultOptions: []
|
|
1966
2117
|
});
|
|
1967
2118
|
var RULE_NAME38 = "no-unsafe-component-will-mount";
|
|
2119
|
+
var RULE_FEATURES38 = [
|
|
2120
|
+
"LNT"
|
|
2121
|
+
];
|
|
1968
2122
|
function isUnsafeComponentWillMount(node) {
|
|
1969
2123
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
|
|
1970
2124
|
}
|
|
@@ -1972,7 +2126,8 @@ var no_unsafe_component_will_mount_default = createRule({
|
|
|
1972
2126
|
meta: {
|
|
1973
2127
|
type: "problem",
|
|
1974
2128
|
docs: {
|
|
1975
|
-
description: "disallow using 'UNSAFE_componentWillMount'"
|
|
2129
|
+
description: "disallow using 'UNSAFE_componentWillMount'",
|
|
2130
|
+
[Symbol.for("rule_features")]: RULE_FEATURES38
|
|
1976
2131
|
},
|
|
1977
2132
|
messages: {
|
|
1978
2133
|
noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'."
|
|
@@ -2004,6 +2159,9 @@ var no_unsafe_component_will_mount_default = createRule({
|
|
|
2004
2159
|
defaultOptions: []
|
|
2005
2160
|
});
|
|
2006
2161
|
var RULE_NAME39 = "no-unsafe-component-will-receive-props";
|
|
2162
|
+
var RULE_FEATURES39 = [
|
|
2163
|
+
"LNT"
|
|
2164
|
+
];
|
|
2007
2165
|
function isUnsafeComponentWillReceiveProps(node) {
|
|
2008
2166
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
|
|
2009
2167
|
}
|
|
@@ -2011,7 +2169,8 @@ var no_unsafe_component_will_receive_props_default = createRule({
|
|
|
2011
2169
|
meta: {
|
|
2012
2170
|
type: "problem",
|
|
2013
2171
|
docs: {
|
|
2014
|
-
description: "disallow using 'UNSAFE_componentWillReceiveProps'"
|
|
2172
|
+
description: "disallow using 'UNSAFE_componentWillReceiveProps'",
|
|
2173
|
+
[Symbol.for("rule_features")]: RULE_FEATURES39
|
|
2015
2174
|
},
|
|
2016
2175
|
messages: {
|
|
2017
2176
|
noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'."
|
|
@@ -2043,6 +2202,9 @@ var no_unsafe_component_will_receive_props_default = createRule({
|
|
|
2043
2202
|
defaultOptions: []
|
|
2044
2203
|
});
|
|
2045
2204
|
var RULE_NAME40 = "no-unsafe-component-will-update";
|
|
2205
|
+
var RULE_FEATURES40 = [
|
|
2206
|
+
"LNT"
|
|
2207
|
+
];
|
|
2046
2208
|
function isUnsafeComponentWillUpdate(node) {
|
|
2047
2209
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
|
|
2048
2210
|
}
|
|
@@ -2050,7 +2212,8 @@ var no_unsafe_component_will_update_default = createRule({
|
|
|
2050
2212
|
meta: {
|
|
2051
2213
|
type: "problem",
|
|
2052
2214
|
docs: {
|
|
2053
|
-
description: "disallow using 'UNSAFE_componentWillUpdate'"
|
|
2215
|
+
description: "disallow using 'UNSAFE_componentWillUpdate'",
|
|
2216
|
+
[Symbol.for("rule_features")]: RULE_FEATURES40
|
|
2054
2217
|
},
|
|
2055
2218
|
messages: {
|
|
2056
2219
|
noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'."
|
|
@@ -2082,11 +2245,15 @@ var no_unsafe_component_will_update_default = createRule({
|
|
|
2082
2245
|
defaultOptions: []
|
|
2083
2246
|
});
|
|
2084
2247
|
var RULE_NAME41 = "no-unstable-context-value";
|
|
2248
|
+
var RULE_FEATURES41 = [
|
|
2249
|
+
"LNT"
|
|
2250
|
+
];
|
|
2085
2251
|
var no_unstable_context_value_default = createRule({
|
|
2086
2252
|
meta: {
|
|
2087
2253
|
type: "problem",
|
|
2088
2254
|
docs: {
|
|
2089
|
-
description: "disallow passing constructed values to context providers"
|
|
2255
|
+
description: "disallow passing constructed values to context providers",
|
|
2256
|
+
[Symbol.for("rule_features")]: RULE_FEATURES41
|
|
2090
2257
|
},
|
|
2091
2258
|
messages: {
|
|
2092
2259
|
noUnstableContextValue: "A/an '{{type}}' passed as the value prop to the context provider should not be constructed. It will change on every render.",
|
|
@@ -2149,11 +2316,15 @@ var no_unstable_context_value_default = createRule({
|
|
|
2149
2316
|
defaultOptions: []
|
|
2150
2317
|
});
|
|
2151
2318
|
var RULE_NAME42 = "no-unstable-default-props";
|
|
2319
|
+
var RULE_FEATURES42 = [
|
|
2320
|
+
"LNT"
|
|
2321
|
+
];
|
|
2152
2322
|
var no_unstable_default_props_default = createRule({
|
|
2153
2323
|
meta: {
|
|
2154
2324
|
type: "problem",
|
|
2155
2325
|
docs: {
|
|
2156
|
-
description: "disallow using unstable value as default param in function component"
|
|
2326
|
+
description: "disallow using unstable value as default param in function component",
|
|
2327
|
+
[Symbol.for("rule_features")]: RULE_FEATURES42
|
|
2157
2328
|
},
|
|
2158
2329
|
messages: {
|
|
2159
2330
|
noUnstableDefaultProps: "A/an '{{forbiddenType}}' as default prop. This could lead to potential infinite render loop in React. Use a variable instead of '{{forbiddenType}}'."
|
|
@@ -2214,6 +2385,9 @@ var no_unstable_default_props_default = createRule({
|
|
|
2214
2385
|
defaultOptions: []
|
|
2215
2386
|
});
|
|
2216
2387
|
var RULE_NAME43 = "no-unused-class-component-members";
|
|
2388
|
+
var RULE_FEATURES43 = [
|
|
2389
|
+
"LNT"
|
|
2390
|
+
];
|
|
2217
2391
|
var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
|
|
2218
2392
|
"componentDidCatch",
|
|
2219
2393
|
"componentDidMount",
|
|
@@ -2250,7 +2424,8 @@ var no_unused_class_component_members_default = createRule({
|
|
|
2250
2424
|
meta: {
|
|
2251
2425
|
type: "problem",
|
|
2252
2426
|
docs: {
|
|
2253
|
-
description: "disallow unused class component members"
|
|
2427
|
+
description: "disallow unused class component members",
|
|
2428
|
+
[Symbol.for("rule_features")]: RULE_FEATURES43
|
|
2254
2429
|
},
|
|
2255
2430
|
messages: {
|
|
2256
2431
|
noUnusedClassComponentMembers: "Unused method or property '{{methodName}}'' of class '{{className}}'."
|
|
@@ -2341,6 +2516,9 @@ var no_unused_class_component_members_default = createRule({
|
|
|
2341
2516
|
defaultOptions: []
|
|
2342
2517
|
});
|
|
2343
2518
|
var RULE_NAME44 = "no-unused-state";
|
|
2519
|
+
var RULE_FEATURES44 = [
|
|
2520
|
+
"LNT"
|
|
2521
|
+
];
|
|
2344
2522
|
function getName4(node) {
|
|
2345
2523
|
if (node.type === types.AST_NODE_TYPES.TSAsExpression) {
|
|
2346
2524
|
return getName4(node.expression);
|
|
@@ -2373,7 +2551,8 @@ var no_unused_state_default = createRule({
|
|
|
2373
2551
|
meta: {
|
|
2374
2552
|
type: "problem",
|
|
2375
2553
|
docs: {
|
|
2376
|
-
description: "disallow unused state of class component"
|
|
2554
|
+
description: "disallow unused state of class component",
|
|
2555
|
+
[Symbol.for("rule_features")]: RULE_FEATURES44
|
|
2377
2556
|
},
|
|
2378
2557
|
messages: {
|
|
2379
2558
|
noUnusedState: "Unused class component state in '{{className}}'"
|
|
@@ -2541,6 +2720,9 @@ var no_useless_fragment_default = createRule({
|
|
|
2541
2720
|
}]
|
|
2542
2721
|
});
|
|
2543
2722
|
var RULE_NAME46 = "prefer-destructuring-assignment";
|
|
2723
|
+
var RULE_FEATURES45 = [
|
|
2724
|
+
"LNT"
|
|
2725
|
+
];
|
|
2544
2726
|
function isMemberExpressionWithObjectName(node) {
|
|
2545
2727
|
return node.object.type === types.AST_NODE_TYPES.Identifier && "name" in node.object;
|
|
2546
2728
|
}
|
|
@@ -2548,7 +2730,8 @@ var prefer_destructuring_assignment_default = createRule({
|
|
|
2548
2730
|
meta: {
|
|
2549
2731
|
type: "problem",
|
|
2550
2732
|
docs: {
|
|
2551
|
-
description: "enforce using destructuring assignment in component props and context"
|
|
2733
|
+
description: "enforce using destructuring assignment in component props and context",
|
|
2734
|
+
[Symbol.for("rule_features")]: RULE_FEATURES45
|
|
2552
2735
|
},
|
|
2553
2736
|
messages: {
|
|
2554
2737
|
preferDestructuringAssignment: "Use destructuring assignment for {{name}}."
|
|
@@ -2611,11 +2794,16 @@ var prefer_destructuring_assignment_default = createRule({
|
|
|
2611
2794
|
defaultOptions: []
|
|
2612
2795
|
});
|
|
2613
2796
|
var RULE_NAME47 = "prefer-react-namespace-import";
|
|
2797
|
+
var RULE_FEATURES46 = [
|
|
2798
|
+
"LNT",
|
|
2799
|
+
"FIX"
|
|
2800
|
+
];
|
|
2614
2801
|
var prefer_react_namespace_import_default = createRule({
|
|
2615
2802
|
meta: {
|
|
2616
2803
|
type: "problem",
|
|
2617
2804
|
docs: {
|
|
2618
|
-
description: "enforce React is imported via a namespace import"
|
|
2805
|
+
description: "enforce React is imported via a namespace import",
|
|
2806
|
+
[Symbol.for("rule_features")]: RULE_FEATURES46
|
|
2619
2807
|
},
|
|
2620
2808
|
fixable: "code",
|
|
2621
2809
|
messages: {
|
|
@@ -2660,6 +2848,10 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
|
|
|
2660
2848
|
defaultOptions: []
|
|
2661
2849
|
});
|
|
2662
2850
|
var RULE_NAME48 = "prefer-read-only-props";
|
|
2851
|
+
var RULE_FEATURES47 = [
|
|
2852
|
+
"LNT",
|
|
2853
|
+
"TSC"
|
|
2854
|
+
];
|
|
2663
2855
|
function isReadonlyType(type, services) {
|
|
2664
2856
|
try {
|
|
2665
2857
|
const im = isImmutableType.getTypeImmutability(services.program, type);
|
|
@@ -2672,7 +2864,8 @@ var prefer_read_only_props_default = createRule({
|
|
|
2672
2864
|
meta: {
|
|
2673
2865
|
type: "problem",
|
|
2674
2866
|
docs: {
|
|
2675
|
-
description: "enforce read-only props in components"
|
|
2867
|
+
description: "enforce read-only props in components",
|
|
2868
|
+
[Symbol.for("rule_features")]: RULE_FEATURES47
|
|
2676
2869
|
},
|
|
2677
2870
|
messages: {
|
|
2678
2871
|
preferReadOnlyProps: "A function component's props should be read-only."
|
|
@@ -2700,11 +2893,16 @@ var prefer_read_only_props_default = createRule({
|
|
|
2700
2893
|
defaultOptions: []
|
|
2701
2894
|
});
|
|
2702
2895
|
var RULE_NAME49 = "prefer-shorthand-boolean";
|
|
2896
|
+
var RULE_FEATURES48 = [
|
|
2897
|
+
"LNT",
|
|
2898
|
+
"FIX"
|
|
2899
|
+
];
|
|
2703
2900
|
var prefer_shorthand_boolean_default = createRule({
|
|
2704
2901
|
meta: {
|
|
2705
2902
|
type: "problem",
|
|
2706
2903
|
docs: {
|
|
2707
|
-
description: "enforce using shorthand boolean attributes"
|
|
2904
|
+
description: "enforce using shorthand boolean attributes",
|
|
2905
|
+
[Symbol.for("rule_features")]: RULE_FEATURES48
|
|
2708
2906
|
},
|
|
2709
2907
|
fixable: "code",
|
|
2710
2908
|
messages: {
|
|
@@ -2735,11 +2933,16 @@ var prefer_shorthand_boolean_default = createRule({
|
|
|
2735
2933
|
defaultOptions: []
|
|
2736
2934
|
});
|
|
2737
2935
|
var RULE_NAME50 = "prefer-shorthand-fragment";
|
|
2936
|
+
var RULE_FEATURES49 = [
|
|
2937
|
+
"LNT"
|
|
2938
|
+
// "FIX",
|
|
2939
|
+
];
|
|
2738
2940
|
var prefer_shorthand_fragment_default = createRule({
|
|
2739
2941
|
meta: {
|
|
2740
2942
|
type: "problem",
|
|
2741
2943
|
docs: {
|
|
2742
|
-
description: "enforce using fragment syntax instead of 'Fragment' component"
|
|
2944
|
+
description: "enforce using fragment syntax instead of 'Fragment' component",
|
|
2945
|
+
[Symbol.for("rule_features")]: RULE_FEATURES49
|
|
2743
2946
|
},
|
|
2744
2947
|
messages: {
|
|
2745
2948
|
preferShorthandFragment: "Use fragment shorthand syntax instead of 'Fragment' component."
|