eslint-plugin-react-x 1.20.0-next.7 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -53
- package/dist/index.d.mts +0 -8
- package/dist/index.d.ts +0 -8
- package/dist/index.js +75 -69
- package/dist/index.mjs +75 -69
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ export default [
|
|
|
52
52
|
"react-x/no-forward-ref": "warn",
|
|
53
53
|
"react-x/no-implicit-key": "warn",
|
|
54
54
|
"react-x/no-missing-key": "error",
|
|
55
|
-
"react-x/no-nested-components": "
|
|
55
|
+
"react-x/no-nested-components": "error",
|
|
56
56
|
"react-x/no-prop-types": "error",
|
|
57
57
|
"react-x/no-redundant-should-component-update": "error",
|
|
58
58
|
"react-x/no-set-state-in-component-did-mount": "warn",
|
|
@@ -62,8 +62,8 @@ export default [
|
|
|
62
62
|
"react-x/no-unsafe-component-will-mount": "warn",
|
|
63
63
|
"react-x/no-unsafe-component-will-receive-props": "warn",
|
|
64
64
|
"react-x/no-unsafe-component-will-update": "warn",
|
|
65
|
-
"react-x/no-unstable-context-value": "
|
|
66
|
-
"react-x/no-unstable-default-props": "
|
|
65
|
+
"react-x/no-unstable-context-value": "warn",
|
|
66
|
+
"react-x/no-unstable-default-props": "warn",
|
|
67
67
|
"react-x/no-unused-class-component-members": "warn",
|
|
68
68
|
"react-x/no-unused-state": "warn",
|
|
69
69
|
},
|
|
@@ -73,53 +73,4 @@ export default [
|
|
|
73
73
|
|
|
74
74
|
## Rules
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
| :--------------------------------------- | :--------------------------------------------------------------------------------------------------- | :-: | :-: |
|
|
78
|
-
| `ensure-forward-ref-using-ref` | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | | |
|
|
79
|
-
| `jsx-no-duplicate-props` | Prevents duplicate props in JSX. | | |
|
|
80
|
-
| `jsx-uses-vars` | Prevents variables used in JSX to be marked as unused. | | |
|
|
81
|
-
| `no-access-state-in-setstate` | Prevents accessing `this.state` inside `setState` calls. | | |
|
|
82
|
-
| `no-array-index-key` | Prevents using array `index` as `key`. | | |
|
|
83
|
-
| `no-children-count` | Prevents using `Children.count`. | | |
|
|
84
|
-
| `no-children-for-each` | Prevents using `Children.forEach`. | | |
|
|
85
|
-
| `no-children-map` | Prevents using `Children.map`. | | |
|
|
86
|
-
| `no-children-only` | Prevents using `Children.only`. | | |
|
|
87
|
-
| `no-children-prop` | Prevents using `children` as a prop. | | |
|
|
88
|
-
| `no-children-to-array` | Prevents using `Children.toArray`. | | |
|
|
89
|
-
| `no-class-component` | Prevents using class component. | | |
|
|
90
|
-
| `no-clone-element` | Prevents using `cloneElement`. | | |
|
|
91
|
-
| `no-comment-textnodes` | Prevents comments from being inserted as text nodes. | | |
|
|
92
|
-
| `no-complex-conditional-rendering` | Prevents complex conditional rendering in JSX. | | |
|
|
93
|
-
| `no-component-will-mount` | Prevents using `componentWillMount`. | | |
|
|
94
|
-
| `no-component-will-receive-props` | Prevents using `componentWillReceiveProps`. | | |
|
|
95
|
-
| `no-component-will-update` | Prevents using `componentWillUpdate`. | | |
|
|
96
|
-
| `no-context-provider` | Prevents using `<Context.Provider>`. | | 🔧 |
|
|
97
|
-
| `no-create-ref` | Prevents using `createRef`. | | |
|
|
98
|
-
| `no-default-props` | Prevents using `defaultProps` property in favor of ES6 default parameters. | | |
|
|
99
|
-
| `no-direct-mutation-state` | Prevents direct mutation of `this.state`. | | |
|
|
100
|
-
| `no-duplicate-key` | Prevents duplicate `key` on elements in the same array or a list of `children`. | | |
|
|
101
|
-
| `no-forward-ref` | Prevents using `forwardRef`. | | 🔧 |
|
|
102
|
-
| `no-implicit-key` | Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects). | | |
|
|
103
|
-
| `no-leaked-conditional-rendering` | Prevents problematic leaked values from being rendered. | 💭 | |
|
|
104
|
-
| `no-missing-component-display-name` | Enforces that all components have a `displayName` which can be used in devtools. | | |
|
|
105
|
-
| `no-missing-key` | Prevents missing `key` on items in list rendering. | | |
|
|
106
|
-
| `no-nested-components` | Prevents nesting component definitions inside other components. | | |
|
|
107
|
-
| `no-prop-types` | Prevents using `propTypes` in favor of TypeScript or another type-checking solution. | | |
|
|
108
|
-
| `no-redundant-should-component-update` | Prevents using `shouldComponentUpdate` when extending `React.PureComponent`. | | |
|
|
109
|
-
| `no-set-state-in-component-did-mount` | Prevents calling `this.setState` in `componentDidMount` outside of functions, such as callbacks. | | |
|
|
110
|
-
| `no-set-state-in-component-did-update` | Prevents calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks. | | |
|
|
111
|
-
| `no-set-state-in-component-will-update` | Prevents calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks. | | |
|
|
112
|
-
| `no-string-refs` | Prevents using deprecated string `refs`. | | |
|
|
113
|
-
| `no-unsafe-component-will-mount` | Warns the usage of `UNSAFE_componentWillMount` in class components. | | |
|
|
114
|
-
| `no-unsafe-component-will-receive-props` | Warns the usage of `UNSAFE_componentWillReceiveProps` in class components. | | |
|
|
115
|
-
| `no-unsafe-component-will-update` | Warns the usage of `UNSAFE_componentWillUpdate` in class components. | | |
|
|
116
|
-
| `no-unstable-context-value` | Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`. | | |
|
|
117
|
-
| `no-unstable-default-props` | Prevents using referential-type values as default props in object destructuring. | | |
|
|
118
|
-
| `no-unused-class-component-members` | Warns unused class component methods and properties. | | |
|
|
119
|
-
| `no-unused-state` | Warns unused class component state. | | |
|
|
120
|
-
| `no-useless-fragment` | Prevents using useless `fragment` components or `<>` syntax. | | |
|
|
121
|
-
| `prefer-destructuring-assignment` | Enforces using destructuring assignment over property assignment. | | |
|
|
122
|
-
| `prefer-react-namespace-import` | Enforces using `React` namespace import over default import. | | 🔧 |
|
|
123
|
-
| `prefer-read-only-props` | Enforce read-only props in components. | 💭 | |
|
|
124
|
-
| `prefer-shorthand-boolean` | Enforces using shorthand syntax for boolean attributes. | | 🔧 |
|
|
125
|
-
| `prefer-shorthand-fragment` | Enforces using shorthand syntax for fragments. | | |
|
|
76
|
+
<https://eslint-react.xyz/docs/rules/overview#core-rules>
|
package/dist/index.d.mts
CHANGED
|
@@ -69,14 +69,6 @@ declare const _default: {
|
|
|
69
69
|
/** @deprecated Use `no-complex-conditional-rendering` instead. */
|
|
70
70
|
"no-complicated-conditional-rendering": _typescript_eslint_utils_ts_eslint.RuleModule<"noComplexConditionalRendering", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
71
71
|
};
|
|
72
|
-
DEFAULT_ESLINT_REACT_SETTINGS: {
|
|
73
|
-
readonly additionalHooks: {
|
|
74
|
-
readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
|
|
75
|
-
};
|
|
76
|
-
readonly polymorphicPropName: "as";
|
|
77
|
-
readonly strictImportCheck: true;
|
|
78
|
-
readonly version: "detect";
|
|
79
|
-
};
|
|
80
72
|
};
|
|
81
73
|
|
|
82
74
|
export { _default as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,14 +69,6 @@ declare const _default: {
|
|
|
69
69
|
/** @deprecated Use `no-complex-conditional-rendering` instead. */
|
|
70
70
|
"no-complicated-conditional-rendering": _typescript_eslint_utils_ts_eslint.RuleModule<"noComplexConditionalRendering", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
71
71
|
};
|
|
72
|
-
DEFAULT_ESLINT_REACT_SETTINGS: {
|
|
73
|
-
readonly additionalHooks: {
|
|
74
|
-
readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
|
|
75
|
-
};
|
|
76
|
-
readonly polymorphicPropName: "as";
|
|
77
|
-
readonly strictImportCheck: true;
|
|
78
|
-
readonly version: "detect";
|
|
79
|
-
};
|
|
80
72
|
};
|
|
81
73
|
|
|
82
74
|
export { _default as default };
|
package/dist/index.js
CHANGED
|
@@ -41,13 +41,13 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
43
|
var name = "eslint-plugin-react-x";
|
|
44
|
-
var version = "1.20.0
|
|
44
|
+
var version = "1.20.0";
|
|
45
45
|
var createRule = shared.createRuleForPlugin("x");
|
|
46
46
|
|
|
47
47
|
// src/rules/avoid-shorthand-boolean.ts
|
|
48
48
|
var RULE_NAME = "avoid-shorthand-boolean";
|
|
49
49
|
var RULE_FEATURES = [
|
|
50
|
-
"
|
|
50
|
+
"CHK"
|
|
51
51
|
];
|
|
52
52
|
var avoid_shorthand_boolean_default = createRule({
|
|
53
53
|
meta: {
|
|
@@ -84,7 +84,7 @@ var avoid_shorthand_boolean_default = createRule({
|
|
|
84
84
|
// src/rules/avoid-shorthand-fragment.ts
|
|
85
85
|
var RULE_NAME2 = "avoid-shorthand-fragment";
|
|
86
86
|
var RULE_FEATURES2 = [
|
|
87
|
-
"
|
|
87
|
+
"CHK"
|
|
88
88
|
];
|
|
89
89
|
var avoid_shorthand_fragment_default = createRule({
|
|
90
90
|
meta: {
|
|
@@ -113,7 +113,7 @@ var avoid_shorthand_fragment_default = createRule({
|
|
|
113
113
|
});
|
|
114
114
|
var RULE_NAME3 = "ensure-forward-ref-using-ref";
|
|
115
115
|
var RULE_FEATURES3 = [
|
|
116
|
-
"
|
|
116
|
+
"CHK"
|
|
117
117
|
];
|
|
118
118
|
var ensure_forward_ref_using_ref_default = createRule({
|
|
119
119
|
meta: {
|
|
@@ -147,7 +147,7 @@ var ensure_forward_ref_using_ref_default = createRule({
|
|
|
147
147
|
});
|
|
148
148
|
var RULE_NAME4 = "jsx-no-duplicate-props";
|
|
149
149
|
var RULE_FEATURES4 = [
|
|
150
|
-
"
|
|
150
|
+
"CHK"
|
|
151
151
|
];
|
|
152
152
|
var jsx_no_duplicate_props_default = createRule({
|
|
153
153
|
meta: {
|
|
@@ -186,9 +186,7 @@ var jsx_no_duplicate_props_default = createRule({
|
|
|
186
186
|
defaultOptions: []
|
|
187
187
|
});
|
|
188
188
|
var RULE_NAME5 = "jsx-uses-vars";
|
|
189
|
-
var RULE_FEATURES5 = [
|
|
190
|
-
"LNT"
|
|
191
|
-
];
|
|
189
|
+
var RULE_FEATURES5 = [];
|
|
192
190
|
var jsx_uses_vars_default = createRule({
|
|
193
191
|
meta: {
|
|
194
192
|
type: "problem",
|
|
@@ -227,7 +225,7 @@ var jsx_uses_vars_default = createRule({
|
|
|
227
225
|
});
|
|
228
226
|
var RULE_NAME6 = "no-access-state-in-setstate";
|
|
229
227
|
var RULE_FEATURES6 = [
|
|
230
|
-
"
|
|
228
|
+
"CHK"
|
|
231
229
|
];
|
|
232
230
|
function getName(node) {
|
|
233
231
|
if (node.type === types.AST_NODE_TYPES.TSAsExpression) {
|
|
@@ -329,7 +327,7 @@ var no_access_state_in_setstate_default = createRule({
|
|
|
329
327
|
});
|
|
330
328
|
var RULE_NAME7 = "no-array-index-key";
|
|
331
329
|
var RULE_FEATURES7 = [
|
|
332
|
-
"
|
|
330
|
+
"CHK"
|
|
333
331
|
];
|
|
334
332
|
var reactChildrenMethod = ["forEach", "map"];
|
|
335
333
|
var iteratorFunctionIndexParamPosition = /* @__PURE__ */ new Map([
|
|
@@ -446,7 +444,7 @@ var no_array_index_key_default = createRule({
|
|
|
446
444
|
const [_, props] = node.arguments;
|
|
447
445
|
if (props?.type !== types.AST_NODE_TYPES.ObjectExpression) return;
|
|
448
446
|
for (const prop of props.properties) {
|
|
449
|
-
if (!tsPattern.isMatching({ key: { name: "key" } }
|
|
447
|
+
if (!tsPattern.isMatching({ key: { name: "key" } })(prop)) continue;
|
|
450
448
|
if (!("value" in prop)) continue;
|
|
451
449
|
const descriptors = getReportDescriptor(prop.value);
|
|
452
450
|
for (const descriptor of descriptors) {
|
|
@@ -473,7 +471,7 @@ var no_array_index_key_default = createRule({
|
|
|
473
471
|
});
|
|
474
472
|
var RULE_NAME8 = "no-children-count";
|
|
475
473
|
var RULE_FEATURES8 = [
|
|
476
|
-
"
|
|
474
|
+
"CHK"
|
|
477
475
|
];
|
|
478
476
|
var no_children_count_default = createRule({
|
|
479
477
|
meta: {
|
|
@@ -504,7 +502,7 @@ var no_children_count_default = createRule({
|
|
|
504
502
|
});
|
|
505
503
|
var RULE_NAME9 = "no-children-for-each";
|
|
506
504
|
var RULE_FEATURES9 = [
|
|
507
|
-
"
|
|
505
|
+
"CHK"
|
|
508
506
|
];
|
|
509
507
|
var no_children_for_each_default = createRule({
|
|
510
508
|
meta: {
|
|
@@ -535,7 +533,7 @@ var no_children_for_each_default = createRule({
|
|
|
535
533
|
});
|
|
536
534
|
var RULE_NAME10 = "no-children-map";
|
|
537
535
|
var RULE_FEATURES10 = [
|
|
538
|
-
"
|
|
536
|
+
"CHK"
|
|
539
537
|
];
|
|
540
538
|
var no_children_map_default = createRule({
|
|
541
539
|
meta: {
|
|
@@ -566,7 +564,7 @@ var no_children_map_default = createRule({
|
|
|
566
564
|
});
|
|
567
565
|
var RULE_NAME11 = "no-children-only";
|
|
568
566
|
var RULE_FEATURES11 = [
|
|
569
|
-
"
|
|
567
|
+
"CHK"
|
|
570
568
|
];
|
|
571
569
|
var no_children_only_default = createRule({
|
|
572
570
|
meta: {
|
|
@@ -597,7 +595,7 @@ var no_children_only_default = createRule({
|
|
|
597
595
|
});
|
|
598
596
|
var RULE_NAME12 = "no-children-prop";
|
|
599
597
|
var RULE_FEATURES12 = [
|
|
600
|
-
"
|
|
598
|
+
"CHK"
|
|
601
599
|
];
|
|
602
600
|
var no_children_prop_default = createRule({
|
|
603
601
|
meta: {
|
|
@@ -626,7 +624,7 @@ var no_children_prop_default = createRule({
|
|
|
626
624
|
});
|
|
627
625
|
var RULE_NAME13 = "no-children-to-array";
|
|
628
626
|
var RULE_FEATURES13 = [
|
|
629
|
-
"
|
|
627
|
+
"CHK"
|
|
630
628
|
];
|
|
631
629
|
var no_children_to_array_default = createRule({
|
|
632
630
|
meta: {
|
|
@@ -657,7 +655,7 @@ var no_children_to_array_default = createRule({
|
|
|
657
655
|
});
|
|
658
656
|
var RULE_NAME14 = "no-class-component";
|
|
659
657
|
var RULE_FEATURES14 = [
|
|
660
|
-
"
|
|
658
|
+
"CHK"
|
|
661
659
|
];
|
|
662
660
|
var isComponentDidCatch = tsPattern.isMatching({
|
|
663
661
|
key: {
|
|
@@ -713,7 +711,7 @@ var no_class_component_default = createRule({
|
|
|
713
711
|
});
|
|
714
712
|
var RULE_NAME15 = "no-clone-element";
|
|
715
713
|
var RULE_FEATURES15 = [
|
|
716
|
-
"
|
|
714
|
+
"CHK"
|
|
717
715
|
];
|
|
718
716
|
var no_clone_element_default = createRule({
|
|
719
717
|
meta: {
|
|
@@ -743,7 +741,7 @@ var no_clone_element_default = createRule({
|
|
|
743
741
|
});
|
|
744
742
|
var RULE_NAME16 = "no-comment-textnodes";
|
|
745
743
|
var RULE_FEATURES16 = [
|
|
746
|
-
"
|
|
744
|
+
"CHK"
|
|
747
745
|
];
|
|
748
746
|
var no_comment_textnodes_default = createRule({
|
|
749
747
|
meta: {
|
|
@@ -783,7 +781,7 @@ var no_comment_textnodes_default = createRule({
|
|
|
783
781
|
});
|
|
784
782
|
var RULE_NAME17 = "no-complex-conditional-rendering";
|
|
785
783
|
var RULE_FEATURES17 = [
|
|
786
|
-
"
|
|
784
|
+
"CHK"
|
|
787
785
|
];
|
|
788
786
|
var no_complex_conditional_rendering_default = createRule({
|
|
789
787
|
meta: {
|
|
@@ -821,7 +819,8 @@ var no_complex_conditional_rendering_default = createRule({
|
|
|
821
819
|
});
|
|
822
820
|
var RULE_NAME18 = "no-component-will-mount";
|
|
823
821
|
var RULE_FEATURES18 = [
|
|
824
|
-
"
|
|
822
|
+
"CHK",
|
|
823
|
+
"MOD"
|
|
825
824
|
];
|
|
826
825
|
function isComponentWillMount(node) {
|
|
827
826
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillMount";
|
|
@@ -833,6 +832,7 @@ var no_component_will_mount_default = createRule({
|
|
|
833
832
|
description: "disallow using 'componentWillMount'",
|
|
834
833
|
[Symbol.for("rule_features")]: RULE_FEATURES18
|
|
835
834
|
},
|
|
835
|
+
fixable: "code",
|
|
836
836
|
messages: {
|
|
837
837
|
noComponentWillMount: "[Deprecated] Use 'UNSAFE_componentWillMount' instead."
|
|
838
838
|
},
|
|
@@ -852,7 +852,11 @@ var no_component_will_mount_default = createRule({
|
|
|
852
852
|
if (isComponentWillMount(member)) {
|
|
853
853
|
context.report({
|
|
854
854
|
messageId: "noComponentWillMount",
|
|
855
|
-
node: member
|
|
855
|
+
node: member,
|
|
856
|
+
fix(fixer) {
|
|
857
|
+
if (!("key" in member)) return null;
|
|
858
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillMount");
|
|
859
|
+
}
|
|
856
860
|
});
|
|
857
861
|
}
|
|
858
862
|
}
|
|
@@ -864,7 +868,8 @@ var no_component_will_mount_default = createRule({
|
|
|
864
868
|
});
|
|
865
869
|
var RULE_NAME19 = "no-component-will-receive-props";
|
|
866
870
|
var RULE_FEATURES19 = [
|
|
867
|
-
"
|
|
871
|
+
"CHK",
|
|
872
|
+
"MOD"
|
|
868
873
|
];
|
|
869
874
|
function isComponentWillUpdate(node) {
|
|
870
875
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillReceiveProps";
|
|
@@ -876,6 +881,7 @@ var no_component_will_receive_props_default = createRule({
|
|
|
876
881
|
description: "disallow using 'componentWillReceiveProps'",
|
|
877
882
|
[Symbol.for("rule_features")]: RULE_FEATURES19
|
|
878
883
|
},
|
|
884
|
+
fixable: "code",
|
|
879
885
|
messages: {
|
|
880
886
|
noComponentWillReceiveProps: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead."
|
|
881
887
|
},
|
|
@@ -895,7 +901,11 @@ var no_component_will_receive_props_default = createRule({
|
|
|
895
901
|
if (isComponentWillUpdate(member)) {
|
|
896
902
|
context.report({
|
|
897
903
|
messageId: "noComponentWillReceiveProps",
|
|
898
|
-
node: member
|
|
904
|
+
node: member,
|
|
905
|
+
fix(fixer) {
|
|
906
|
+
if (!("key" in member)) return null;
|
|
907
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillReceiveProps");
|
|
908
|
+
}
|
|
899
909
|
});
|
|
900
910
|
}
|
|
901
911
|
}
|
|
@@ -907,7 +917,8 @@ var no_component_will_receive_props_default = createRule({
|
|
|
907
917
|
});
|
|
908
918
|
var RULE_NAME20 = "no-component-will-update";
|
|
909
919
|
var RULE_FEATURES20 = [
|
|
910
|
-
"
|
|
920
|
+
"CHK",
|
|
921
|
+
"MOD"
|
|
911
922
|
];
|
|
912
923
|
function isComponentWillUpdate2(node) {
|
|
913
924
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
@@ -919,6 +930,7 @@ var no_component_will_update_default = createRule({
|
|
|
919
930
|
description: "disallow using 'componentWillReceiveProps'",
|
|
920
931
|
[Symbol.for("rule_features")]: RULE_FEATURES20
|
|
921
932
|
},
|
|
933
|
+
fixable: "code",
|
|
922
934
|
messages: {
|
|
923
935
|
noComponentWillUpdate: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead."
|
|
924
936
|
},
|
|
@@ -938,7 +950,11 @@ var no_component_will_update_default = createRule({
|
|
|
938
950
|
if (isComponentWillUpdate2(member)) {
|
|
939
951
|
context.report({
|
|
940
952
|
messageId: "noComponentWillUpdate",
|
|
941
|
-
node: member
|
|
953
|
+
node: member,
|
|
954
|
+
fix(fixer) {
|
|
955
|
+
if (!("key" in member)) return null;
|
|
956
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillUpdate");
|
|
957
|
+
}
|
|
942
958
|
});
|
|
943
959
|
}
|
|
944
960
|
}
|
|
@@ -950,8 +966,8 @@ var no_component_will_update_default = createRule({
|
|
|
950
966
|
});
|
|
951
967
|
var RULE_NAME21 = "no-context-provider";
|
|
952
968
|
var RULE_FEATURES21 = [
|
|
953
|
-
"
|
|
954
|
-
"
|
|
969
|
+
"CHK",
|
|
970
|
+
"MOD"
|
|
955
971
|
];
|
|
956
972
|
var no_context_provider_default = createRule({
|
|
957
973
|
meta: {
|
|
@@ -996,7 +1012,7 @@ var no_context_provider_default = createRule({
|
|
|
996
1012
|
});
|
|
997
1013
|
var RULE_NAME22 = "no-create-ref";
|
|
998
1014
|
var RULE_FEATURES22 = [
|
|
999
|
-
"
|
|
1015
|
+
"CHK"
|
|
1000
1016
|
];
|
|
1001
1017
|
var no_create_ref_default = createRule({
|
|
1002
1018
|
meta: {
|
|
@@ -1024,7 +1040,7 @@ var no_create_ref_default = createRule({
|
|
|
1024
1040
|
});
|
|
1025
1041
|
var RULE_NAME23 = "no-default-props";
|
|
1026
1042
|
var RULE_FEATURES23 = [
|
|
1027
|
-
"
|
|
1043
|
+
"CHK"
|
|
1028
1044
|
];
|
|
1029
1045
|
var no_default_props_default = createRule({
|
|
1030
1046
|
meta: {
|
|
@@ -1067,7 +1083,7 @@ var no_default_props_default = createRule({
|
|
|
1067
1083
|
});
|
|
1068
1084
|
var RULE_NAME24 = "no-direct-mutation-state";
|
|
1069
1085
|
var RULE_FEATURES24 = [
|
|
1070
|
-
"
|
|
1086
|
+
"CHK"
|
|
1071
1087
|
];
|
|
1072
1088
|
function getName2(node) {
|
|
1073
1089
|
if (node.type === types.AST_NODE_TYPES.TSAsExpression) {
|
|
@@ -1129,7 +1145,7 @@ var no_direct_mutation_state_default = createRule({
|
|
|
1129
1145
|
});
|
|
1130
1146
|
var RULE_NAME25 = "no-duplicate-key";
|
|
1131
1147
|
var RULE_FEATURES25 = [
|
|
1132
|
-
"
|
|
1148
|
+
"CHK"
|
|
1133
1149
|
];
|
|
1134
1150
|
var no_duplicate_key_default = createRule({
|
|
1135
1151
|
meta: {
|
|
@@ -1262,8 +1278,8 @@ var no_duplicate_key_default = createRule({
|
|
|
1262
1278
|
});
|
|
1263
1279
|
var RULE_NAME26 = "no-forward-ref";
|
|
1264
1280
|
var RULE_FEATURES26 = [
|
|
1265
|
-
"
|
|
1266
|
-
"
|
|
1281
|
+
"CHK",
|
|
1282
|
+
"MOD"
|
|
1267
1283
|
];
|
|
1268
1284
|
var no_forward_ref_default = createRule({
|
|
1269
1285
|
meta: {
|
|
@@ -1359,7 +1375,7 @@ function getComponentPropsFixes(node, typeArguments, fixer, context) {
|
|
|
1359
1375
|
}
|
|
1360
1376
|
var RULE_NAME27 = "no-implicit-key";
|
|
1361
1377
|
var RULE_FEATURES27 = [
|
|
1362
|
-
"
|
|
1378
|
+
"CHK"
|
|
1363
1379
|
];
|
|
1364
1380
|
var no_implicit_key_default = createRule({
|
|
1365
1381
|
meta: {
|
|
@@ -1418,7 +1434,7 @@ function unionTypeParts(type) {
|
|
|
1418
1434
|
}
|
|
1419
1435
|
var RULE_NAME28 = "no-leaked-conditional-rendering";
|
|
1420
1436
|
var RULE_FEATURES28 = [
|
|
1421
|
-
"
|
|
1437
|
+
"CHK",
|
|
1422
1438
|
"TSC"
|
|
1423
1439
|
];
|
|
1424
1440
|
var tsHelpers = {
|
|
@@ -1584,7 +1600,7 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1584
1600
|
});
|
|
1585
1601
|
var RULE_NAME29 = "no-missing-component-display-name";
|
|
1586
1602
|
var RULE_FEATURES29 = [
|
|
1587
|
-
"
|
|
1603
|
+
"CHK"
|
|
1588
1604
|
];
|
|
1589
1605
|
var no_missing_component_display_name_default = createRule({
|
|
1590
1606
|
meta: {
|
|
@@ -1624,7 +1640,7 @@ var no_missing_component_display_name_default = createRule({
|
|
|
1624
1640
|
});
|
|
1625
1641
|
var RULE_NAME30 = "no-missing-key";
|
|
1626
1642
|
var RULE_FEATURES30 = [
|
|
1627
|
-
"
|
|
1643
|
+
"CHK"
|
|
1628
1644
|
];
|
|
1629
1645
|
var no_missing_key_default = createRule({
|
|
1630
1646
|
meta: {
|
|
@@ -1745,7 +1761,7 @@ var no_missing_key_default = createRule({
|
|
|
1745
1761
|
});
|
|
1746
1762
|
var RULE_NAME31 = "no-nested-components";
|
|
1747
1763
|
var RULE_FEATURES31 = [
|
|
1748
|
-
"
|
|
1764
|
+
"CHK"
|
|
1749
1765
|
];
|
|
1750
1766
|
var no_nested_components_default = createRule({
|
|
1751
1767
|
meta: {
|
|
@@ -1846,7 +1862,7 @@ var no_nested_components_default = createRule({
|
|
|
1846
1862
|
});
|
|
1847
1863
|
var RULE_NAME32 = "no-prop-types";
|
|
1848
1864
|
var RULE_FEATURES32 = [
|
|
1849
|
-
"
|
|
1865
|
+
"CHK"
|
|
1850
1866
|
];
|
|
1851
1867
|
var no_prop_types_default = createRule({
|
|
1852
1868
|
meta: {
|
|
@@ -1889,7 +1905,7 @@ var no_prop_types_default = createRule({
|
|
|
1889
1905
|
});
|
|
1890
1906
|
var RULE_NAME33 = "no-redundant-should-component-update";
|
|
1891
1907
|
var RULE_FEATURES33 = [
|
|
1892
|
-
"
|
|
1908
|
+
"CHK"
|
|
1893
1909
|
];
|
|
1894
1910
|
function isShouldComponentUpdate(node) {
|
|
1895
1911
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
|
|
@@ -1936,7 +1952,7 @@ var no_redundant_should_component_update_default = createRule({
|
|
|
1936
1952
|
});
|
|
1937
1953
|
var RULE_NAME34 = "no-set-state-in-component-did-mount";
|
|
1938
1954
|
var RULE_FEATURES34 = [
|
|
1939
|
-
"
|
|
1955
|
+
"CHK"
|
|
1940
1956
|
];
|
|
1941
1957
|
function isComponentDidMount(node) {
|
|
1942
1958
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
@@ -1983,7 +1999,7 @@ var no_set_state_in_component_did_mount_default = createRule({
|
|
|
1983
1999
|
});
|
|
1984
2000
|
var RULE_NAME35 = "no-set-state-in-component-did-update";
|
|
1985
2001
|
var RULE_FEATURES35 = [
|
|
1986
|
-
"
|
|
2002
|
+
"CHK"
|
|
1987
2003
|
];
|
|
1988
2004
|
function isComponentDidUpdate(node) {
|
|
1989
2005
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
|
|
@@ -2030,7 +2046,7 @@ var no_set_state_in_component_did_update_default = createRule({
|
|
|
2030
2046
|
});
|
|
2031
2047
|
var RULE_NAME36 = "no-set-state-in-component-will-update";
|
|
2032
2048
|
var RULE_FEATURES36 = [
|
|
2033
|
-
"
|
|
2049
|
+
"CHK"
|
|
2034
2050
|
];
|
|
2035
2051
|
function isComponentWillUpdate3(node) {
|
|
2036
2052
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
@@ -2077,7 +2093,7 @@ var no_set_state_in_component_will_update_default = createRule({
|
|
|
2077
2093
|
});
|
|
2078
2094
|
var RULE_NAME37 = "no-string-refs";
|
|
2079
2095
|
var RULE_FEATURES37 = [
|
|
2080
|
-
"
|
|
2096
|
+
"CHK"
|
|
2081
2097
|
];
|
|
2082
2098
|
function containsStringLiteral({ value }) {
|
|
2083
2099
|
return value?.type === types.AST_NODE_TYPES.Literal && tools.isString(value.value);
|
|
@@ -2117,7 +2133,7 @@ var no_string_refs_default = createRule({
|
|
|
2117
2133
|
});
|
|
2118
2134
|
var RULE_NAME38 = "no-unsafe-component-will-mount";
|
|
2119
2135
|
var RULE_FEATURES38 = [
|
|
2120
|
-
"
|
|
2136
|
+
"CHK"
|
|
2121
2137
|
];
|
|
2122
2138
|
function isUnsafeComponentWillMount(node) {
|
|
2123
2139
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
|
|
@@ -2160,7 +2176,7 @@ var no_unsafe_component_will_mount_default = createRule({
|
|
|
2160
2176
|
});
|
|
2161
2177
|
var RULE_NAME39 = "no-unsafe-component-will-receive-props";
|
|
2162
2178
|
var RULE_FEATURES39 = [
|
|
2163
|
-
"
|
|
2179
|
+
"CHK"
|
|
2164
2180
|
];
|
|
2165
2181
|
function isUnsafeComponentWillReceiveProps(node) {
|
|
2166
2182
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
|
|
@@ -2203,7 +2219,7 @@ var no_unsafe_component_will_receive_props_default = createRule({
|
|
|
2203
2219
|
});
|
|
2204
2220
|
var RULE_NAME40 = "no-unsafe-component-will-update";
|
|
2205
2221
|
var RULE_FEATURES40 = [
|
|
2206
|
-
"
|
|
2222
|
+
"CHK"
|
|
2207
2223
|
];
|
|
2208
2224
|
function isUnsafeComponentWillUpdate(node) {
|
|
2209
2225
|
return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
|
|
@@ -2246,7 +2262,7 @@ var no_unsafe_component_will_update_default = createRule({
|
|
|
2246
2262
|
});
|
|
2247
2263
|
var RULE_NAME41 = "no-unstable-context-value";
|
|
2248
2264
|
var RULE_FEATURES41 = [
|
|
2249
|
-
"
|
|
2265
|
+
"CHK"
|
|
2250
2266
|
];
|
|
2251
2267
|
var no_unstable_context_value_default = createRule({
|
|
2252
2268
|
meta: {
|
|
@@ -2317,7 +2333,7 @@ var no_unstable_context_value_default = createRule({
|
|
|
2317
2333
|
});
|
|
2318
2334
|
var RULE_NAME42 = "no-unstable-default-props";
|
|
2319
2335
|
var RULE_FEATURES42 = [
|
|
2320
|
-
"
|
|
2336
|
+
"CHK"
|
|
2321
2337
|
];
|
|
2322
2338
|
var no_unstable_default_props_default = createRule({
|
|
2323
2339
|
meta: {
|
|
@@ -2386,7 +2402,7 @@ var no_unstable_default_props_default = createRule({
|
|
|
2386
2402
|
});
|
|
2387
2403
|
var RULE_NAME43 = "no-unused-class-component-members";
|
|
2388
2404
|
var RULE_FEATURES43 = [
|
|
2389
|
-
"
|
|
2405
|
+
"CHK"
|
|
2390
2406
|
];
|
|
2391
2407
|
var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
|
|
2392
2408
|
"componentDidCatch",
|
|
@@ -2517,7 +2533,7 @@ var no_unused_class_component_members_default = createRule({
|
|
|
2517
2533
|
});
|
|
2518
2534
|
var RULE_NAME44 = "no-unused-state";
|
|
2519
2535
|
var RULE_FEATURES44 = [
|
|
2520
|
-
"
|
|
2536
|
+
"CHK"
|
|
2521
2537
|
];
|
|
2522
2538
|
function getName4(node) {
|
|
2523
2539
|
if (node.type === types.AST_NODE_TYPES.TSAsExpression) {
|
|
@@ -2721,7 +2737,7 @@ var no_useless_fragment_default = createRule({
|
|
|
2721
2737
|
});
|
|
2722
2738
|
var RULE_NAME46 = "prefer-destructuring-assignment";
|
|
2723
2739
|
var RULE_FEATURES45 = [
|
|
2724
|
-
"
|
|
2740
|
+
"CHK"
|
|
2725
2741
|
];
|
|
2726
2742
|
function isMemberExpressionWithObjectName(node) {
|
|
2727
2743
|
return node.object.type === types.AST_NODE_TYPES.Identifier && "name" in node.object;
|
|
@@ -2795,7 +2811,7 @@ var prefer_destructuring_assignment_default = createRule({
|
|
|
2795
2811
|
});
|
|
2796
2812
|
var RULE_NAME47 = "prefer-react-namespace-import";
|
|
2797
2813
|
var RULE_FEATURES46 = [
|
|
2798
|
-
"
|
|
2814
|
+
"CHK",
|
|
2799
2815
|
"FIX"
|
|
2800
2816
|
];
|
|
2801
2817
|
var prefer_react_namespace_import_default = createRule({
|
|
@@ -2849,7 +2865,7 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
|
|
|
2849
2865
|
});
|
|
2850
2866
|
var RULE_NAME48 = "prefer-read-only-props";
|
|
2851
2867
|
var RULE_FEATURES47 = [
|
|
2852
|
-
"
|
|
2868
|
+
"CHK",
|
|
2853
2869
|
"TSC"
|
|
2854
2870
|
];
|
|
2855
2871
|
function isReadonlyType(type, services) {
|
|
@@ -2894,7 +2910,7 @@ var prefer_read_only_props_default = createRule({
|
|
|
2894
2910
|
});
|
|
2895
2911
|
var RULE_NAME49 = "prefer-shorthand-boolean";
|
|
2896
2912
|
var RULE_FEATURES48 = [
|
|
2897
|
-
"
|
|
2913
|
+
"CHK",
|
|
2898
2914
|
"FIX"
|
|
2899
2915
|
];
|
|
2900
2916
|
var prefer_shorthand_boolean_default = createRule({
|
|
@@ -2934,8 +2950,7 @@ var prefer_shorthand_boolean_default = createRule({
|
|
|
2934
2950
|
});
|
|
2935
2951
|
var RULE_NAME50 = "prefer-shorthand-fragment";
|
|
2936
2952
|
var RULE_FEATURES49 = [
|
|
2937
|
-
"
|
|
2938
|
-
// "FIX",
|
|
2953
|
+
"CHK"
|
|
2939
2954
|
];
|
|
2940
2955
|
var prefer_shorthand_fragment_default = createRule({
|
|
2941
2956
|
meta: {
|
|
@@ -2968,14 +2983,6 @@ var prefer_shorthand_fragment_default = createRule({
|
|
|
2968
2983
|
});
|
|
2969
2984
|
|
|
2970
2985
|
// src/index.ts
|
|
2971
|
-
var DEFAULT_ESLINT_REACT_SETTINGS = {
|
|
2972
|
-
additionalHooks: {
|
|
2973
|
-
useLayoutEffect: ["useIsomorphicLayoutEffect"]
|
|
2974
|
-
},
|
|
2975
|
-
polymorphicPropName: "as",
|
|
2976
|
-
strictImportCheck: true,
|
|
2977
|
-
version: "detect"
|
|
2978
|
-
};
|
|
2979
2986
|
var src_default = {
|
|
2980
2987
|
meta: {
|
|
2981
2988
|
name,
|
|
@@ -3035,8 +3042,7 @@ var src_default = {
|
|
|
3035
3042
|
// Deprecated Rules
|
|
3036
3043
|
/** @deprecated Use `no-complex-conditional-rendering` instead. */
|
|
3037
3044
|
"no-complicated-conditional-rendering": no_complex_conditional_rendering_default
|
|
3038
|
-
}
|
|
3039
|
-
DEFAULT_ESLINT_REACT_SETTINGS
|
|
3045
|
+
}
|
|
3040
3046
|
};
|
|
3041
3047
|
|
|
3042
3048
|
module.exports = src_default;
|
package/dist/index.mjs
CHANGED
|
@@ -14,13 +14,13 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
|
|
|
14
14
|
|
|
15
15
|
// package.json
|
|
16
16
|
var name = "eslint-plugin-react-x";
|
|
17
|
-
var version = "1.20.0
|
|
17
|
+
var version = "1.20.0";
|
|
18
18
|
var createRule = createRuleForPlugin("x");
|
|
19
19
|
|
|
20
20
|
// src/rules/avoid-shorthand-boolean.ts
|
|
21
21
|
var RULE_NAME = "avoid-shorthand-boolean";
|
|
22
22
|
var RULE_FEATURES = [
|
|
23
|
-
"
|
|
23
|
+
"CHK"
|
|
24
24
|
];
|
|
25
25
|
var avoid_shorthand_boolean_default = createRule({
|
|
26
26
|
meta: {
|
|
@@ -57,7 +57,7 @@ var avoid_shorthand_boolean_default = createRule({
|
|
|
57
57
|
// src/rules/avoid-shorthand-fragment.ts
|
|
58
58
|
var RULE_NAME2 = "avoid-shorthand-fragment";
|
|
59
59
|
var RULE_FEATURES2 = [
|
|
60
|
-
"
|
|
60
|
+
"CHK"
|
|
61
61
|
];
|
|
62
62
|
var avoid_shorthand_fragment_default = createRule({
|
|
63
63
|
meta: {
|
|
@@ -86,7 +86,7 @@ var avoid_shorthand_fragment_default = createRule({
|
|
|
86
86
|
});
|
|
87
87
|
var RULE_NAME3 = "ensure-forward-ref-using-ref";
|
|
88
88
|
var RULE_FEATURES3 = [
|
|
89
|
-
"
|
|
89
|
+
"CHK"
|
|
90
90
|
];
|
|
91
91
|
var ensure_forward_ref_using_ref_default = createRule({
|
|
92
92
|
meta: {
|
|
@@ -120,7 +120,7 @@ var ensure_forward_ref_using_ref_default = createRule({
|
|
|
120
120
|
});
|
|
121
121
|
var RULE_NAME4 = "jsx-no-duplicate-props";
|
|
122
122
|
var RULE_FEATURES4 = [
|
|
123
|
-
"
|
|
123
|
+
"CHK"
|
|
124
124
|
];
|
|
125
125
|
var jsx_no_duplicate_props_default = createRule({
|
|
126
126
|
meta: {
|
|
@@ -159,9 +159,7 @@ var jsx_no_duplicate_props_default = createRule({
|
|
|
159
159
|
defaultOptions: []
|
|
160
160
|
});
|
|
161
161
|
var RULE_NAME5 = "jsx-uses-vars";
|
|
162
|
-
var RULE_FEATURES5 = [
|
|
163
|
-
"LNT"
|
|
164
|
-
];
|
|
162
|
+
var RULE_FEATURES5 = [];
|
|
165
163
|
var jsx_uses_vars_default = createRule({
|
|
166
164
|
meta: {
|
|
167
165
|
type: "problem",
|
|
@@ -200,7 +198,7 @@ var jsx_uses_vars_default = createRule({
|
|
|
200
198
|
});
|
|
201
199
|
var RULE_NAME6 = "no-access-state-in-setstate";
|
|
202
200
|
var RULE_FEATURES6 = [
|
|
203
|
-
"
|
|
201
|
+
"CHK"
|
|
204
202
|
];
|
|
205
203
|
function getName(node) {
|
|
206
204
|
if (node.type === AST_NODE_TYPES.TSAsExpression) {
|
|
@@ -302,7 +300,7 @@ var no_access_state_in_setstate_default = createRule({
|
|
|
302
300
|
});
|
|
303
301
|
var RULE_NAME7 = "no-array-index-key";
|
|
304
302
|
var RULE_FEATURES7 = [
|
|
305
|
-
"
|
|
303
|
+
"CHK"
|
|
306
304
|
];
|
|
307
305
|
var reactChildrenMethod = ["forEach", "map"];
|
|
308
306
|
var iteratorFunctionIndexParamPosition = /* @__PURE__ */ new Map([
|
|
@@ -419,7 +417,7 @@ var no_array_index_key_default = createRule({
|
|
|
419
417
|
const [_, props] = node.arguments;
|
|
420
418
|
if (props?.type !== AST_NODE_TYPES.ObjectExpression) return;
|
|
421
419
|
for (const prop of props.properties) {
|
|
422
|
-
if (!isMatching({ key: { name: "key" } }
|
|
420
|
+
if (!isMatching({ key: { name: "key" } })(prop)) continue;
|
|
423
421
|
if (!("value" in prop)) continue;
|
|
424
422
|
const descriptors = getReportDescriptor(prop.value);
|
|
425
423
|
for (const descriptor of descriptors) {
|
|
@@ -446,7 +444,7 @@ var no_array_index_key_default = createRule({
|
|
|
446
444
|
});
|
|
447
445
|
var RULE_NAME8 = "no-children-count";
|
|
448
446
|
var RULE_FEATURES8 = [
|
|
449
|
-
"
|
|
447
|
+
"CHK"
|
|
450
448
|
];
|
|
451
449
|
var no_children_count_default = createRule({
|
|
452
450
|
meta: {
|
|
@@ -477,7 +475,7 @@ var no_children_count_default = createRule({
|
|
|
477
475
|
});
|
|
478
476
|
var RULE_NAME9 = "no-children-for-each";
|
|
479
477
|
var RULE_FEATURES9 = [
|
|
480
|
-
"
|
|
478
|
+
"CHK"
|
|
481
479
|
];
|
|
482
480
|
var no_children_for_each_default = createRule({
|
|
483
481
|
meta: {
|
|
@@ -508,7 +506,7 @@ var no_children_for_each_default = createRule({
|
|
|
508
506
|
});
|
|
509
507
|
var RULE_NAME10 = "no-children-map";
|
|
510
508
|
var RULE_FEATURES10 = [
|
|
511
|
-
"
|
|
509
|
+
"CHK"
|
|
512
510
|
];
|
|
513
511
|
var no_children_map_default = createRule({
|
|
514
512
|
meta: {
|
|
@@ -539,7 +537,7 @@ var no_children_map_default = createRule({
|
|
|
539
537
|
});
|
|
540
538
|
var RULE_NAME11 = "no-children-only";
|
|
541
539
|
var RULE_FEATURES11 = [
|
|
542
|
-
"
|
|
540
|
+
"CHK"
|
|
543
541
|
];
|
|
544
542
|
var no_children_only_default = createRule({
|
|
545
543
|
meta: {
|
|
@@ -570,7 +568,7 @@ var no_children_only_default = createRule({
|
|
|
570
568
|
});
|
|
571
569
|
var RULE_NAME12 = "no-children-prop";
|
|
572
570
|
var RULE_FEATURES12 = [
|
|
573
|
-
"
|
|
571
|
+
"CHK"
|
|
574
572
|
];
|
|
575
573
|
var no_children_prop_default = createRule({
|
|
576
574
|
meta: {
|
|
@@ -599,7 +597,7 @@ var no_children_prop_default = createRule({
|
|
|
599
597
|
});
|
|
600
598
|
var RULE_NAME13 = "no-children-to-array";
|
|
601
599
|
var RULE_FEATURES13 = [
|
|
602
|
-
"
|
|
600
|
+
"CHK"
|
|
603
601
|
];
|
|
604
602
|
var no_children_to_array_default = createRule({
|
|
605
603
|
meta: {
|
|
@@ -630,7 +628,7 @@ var no_children_to_array_default = createRule({
|
|
|
630
628
|
});
|
|
631
629
|
var RULE_NAME14 = "no-class-component";
|
|
632
630
|
var RULE_FEATURES14 = [
|
|
633
|
-
"
|
|
631
|
+
"CHK"
|
|
634
632
|
];
|
|
635
633
|
var isComponentDidCatch = isMatching({
|
|
636
634
|
key: {
|
|
@@ -686,7 +684,7 @@ var no_class_component_default = createRule({
|
|
|
686
684
|
});
|
|
687
685
|
var RULE_NAME15 = "no-clone-element";
|
|
688
686
|
var RULE_FEATURES15 = [
|
|
689
|
-
"
|
|
687
|
+
"CHK"
|
|
690
688
|
];
|
|
691
689
|
var no_clone_element_default = createRule({
|
|
692
690
|
meta: {
|
|
@@ -716,7 +714,7 @@ var no_clone_element_default = createRule({
|
|
|
716
714
|
});
|
|
717
715
|
var RULE_NAME16 = "no-comment-textnodes";
|
|
718
716
|
var RULE_FEATURES16 = [
|
|
719
|
-
"
|
|
717
|
+
"CHK"
|
|
720
718
|
];
|
|
721
719
|
var no_comment_textnodes_default = createRule({
|
|
722
720
|
meta: {
|
|
@@ -756,7 +754,7 @@ var no_comment_textnodes_default = createRule({
|
|
|
756
754
|
});
|
|
757
755
|
var RULE_NAME17 = "no-complex-conditional-rendering";
|
|
758
756
|
var RULE_FEATURES17 = [
|
|
759
|
-
"
|
|
757
|
+
"CHK"
|
|
760
758
|
];
|
|
761
759
|
var no_complex_conditional_rendering_default = createRule({
|
|
762
760
|
meta: {
|
|
@@ -794,7 +792,8 @@ var no_complex_conditional_rendering_default = createRule({
|
|
|
794
792
|
});
|
|
795
793
|
var RULE_NAME18 = "no-component-will-mount";
|
|
796
794
|
var RULE_FEATURES18 = [
|
|
797
|
-
"
|
|
795
|
+
"CHK",
|
|
796
|
+
"MOD"
|
|
798
797
|
];
|
|
799
798
|
function isComponentWillMount(node) {
|
|
800
799
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillMount";
|
|
@@ -806,6 +805,7 @@ var no_component_will_mount_default = createRule({
|
|
|
806
805
|
description: "disallow using 'componentWillMount'",
|
|
807
806
|
[Symbol.for("rule_features")]: RULE_FEATURES18
|
|
808
807
|
},
|
|
808
|
+
fixable: "code",
|
|
809
809
|
messages: {
|
|
810
810
|
noComponentWillMount: "[Deprecated] Use 'UNSAFE_componentWillMount' instead."
|
|
811
811
|
},
|
|
@@ -825,7 +825,11 @@ var no_component_will_mount_default = createRule({
|
|
|
825
825
|
if (isComponentWillMount(member)) {
|
|
826
826
|
context.report({
|
|
827
827
|
messageId: "noComponentWillMount",
|
|
828
|
-
node: member
|
|
828
|
+
node: member,
|
|
829
|
+
fix(fixer) {
|
|
830
|
+
if (!("key" in member)) return null;
|
|
831
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillMount");
|
|
832
|
+
}
|
|
829
833
|
});
|
|
830
834
|
}
|
|
831
835
|
}
|
|
@@ -837,7 +841,8 @@ var no_component_will_mount_default = createRule({
|
|
|
837
841
|
});
|
|
838
842
|
var RULE_NAME19 = "no-component-will-receive-props";
|
|
839
843
|
var RULE_FEATURES19 = [
|
|
840
|
-
"
|
|
844
|
+
"CHK",
|
|
845
|
+
"MOD"
|
|
841
846
|
];
|
|
842
847
|
function isComponentWillUpdate(node) {
|
|
843
848
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillReceiveProps";
|
|
@@ -849,6 +854,7 @@ var no_component_will_receive_props_default = createRule({
|
|
|
849
854
|
description: "disallow using 'componentWillReceiveProps'",
|
|
850
855
|
[Symbol.for("rule_features")]: RULE_FEATURES19
|
|
851
856
|
},
|
|
857
|
+
fixable: "code",
|
|
852
858
|
messages: {
|
|
853
859
|
noComponentWillReceiveProps: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead."
|
|
854
860
|
},
|
|
@@ -868,7 +874,11 @@ var no_component_will_receive_props_default = createRule({
|
|
|
868
874
|
if (isComponentWillUpdate(member)) {
|
|
869
875
|
context.report({
|
|
870
876
|
messageId: "noComponentWillReceiveProps",
|
|
871
|
-
node: member
|
|
877
|
+
node: member,
|
|
878
|
+
fix(fixer) {
|
|
879
|
+
if (!("key" in member)) return null;
|
|
880
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillReceiveProps");
|
|
881
|
+
}
|
|
872
882
|
});
|
|
873
883
|
}
|
|
874
884
|
}
|
|
@@ -880,7 +890,8 @@ var no_component_will_receive_props_default = createRule({
|
|
|
880
890
|
});
|
|
881
891
|
var RULE_NAME20 = "no-component-will-update";
|
|
882
892
|
var RULE_FEATURES20 = [
|
|
883
|
-
"
|
|
893
|
+
"CHK",
|
|
894
|
+
"MOD"
|
|
884
895
|
];
|
|
885
896
|
function isComponentWillUpdate2(node) {
|
|
886
897
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
@@ -892,6 +903,7 @@ var no_component_will_update_default = createRule({
|
|
|
892
903
|
description: "disallow using 'componentWillReceiveProps'",
|
|
893
904
|
[Symbol.for("rule_features")]: RULE_FEATURES20
|
|
894
905
|
},
|
|
906
|
+
fixable: "code",
|
|
895
907
|
messages: {
|
|
896
908
|
noComponentWillUpdate: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead."
|
|
897
909
|
},
|
|
@@ -911,7 +923,11 @@ var no_component_will_update_default = createRule({
|
|
|
911
923
|
if (isComponentWillUpdate2(member)) {
|
|
912
924
|
context.report({
|
|
913
925
|
messageId: "noComponentWillUpdate",
|
|
914
|
-
node: member
|
|
926
|
+
node: member,
|
|
927
|
+
fix(fixer) {
|
|
928
|
+
if (!("key" in member)) return null;
|
|
929
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillUpdate");
|
|
930
|
+
}
|
|
915
931
|
});
|
|
916
932
|
}
|
|
917
933
|
}
|
|
@@ -923,8 +939,8 @@ var no_component_will_update_default = createRule({
|
|
|
923
939
|
});
|
|
924
940
|
var RULE_NAME21 = "no-context-provider";
|
|
925
941
|
var RULE_FEATURES21 = [
|
|
926
|
-
"
|
|
927
|
-
"
|
|
942
|
+
"CHK",
|
|
943
|
+
"MOD"
|
|
928
944
|
];
|
|
929
945
|
var no_context_provider_default = createRule({
|
|
930
946
|
meta: {
|
|
@@ -969,7 +985,7 @@ var no_context_provider_default = createRule({
|
|
|
969
985
|
});
|
|
970
986
|
var RULE_NAME22 = "no-create-ref";
|
|
971
987
|
var RULE_FEATURES22 = [
|
|
972
|
-
"
|
|
988
|
+
"CHK"
|
|
973
989
|
];
|
|
974
990
|
var no_create_ref_default = createRule({
|
|
975
991
|
meta: {
|
|
@@ -997,7 +1013,7 @@ var no_create_ref_default = createRule({
|
|
|
997
1013
|
});
|
|
998
1014
|
var RULE_NAME23 = "no-default-props";
|
|
999
1015
|
var RULE_FEATURES23 = [
|
|
1000
|
-
"
|
|
1016
|
+
"CHK"
|
|
1001
1017
|
];
|
|
1002
1018
|
var no_default_props_default = createRule({
|
|
1003
1019
|
meta: {
|
|
@@ -1040,7 +1056,7 @@ var no_default_props_default = createRule({
|
|
|
1040
1056
|
});
|
|
1041
1057
|
var RULE_NAME24 = "no-direct-mutation-state";
|
|
1042
1058
|
var RULE_FEATURES24 = [
|
|
1043
|
-
"
|
|
1059
|
+
"CHK"
|
|
1044
1060
|
];
|
|
1045
1061
|
function getName2(node) {
|
|
1046
1062
|
if (node.type === AST_NODE_TYPES.TSAsExpression) {
|
|
@@ -1102,7 +1118,7 @@ var no_direct_mutation_state_default = createRule({
|
|
|
1102
1118
|
});
|
|
1103
1119
|
var RULE_NAME25 = "no-duplicate-key";
|
|
1104
1120
|
var RULE_FEATURES25 = [
|
|
1105
|
-
"
|
|
1121
|
+
"CHK"
|
|
1106
1122
|
];
|
|
1107
1123
|
var no_duplicate_key_default = createRule({
|
|
1108
1124
|
meta: {
|
|
@@ -1235,8 +1251,8 @@ var no_duplicate_key_default = createRule({
|
|
|
1235
1251
|
});
|
|
1236
1252
|
var RULE_NAME26 = "no-forward-ref";
|
|
1237
1253
|
var RULE_FEATURES26 = [
|
|
1238
|
-
"
|
|
1239
|
-
"
|
|
1254
|
+
"CHK",
|
|
1255
|
+
"MOD"
|
|
1240
1256
|
];
|
|
1241
1257
|
var no_forward_ref_default = createRule({
|
|
1242
1258
|
meta: {
|
|
@@ -1332,7 +1348,7 @@ function getComponentPropsFixes(node, typeArguments, fixer, context) {
|
|
|
1332
1348
|
}
|
|
1333
1349
|
var RULE_NAME27 = "no-implicit-key";
|
|
1334
1350
|
var RULE_FEATURES27 = [
|
|
1335
|
-
"
|
|
1351
|
+
"CHK"
|
|
1336
1352
|
];
|
|
1337
1353
|
var no_implicit_key_default = createRule({
|
|
1338
1354
|
meta: {
|
|
@@ -1391,7 +1407,7 @@ function unionTypeParts(type) {
|
|
|
1391
1407
|
}
|
|
1392
1408
|
var RULE_NAME28 = "no-leaked-conditional-rendering";
|
|
1393
1409
|
var RULE_FEATURES28 = [
|
|
1394
|
-
"
|
|
1410
|
+
"CHK",
|
|
1395
1411
|
"TSC"
|
|
1396
1412
|
];
|
|
1397
1413
|
var tsHelpers = {
|
|
@@ -1557,7 +1573,7 @@ var no_leaked_conditional_rendering_default = createRule({
|
|
|
1557
1573
|
});
|
|
1558
1574
|
var RULE_NAME29 = "no-missing-component-display-name";
|
|
1559
1575
|
var RULE_FEATURES29 = [
|
|
1560
|
-
"
|
|
1576
|
+
"CHK"
|
|
1561
1577
|
];
|
|
1562
1578
|
var no_missing_component_display_name_default = createRule({
|
|
1563
1579
|
meta: {
|
|
@@ -1597,7 +1613,7 @@ var no_missing_component_display_name_default = createRule({
|
|
|
1597
1613
|
});
|
|
1598
1614
|
var RULE_NAME30 = "no-missing-key";
|
|
1599
1615
|
var RULE_FEATURES30 = [
|
|
1600
|
-
"
|
|
1616
|
+
"CHK"
|
|
1601
1617
|
];
|
|
1602
1618
|
var no_missing_key_default = createRule({
|
|
1603
1619
|
meta: {
|
|
@@ -1718,7 +1734,7 @@ var no_missing_key_default = createRule({
|
|
|
1718
1734
|
});
|
|
1719
1735
|
var RULE_NAME31 = "no-nested-components";
|
|
1720
1736
|
var RULE_FEATURES31 = [
|
|
1721
|
-
"
|
|
1737
|
+
"CHK"
|
|
1722
1738
|
];
|
|
1723
1739
|
var no_nested_components_default = createRule({
|
|
1724
1740
|
meta: {
|
|
@@ -1819,7 +1835,7 @@ var no_nested_components_default = createRule({
|
|
|
1819
1835
|
});
|
|
1820
1836
|
var RULE_NAME32 = "no-prop-types";
|
|
1821
1837
|
var RULE_FEATURES32 = [
|
|
1822
|
-
"
|
|
1838
|
+
"CHK"
|
|
1823
1839
|
];
|
|
1824
1840
|
var no_prop_types_default = createRule({
|
|
1825
1841
|
meta: {
|
|
@@ -1862,7 +1878,7 @@ var no_prop_types_default = createRule({
|
|
|
1862
1878
|
});
|
|
1863
1879
|
var RULE_NAME33 = "no-redundant-should-component-update";
|
|
1864
1880
|
var RULE_FEATURES33 = [
|
|
1865
|
-
"
|
|
1881
|
+
"CHK"
|
|
1866
1882
|
];
|
|
1867
1883
|
function isShouldComponentUpdate(node) {
|
|
1868
1884
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
|
|
@@ -1909,7 +1925,7 @@ var no_redundant_should_component_update_default = createRule({
|
|
|
1909
1925
|
});
|
|
1910
1926
|
var RULE_NAME34 = "no-set-state-in-component-did-mount";
|
|
1911
1927
|
var RULE_FEATURES34 = [
|
|
1912
|
-
"
|
|
1928
|
+
"CHK"
|
|
1913
1929
|
];
|
|
1914
1930
|
function isComponentDidMount(node) {
|
|
1915
1931
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
@@ -1956,7 +1972,7 @@ var no_set_state_in_component_did_mount_default = createRule({
|
|
|
1956
1972
|
});
|
|
1957
1973
|
var RULE_NAME35 = "no-set-state-in-component-did-update";
|
|
1958
1974
|
var RULE_FEATURES35 = [
|
|
1959
|
-
"
|
|
1975
|
+
"CHK"
|
|
1960
1976
|
];
|
|
1961
1977
|
function isComponentDidUpdate(node) {
|
|
1962
1978
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
|
|
@@ -2003,7 +2019,7 @@ var no_set_state_in_component_did_update_default = createRule({
|
|
|
2003
2019
|
});
|
|
2004
2020
|
var RULE_NAME36 = "no-set-state-in-component-will-update";
|
|
2005
2021
|
var RULE_FEATURES36 = [
|
|
2006
|
-
"
|
|
2022
|
+
"CHK"
|
|
2007
2023
|
];
|
|
2008
2024
|
function isComponentWillUpdate3(node) {
|
|
2009
2025
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
@@ -2050,7 +2066,7 @@ var no_set_state_in_component_will_update_default = createRule({
|
|
|
2050
2066
|
});
|
|
2051
2067
|
var RULE_NAME37 = "no-string-refs";
|
|
2052
2068
|
var RULE_FEATURES37 = [
|
|
2053
|
-
"
|
|
2069
|
+
"CHK"
|
|
2054
2070
|
];
|
|
2055
2071
|
function containsStringLiteral({ value }) {
|
|
2056
2072
|
return value?.type === AST_NODE_TYPES.Literal && isString(value.value);
|
|
@@ -2090,7 +2106,7 @@ var no_string_refs_default = createRule({
|
|
|
2090
2106
|
});
|
|
2091
2107
|
var RULE_NAME38 = "no-unsafe-component-will-mount";
|
|
2092
2108
|
var RULE_FEATURES38 = [
|
|
2093
|
-
"
|
|
2109
|
+
"CHK"
|
|
2094
2110
|
];
|
|
2095
2111
|
function isUnsafeComponentWillMount(node) {
|
|
2096
2112
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
|
|
@@ -2133,7 +2149,7 @@ var no_unsafe_component_will_mount_default = createRule({
|
|
|
2133
2149
|
});
|
|
2134
2150
|
var RULE_NAME39 = "no-unsafe-component-will-receive-props";
|
|
2135
2151
|
var RULE_FEATURES39 = [
|
|
2136
|
-
"
|
|
2152
|
+
"CHK"
|
|
2137
2153
|
];
|
|
2138
2154
|
function isUnsafeComponentWillReceiveProps(node) {
|
|
2139
2155
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
|
|
@@ -2176,7 +2192,7 @@ var no_unsafe_component_will_receive_props_default = createRule({
|
|
|
2176
2192
|
});
|
|
2177
2193
|
var RULE_NAME40 = "no-unsafe-component-will-update";
|
|
2178
2194
|
var RULE_FEATURES40 = [
|
|
2179
|
-
"
|
|
2195
|
+
"CHK"
|
|
2180
2196
|
];
|
|
2181
2197
|
function isUnsafeComponentWillUpdate(node) {
|
|
2182
2198
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
|
|
@@ -2219,7 +2235,7 @@ var no_unsafe_component_will_update_default = createRule({
|
|
|
2219
2235
|
});
|
|
2220
2236
|
var RULE_NAME41 = "no-unstable-context-value";
|
|
2221
2237
|
var RULE_FEATURES41 = [
|
|
2222
|
-
"
|
|
2238
|
+
"CHK"
|
|
2223
2239
|
];
|
|
2224
2240
|
var no_unstable_context_value_default = createRule({
|
|
2225
2241
|
meta: {
|
|
@@ -2290,7 +2306,7 @@ var no_unstable_context_value_default = createRule({
|
|
|
2290
2306
|
});
|
|
2291
2307
|
var RULE_NAME42 = "no-unstable-default-props";
|
|
2292
2308
|
var RULE_FEATURES42 = [
|
|
2293
|
-
"
|
|
2309
|
+
"CHK"
|
|
2294
2310
|
];
|
|
2295
2311
|
var no_unstable_default_props_default = createRule({
|
|
2296
2312
|
meta: {
|
|
@@ -2359,7 +2375,7 @@ var no_unstable_default_props_default = createRule({
|
|
|
2359
2375
|
});
|
|
2360
2376
|
var RULE_NAME43 = "no-unused-class-component-members";
|
|
2361
2377
|
var RULE_FEATURES43 = [
|
|
2362
|
-
"
|
|
2378
|
+
"CHK"
|
|
2363
2379
|
];
|
|
2364
2380
|
var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
|
|
2365
2381
|
"componentDidCatch",
|
|
@@ -2490,7 +2506,7 @@ var no_unused_class_component_members_default = createRule({
|
|
|
2490
2506
|
});
|
|
2491
2507
|
var RULE_NAME44 = "no-unused-state";
|
|
2492
2508
|
var RULE_FEATURES44 = [
|
|
2493
|
-
"
|
|
2509
|
+
"CHK"
|
|
2494
2510
|
];
|
|
2495
2511
|
function getName4(node) {
|
|
2496
2512
|
if (node.type === AST_NODE_TYPES.TSAsExpression) {
|
|
@@ -2694,7 +2710,7 @@ var no_useless_fragment_default = createRule({
|
|
|
2694
2710
|
});
|
|
2695
2711
|
var RULE_NAME46 = "prefer-destructuring-assignment";
|
|
2696
2712
|
var RULE_FEATURES45 = [
|
|
2697
|
-
"
|
|
2713
|
+
"CHK"
|
|
2698
2714
|
];
|
|
2699
2715
|
function isMemberExpressionWithObjectName(node) {
|
|
2700
2716
|
return node.object.type === AST_NODE_TYPES.Identifier && "name" in node.object;
|
|
@@ -2768,7 +2784,7 @@ var prefer_destructuring_assignment_default = createRule({
|
|
|
2768
2784
|
});
|
|
2769
2785
|
var RULE_NAME47 = "prefer-react-namespace-import";
|
|
2770
2786
|
var RULE_FEATURES46 = [
|
|
2771
|
-
"
|
|
2787
|
+
"CHK",
|
|
2772
2788
|
"FIX"
|
|
2773
2789
|
];
|
|
2774
2790
|
var prefer_react_namespace_import_default = createRule({
|
|
@@ -2822,7 +2838,7 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
|
|
|
2822
2838
|
});
|
|
2823
2839
|
var RULE_NAME48 = "prefer-read-only-props";
|
|
2824
2840
|
var RULE_FEATURES47 = [
|
|
2825
|
-
"
|
|
2841
|
+
"CHK",
|
|
2826
2842
|
"TSC"
|
|
2827
2843
|
];
|
|
2828
2844
|
function isReadonlyType(type, services) {
|
|
@@ -2867,7 +2883,7 @@ var prefer_read_only_props_default = createRule({
|
|
|
2867
2883
|
});
|
|
2868
2884
|
var RULE_NAME49 = "prefer-shorthand-boolean";
|
|
2869
2885
|
var RULE_FEATURES48 = [
|
|
2870
|
-
"
|
|
2886
|
+
"CHK",
|
|
2871
2887
|
"FIX"
|
|
2872
2888
|
];
|
|
2873
2889
|
var prefer_shorthand_boolean_default = createRule({
|
|
@@ -2907,8 +2923,7 @@ var prefer_shorthand_boolean_default = createRule({
|
|
|
2907
2923
|
});
|
|
2908
2924
|
var RULE_NAME50 = "prefer-shorthand-fragment";
|
|
2909
2925
|
var RULE_FEATURES49 = [
|
|
2910
|
-
"
|
|
2911
|
-
// "FIX",
|
|
2926
|
+
"CHK"
|
|
2912
2927
|
];
|
|
2913
2928
|
var prefer_shorthand_fragment_default = createRule({
|
|
2914
2929
|
meta: {
|
|
@@ -2941,14 +2956,6 @@ var prefer_shorthand_fragment_default = createRule({
|
|
|
2941
2956
|
});
|
|
2942
2957
|
|
|
2943
2958
|
// src/index.ts
|
|
2944
|
-
var DEFAULT_ESLINT_REACT_SETTINGS = {
|
|
2945
|
-
additionalHooks: {
|
|
2946
|
-
useLayoutEffect: ["useIsomorphicLayoutEffect"]
|
|
2947
|
-
},
|
|
2948
|
-
polymorphicPropName: "as",
|
|
2949
|
-
strictImportCheck: true,
|
|
2950
|
-
version: "detect"
|
|
2951
|
-
};
|
|
2952
2959
|
var src_default = {
|
|
2953
2960
|
meta: {
|
|
2954
2961
|
name,
|
|
@@ -3008,8 +3015,7 @@ var src_default = {
|
|
|
3008
3015
|
// Deprecated Rules
|
|
3009
3016
|
/** @deprecated Use `no-complex-conditional-rendering` instead. */
|
|
3010
3017
|
"no-complicated-conditional-rendering": no_complex_conditional_rendering_default
|
|
3011
|
-
}
|
|
3012
|
-
DEFAULT_ESLINT_REACT_SETTINGS
|
|
3018
|
+
}
|
|
3013
3019
|
};
|
|
3014
3020
|
|
|
3015
3021
|
export { src_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.20.0
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"@typescript-eslint/utils": "^8.18.0",
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"is-immutable-type": "^5.0.0",
|
|
51
|
-
"ts-pattern": "^5.
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/jsx": "1.20.0
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/types": "1.20.0
|
|
58
|
-
"@eslint-react/var": "1.20.0
|
|
51
|
+
"ts-pattern": "^5.6.0",
|
|
52
|
+
"@eslint-react/core": "1.20.0",
|
|
53
|
+
"@eslint-react/ast": "1.20.0",
|
|
54
|
+
"@eslint-react/jsx": "1.20.0",
|
|
55
|
+
"@eslint-react/shared": "1.20.0",
|
|
56
|
+
"@eslint-react/tools": "1.20.0",
|
|
57
|
+
"@eslint-react/types": "1.20.0",
|
|
58
|
+
"@eslint-react/var": "1.20.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.1",
|