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