eslint-plugin-react-x 1.38.0-beta.7 → 1.38.0-beta.8
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.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +349 -305
- package/dist/index.mjs +348 -304
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -4,13 +4,13 @@ var shared = require('@eslint-react/shared');
|
|
|
4
4
|
var JSX8 = require('@eslint-react/jsx');
|
|
5
5
|
var utils = require('@typescript-eslint/utils');
|
|
6
6
|
var types = require('@typescript-eslint/types');
|
|
7
|
+
var VAR2 = require('@eslint-react/var');
|
|
7
8
|
var AST11 = require('@eslint-react/ast');
|
|
8
9
|
var core = require('@eslint-react/core');
|
|
9
10
|
var eff = require('@eslint-react/eff');
|
|
10
11
|
var tsPattern = require('ts-pattern');
|
|
11
12
|
var kit = require('@eslint-react/kit');
|
|
12
13
|
var compareVersions = require('compare-versions');
|
|
13
|
-
var VAR = require('@eslint-react/var');
|
|
14
14
|
var typeUtils = require('@typescript-eslint/type-utils');
|
|
15
15
|
var tsApiUtils = require('ts-api-utils');
|
|
16
16
|
var ts = require('typescript');
|
|
@@ -37,8 +37,8 @@ function _interopNamespace(e) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
var JSX8__namespace = /*#__PURE__*/_interopNamespace(JSX8);
|
|
40
|
+
var VAR2__namespace = /*#__PURE__*/_interopNamespace(VAR2);
|
|
40
41
|
var AST11__namespace = /*#__PURE__*/_interopNamespace(AST11);
|
|
41
|
-
var VAR__namespace = /*#__PURE__*/_interopNamespace(VAR);
|
|
42
42
|
var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
43
43
|
|
|
44
44
|
var __defProp = Object.defineProperty;
|
|
@@ -56,6 +56,9 @@ __export(recommended_exports, {
|
|
|
56
56
|
});
|
|
57
57
|
var name = "react-x/recommended";
|
|
58
58
|
var rules = {
|
|
59
|
+
"react-x/jsx-no-duplicate-props": "warn",
|
|
60
|
+
"react-x/jsx-no-undef": "error",
|
|
61
|
+
"react-x/jsx-uses-vars": "warn",
|
|
59
62
|
"react-x/no-access-state-in-setstate": "error",
|
|
60
63
|
"react-x/no-array-index-key": "warn",
|
|
61
64
|
"react-x/no-children-count": "warn",
|
|
@@ -72,7 +75,6 @@ var rules = {
|
|
|
72
75
|
"react-x/no-create-ref": "error",
|
|
73
76
|
"react-x/no-default-props": "error",
|
|
74
77
|
"react-x/no-direct-mutation-state": "error",
|
|
75
|
-
"react-x/jsx-no-duplicate-props": "warn",
|
|
76
78
|
"react-x/no-duplicate-key": "warn",
|
|
77
79
|
"react-x/no-forward-ref": "warn",
|
|
78
80
|
"react-x/no-implicit-key": "warn",
|
|
@@ -92,8 +94,7 @@ var rules = {
|
|
|
92
94
|
"react-x/no-unused-class-component-members": "warn",
|
|
93
95
|
"react-x/no-unused-state": "warn",
|
|
94
96
|
"react-x/no-use-context": "warn",
|
|
95
|
-
"react-x/no-useless-forward-ref": "warn"
|
|
96
|
-
"react-x/jsx-uses-vars": "warn"
|
|
97
|
+
"react-x/no-useless-forward-ref": "warn"
|
|
97
98
|
};
|
|
98
99
|
var settings = {
|
|
99
100
|
"react-x": shared.DEFAULT_ESLINT_REACT_SETTINGS
|
|
@@ -118,6 +119,7 @@ var name2 = "react-x/recommended-typescript";
|
|
|
118
119
|
var rules2 = {
|
|
119
120
|
...rules,
|
|
120
121
|
"react-x/jsx-no-duplicate-props": "off",
|
|
122
|
+
"react-x/jsx-no-undef": "off",
|
|
121
123
|
"react-x/jsx-uses-vars": "off"
|
|
122
124
|
};
|
|
123
125
|
var settings2 = {
|
|
@@ -137,7 +139,7 @@ var settings3 = {
|
|
|
137
139
|
|
|
138
140
|
// package.json
|
|
139
141
|
var name4 = "eslint-plugin-react-x";
|
|
140
|
-
var version = "1.38.0-beta.
|
|
142
|
+
var version = "1.38.0-beta.8";
|
|
141
143
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
142
144
|
|
|
143
145
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -248,17 +250,17 @@ function create3(context) {
|
|
|
248
250
|
}
|
|
249
251
|
};
|
|
250
252
|
}
|
|
251
|
-
var RULE_NAME4 = "jsx-
|
|
253
|
+
var RULE_NAME4 = "jsx-no-undef";
|
|
252
254
|
var RULE_FEATURES4 = [];
|
|
253
|
-
var
|
|
255
|
+
var jsx_no_undef_default = createRule({
|
|
254
256
|
meta: {
|
|
255
257
|
type: "problem",
|
|
256
258
|
docs: {
|
|
257
|
-
description: "
|
|
259
|
+
description: "Disallow undefined variables in JSX.",
|
|
258
260
|
[Symbol.for("rule_features")]: RULE_FEATURES4
|
|
259
261
|
},
|
|
260
262
|
messages: {
|
|
261
|
-
|
|
263
|
+
jsxNoUndef: "JSX variable {{name}} is not defined."
|
|
262
264
|
},
|
|
263
265
|
schema: []
|
|
264
266
|
},
|
|
@@ -267,6 +269,47 @@ var jsx_uses_vars_default = createRule({
|
|
|
267
269
|
defaultOptions: []
|
|
268
270
|
});
|
|
269
271
|
function create4(context) {
|
|
272
|
+
return {
|
|
273
|
+
JSXIdentifier(node) {
|
|
274
|
+
if (node.name === "this") {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (/^[a-z]/u.test(node.name)) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (node.parent.type === types.AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const initialScope = context.sourceCode.getScope(node);
|
|
284
|
+
if (VAR2__namespace.findVariable(node.name, initialScope) == null) {
|
|
285
|
+
context.report({
|
|
286
|
+
messageId: "jsxNoUndef",
|
|
287
|
+
node,
|
|
288
|
+
data: { name: node.name }
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
var RULE_NAME5 = "jsx-uses-vars";
|
|
295
|
+
var RULE_FEATURES5 = [];
|
|
296
|
+
var jsx_uses_vars_default = createRule({
|
|
297
|
+
meta: {
|
|
298
|
+
type: "problem",
|
|
299
|
+
docs: {
|
|
300
|
+
description: "Marks variables used in JSX as used.",
|
|
301
|
+
[Symbol.for("rule_features")]: RULE_FEATURES5
|
|
302
|
+
},
|
|
303
|
+
messages: {
|
|
304
|
+
jsxUsesVars: "JSX variables should be marked as used."
|
|
305
|
+
},
|
|
306
|
+
schema: []
|
|
307
|
+
},
|
|
308
|
+
name: RULE_NAME5,
|
|
309
|
+
create: create5,
|
|
310
|
+
defaultOptions: []
|
|
311
|
+
});
|
|
312
|
+
function create5(context) {
|
|
270
313
|
return {
|
|
271
314
|
JSXOpeningElement(node) {
|
|
272
315
|
switch (node.name.type) {
|
|
@@ -288,8 +331,8 @@ function create4(context) {
|
|
|
288
331
|
}
|
|
289
332
|
};
|
|
290
333
|
}
|
|
291
|
-
var
|
|
292
|
-
var
|
|
334
|
+
var RULE_NAME6 = "no-access-state-in-setstate";
|
|
335
|
+
var RULE_FEATURES6 = [];
|
|
293
336
|
function isKeyLiteral(node, key) {
|
|
294
337
|
return tsPattern.match(key).with({ type: types.AST_NODE_TYPES.Literal }, eff.constTrue).with({ type: types.AST_NODE_TYPES.TemplateLiteral, expressions: [] }, eff.constTrue).with({ type: types.AST_NODE_TYPES.Identifier }, () => !node.computed).otherwise(eff.constFalse);
|
|
295
338
|
}
|
|
@@ -298,18 +341,18 @@ var no_access_state_in_setstate_default = createRule({
|
|
|
298
341
|
type: "problem",
|
|
299
342
|
docs: {
|
|
300
343
|
description: "Disallow accessing `this.state` inside `setState` calls.",
|
|
301
|
-
[Symbol.for("rule_features")]:
|
|
344
|
+
[Symbol.for("rule_features")]: RULE_FEATURES6
|
|
302
345
|
},
|
|
303
346
|
messages: {
|
|
304
347
|
noAccessStateInSetstate: "Do not access 'this.state' within 'setState'. Use the update function instead."
|
|
305
348
|
},
|
|
306
349
|
schema: []
|
|
307
350
|
},
|
|
308
|
-
name:
|
|
309
|
-
create:
|
|
351
|
+
name: RULE_NAME6,
|
|
352
|
+
create: create6,
|
|
310
353
|
defaultOptions: []
|
|
311
354
|
});
|
|
312
|
-
function
|
|
355
|
+
function create6(context) {
|
|
313
356
|
if (!context.sourceCode.text.includes("setState")) {
|
|
314
357
|
return {};
|
|
315
358
|
}
|
|
@@ -400,8 +443,8 @@ function create5(context) {
|
|
|
400
443
|
}
|
|
401
444
|
};
|
|
402
445
|
}
|
|
403
|
-
var
|
|
404
|
-
var
|
|
446
|
+
var RULE_NAME7 = "no-array-index-key";
|
|
447
|
+
var RULE_FEATURES7 = [];
|
|
405
448
|
var reactChildrenMethod = ["forEach", "map"];
|
|
406
449
|
var iteratorFunctionIndexParamPosition = /* @__PURE__ */ new Map([
|
|
407
450
|
["every", 1],
|
|
@@ -485,18 +528,18 @@ var no_array_index_key_default = createRule({
|
|
|
485
528
|
type: "problem",
|
|
486
529
|
docs: {
|
|
487
530
|
description: "Disallow an item's index in the array as its key.",
|
|
488
|
-
[Symbol.for("rule_features")]:
|
|
531
|
+
[Symbol.for("rule_features")]: RULE_FEATURES7
|
|
489
532
|
},
|
|
490
533
|
messages: {
|
|
491
534
|
noArrayIndexKey: "Do not use item index in the array as its key."
|
|
492
535
|
},
|
|
493
536
|
schema: []
|
|
494
537
|
},
|
|
495
|
-
name:
|
|
496
|
-
create:
|
|
538
|
+
name: RULE_NAME7,
|
|
539
|
+
create: create7,
|
|
497
540
|
defaultOptions: []
|
|
498
541
|
});
|
|
499
|
-
function
|
|
542
|
+
function create7(context) {
|
|
500
543
|
const report = kit.createReport(context);
|
|
501
544
|
const indexParamNames = [];
|
|
502
545
|
function isArrayIndex(node) {
|
|
@@ -594,25 +637,25 @@ function create6(context) {
|
|
|
594
637
|
}
|
|
595
638
|
};
|
|
596
639
|
}
|
|
597
|
-
var
|
|
598
|
-
var
|
|
640
|
+
var RULE_NAME8 = "no-children-count";
|
|
641
|
+
var RULE_FEATURES8 = [];
|
|
599
642
|
var no_children_count_default = createRule({
|
|
600
643
|
meta: {
|
|
601
644
|
type: "problem",
|
|
602
645
|
docs: {
|
|
603
646
|
description: "Disallow `Children.count`.",
|
|
604
|
-
[Symbol.for("rule_features")]:
|
|
647
|
+
[Symbol.for("rule_features")]: RULE_FEATURES8
|
|
605
648
|
},
|
|
606
649
|
messages: {
|
|
607
650
|
noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
608
651
|
},
|
|
609
652
|
schema: []
|
|
610
653
|
},
|
|
611
|
-
name:
|
|
612
|
-
create:
|
|
654
|
+
name: RULE_NAME8,
|
|
655
|
+
create: create8,
|
|
613
656
|
defaultOptions: []
|
|
614
657
|
});
|
|
615
|
-
function
|
|
658
|
+
function create8(context) {
|
|
616
659
|
return {
|
|
617
660
|
MemberExpression(node) {
|
|
618
661
|
if (core.isChildrenCount(context, node)) {
|
|
@@ -624,25 +667,25 @@ function create7(context) {
|
|
|
624
667
|
}
|
|
625
668
|
};
|
|
626
669
|
}
|
|
627
|
-
var
|
|
628
|
-
var
|
|
670
|
+
var RULE_NAME9 = "no-children-for-each";
|
|
671
|
+
var RULE_FEATURES9 = [];
|
|
629
672
|
var no_children_for_each_default = createRule({
|
|
630
673
|
meta: {
|
|
631
674
|
type: "problem",
|
|
632
675
|
docs: {
|
|
633
676
|
description: "Disallow 'Children.forEach'.",
|
|
634
|
-
[Symbol.for("rule_features")]:
|
|
677
|
+
[Symbol.for("rule_features")]: RULE_FEATURES9
|
|
635
678
|
},
|
|
636
679
|
messages: {
|
|
637
680
|
noChildrenForEach: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
638
681
|
},
|
|
639
682
|
schema: []
|
|
640
683
|
},
|
|
641
|
-
name:
|
|
642
|
-
create:
|
|
684
|
+
name: RULE_NAME9,
|
|
685
|
+
create: create9,
|
|
643
686
|
defaultOptions: []
|
|
644
687
|
});
|
|
645
|
-
function
|
|
688
|
+
function create9(context) {
|
|
646
689
|
return {
|
|
647
690
|
MemberExpression(node) {
|
|
648
691
|
if (core.isChildrenForEach(context, node)) {
|
|
@@ -654,25 +697,25 @@ function create8(context) {
|
|
|
654
697
|
}
|
|
655
698
|
};
|
|
656
699
|
}
|
|
657
|
-
var
|
|
658
|
-
var
|
|
700
|
+
var RULE_NAME10 = "no-children-map";
|
|
701
|
+
var RULE_FEATURES10 = [];
|
|
659
702
|
var no_children_map_default = createRule({
|
|
660
703
|
meta: {
|
|
661
704
|
type: "problem",
|
|
662
705
|
docs: {
|
|
663
706
|
description: "Disallow `Children.map`.",
|
|
664
|
-
[Symbol.for("rule_features")]:
|
|
707
|
+
[Symbol.for("rule_features")]: RULE_FEATURES10
|
|
665
708
|
},
|
|
666
709
|
messages: {
|
|
667
710
|
noChildrenMap: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
668
711
|
},
|
|
669
712
|
schema: []
|
|
670
713
|
},
|
|
671
|
-
name:
|
|
672
|
-
create:
|
|
714
|
+
name: RULE_NAME10,
|
|
715
|
+
create: create10,
|
|
673
716
|
defaultOptions: []
|
|
674
717
|
});
|
|
675
|
-
function
|
|
718
|
+
function create10(context) {
|
|
676
719
|
return {
|
|
677
720
|
MemberExpression(node) {
|
|
678
721
|
if (core.isChildrenMap(context, node)) {
|
|
@@ -684,25 +727,25 @@ function create9(context) {
|
|
|
684
727
|
}
|
|
685
728
|
};
|
|
686
729
|
}
|
|
687
|
-
var
|
|
688
|
-
var
|
|
730
|
+
var RULE_NAME11 = "no-children-only";
|
|
731
|
+
var RULE_FEATURES11 = [];
|
|
689
732
|
var no_children_only_default = createRule({
|
|
690
733
|
meta: {
|
|
691
734
|
type: "problem",
|
|
692
735
|
docs: {
|
|
693
736
|
description: "Disallow `Children.only`.",
|
|
694
|
-
[Symbol.for("rule_features")]:
|
|
737
|
+
[Symbol.for("rule_features")]: RULE_FEATURES11
|
|
695
738
|
},
|
|
696
739
|
messages: {
|
|
697
740
|
noChildrenOnly: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
698
741
|
},
|
|
699
742
|
schema: []
|
|
700
743
|
},
|
|
701
|
-
name:
|
|
702
|
-
create:
|
|
744
|
+
name: RULE_NAME11,
|
|
745
|
+
create: create11,
|
|
703
746
|
defaultOptions: []
|
|
704
747
|
});
|
|
705
|
-
function
|
|
748
|
+
function create11(context) {
|
|
706
749
|
return {
|
|
707
750
|
MemberExpression(node) {
|
|
708
751
|
if (core.isChildrenOnly(context, node)) {
|
|
@@ -714,25 +757,25 @@ function create10(context) {
|
|
|
714
757
|
}
|
|
715
758
|
};
|
|
716
759
|
}
|
|
717
|
-
var
|
|
718
|
-
var
|
|
760
|
+
var RULE_NAME12 = "no-children-prop";
|
|
761
|
+
var RULE_FEATURES12 = [];
|
|
719
762
|
var no_children_prop_default = createRule({
|
|
720
763
|
meta: {
|
|
721
764
|
type: "problem",
|
|
722
765
|
docs: {
|
|
723
766
|
description: "Disallow passing `children` as a prop.",
|
|
724
|
-
[Symbol.for("rule_features")]:
|
|
767
|
+
[Symbol.for("rule_features")]: RULE_FEATURES12
|
|
725
768
|
},
|
|
726
769
|
messages: {
|
|
727
770
|
noChildrenProp: "Do not pass 'children' as props."
|
|
728
771
|
},
|
|
729
772
|
schema: []
|
|
730
773
|
},
|
|
731
|
-
name:
|
|
732
|
-
create:
|
|
774
|
+
name: RULE_NAME12,
|
|
775
|
+
create: create12,
|
|
733
776
|
defaultOptions: []
|
|
734
777
|
});
|
|
735
|
-
function
|
|
778
|
+
function create12(context) {
|
|
736
779
|
return {
|
|
737
780
|
JSXElement(node) {
|
|
738
781
|
const attribute = JSX8__namespace.getAttribute(
|
|
@@ -749,25 +792,25 @@ function create11(context) {
|
|
|
749
792
|
}
|
|
750
793
|
};
|
|
751
794
|
}
|
|
752
|
-
var
|
|
753
|
-
var
|
|
795
|
+
var RULE_NAME13 = "no-children-to-array";
|
|
796
|
+
var RULE_FEATURES13 = [];
|
|
754
797
|
var no_children_to_array_default = createRule({
|
|
755
798
|
meta: {
|
|
756
799
|
type: "problem",
|
|
757
800
|
docs: {
|
|
758
801
|
description: "Disallow `Children.toArray`.",
|
|
759
|
-
[Symbol.for("rule_features")]:
|
|
802
|
+
[Symbol.for("rule_features")]: RULE_FEATURES13
|
|
760
803
|
},
|
|
761
804
|
messages: {
|
|
762
805
|
noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
763
806
|
},
|
|
764
807
|
schema: []
|
|
765
808
|
},
|
|
766
|
-
name:
|
|
767
|
-
create:
|
|
809
|
+
name: RULE_NAME13,
|
|
810
|
+
create: create13,
|
|
768
811
|
defaultOptions: []
|
|
769
812
|
});
|
|
770
|
-
function
|
|
813
|
+
function create13(context) {
|
|
771
814
|
return {
|
|
772
815
|
MemberExpression(node) {
|
|
773
816
|
if (core.isChildrenToArray(context, node)) {
|
|
@@ -779,25 +822,25 @@ function create12(context) {
|
|
|
779
822
|
}
|
|
780
823
|
};
|
|
781
824
|
}
|
|
782
|
-
var
|
|
783
|
-
var
|
|
825
|
+
var RULE_NAME14 = "no-class-component";
|
|
826
|
+
var RULE_FEATURES14 = [];
|
|
784
827
|
var no_class_component_default = createRule({
|
|
785
828
|
meta: {
|
|
786
829
|
type: "problem",
|
|
787
830
|
docs: {
|
|
788
831
|
description: "Disallow class components.",
|
|
789
|
-
[Symbol.for("rule_features")]:
|
|
832
|
+
[Symbol.for("rule_features")]: RULE_FEATURES14
|
|
790
833
|
},
|
|
791
834
|
messages: {
|
|
792
835
|
noClassComponent: "Do not use class components. Use function components instead."
|
|
793
836
|
},
|
|
794
837
|
schema: []
|
|
795
838
|
},
|
|
796
|
-
name:
|
|
797
|
-
create:
|
|
839
|
+
name: RULE_NAME14,
|
|
840
|
+
create: create14,
|
|
798
841
|
defaultOptions: []
|
|
799
842
|
});
|
|
800
|
-
function
|
|
843
|
+
function create14(context) {
|
|
801
844
|
if (!context.sourceCode.text.includes("Component")) return {};
|
|
802
845
|
const { ctx, listeners } = core.useComponentCollectorLegacy();
|
|
803
846
|
return {
|
|
@@ -819,25 +862,25 @@ function create13(context) {
|
|
|
819
862
|
}
|
|
820
863
|
};
|
|
821
864
|
}
|
|
822
|
-
var
|
|
823
|
-
var
|
|
865
|
+
var RULE_NAME15 = "no-clone-element";
|
|
866
|
+
var RULE_FEATURES15 = [];
|
|
824
867
|
var no_clone_element_default = createRule({
|
|
825
868
|
meta: {
|
|
826
869
|
type: "problem",
|
|
827
870
|
docs: {
|
|
828
871
|
description: "Disallow `cloneElement`.",
|
|
829
|
-
[Symbol.for("rule_features")]:
|
|
872
|
+
[Symbol.for("rule_features")]: RULE_FEATURES15
|
|
830
873
|
},
|
|
831
874
|
messages: {
|
|
832
875
|
noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead."
|
|
833
876
|
},
|
|
834
877
|
schema: []
|
|
835
878
|
},
|
|
836
|
-
name:
|
|
837
|
-
create:
|
|
879
|
+
name: RULE_NAME15,
|
|
880
|
+
create: create15,
|
|
838
881
|
defaultOptions: []
|
|
839
882
|
});
|
|
840
|
-
function
|
|
883
|
+
function create15(context) {
|
|
841
884
|
return {
|
|
842
885
|
CallExpression(node) {
|
|
843
886
|
if (!core.isCloneElementCall(context, node)) {
|
|
@@ -850,25 +893,25 @@ function create14(context) {
|
|
|
850
893
|
}
|
|
851
894
|
};
|
|
852
895
|
}
|
|
853
|
-
var
|
|
854
|
-
var
|
|
896
|
+
var RULE_NAME16 = "no-comment-textnodes";
|
|
897
|
+
var RULE_FEATURES16 = [];
|
|
855
898
|
var no_comment_textnodes_default = createRule({
|
|
856
899
|
meta: {
|
|
857
900
|
type: "problem",
|
|
858
901
|
docs: {
|
|
859
902
|
description: "Prevents comments from being inserted as text nodes.",
|
|
860
|
-
[Symbol.for("rule_features")]:
|
|
903
|
+
[Symbol.for("rule_features")]: RULE_FEATURES16
|
|
861
904
|
},
|
|
862
905
|
messages: {
|
|
863
906
|
noCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces."
|
|
864
907
|
},
|
|
865
908
|
schema: []
|
|
866
909
|
},
|
|
867
|
-
name:
|
|
868
|
-
create:
|
|
910
|
+
name: RULE_NAME16,
|
|
911
|
+
create: create16,
|
|
869
912
|
defaultOptions: []
|
|
870
913
|
});
|
|
871
|
-
function
|
|
914
|
+
function create16(context) {
|
|
872
915
|
function hasCommentLike(node) {
|
|
873
916
|
if (AST11__namespace.isOneOf([types.AST_NODE_TYPES.JSXAttribute, types.AST_NODE_TYPES.JSXExpressionContainer])(node.parent)) {
|
|
874
917
|
return false;
|
|
@@ -896,8 +939,8 @@ function create15(context) {
|
|
|
896
939
|
Literal: visitorFunction
|
|
897
940
|
};
|
|
898
941
|
}
|
|
899
|
-
var
|
|
900
|
-
var
|
|
942
|
+
var RULE_NAME17 = "no-complex-conditional-rendering";
|
|
943
|
+
var RULE_FEATURES17 = [
|
|
901
944
|
"EXP"
|
|
902
945
|
];
|
|
903
946
|
var no_complex_conditional_rendering_default = createRule({
|
|
@@ -905,18 +948,18 @@ var no_complex_conditional_rendering_default = createRule({
|
|
|
905
948
|
type: "problem",
|
|
906
949
|
docs: {
|
|
907
950
|
description: "Disallow complex conditional rendering in JSX expressions.",
|
|
908
|
-
[Symbol.for("rule_features")]:
|
|
951
|
+
[Symbol.for("rule_features")]: RULE_FEATURES17
|
|
909
952
|
},
|
|
910
953
|
messages: {
|
|
911
954
|
noComplexConditionalRendering: "Avoid complex conditional rendering. Extract the logic into separate elements or components."
|
|
912
955
|
},
|
|
913
956
|
schema: []
|
|
914
957
|
},
|
|
915
|
-
name:
|
|
916
|
-
create:
|
|
958
|
+
name: RULE_NAME17,
|
|
959
|
+
create: create17,
|
|
917
960
|
defaultOptions: []
|
|
918
961
|
});
|
|
919
|
-
function
|
|
962
|
+
function create17(context) {
|
|
920
963
|
const visitorFunction = (node) => {
|
|
921
964
|
const jsxExpContainer = node.parent?.parent;
|
|
922
965
|
if (!AST11__namespace.is(types.AST_NODE_TYPES.JSXExpressionContainer)(jsxExpContainer)) {
|
|
@@ -941,8 +984,8 @@ function create16(context) {
|
|
|
941
984
|
"JSXExpressionContainer > LogicalExpression[operator='||'] > LogicalExpression[operator='&&']": visitorFunction
|
|
942
985
|
};
|
|
943
986
|
}
|
|
944
|
-
var
|
|
945
|
-
var
|
|
987
|
+
var RULE_NAME18 = "no-component-will-mount";
|
|
988
|
+
var RULE_FEATURES18 = [
|
|
946
989
|
"MOD"
|
|
947
990
|
];
|
|
948
991
|
function isComponentWillMount(node) {
|
|
@@ -953,7 +996,7 @@ var no_component_will_mount_default = createRule({
|
|
|
953
996
|
type: "problem",
|
|
954
997
|
docs: {
|
|
955
998
|
description: "Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.",
|
|
956
|
-
[Symbol.for("rule_features")]:
|
|
999
|
+
[Symbol.for("rule_features")]: RULE_FEATURES18
|
|
957
1000
|
},
|
|
958
1001
|
fixable: "code",
|
|
959
1002
|
messages: {
|
|
@@ -961,11 +1004,11 @@ var no_component_will_mount_default = createRule({
|
|
|
961
1004
|
},
|
|
962
1005
|
schema: []
|
|
963
1006
|
},
|
|
964
|
-
name:
|
|
965
|
-
create:
|
|
1007
|
+
name: RULE_NAME18,
|
|
1008
|
+
create: create18,
|
|
966
1009
|
defaultOptions: []
|
|
967
1010
|
});
|
|
968
|
-
function
|
|
1011
|
+
function create18(context) {
|
|
969
1012
|
if (!context.sourceCode.text.includes("componentWillMount")) return {};
|
|
970
1013
|
const { ctx, listeners } = core.useComponentCollectorLegacy();
|
|
971
1014
|
return {
|
|
@@ -992,8 +1035,8 @@ function create17(context) {
|
|
|
992
1035
|
}
|
|
993
1036
|
};
|
|
994
1037
|
}
|
|
995
|
-
var
|
|
996
|
-
var
|
|
1038
|
+
var RULE_NAME19 = "no-component-will-receive-props";
|
|
1039
|
+
var RULE_FEATURES19 = [
|
|
997
1040
|
"MOD"
|
|
998
1041
|
];
|
|
999
1042
|
function isComponentWillUpdate(node) {
|
|
@@ -1004,7 +1047,7 @@ var no_component_will_receive_props_default = createRule({
|
|
|
1004
1047
|
type: "problem",
|
|
1005
1048
|
docs: {
|
|
1006
1049
|
description: "Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.",
|
|
1007
|
-
[Symbol.for("rule_features")]:
|
|
1050
|
+
[Symbol.for("rule_features")]: RULE_FEATURES19
|
|
1008
1051
|
},
|
|
1009
1052
|
fixable: "code",
|
|
1010
1053
|
messages: {
|
|
@@ -1012,11 +1055,11 @@ var no_component_will_receive_props_default = createRule({
|
|
|
1012
1055
|
},
|
|
1013
1056
|
schema: []
|
|
1014
1057
|
},
|
|
1015
|
-
name:
|
|
1016
|
-
create:
|
|
1058
|
+
name: RULE_NAME19,
|
|
1059
|
+
create: create19,
|
|
1017
1060
|
defaultOptions: []
|
|
1018
1061
|
});
|
|
1019
|
-
function
|
|
1062
|
+
function create19(context) {
|
|
1020
1063
|
if (!context.sourceCode.text.includes("componentWillReceiveProps")) return {};
|
|
1021
1064
|
const { ctx, listeners } = core.useComponentCollectorLegacy();
|
|
1022
1065
|
return {
|
|
@@ -1043,8 +1086,8 @@ function create18(context) {
|
|
|
1043
1086
|
}
|
|
1044
1087
|
};
|
|
1045
1088
|
}
|
|
1046
|
-
var
|
|
1047
|
-
var
|
|
1089
|
+
var RULE_NAME20 = "no-component-will-update";
|
|
1090
|
+
var RULE_FEATURES20 = [
|
|
1048
1091
|
"MOD"
|
|
1049
1092
|
];
|
|
1050
1093
|
function isComponentWillUpdate2(node) {
|
|
@@ -1055,7 +1098,7 @@ var no_component_will_update_default = createRule({
|
|
|
1055
1098
|
type: "problem",
|
|
1056
1099
|
docs: {
|
|
1057
1100
|
description: "Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`.",
|
|
1058
|
-
[Symbol.for("rule_features")]:
|
|
1101
|
+
[Symbol.for("rule_features")]: RULE_FEATURES20
|
|
1059
1102
|
},
|
|
1060
1103
|
fixable: "code",
|
|
1061
1104
|
messages: {
|
|
@@ -1063,11 +1106,11 @@ var no_component_will_update_default = createRule({
|
|
|
1063
1106
|
},
|
|
1064
1107
|
schema: []
|
|
1065
1108
|
},
|
|
1066
|
-
name:
|
|
1067
|
-
create:
|
|
1109
|
+
name: RULE_NAME20,
|
|
1110
|
+
create: create20,
|
|
1068
1111
|
defaultOptions: []
|
|
1069
1112
|
});
|
|
1070
|
-
function
|
|
1113
|
+
function create20(context) {
|
|
1071
1114
|
if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
|
|
1072
1115
|
const { ctx, listeners } = core.useComponentCollectorLegacy();
|
|
1073
1116
|
return {
|
|
@@ -1094,8 +1137,8 @@ function create19(context) {
|
|
|
1094
1137
|
}
|
|
1095
1138
|
};
|
|
1096
1139
|
}
|
|
1097
|
-
var
|
|
1098
|
-
var
|
|
1140
|
+
var RULE_NAME21 = "no-context-provider";
|
|
1141
|
+
var RULE_FEATURES21 = [
|
|
1099
1142
|
"MOD"
|
|
1100
1143
|
];
|
|
1101
1144
|
var no_context_provider_default = createRule({
|
|
@@ -1103,7 +1146,7 @@ var no_context_provider_default = createRule({
|
|
|
1103
1146
|
type: "problem",
|
|
1104
1147
|
docs: {
|
|
1105
1148
|
description: "Replace usages of `<Context.Provider>` with `<Context>`.",
|
|
1106
|
-
[Symbol.for("rule_features")]:
|
|
1149
|
+
[Symbol.for("rule_features")]: RULE_FEATURES21
|
|
1107
1150
|
},
|
|
1108
1151
|
fixable: "code",
|
|
1109
1152
|
messages: {
|
|
@@ -1111,11 +1154,11 @@ var no_context_provider_default = createRule({
|
|
|
1111
1154
|
},
|
|
1112
1155
|
schema: []
|
|
1113
1156
|
},
|
|
1114
|
-
name:
|
|
1115
|
-
create:
|
|
1157
|
+
name: RULE_NAME21,
|
|
1158
|
+
create: create21,
|
|
1116
1159
|
defaultOptions: []
|
|
1117
1160
|
});
|
|
1118
|
-
function
|
|
1161
|
+
function create21(context) {
|
|
1119
1162
|
if (!context.sourceCode.text.includes("Provider")) return {};
|
|
1120
1163
|
const { version: version2 } = shared.getSettingsFromContext(context);
|
|
1121
1164
|
if (compareVersions.compare(version2, "19.0.0", "<")) return {};
|
|
@@ -1147,25 +1190,25 @@ function create20(context) {
|
|
|
1147
1190
|
}
|
|
1148
1191
|
};
|
|
1149
1192
|
}
|
|
1150
|
-
var
|
|
1151
|
-
var
|
|
1193
|
+
var RULE_NAME22 = "no-create-ref";
|
|
1194
|
+
var RULE_FEATURES22 = [];
|
|
1152
1195
|
var no_create_ref_default = createRule({
|
|
1153
1196
|
meta: {
|
|
1154
1197
|
type: "problem",
|
|
1155
1198
|
docs: {
|
|
1156
1199
|
description: "Disallow `createRef` in function components.",
|
|
1157
|
-
[Symbol.for("rule_features")]:
|
|
1200
|
+
[Symbol.for("rule_features")]: RULE_FEATURES22
|
|
1158
1201
|
},
|
|
1159
1202
|
messages: {
|
|
1160
1203
|
noCreateRef: "[Deprecated] Use 'useRef' instead."
|
|
1161
1204
|
},
|
|
1162
1205
|
schema: []
|
|
1163
1206
|
},
|
|
1164
|
-
name:
|
|
1165
|
-
create:
|
|
1207
|
+
name: RULE_NAME22,
|
|
1208
|
+
create: create22,
|
|
1166
1209
|
defaultOptions: []
|
|
1167
1210
|
});
|
|
1168
|
-
function
|
|
1211
|
+
function create22(context) {
|
|
1169
1212
|
return {
|
|
1170
1213
|
CallExpression(node) {
|
|
1171
1214
|
if (core.isCreateRefCall(context, node) && AST11__namespace.findParentNode(node, core.isClassComponent) == null) {
|
|
@@ -1174,25 +1217,25 @@ function create21(context) {
|
|
|
1174
1217
|
}
|
|
1175
1218
|
};
|
|
1176
1219
|
}
|
|
1177
|
-
var
|
|
1178
|
-
var
|
|
1220
|
+
var RULE_NAME23 = "no-default-props";
|
|
1221
|
+
var RULE_FEATURES23 = [];
|
|
1179
1222
|
var no_default_props_default = createRule({
|
|
1180
1223
|
meta: {
|
|
1181
1224
|
type: "problem",
|
|
1182
1225
|
docs: {
|
|
1183
1226
|
description: "Disallow `defaultProps` property in favor of ES6 default parameters.",
|
|
1184
|
-
[Symbol.for("rule_features")]:
|
|
1227
|
+
[Symbol.for("rule_features")]: RULE_FEATURES23
|
|
1185
1228
|
},
|
|
1186
1229
|
messages: {
|
|
1187
1230
|
noDefaultProps: "[Deprecated] Use ES6 default parameters instead."
|
|
1188
1231
|
},
|
|
1189
1232
|
schema: []
|
|
1190
1233
|
},
|
|
1191
|
-
name:
|
|
1192
|
-
create:
|
|
1234
|
+
name: RULE_NAME23,
|
|
1235
|
+
create: create23,
|
|
1193
1236
|
defaultOptions: []
|
|
1194
1237
|
});
|
|
1195
|
-
function
|
|
1238
|
+
function create23(context) {
|
|
1196
1239
|
if (!context.sourceCode.text.includes("defaultProps")) return {};
|
|
1197
1240
|
return {
|
|
1198
1241
|
AssignmentExpression(node) {
|
|
@@ -1209,8 +1252,8 @@ function create22(context) {
|
|
|
1209
1252
|
if (!core.isComponentNameLoose(object.name)) {
|
|
1210
1253
|
return;
|
|
1211
1254
|
}
|
|
1212
|
-
const variable =
|
|
1213
|
-
const variableNode =
|
|
1255
|
+
const variable = VAR2__namespace.findVariable(object.name, context.sourceCode.getScope(node));
|
|
1256
|
+
const variableNode = VAR2__namespace.getVariableInitNode(variable, 0);
|
|
1214
1257
|
if (variableNode == null) return;
|
|
1215
1258
|
if (!AST11__namespace.isFunction(variableNode) && !core.isClassComponent(variableNode)) return;
|
|
1216
1259
|
context.report({ messageId: "noDefaultProps", node: property });
|
|
@@ -1226,8 +1269,8 @@ function create22(context) {
|
|
|
1226
1269
|
}
|
|
1227
1270
|
};
|
|
1228
1271
|
}
|
|
1229
|
-
var
|
|
1230
|
-
var
|
|
1272
|
+
var RULE_NAME24 = "no-direct-mutation-state";
|
|
1273
|
+
var RULE_FEATURES24 = [];
|
|
1231
1274
|
function isConstructorFunction(node) {
|
|
1232
1275
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.FunctionDeclaration, types.AST_NODE_TYPES.FunctionExpression])(node) && AST11__namespace.isMethodOrProperty(node.parent) && node.parent.key.type === types.AST_NODE_TYPES.Identifier && node.parent.key.name === "constructor";
|
|
1233
1276
|
}
|
|
@@ -1236,18 +1279,18 @@ var no_direct_mutation_state_default = createRule({
|
|
|
1236
1279
|
type: "problem",
|
|
1237
1280
|
docs: {
|
|
1238
1281
|
description: "Disallow direct mutation of `this.state`.",
|
|
1239
|
-
[Symbol.for("rule_features")]:
|
|
1282
|
+
[Symbol.for("rule_features")]: RULE_FEATURES24
|
|
1240
1283
|
},
|
|
1241
1284
|
messages: {
|
|
1242
1285
|
noDirectMutationState: "Do not mutate state directly. Use 'setState()' instead."
|
|
1243
1286
|
},
|
|
1244
1287
|
schema: []
|
|
1245
1288
|
},
|
|
1246
|
-
name:
|
|
1247
|
-
create:
|
|
1289
|
+
name: RULE_NAME24,
|
|
1290
|
+
create: create24,
|
|
1248
1291
|
defaultOptions: []
|
|
1249
1292
|
});
|
|
1250
|
-
function
|
|
1293
|
+
function create24(context) {
|
|
1251
1294
|
return {
|
|
1252
1295
|
AssignmentExpression(node) {
|
|
1253
1296
|
if (!core.isAssignmentToThisState(node)) return;
|
|
@@ -1268,25 +1311,25 @@ function create23(context) {
|
|
|
1268
1311
|
}
|
|
1269
1312
|
};
|
|
1270
1313
|
}
|
|
1271
|
-
var
|
|
1272
|
-
var
|
|
1314
|
+
var RULE_NAME25 = "no-duplicate-key";
|
|
1315
|
+
var RULE_FEATURES25 = [];
|
|
1273
1316
|
var no_duplicate_key_default = createRule({
|
|
1274
1317
|
meta: {
|
|
1275
1318
|
type: "problem",
|
|
1276
1319
|
docs: {
|
|
1277
1320
|
description: "Disallow duplicate `key` on elements in the same array or a list of `children`.",
|
|
1278
|
-
[Symbol.for("rule_features")]:
|
|
1321
|
+
[Symbol.for("rule_features")]: RULE_FEATURES25
|
|
1279
1322
|
},
|
|
1280
1323
|
messages: {
|
|
1281
1324
|
noDuplicateKey: "A key must be unique. '{{value}}' is duplicated."
|
|
1282
1325
|
},
|
|
1283
1326
|
schema: []
|
|
1284
1327
|
},
|
|
1285
|
-
name:
|
|
1286
|
-
create:
|
|
1328
|
+
name: RULE_NAME25,
|
|
1329
|
+
create: create25,
|
|
1287
1330
|
defaultOptions: []
|
|
1288
1331
|
});
|
|
1289
|
-
function
|
|
1332
|
+
function create25(context) {
|
|
1290
1333
|
if (!context.sourceCode.getText().includes("key=")) {
|
|
1291
1334
|
return {};
|
|
1292
1335
|
}
|
|
@@ -1350,8 +1393,8 @@ function create24(context) {
|
|
|
1350
1393
|
}
|
|
1351
1394
|
};
|
|
1352
1395
|
}
|
|
1353
|
-
var
|
|
1354
|
-
var
|
|
1396
|
+
var RULE_NAME26 = "no-forward-ref";
|
|
1397
|
+
var RULE_FEATURES26 = [
|
|
1355
1398
|
"MOD"
|
|
1356
1399
|
];
|
|
1357
1400
|
var no_forward_ref_default = createRule({
|
|
@@ -1359,7 +1402,7 @@ var no_forward_ref_default = createRule({
|
|
|
1359
1402
|
type: "problem",
|
|
1360
1403
|
docs: {
|
|
1361
1404
|
description: "Replaces usages of `forwardRef` with passing `ref` as a prop.",
|
|
1362
|
-
[Symbol.for("rule_features")]:
|
|
1405
|
+
[Symbol.for("rule_features")]: RULE_FEATURES26
|
|
1363
1406
|
},
|
|
1364
1407
|
fixable: "code",
|
|
1365
1408
|
messages: {
|
|
@@ -1367,11 +1410,11 @@ var no_forward_ref_default = createRule({
|
|
|
1367
1410
|
},
|
|
1368
1411
|
schema: []
|
|
1369
1412
|
},
|
|
1370
|
-
name:
|
|
1371
|
-
create:
|
|
1413
|
+
name: RULE_NAME26,
|
|
1414
|
+
create: create26,
|
|
1372
1415
|
defaultOptions: []
|
|
1373
1416
|
});
|
|
1374
|
-
function
|
|
1417
|
+
function create26(context) {
|
|
1375
1418
|
if (!context.sourceCode.text.includes("forwardRef")) {
|
|
1376
1419
|
return {};
|
|
1377
1420
|
}
|
|
@@ -1459,8 +1502,8 @@ function getComponentPropsFixes(context, fixer, node, typeArguments) {
|
|
|
1459
1502
|
...arg1 == null ? [] : [fixer.remove(arg1), fixer.removeRange([arg0.range[1], arg1.range[0]])]
|
|
1460
1503
|
];
|
|
1461
1504
|
}
|
|
1462
|
-
var
|
|
1463
|
-
var
|
|
1505
|
+
var RULE_NAME27 = "no-implicit-key";
|
|
1506
|
+
var RULE_FEATURES27 = [
|
|
1464
1507
|
"EXP"
|
|
1465
1508
|
];
|
|
1466
1509
|
var no_implicit_key_default = createRule({
|
|
@@ -1468,18 +1511,18 @@ var no_implicit_key_default = createRule({
|
|
|
1468
1511
|
type: "problem",
|
|
1469
1512
|
docs: {
|
|
1470
1513
|
description: "Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).",
|
|
1471
|
-
[Symbol.for("rule_features")]:
|
|
1514
|
+
[Symbol.for("rule_features")]: RULE_FEATURES27
|
|
1472
1515
|
},
|
|
1473
1516
|
messages: {
|
|
1474
1517
|
noImplicitKey: "Do not use implicit 'key' props."
|
|
1475
1518
|
},
|
|
1476
1519
|
schema: []
|
|
1477
1520
|
},
|
|
1478
|
-
name:
|
|
1479
|
-
create:
|
|
1521
|
+
name: RULE_NAME27,
|
|
1522
|
+
create: create27,
|
|
1480
1523
|
defaultOptions: []
|
|
1481
1524
|
});
|
|
1482
|
-
function
|
|
1525
|
+
function create27(context) {
|
|
1483
1526
|
return {
|
|
1484
1527
|
JSXOpeningElement(node) {
|
|
1485
1528
|
const initialScope = context.sourceCode.getScope(node);
|
|
@@ -1493,8 +1536,8 @@ function create26(context) {
|
|
|
1493
1536
|
}
|
|
1494
1537
|
};
|
|
1495
1538
|
}
|
|
1496
|
-
var
|
|
1497
|
-
var
|
|
1539
|
+
var RULE_NAME28 = "no-leaked-conditional-rendering";
|
|
1540
|
+
var RULE_FEATURES28 = [
|
|
1498
1541
|
"TSC"
|
|
1499
1542
|
];
|
|
1500
1543
|
var tsHelpers = {
|
|
@@ -1580,18 +1623,18 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1580
1623
|
type: "problem",
|
|
1581
1624
|
docs: {
|
|
1582
1625
|
description: "Prevents problematic leaked values from being rendered.",
|
|
1583
|
-
[Symbol.for("rule_features")]:
|
|
1626
|
+
[Symbol.for("rule_features")]: RULE_FEATURES28
|
|
1584
1627
|
},
|
|
1585
1628
|
messages: {
|
|
1586
1629
|
noLeakedConditionalRendering: "Potential leaked value {{value}} that might cause unintentionally rendered values or rendering crashes."
|
|
1587
1630
|
},
|
|
1588
1631
|
schema: []
|
|
1589
1632
|
},
|
|
1590
|
-
name:
|
|
1591
|
-
create:
|
|
1633
|
+
name: RULE_NAME28,
|
|
1634
|
+
create: create28,
|
|
1592
1635
|
defaultOptions: []
|
|
1593
1636
|
});
|
|
1594
|
-
function
|
|
1637
|
+
function create28(context) {
|
|
1595
1638
|
if (!context.sourceCode.text.includes("&&") && !context.sourceCode.text.includes("?")) return {};
|
|
1596
1639
|
const { version: version2 } = shared.getSettingsFromContext(context);
|
|
1597
1640
|
const allowedVariants = [
|
|
@@ -1615,7 +1658,7 @@ function create27(context) {
|
|
|
1615
1658
|
return getReportDescriptor(right);
|
|
1616
1659
|
}
|
|
1617
1660
|
const initialScope = context.sourceCode.getScope(left);
|
|
1618
|
-
const isLeftNan = left.type === types.AST_NODE_TYPES.Identifier && left.name === "NaN" ||
|
|
1661
|
+
const isLeftNan = left.type === types.AST_NODE_TYPES.Identifier && left.name === "NaN" || VAR2__namespace.toStaticValue({ kind: "lazy", node: left, initialScope }).value === "NaN";
|
|
1619
1662
|
if (isLeftNan) {
|
|
1620
1663
|
return {
|
|
1621
1664
|
messageId: "noLeakedConditionalRendering",
|
|
@@ -1637,7 +1680,7 @@ function create27(context) {
|
|
|
1637
1680
|
}).with({ type: types.AST_NODE_TYPES.ConditionalExpression }, ({ alternate, consequent }) => {
|
|
1638
1681
|
return getReportDescriptor(consequent) ?? getReportDescriptor(alternate);
|
|
1639
1682
|
}).with({ type: types.AST_NODE_TYPES.Identifier }, (n) => {
|
|
1640
|
-
const variable =
|
|
1683
|
+
const variable = VAR2__namespace.findVariable(n.name, context.sourceCode.getScope(n));
|
|
1641
1684
|
const variableDefNode = variable?.defs.at(0)?.node;
|
|
1642
1685
|
return tsPattern.match(variableDefNode).with({ init: tsPattern.P.select({ type: tsPattern.P.not(types.AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => eff._);
|
|
1643
1686
|
}).otherwise(() => eff._);
|
|
@@ -1648,25 +1691,25 @@ function create27(context) {
|
|
|
1648
1691
|
"JSXExpressionContainer > LogicalExpression": visitorFunction
|
|
1649
1692
|
};
|
|
1650
1693
|
}
|
|
1651
|
-
var
|
|
1652
|
-
var
|
|
1694
|
+
var RULE_NAME29 = "no-missing-component-display-name";
|
|
1695
|
+
var RULE_FEATURES29 = [];
|
|
1653
1696
|
var no_missing_component_display_name_default = createRule({
|
|
1654
1697
|
meta: {
|
|
1655
1698
|
type: "problem",
|
|
1656
1699
|
docs: {
|
|
1657
1700
|
description: "Enforces that all components have a `displayName` which can be used in devtools.",
|
|
1658
|
-
[Symbol.for("rule_features")]:
|
|
1701
|
+
[Symbol.for("rule_features")]: RULE_FEATURES29
|
|
1659
1702
|
},
|
|
1660
1703
|
messages: {
|
|
1661
1704
|
noMissingComponentDisplayName: "Add missing 'displayName' for component."
|
|
1662
1705
|
},
|
|
1663
1706
|
schema: []
|
|
1664
1707
|
},
|
|
1665
|
-
name:
|
|
1666
|
-
create:
|
|
1708
|
+
name: RULE_NAME29,
|
|
1709
|
+
create: create29,
|
|
1667
1710
|
defaultOptions: []
|
|
1668
1711
|
});
|
|
1669
|
-
function
|
|
1712
|
+
function create29(context) {
|
|
1670
1713
|
if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
|
|
1671
1714
|
const {
|
|
1672
1715
|
ctx,
|
|
@@ -1701,25 +1744,25 @@ function create28(context) {
|
|
|
1701
1744
|
}
|
|
1702
1745
|
};
|
|
1703
1746
|
}
|
|
1704
|
-
var
|
|
1705
|
-
var
|
|
1747
|
+
var RULE_NAME30 = "no-missing-context-display-name";
|
|
1748
|
+
var RULE_FEATURES30 = [];
|
|
1706
1749
|
var no_missing_context_display_name_default = createRule({
|
|
1707
1750
|
meta: {
|
|
1708
1751
|
type: "problem",
|
|
1709
1752
|
docs: {
|
|
1710
1753
|
description: "Enforces that all contexts have a `displayName` which can be used in devtools.",
|
|
1711
|
-
[Symbol.for("rule_features")]:
|
|
1754
|
+
[Symbol.for("rule_features")]: RULE_FEATURES30
|
|
1712
1755
|
},
|
|
1713
1756
|
messages: {
|
|
1714
1757
|
noMissingContextDisplayName: "Add missing 'displayName' for context."
|
|
1715
1758
|
},
|
|
1716
1759
|
schema: []
|
|
1717
1760
|
},
|
|
1718
|
-
name:
|
|
1719
|
-
create:
|
|
1761
|
+
name: RULE_NAME30,
|
|
1762
|
+
create: create30,
|
|
1720
1763
|
defaultOptions: []
|
|
1721
1764
|
});
|
|
1722
|
-
function
|
|
1765
|
+
function create30(context) {
|
|
1723
1766
|
if (!context.sourceCode.text.includes("createContext")) return {};
|
|
1724
1767
|
const createCalls = [];
|
|
1725
1768
|
const displayNameAssignments = [];
|
|
@@ -1757,14 +1800,14 @@ function create29(context) {
|
|
|
1757
1800
|
}
|
|
1758
1801
|
};
|
|
1759
1802
|
}
|
|
1760
|
-
var
|
|
1761
|
-
var
|
|
1803
|
+
var RULE_NAME31 = "no-missing-key";
|
|
1804
|
+
var RULE_FEATURES31 = [];
|
|
1762
1805
|
var no_missing_key_default = createRule({
|
|
1763
1806
|
meta: {
|
|
1764
1807
|
type: "problem",
|
|
1765
1808
|
docs: {
|
|
1766
1809
|
description: "Disallow missing `key` on items in list rendering.",
|
|
1767
|
-
[Symbol.for("rule_features")]:
|
|
1810
|
+
[Symbol.for("rule_features")]: RULE_FEATURES31
|
|
1768
1811
|
},
|
|
1769
1812
|
messages: {
|
|
1770
1813
|
missingKey: "Missing 'key' for element when rendering list.",
|
|
@@ -1772,11 +1815,11 @@ var no_missing_key_default = createRule({
|
|
|
1772
1815
|
},
|
|
1773
1816
|
schema: []
|
|
1774
1817
|
},
|
|
1775
|
-
name:
|
|
1776
|
-
create:
|
|
1818
|
+
name: RULE_NAME31,
|
|
1819
|
+
create: create31,
|
|
1777
1820
|
defaultOptions: []
|
|
1778
1821
|
});
|
|
1779
|
-
function
|
|
1822
|
+
function create31(context) {
|
|
1780
1823
|
const report = kit.createReport(context);
|
|
1781
1824
|
const state = { isWithinChildrenToArray: false };
|
|
1782
1825
|
function checkIteratorElement(node) {
|
|
@@ -1889,25 +1932,25 @@ function create30(context) {
|
|
|
1889
1932
|
function isArrayFromCall(node) {
|
|
1890
1933
|
return node.type === types.AST_NODE_TYPES.CallExpression && node.callee.type === types.AST_NODE_TYPES.MemberExpression && node.callee.property.type === types.AST_NODE_TYPES.Identifier && node.callee.property.name === "from";
|
|
1891
1934
|
}
|
|
1892
|
-
var
|
|
1893
|
-
var
|
|
1935
|
+
var RULE_NAME32 = "no-nested-component-definitions";
|
|
1936
|
+
var RULE_FEATURES32 = [];
|
|
1894
1937
|
var no_nested_component_definitions_default = createRule({
|
|
1895
1938
|
meta: {
|
|
1896
1939
|
type: "problem",
|
|
1897
1940
|
docs: {
|
|
1898
1941
|
description: "Disallow nesting component definitions inside other components.",
|
|
1899
|
-
[Symbol.for("rule_features")]:
|
|
1942
|
+
[Symbol.for("rule_features")]: RULE_FEATURES32
|
|
1900
1943
|
},
|
|
1901
1944
|
messages: {
|
|
1902
1945
|
noNestedComponentDefinitions: "Do not nest component definitions inside other components or props. {{suggestion}}"
|
|
1903
1946
|
},
|
|
1904
1947
|
schema: []
|
|
1905
1948
|
},
|
|
1906
|
-
name:
|
|
1907
|
-
create:
|
|
1949
|
+
name: RULE_NAME32,
|
|
1950
|
+
create: create32,
|
|
1908
1951
|
defaultOptions: []
|
|
1909
1952
|
});
|
|
1910
|
-
function
|
|
1953
|
+
function create32(context) {
|
|
1911
1954
|
const hint = core.ERComponentHint.SkipMapCallback | core.ERComponentHint.SkipNullLiteral | core.ERComponentHint.SkipUndefined | core.ERComponentHint.SkipBooleanLiteral | core.ERComponentHint.SkipStringLiteral | core.ERComponentHint.SkipNumberLiteral | core.ERComponentHint.StrictLogical | core.ERComponentHint.StrictConditional;
|
|
1912
1955
|
const collector = core.useComponentCollector(context, { hint });
|
|
1913
1956
|
const collectorLegacy = core.useComponentCollectorLegacy();
|
|
@@ -2003,25 +2046,25 @@ function isInsideCreateElementProps(context, node) {
|
|
|
2003
2046
|
if (prop == null) return false;
|
|
2004
2047
|
return prop === call.arguments[1];
|
|
2005
2048
|
}
|
|
2006
|
-
var
|
|
2007
|
-
var
|
|
2049
|
+
var RULE_NAME33 = "no-prop-types";
|
|
2050
|
+
var RULE_FEATURES33 = [];
|
|
2008
2051
|
var no_prop_types_default = createRule({
|
|
2009
2052
|
meta: {
|
|
2010
2053
|
type: "problem",
|
|
2011
2054
|
docs: {
|
|
2012
2055
|
description: "Disallow `propTypes` in favor of TypeScript or another type-checking solution.",
|
|
2013
|
-
[Symbol.for("rule_features")]:
|
|
2056
|
+
[Symbol.for("rule_features")]: RULE_FEATURES33
|
|
2014
2057
|
},
|
|
2015
2058
|
messages: {
|
|
2016
2059
|
noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead."
|
|
2017
2060
|
},
|
|
2018
2061
|
schema: []
|
|
2019
2062
|
},
|
|
2020
|
-
name:
|
|
2021
|
-
create:
|
|
2063
|
+
name: RULE_NAME33,
|
|
2064
|
+
create: create33,
|
|
2022
2065
|
defaultOptions: []
|
|
2023
2066
|
});
|
|
2024
|
-
function
|
|
2067
|
+
function create33(context) {
|
|
2025
2068
|
if (!context.sourceCode.text.includes("propTypes")) {
|
|
2026
2069
|
return {};
|
|
2027
2070
|
}
|
|
@@ -2040,8 +2083,8 @@ function create32(context) {
|
|
|
2040
2083
|
if (!core.isComponentNameLoose(object.name)) {
|
|
2041
2084
|
return;
|
|
2042
2085
|
}
|
|
2043
|
-
const variable =
|
|
2044
|
-
const variableNode =
|
|
2086
|
+
const variable = VAR2__namespace.findVariable(object.name, context.sourceCode.getScope(node));
|
|
2087
|
+
const variableNode = VAR2__namespace.getVariableInitNode(variable, 0);
|
|
2045
2088
|
if (variableNode != null && (AST11__namespace.isFunction(variableNode) || core.isClassComponent(variableNode))) {
|
|
2046
2089
|
context.report({ messageId: "noPropTypes", node: property });
|
|
2047
2090
|
}
|
|
@@ -2057,8 +2100,8 @@ function create32(context) {
|
|
|
2057
2100
|
}
|
|
2058
2101
|
};
|
|
2059
2102
|
}
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2103
|
+
var RULE_NAME34 = "no-redundant-should-component-update";
|
|
2104
|
+
var RULE_FEATURES34 = [];
|
|
2062
2105
|
function isShouldComponentUpdate(node) {
|
|
2063
2106
|
return AST11__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
|
|
2064
2107
|
}
|
|
@@ -2067,18 +2110,18 @@ var no_redundant_should_component_update_default = createRule({
|
|
|
2067
2110
|
type: "problem",
|
|
2068
2111
|
docs: {
|
|
2069
2112
|
description: "Disallow `shouldComponentUpdate` when extending `React.PureComponent`.",
|
|
2070
|
-
[Symbol.for("rule_features")]:
|
|
2113
|
+
[Symbol.for("rule_features")]: RULE_FEATURES34
|
|
2071
2114
|
},
|
|
2072
2115
|
messages: {
|
|
2073
2116
|
noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'."
|
|
2074
2117
|
},
|
|
2075
2118
|
schema: []
|
|
2076
2119
|
},
|
|
2077
|
-
name:
|
|
2078
|
-
create:
|
|
2120
|
+
name: RULE_NAME34,
|
|
2121
|
+
create: create34,
|
|
2079
2122
|
defaultOptions: []
|
|
2080
2123
|
});
|
|
2081
|
-
function
|
|
2124
|
+
function create34(context) {
|
|
2082
2125
|
if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
|
|
2083
2126
|
const { ctx, listeners } = core.useComponentCollectorLegacy();
|
|
2084
2127
|
return {
|
|
@@ -2105,8 +2148,8 @@ function create33(context) {
|
|
|
2105
2148
|
}
|
|
2106
2149
|
};
|
|
2107
2150
|
}
|
|
2108
|
-
var
|
|
2109
|
-
var
|
|
2151
|
+
var RULE_NAME35 = "no-set-state-in-component-did-mount";
|
|
2152
|
+
var RULE_FEATURES35 = [];
|
|
2110
2153
|
function isComponentDidMount(node) {
|
|
2111
2154
|
return AST11__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
2112
2155
|
}
|
|
@@ -2115,18 +2158,18 @@ var no_set_state_in_component_did_mount_default = createRule({
|
|
|
2115
2158
|
type: "problem",
|
|
2116
2159
|
docs: {
|
|
2117
2160
|
description: "Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks.",
|
|
2118
|
-
[Symbol.for("rule_features")]:
|
|
2161
|
+
[Symbol.for("rule_features")]: RULE_FEATURES35
|
|
2119
2162
|
},
|
|
2120
2163
|
messages: {
|
|
2121
2164
|
noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions, such as callbacks."
|
|
2122
2165
|
},
|
|
2123
2166
|
schema: []
|
|
2124
2167
|
},
|
|
2125
|
-
name:
|
|
2126
|
-
create:
|
|
2168
|
+
name: RULE_NAME35,
|
|
2169
|
+
create: create35,
|
|
2127
2170
|
defaultOptions: []
|
|
2128
2171
|
});
|
|
2129
|
-
function
|
|
2172
|
+
function create35(context) {
|
|
2130
2173
|
if (!context.sourceCode.text.includes("componentDidMount")) return {};
|
|
2131
2174
|
return {
|
|
2132
2175
|
CallExpression(node) {
|
|
@@ -2147,8 +2190,8 @@ function create34(context) {
|
|
|
2147
2190
|
}
|
|
2148
2191
|
};
|
|
2149
2192
|
}
|
|
2150
|
-
var
|
|
2151
|
-
var
|
|
2193
|
+
var RULE_NAME36 = "no-set-state-in-component-did-update";
|
|
2194
|
+
var RULE_FEATURES36 = [];
|
|
2152
2195
|
function isComponentDidUpdate(node) {
|
|
2153
2196
|
return AST11__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
|
|
2154
2197
|
}
|
|
@@ -2157,18 +2200,18 @@ var no_set_state_in_component_did_update_default = createRule({
|
|
|
2157
2200
|
type: "problem",
|
|
2158
2201
|
docs: {
|
|
2159
2202
|
description: "Disallows calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks.",
|
|
2160
|
-
[Symbol.for("rule_features")]:
|
|
2203
|
+
[Symbol.for("rule_features")]: RULE_FEATURES36
|
|
2161
2204
|
},
|
|
2162
2205
|
messages: {
|
|
2163
2206
|
noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions, such as callbacks."
|
|
2164
2207
|
},
|
|
2165
2208
|
schema: []
|
|
2166
2209
|
},
|
|
2167
|
-
name:
|
|
2168
|
-
create:
|
|
2210
|
+
name: RULE_NAME36,
|
|
2211
|
+
create: create36,
|
|
2169
2212
|
defaultOptions: []
|
|
2170
2213
|
});
|
|
2171
|
-
function
|
|
2214
|
+
function create36(context) {
|
|
2172
2215
|
if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
|
|
2173
2216
|
return {
|
|
2174
2217
|
CallExpression(node) {
|
|
@@ -2189,8 +2232,8 @@ function create35(context) {
|
|
|
2189
2232
|
}
|
|
2190
2233
|
};
|
|
2191
2234
|
}
|
|
2192
|
-
var
|
|
2193
|
-
var
|
|
2235
|
+
var RULE_NAME37 = "no-set-state-in-component-will-update";
|
|
2236
|
+
var RULE_FEATURES37 = [];
|
|
2194
2237
|
function isComponentWillUpdate3(node) {
|
|
2195
2238
|
return AST11__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
2196
2239
|
}
|
|
@@ -2199,18 +2242,18 @@ var no_set_state_in_component_will_update_default = createRule({
|
|
|
2199
2242
|
type: "problem",
|
|
2200
2243
|
docs: {
|
|
2201
2244
|
description: "Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.",
|
|
2202
|
-
[Symbol.for("rule_features")]:
|
|
2245
|
+
[Symbol.for("rule_features")]: RULE_FEATURES37
|
|
2203
2246
|
},
|
|
2204
2247
|
messages: {
|
|
2205
2248
|
noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions, such as callbacks."
|
|
2206
2249
|
},
|
|
2207
2250
|
schema: []
|
|
2208
2251
|
},
|
|
2209
|
-
name:
|
|
2210
|
-
create:
|
|
2252
|
+
name: RULE_NAME37,
|
|
2253
|
+
create: create37,
|
|
2211
2254
|
defaultOptions: []
|
|
2212
2255
|
});
|
|
2213
|
-
function
|
|
2256
|
+
function create37(context) {
|
|
2214
2257
|
if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
|
|
2215
2258
|
return {
|
|
2216
2259
|
CallExpression(node) {
|
|
@@ -2231,8 +2274,8 @@ function create36(context) {
|
|
|
2231
2274
|
}
|
|
2232
2275
|
};
|
|
2233
2276
|
}
|
|
2234
|
-
var
|
|
2235
|
-
var
|
|
2277
|
+
var RULE_NAME38 = "no-string-refs";
|
|
2278
|
+
var RULE_FEATURES38 = [];
|
|
2236
2279
|
function containsStringLiteral({ value }) {
|
|
2237
2280
|
return value?.type === types.AST_NODE_TYPES.Literal && typeof value.value === "string";
|
|
2238
2281
|
}
|
|
@@ -2250,18 +2293,18 @@ var no_string_refs_default = createRule({
|
|
|
2250
2293
|
type: "problem",
|
|
2251
2294
|
docs: {
|
|
2252
2295
|
description: "Disallow deprecated string `refs`.",
|
|
2253
|
-
[Symbol.for("rule_features")]:
|
|
2296
|
+
[Symbol.for("rule_features")]: RULE_FEATURES38
|
|
2254
2297
|
},
|
|
2255
2298
|
messages: {
|
|
2256
2299
|
noStringRefs: "[Deprecated] Use callback refs instead."
|
|
2257
2300
|
},
|
|
2258
2301
|
schema: []
|
|
2259
2302
|
},
|
|
2260
|
-
name:
|
|
2261
|
-
create:
|
|
2303
|
+
name: RULE_NAME38,
|
|
2304
|
+
create: create38,
|
|
2262
2305
|
defaultOptions: []
|
|
2263
2306
|
});
|
|
2264
|
-
function
|
|
2307
|
+
function create38(context) {
|
|
2265
2308
|
return {
|
|
2266
2309
|
JSXAttribute(node) {
|
|
2267
2310
|
if (node.name.name !== "ref") {
|
|
@@ -2276,8 +2319,8 @@ function create37(context) {
|
|
|
2276
2319
|
}
|
|
2277
2320
|
};
|
|
2278
2321
|
}
|
|
2279
|
-
var
|
|
2280
|
-
var
|
|
2322
|
+
var RULE_NAME39 = "no-unsafe-component-will-mount";
|
|
2323
|
+
var RULE_FEATURES39 = [];
|
|
2281
2324
|
function isUnsafeComponentWillMount(node) {
|
|
2282
2325
|
return AST11__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
|
|
2283
2326
|
}
|
|
@@ -2286,18 +2329,18 @@ var no_unsafe_component_will_mount_default = createRule({
|
|
|
2286
2329
|
type: "problem",
|
|
2287
2330
|
docs: {
|
|
2288
2331
|
description: "Warns the usage of `UNSAFE_componentWillMount` in class components.",
|
|
2289
|
-
[Symbol.for("rule_features")]:
|
|
2332
|
+
[Symbol.for("rule_features")]: RULE_FEATURES39
|
|
2290
2333
|
},
|
|
2291
2334
|
messages: {
|
|
2292
2335
|
noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'."
|
|
2293
2336
|
},
|
|
2294
2337
|
schema: []
|
|
2295
2338
|
},
|
|
2296
|
-
name:
|
|
2297
|
-
create:
|
|
2339
|
+
name: RULE_NAME39,
|
|
2340
|
+
create: create39,
|
|
2298
2341
|
defaultOptions: []
|
|
2299
2342
|
});
|
|
2300
|
-
function
|
|
2343
|
+
function create39(context) {
|
|
2301
2344
|
if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
|
|
2302
2345
|
const { ctx, listeners } = core.useComponentCollectorLegacy();
|
|
2303
2346
|
return {
|
|
@@ -2318,8 +2361,8 @@ function create38(context) {
|
|
|
2318
2361
|
}
|
|
2319
2362
|
};
|
|
2320
2363
|
}
|
|
2321
|
-
var
|
|
2322
|
-
var
|
|
2364
|
+
var RULE_NAME40 = "no-unsafe-component-will-receive-props";
|
|
2365
|
+
var RULE_FEATURES40 = [];
|
|
2323
2366
|
function isUnsafeComponentWillReceiveProps(node) {
|
|
2324
2367
|
return AST11__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
|
|
2325
2368
|
}
|
|
@@ -2328,18 +2371,18 @@ var no_unsafe_component_will_receive_props_default = createRule({
|
|
|
2328
2371
|
type: "problem",
|
|
2329
2372
|
docs: {
|
|
2330
2373
|
description: "Warns the usage of `UNSAFE_componentWillReceiveProps` in class components.",
|
|
2331
|
-
[Symbol.for("rule_features")]:
|
|
2374
|
+
[Symbol.for("rule_features")]: RULE_FEATURES40
|
|
2332
2375
|
},
|
|
2333
2376
|
messages: {
|
|
2334
2377
|
noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'."
|
|
2335
2378
|
},
|
|
2336
2379
|
schema: []
|
|
2337
2380
|
},
|
|
2338
|
-
name:
|
|
2339
|
-
create:
|
|
2381
|
+
name: RULE_NAME40,
|
|
2382
|
+
create: create40,
|
|
2340
2383
|
defaultOptions: []
|
|
2341
2384
|
});
|
|
2342
|
-
function
|
|
2385
|
+
function create40(context) {
|
|
2343
2386
|
if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) {
|
|
2344
2387
|
return {};
|
|
2345
2388
|
}
|
|
@@ -2362,8 +2405,8 @@ function create39(context) {
|
|
|
2362
2405
|
}
|
|
2363
2406
|
};
|
|
2364
2407
|
}
|
|
2365
|
-
var
|
|
2366
|
-
var
|
|
2408
|
+
var RULE_NAME41 = "no-unsafe-component-will-update";
|
|
2409
|
+
var RULE_FEATURES41 = [];
|
|
2367
2410
|
function isUnsafeComponentWillUpdate(node) {
|
|
2368
2411
|
return AST11__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
|
|
2369
2412
|
}
|
|
@@ -2372,18 +2415,18 @@ var no_unsafe_component_will_update_default = createRule({
|
|
|
2372
2415
|
type: "problem",
|
|
2373
2416
|
docs: {
|
|
2374
2417
|
description: "Warns the usage of `UNSAFE_componentWillUpdate` in class components.",
|
|
2375
|
-
[Symbol.for("rule_features")]:
|
|
2418
|
+
[Symbol.for("rule_features")]: RULE_FEATURES41
|
|
2376
2419
|
},
|
|
2377
2420
|
messages: {
|
|
2378
2421
|
noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'."
|
|
2379
2422
|
},
|
|
2380
2423
|
schema: []
|
|
2381
2424
|
},
|
|
2382
|
-
name:
|
|
2383
|
-
create:
|
|
2425
|
+
name: RULE_NAME41,
|
|
2426
|
+
create: create41,
|
|
2384
2427
|
defaultOptions: []
|
|
2385
2428
|
});
|
|
2386
|
-
function
|
|
2429
|
+
function create41(context) {
|
|
2387
2430
|
if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
|
|
2388
2431
|
const { ctx, listeners } = core.useComponentCollectorLegacy();
|
|
2389
2432
|
return {
|
|
@@ -2404,25 +2447,25 @@ function create40(context) {
|
|
|
2404
2447
|
}
|
|
2405
2448
|
};
|
|
2406
2449
|
}
|
|
2407
|
-
var
|
|
2408
|
-
var
|
|
2450
|
+
var RULE_NAME42 = "no-unstable-context-value";
|
|
2451
|
+
var RULE_FEATURES42 = [];
|
|
2409
2452
|
var no_unstable_context_value_default = createRule({
|
|
2410
2453
|
meta: {
|
|
2411
2454
|
type: "problem",
|
|
2412
2455
|
docs: {
|
|
2413
2456
|
description: "Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`.",
|
|
2414
|
-
[Symbol.for("rule_features")]:
|
|
2457
|
+
[Symbol.for("rule_features")]: RULE_FEATURES42
|
|
2415
2458
|
},
|
|
2416
2459
|
messages: {
|
|
2417
2460
|
unstableContextValue: "A/an '{{type}}' passed as the value prop to the context provider should not be constructed. It will change on every render. {{suggestion}}"
|
|
2418
2461
|
},
|
|
2419
2462
|
schema: []
|
|
2420
2463
|
},
|
|
2421
|
-
name:
|
|
2422
|
-
create:
|
|
2464
|
+
name: RULE_NAME42,
|
|
2465
|
+
create: create42,
|
|
2423
2466
|
defaultOptions: []
|
|
2424
2467
|
});
|
|
2425
|
-
function
|
|
2468
|
+
function create42(context) {
|
|
2426
2469
|
const { version: version2 } = shared.getSettingsFromContext(context);
|
|
2427
2470
|
const isReact18OrBelow = compareVersions.compare(version2, "19.0.0", "<");
|
|
2428
2471
|
const { ctx, listeners } = core.useComponentCollector(context);
|
|
@@ -2444,7 +2487,7 @@ function create41(context) {
|
|
|
2444
2487
|
if (value?.type !== types.AST_NODE_TYPES.JSXExpressionContainer) return;
|
|
2445
2488
|
const valueExpression = value.expression;
|
|
2446
2489
|
const initialScope = context.sourceCode.getScope(valueExpression);
|
|
2447
|
-
const construction =
|
|
2490
|
+
const construction = VAR2__namespace.getValueConstruction(valueExpression, initialScope);
|
|
2448
2491
|
if (construction == null) return;
|
|
2449
2492
|
if (core.isReactHookCall(construction.node)) {
|
|
2450
2493
|
return;
|
|
@@ -2477,25 +2520,25 @@ function isContextName(name5, isReact18OrBelow) {
|
|
|
2477
2520
|
}
|
|
2478
2521
|
return false;
|
|
2479
2522
|
}
|
|
2480
|
-
var
|
|
2481
|
-
var
|
|
2523
|
+
var RULE_NAME43 = "no-unstable-default-props";
|
|
2524
|
+
var RULE_FEATURES43 = [];
|
|
2482
2525
|
var no_unstable_default_props_default = createRule({
|
|
2483
2526
|
meta: {
|
|
2484
2527
|
type: "problem",
|
|
2485
2528
|
docs: {
|
|
2486
2529
|
description: "Prevents using referential-type values as default props in object destructuring.",
|
|
2487
|
-
[Symbol.for("rule_features")]:
|
|
2530
|
+
[Symbol.for("rule_features")]: RULE_FEATURES43
|
|
2488
2531
|
},
|
|
2489
2532
|
messages: {
|
|
2490
2533
|
noUnstableDefaultProps: "A/an '{{forbiddenType}}' as default prop. This could lead to potential infinite render loop in React. Use a variable instead of '{{forbiddenType}}'."
|
|
2491
2534
|
},
|
|
2492
2535
|
schema: []
|
|
2493
2536
|
},
|
|
2494
|
-
name:
|
|
2495
|
-
create:
|
|
2537
|
+
name: RULE_NAME43,
|
|
2538
|
+
create: create43,
|
|
2496
2539
|
defaultOptions: []
|
|
2497
2540
|
});
|
|
2498
|
-
function
|
|
2541
|
+
function create43(context) {
|
|
2499
2542
|
const { ctx, listeners } = core.useComponentCollector(context);
|
|
2500
2543
|
const declarators = /* @__PURE__ */ new Map();
|
|
2501
2544
|
return {
|
|
@@ -2518,10 +2561,10 @@ function create42(context) {
|
|
|
2518
2561
|
const { value } = prop;
|
|
2519
2562
|
const { right } = value;
|
|
2520
2563
|
const initialScope = context.sourceCode.getScope(value);
|
|
2521
|
-
const construction =
|
|
2564
|
+
const construction = VAR2__namespace.getValueConstruction(
|
|
2522
2565
|
value,
|
|
2523
2566
|
initialScope,
|
|
2524
|
-
|
|
2567
|
+
VAR2__namespace.ValueConstructionHint.StrictCallExpression
|
|
2525
2568
|
);
|
|
2526
2569
|
if (construction == null) {
|
|
2527
2570
|
continue;
|
|
@@ -2551,8 +2594,8 @@ function create42(context) {
|
|
|
2551
2594
|
}
|
|
2552
2595
|
};
|
|
2553
2596
|
}
|
|
2554
|
-
var
|
|
2555
|
-
var
|
|
2597
|
+
var RULE_NAME44 = "no-unused-class-component-members";
|
|
2598
|
+
var RULE_FEATURES44 = [];
|
|
2556
2599
|
var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
|
|
2557
2600
|
"componentDidCatch",
|
|
2558
2601
|
"componentDidMount",
|
|
@@ -2578,18 +2621,18 @@ var no_unused_class_component_members_default = createRule({
|
|
|
2578
2621
|
type: "problem",
|
|
2579
2622
|
docs: {
|
|
2580
2623
|
description: "Warns unused class component methods and properties.",
|
|
2581
|
-
[Symbol.for("rule_features")]:
|
|
2624
|
+
[Symbol.for("rule_features")]: RULE_FEATURES44
|
|
2582
2625
|
},
|
|
2583
2626
|
messages: {
|
|
2584
2627
|
noUnusedClassComponentMembers: "Unused method or property '{{methodName}}'' of class '{{className}}'."
|
|
2585
2628
|
},
|
|
2586
2629
|
schema: []
|
|
2587
2630
|
},
|
|
2588
|
-
name:
|
|
2589
|
-
create:
|
|
2631
|
+
name: RULE_NAME44,
|
|
2632
|
+
create: create44,
|
|
2590
2633
|
defaultOptions: []
|
|
2591
2634
|
});
|
|
2592
|
-
function
|
|
2635
|
+
function create44(context) {
|
|
2593
2636
|
const classEntries = [];
|
|
2594
2637
|
const methodEntries = [];
|
|
2595
2638
|
const propertyDefs = /* @__PURE__ */ new WeakMap();
|
|
@@ -2699,8 +2742,8 @@ function create43(context) {
|
|
|
2699
2742
|
}
|
|
2700
2743
|
};
|
|
2701
2744
|
}
|
|
2702
|
-
var
|
|
2703
|
-
var
|
|
2745
|
+
var RULE_NAME45 = "no-unused-state";
|
|
2746
|
+
var RULE_FEATURES45 = [];
|
|
2704
2747
|
function isKeyLiteral3(node, key) {
|
|
2705
2748
|
return tsPattern.match(key).with({ type: types.AST_NODE_TYPES.Literal }, eff.constTrue).with({ type: types.AST_NODE_TYPES.TemplateLiteral, expressions: [] }, eff.constTrue).with({ type: types.AST_NODE_TYPES.Identifier }, () => !node.computed).otherwise(eff.constFalse);
|
|
2706
2749
|
}
|
|
@@ -2709,18 +2752,18 @@ var no_unused_state_default = createRule({
|
|
|
2709
2752
|
type: "problem",
|
|
2710
2753
|
docs: {
|
|
2711
2754
|
description: "Warns unused class component state.",
|
|
2712
|
-
[Symbol.for("rule_features")]:
|
|
2755
|
+
[Symbol.for("rule_features")]: RULE_FEATURES45
|
|
2713
2756
|
},
|
|
2714
2757
|
messages: {
|
|
2715
2758
|
noUnusedState: "Unused class component state in '{{className}}'"
|
|
2716
2759
|
},
|
|
2717
2760
|
schema: []
|
|
2718
2761
|
},
|
|
2719
|
-
name:
|
|
2720
|
-
create:
|
|
2762
|
+
name: RULE_NAME45,
|
|
2763
|
+
create: create45,
|
|
2721
2764
|
defaultOptions: []
|
|
2722
2765
|
});
|
|
2723
|
-
function
|
|
2766
|
+
function create45(context) {
|
|
2724
2767
|
const classEntries = [];
|
|
2725
2768
|
const methodEntries = [];
|
|
2726
2769
|
const constructorEntries = [];
|
|
@@ -2854,8 +2897,8 @@ function create44(context) {
|
|
|
2854
2897
|
}
|
|
2855
2898
|
};
|
|
2856
2899
|
}
|
|
2857
|
-
var
|
|
2858
|
-
var
|
|
2900
|
+
var RULE_NAME46 = "no-use-context";
|
|
2901
|
+
var RULE_FEATURES46 = [
|
|
2859
2902
|
"MOD"
|
|
2860
2903
|
];
|
|
2861
2904
|
var no_use_context_default = createRule({
|
|
@@ -2863,7 +2906,7 @@ var no_use_context_default = createRule({
|
|
|
2863
2906
|
type: "problem",
|
|
2864
2907
|
docs: {
|
|
2865
2908
|
description: "Replaces usages of `useContext` with `use`.",
|
|
2866
|
-
[Symbol.for("rule_features")]:
|
|
2909
|
+
[Symbol.for("rule_features")]: RULE_FEATURES46
|
|
2867
2910
|
},
|
|
2868
2911
|
fixable: "code",
|
|
2869
2912
|
messages: {
|
|
@@ -2871,11 +2914,11 @@ var no_use_context_default = createRule({
|
|
|
2871
2914
|
},
|
|
2872
2915
|
schema: []
|
|
2873
2916
|
},
|
|
2874
|
-
name:
|
|
2875
|
-
create:
|
|
2917
|
+
name: RULE_NAME46,
|
|
2918
|
+
create: create46,
|
|
2876
2919
|
defaultOptions: []
|
|
2877
2920
|
});
|
|
2878
|
-
function
|
|
2921
|
+
function create46(context) {
|
|
2879
2922
|
if (!context.sourceCode.text.includes("useContext")) return {};
|
|
2880
2923
|
const settings4 = shared.getSettingsFromContext(context);
|
|
2881
2924
|
const useContextAlias = /* @__PURE__ */ new Set();
|
|
@@ -2953,25 +2996,25 @@ function getAssociatedTokens(context, node) {
|
|
|
2953
2996
|
return tokens;
|
|
2954
2997
|
}
|
|
2955
2998
|
}
|
|
2956
|
-
var
|
|
2957
|
-
var
|
|
2999
|
+
var RULE_NAME47 = "no-useless-forward-ref";
|
|
3000
|
+
var RULE_FEATURES47 = [];
|
|
2958
3001
|
var no_useless_forward_ref_default = createRule({
|
|
2959
3002
|
meta: {
|
|
2960
3003
|
type: "problem",
|
|
2961
3004
|
docs: {
|
|
2962
3005
|
description: "Disallow useless `forwardRef` calls on components that don't use `ref`s.",
|
|
2963
|
-
[Symbol.for("rule_features")]:
|
|
3006
|
+
[Symbol.for("rule_features")]: RULE_FEATURES47
|
|
2964
3007
|
},
|
|
2965
3008
|
messages: {
|
|
2966
3009
|
noUselessForwardRef: "A 'forwardRef' is used with this component but no 'ref' parameter is set."
|
|
2967
3010
|
},
|
|
2968
3011
|
schema: []
|
|
2969
3012
|
},
|
|
2970
|
-
name:
|
|
2971
|
-
create:
|
|
3013
|
+
name: RULE_NAME47,
|
|
3014
|
+
create: create47,
|
|
2972
3015
|
defaultOptions: []
|
|
2973
3016
|
});
|
|
2974
|
-
function
|
|
3017
|
+
function create47(context) {
|
|
2975
3018
|
return {
|
|
2976
3019
|
CallExpression(node) {
|
|
2977
3020
|
if (!core.isForwardRefCall(context, node)) {
|
|
@@ -2992,7 +3035,7 @@ function create46(context) {
|
|
|
2992
3035
|
}
|
|
2993
3036
|
};
|
|
2994
3037
|
}
|
|
2995
|
-
var
|
|
3038
|
+
var RULE_NAME48 = "no-useless-fragment";
|
|
2996
3039
|
var defaultOptions = [{
|
|
2997
3040
|
allowExpressions: true
|
|
2998
3041
|
}];
|
|
@@ -3018,11 +3061,11 @@ var no_useless_fragment_default = createRule({
|
|
|
3018
3061
|
}
|
|
3019
3062
|
}]
|
|
3020
3063
|
},
|
|
3021
|
-
name:
|
|
3022
|
-
create:
|
|
3064
|
+
name: RULE_NAME48,
|
|
3065
|
+
create: create48,
|
|
3023
3066
|
defaultOptions
|
|
3024
3067
|
});
|
|
3025
|
-
function
|
|
3068
|
+
function create48(context, [option]) {
|
|
3026
3069
|
const { allowExpressions = true } = option;
|
|
3027
3070
|
return {
|
|
3028
3071
|
JSXElement(node) {
|
|
@@ -3134,8 +3177,8 @@ function doCheck(context, node, allowExpressions) {
|
|
|
3134
3177
|
}
|
|
3135
3178
|
return;
|
|
3136
3179
|
}
|
|
3137
|
-
var
|
|
3138
|
-
var
|
|
3180
|
+
var RULE_NAME49 = "prefer-destructuring-assignment";
|
|
3181
|
+
var RULE_FEATURES48 = [];
|
|
3139
3182
|
function isMemberExpressionWithObjectName(node) {
|
|
3140
3183
|
return node.object.type === types.AST_NODE_TYPES.Identifier && "name" in node.object;
|
|
3141
3184
|
}
|
|
@@ -3144,18 +3187,18 @@ var prefer_destructuring_assignment_default = createRule({
|
|
|
3144
3187
|
type: "problem",
|
|
3145
3188
|
docs: {
|
|
3146
3189
|
description: "Enforces destructuring assignment for component props and context.",
|
|
3147
|
-
[Symbol.for("rule_features")]:
|
|
3190
|
+
[Symbol.for("rule_features")]: RULE_FEATURES48
|
|
3148
3191
|
},
|
|
3149
3192
|
messages: {
|
|
3150
3193
|
preferDestructuringAssignment: "Use destructuring assignment for {{name}}."
|
|
3151
3194
|
},
|
|
3152
3195
|
schema: []
|
|
3153
3196
|
},
|
|
3154
|
-
name:
|
|
3155
|
-
create:
|
|
3197
|
+
name: RULE_NAME49,
|
|
3198
|
+
create: create49,
|
|
3156
3199
|
defaultOptions: []
|
|
3157
3200
|
});
|
|
3158
|
-
function
|
|
3201
|
+
function create49(context) {
|
|
3159
3202
|
const { ctx, listeners } = core.useComponentCollector(context);
|
|
3160
3203
|
const memberExpressionWithNames = [];
|
|
3161
3204
|
return {
|
|
@@ -3215,8 +3258,8 @@ function create48(context) {
|
|
|
3215
3258
|
}
|
|
3216
3259
|
};
|
|
3217
3260
|
}
|
|
3218
|
-
var
|
|
3219
|
-
var
|
|
3261
|
+
var RULE_NAME50 = "prefer-react-namespace-import";
|
|
3262
|
+
var RULE_FEATURES49 = [
|
|
3220
3263
|
"FIX",
|
|
3221
3264
|
"EXP"
|
|
3222
3265
|
];
|
|
@@ -3225,7 +3268,7 @@ var prefer_react_namespace_import_default = createRule({
|
|
|
3225
3268
|
type: "problem",
|
|
3226
3269
|
docs: {
|
|
3227
3270
|
description: "Enforces React is imported via a namespace import.",
|
|
3228
|
-
[Symbol.for("rule_features")]:
|
|
3271
|
+
[Symbol.for("rule_features")]: RULE_FEATURES49
|
|
3229
3272
|
},
|
|
3230
3273
|
fixable: "code",
|
|
3231
3274
|
messages: {
|
|
@@ -3233,11 +3276,11 @@ var prefer_react_namespace_import_default = createRule({
|
|
|
3233
3276
|
},
|
|
3234
3277
|
schema: []
|
|
3235
3278
|
},
|
|
3236
|
-
name:
|
|
3237
|
-
create:
|
|
3279
|
+
name: RULE_NAME50,
|
|
3280
|
+
create: create50,
|
|
3238
3281
|
defaultOptions: []
|
|
3239
3282
|
});
|
|
3240
|
-
function
|
|
3283
|
+
function create50(context) {
|
|
3241
3284
|
const { importSource } = shared.getSettingsFromContext(context);
|
|
3242
3285
|
return {
|
|
3243
3286
|
[`ImportDeclaration[source.value="${importSource}"] ImportDefaultSpecifier`](node) {
|
|
@@ -3270,8 +3313,8 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
|
|
|
3270
3313
|
}
|
|
3271
3314
|
};
|
|
3272
3315
|
}
|
|
3273
|
-
var
|
|
3274
|
-
var
|
|
3316
|
+
var RULE_NAME51 = "prefer-read-only-props";
|
|
3317
|
+
var RULE_FEATURES50 = [
|
|
3275
3318
|
"TSC",
|
|
3276
3319
|
"EXP"
|
|
3277
3320
|
];
|
|
@@ -3280,18 +3323,18 @@ var prefer_read_only_props_default = createRule({
|
|
|
3280
3323
|
type: "problem",
|
|
3281
3324
|
docs: {
|
|
3282
3325
|
description: "Enforces read-only props in components.",
|
|
3283
|
-
[Symbol.for("rule_features")]:
|
|
3326
|
+
[Symbol.for("rule_features")]: RULE_FEATURES50
|
|
3284
3327
|
},
|
|
3285
3328
|
messages: {
|
|
3286
3329
|
preferReadOnlyProps: "A function component's props should be read-only."
|
|
3287
3330
|
},
|
|
3288
3331
|
schema: []
|
|
3289
3332
|
},
|
|
3290
|
-
name:
|
|
3291
|
-
create:
|
|
3333
|
+
name: RULE_NAME51,
|
|
3334
|
+
create: create51,
|
|
3292
3335
|
defaultOptions: []
|
|
3293
3336
|
});
|
|
3294
|
-
function
|
|
3337
|
+
function create51(context) {
|
|
3295
3338
|
const services = utils.ESLintUtils.getParserServices(context, false);
|
|
3296
3339
|
const { ctx, listeners } = core.useComponentCollector(context);
|
|
3297
3340
|
return {
|
|
@@ -3321,8 +3364,8 @@ function isTypeReadonlyLoose(services, type) {
|
|
|
3321
3364
|
return true;
|
|
3322
3365
|
}
|
|
3323
3366
|
}
|
|
3324
|
-
var
|
|
3325
|
-
var
|
|
3367
|
+
var RULE_NAME52 = "prefer-shorthand-boolean";
|
|
3368
|
+
var RULE_FEATURES51 = [
|
|
3326
3369
|
"FIX"
|
|
3327
3370
|
];
|
|
3328
3371
|
var prefer_shorthand_boolean_default = createRule({
|
|
@@ -3330,7 +3373,7 @@ var prefer_shorthand_boolean_default = createRule({
|
|
|
3330
3373
|
type: "problem",
|
|
3331
3374
|
docs: {
|
|
3332
3375
|
description: "Enforces shorthand syntax for boolean attributes.",
|
|
3333
|
-
[Symbol.for("rule_features")]:
|
|
3376
|
+
[Symbol.for("rule_features")]: RULE_FEATURES51
|
|
3334
3377
|
},
|
|
3335
3378
|
fixable: "code",
|
|
3336
3379
|
messages: {
|
|
@@ -3338,11 +3381,11 @@ var prefer_shorthand_boolean_default = createRule({
|
|
|
3338
3381
|
},
|
|
3339
3382
|
schema: []
|
|
3340
3383
|
},
|
|
3341
|
-
name:
|
|
3342
|
-
create:
|
|
3384
|
+
name: RULE_NAME52,
|
|
3385
|
+
create: create52,
|
|
3343
3386
|
defaultOptions: []
|
|
3344
3387
|
});
|
|
3345
|
-
function
|
|
3388
|
+
function create52(context) {
|
|
3346
3389
|
return {
|
|
3347
3390
|
JSXAttribute(node) {
|
|
3348
3391
|
const { value } = node;
|
|
@@ -3362,8 +3405,8 @@ function create51(context) {
|
|
|
3362
3405
|
}
|
|
3363
3406
|
};
|
|
3364
3407
|
}
|
|
3365
|
-
var
|
|
3366
|
-
var
|
|
3408
|
+
var RULE_NAME53 = "prefer-shorthand-fragment";
|
|
3409
|
+
var RULE_FEATURES52 = [
|
|
3367
3410
|
"FIX"
|
|
3368
3411
|
];
|
|
3369
3412
|
var prefer_shorthand_fragment_default = createRule({
|
|
@@ -3371,7 +3414,7 @@ var prefer_shorthand_fragment_default = createRule({
|
|
|
3371
3414
|
type: "problem",
|
|
3372
3415
|
docs: {
|
|
3373
3416
|
description: "Enforces shorthand syntax for fragments.",
|
|
3374
|
-
[Symbol.for("rule_features")]:
|
|
3417
|
+
[Symbol.for("rule_features")]: RULE_FEATURES52
|
|
3375
3418
|
},
|
|
3376
3419
|
fixable: "code",
|
|
3377
3420
|
messages: {
|
|
@@ -3379,11 +3422,11 @@ var prefer_shorthand_fragment_default = createRule({
|
|
|
3379
3422
|
},
|
|
3380
3423
|
schema: []
|
|
3381
3424
|
},
|
|
3382
|
-
name:
|
|
3383
|
-
create:
|
|
3425
|
+
name: RULE_NAME53,
|
|
3426
|
+
create: create53,
|
|
3384
3427
|
defaultOptions: []
|
|
3385
3428
|
});
|
|
3386
|
-
function
|
|
3429
|
+
function create53(context) {
|
|
3387
3430
|
return {
|
|
3388
3431
|
JSXElement(node) {
|
|
3389
3432
|
if (!JSX8__namespace.isFragmentElement(node)) return;
|
|
@@ -3468,6 +3511,7 @@ var plugin = {
|
|
|
3468
3511
|
"prefer-shorthand-fragment": prefer_shorthand_fragment_default,
|
|
3469
3512
|
// Part: JSX only rules
|
|
3470
3513
|
"jsx-no-duplicate-props": jsx_no_duplicate_props_default,
|
|
3514
|
+
"jsx-no-undef": jsx_no_undef_default,
|
|
3471
3515
|
"jsx-uses-vars": jsx_uses_vars_default,
|
|
3472
3516
|
// Part: deprecated rules
|
|
3473
3517
|
/** @deprecated Use `no-useless-forward-ref` instead */
|