eslint-plugin-react-x 1.20.0-next.11 → 1.20.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -9
- package/dist/index.mjs +27 -9
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
43
|
var name = "eslint-plugin-react-x";
|
|
44
|
-
var version = "1.20.0-next.
|
|
44
|
+
var version = "1.20.0-next.12";
|
|
45
45
|
var createRule = shared.createRuleForPlugin("x");
|
|
46
46
|
|
|
47
47
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -819,7 +819,8 @@ var no_complex_conditional_rendering_default = createRule({
|
|
|
819
819
|
});
|
|
820
820
|
var RULE_NAME18 = "no-component-will-mount";
|
|
821
821
|
var RULE_FEATURES18 = [
|
|
822
|
-
"CHK"
|
|
822
|
+
"CHK",
|
|
823
|
+
"MOD"
|
|
823
824
|
];
|
|
824
825
|
function isComponentWillMount(node) {
|
|
825
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";
|
|
@@ -831,6 +832,7 @@ var no_component_will_mount_default = createRule({
|
|
|
831
832
|
description: "disallow using 'componentWillMount'",
|
|
832
833
|
[Symbol.for("rule_features")]: RULE_FEATURES18
|
|
833
834
|
},
|
|
835
|
+
fixable: "code",
|
|
834
836
|
messages: {
|
|
835
837
|
noComponentWillMount: "[Deprecated] Use 'UNSAFE_componentWillMount' instead."
|
|
836
838
|
},
|
|
@@ -850,7 +852,11 @@ var no_component_will_mount_default = createRule({
|
|
|
850
852
|
if (isComponentWillMount(member)) {
|
|
851
853
|
context.report({
|
|
852
854
|
messageId: "noComponentWillMount",
|
|
853
|
-
node: member
|
|
855
|
+
node: member,
|
|
856
|
+
fix(fixer) {
|
|
857
|
+
if (!("key" in member)) return null;
|
|
858
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillMount");
|
|
859
|
+
}
|
|
854
860
|
});
|
|
855
861
|
}
|
|
856
862
|
}
|
|
@@ -862,7 +868,8 @@ var no_component_will_mount_default = createRule({
|
|
|
862
868
|
});
|
|
863
869
|
var RULE_NAME19 = "no-component-will-receive-props";
|
|
864
870
|
var RULE_FEATURES19 = [
|
|
865
|
-
"CHK"
|
|
871
|
+
"CHK",
|
|
872
|
+
"MOD"
|
|
866
873
|
];
|
|
867
874
|
function isComponentWillUpdate(node) {
|
|
868
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";
|
|
@@ -874,6 +881,7 @@ var no_component_will_receive_props_default = createRule({
|
|
|
874
881
|
description: "disallow using 'componentWillReceiveProps'",
|
|
875
882
|
[Symbol.for("rule_features")]: RULE_FEATURES19
|
|
876
883
|
},
|
|
884
|
+
fixable: "code",
|
|
877
885
|
messages: {
|
|
878
886
|
noComponentWillReceiveProps: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead."
|
|
879
887
|
},
|
|
@@ -893,7 +901,11 @@ var no_component_will_receive_props_default = createRule({
|
|
|
893
901
|
if (isComponentWillUpdate(member)) {
|
|
894
902
|
context.report({
|
|
895
903
|
messageId: "noComponentWillReceiveProps",
|
|
896
|
-
node: member
|
|
904
|
+
node: member,
|
|
905
|
+
fix(fixer) {
|
|
906
|
+
if (!("key" in member)) return null;
|
|
907
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillReceiveProps");
|
|
908
|
+
}
|
|
897
909
|
});
|
|
898
910
|
}
|
|
899
911
|
}
|
|
@@ -905,7 +917,8 @@ var no_component_will_receive_props_default = createRule({
|
|
|
905
917
|
});
|
|
906
918
|
var RULE_NAME20 = "no-component-will-update";
|
|
907
919
|
var RULE_FEATURES20 = [
|
|
908
|
-
"CHK"
|
|
920
|
+
"CHK",
|
|
921
|
+
"MOD"
|
|
909
922
|
];
|
|
910
923
|
function isComponentWillUpdate2(node) {
|
|
911
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";
|
|
@@ -917,6 +930,7 @@ var no_component_will_update_default = createRule({
|
|
|
917
930
|
description: "disallow using 'componentWillReceiveProps'",
|
|
918
931
|
[Symbol.for("rule_features")]: RULE_FEATURES20
|
|
919
932
|
},
|
|
933
|
+
fixable: "code",
|
|
920
934
|
messages: {
|
|
921
935
|
noComponentWillUpdate: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead."
|
|
922
936
|
},
|
|
@@ -936,7 +950,11 @@ var no_component_will_update_default = createRule({
|
|
|
936
950
|
if (isComponentWillUpdate2(member)) {
|
|
937
951
|
context.report({
|
|
938
952
|
messageId: "noComponentWillUpdate",
|
|
939
|
-
node: member
|
|
953
|
+
node: member,
|
|
954
|
+
fix(fixer) {
|
|
955
|
+
if (!("key" in member)) return null;
|
|
956
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillUpdate");
|
|
957
|
+
}
|
|
940
958
|
});
|
|
941
959
|
}
|
|
942
960
|
}
|
|
@@ -949,7 +967,7 @@ var no_component_will_update_default = createRule({
|
|
|
949
967
|
var RULE_NAME21 = "no-context-provider";
|
|
950
968
|
var RULE_FEATURES21 = [
|
|
951
969
|
"CHK",
|
|
952
|
-
"
|
|
970
|
+
"MOD"
|
|
953
971
|
];
|
|
954
972
|
var no_context_provider_default = createRule({
|
|
955
973
|
meta: {
|
|
@@ -1261,7 +1279,7 @@ var no_duplicate_key_default = createRule({
|
|
|
1261
1279
|
var RULE_NAME26 = "no-forward-ref";
|
|
1262
1280
|
var RULE_FEATURES26 = [
|
|
1263
1281
|
"CHK",
|
|
1264
|
-
"
|
|
1282
|
+
"MOD"
|
|
1265
1283
|
];
|
|
1266
1284
|
var no_forward_ref_default = createRule({
|
|
1267
1285
|
meta: {
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
|
|
|
14
14
|
|
|
15
15
|
// package.json
|
|
16
16
|
var name = "eslint-plugin-react-x";
|
|
17
|
-
var version = "1.20.0-next.
|
|
17
|
+
var version = "1.20.0-next.12";
|
|
18
18
|
var createRule = createRuleForPlugin("x");
|
|
19
19
|
|
|
20
20
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -792,7 +792,8 @@ var no_complex_conditional_rendering_default = createRule({
|
|
|
792
792
|
});
|
|
793
793
|
var RULE_NAME18 = "no-component-will-mount";
|
|
794
794
|
var RULE_FEATURES18 = [
|
|
795
|
-
"CHK"
|
|
795
|
+
"CHK",
|
|
796
|
+
"MOD"
|
|
796
797
|
];
|
|
797
798
|
function isComponentWillMount(node) {
|
|
798
799
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillMount";
|
|
@@ -804,6 +805,7 @@ var no_component_will_mount_default = createRule({
|
|
|
804
805
|
description: "disallow using 'componentWillMount'",
|
|
805
806
|
[Symbol.for("rule_features")]: RULE_FEATURES18
|
|
806
807
|
},
|
|
808
|
+
fixable: "code",
|
|
807
809
|
messages: {
|
|
808
810
|
noComponentWillMount: "[Deprecated] Use 'UNSAFE_componentWillMount' instead."
|
|
809
811
|
},
|
|
@@ -823,7 +825,11 @@ var no_component_will_mount_default = createRule({
|
|
|
823
825
|
if (isComponentWillMount(member)) {
|
|
824
826
|
context.report({
|
|
825
827
|
messageId: "noComponentWillMount",
|
|
826
|
-
node: member
|
|
828
|
+
node: member,
|
|
829
|
+
fix(fixer) {
|
|
830
|
+
if (!("key" in member)) return null;
|
|
831
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillMount");
|
|
832
|
+
}
|
|
827
833
|
});
|
|
828
834
|
}
|
|
829
835
|
}
|
|
@@ -835,7 +841,8 @@ var no_component_will_mount_default = createRule({
|
|
|
835
841
|
});
|
|
836
842
|
var RULE_NAME19 = "no-component-will-receive-props";
|
|
837
843
|
var RULE_FEATURES19 = [
|
|
838
|
-
"CHK"
|
|
844
|
+
"CHK",
|
|
845
|
+
"MOD"
|
|
839
846
|
];
|
|
840
847
|
function isComponentWillUpdate(node) {
|
|
841
848
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillReceiveProps";
|
|
@@ -847,6 +854,7 @@ var no_component_will_receive_props_default = createRule({
|
|
|
847
854
|
description: "disallow using 'componentWillReceiveProps'",
|
|
848
855
|
[Symbol.for("rule_features")]: RULE_FEATURES19
|
|
849
856
|
},
|
|
857
|
+
fixable: "code",
|
|
850
858
|
messages: {
|
|
851
859
|
noComponentWillReceiveProps: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead."
|
|
852
860
|
},
|
|
@@ -866,7 +874,11 @@ var no_component_will_receive_props_default = createRule({
|
|
|
866
874
|
if (isComponentWillUpdate(member)) {
|
|
867
875
|
context.report({
|
|
868
876
|
messageId: "noComponentWillReceiveProps",
|
|
869
|
-
node: member
|
|
877
|
+
node: member,
|
|
878
|
+
fix(fixer) {
|
|
879
|
+
if (!("key" in member)) return null;
|
|
880
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillReceiveProps");
|
|
881
|
+
}
|
|
870
882
|
});
|
|
871
883
|
}
|
|
872
884
|
}
|
|
@@ -878,7 +890,8 @@ var no_component_will_receive_props_default = createRule({
|
|
|
878
890
|
});
|
|
879
891
|
var RULE_NAME20 = "no-component-will-update";
|
|
880
892
|
var RULE_FEATURES20 = [
|
|
881
|
-
"CHK"
|
|
893
|
+
"CHK",
|
|
894
|
+
"MOD"
|
|
882
895
|
];
|
|
883
896
|
function isComponentWillUpdate2(node) {
|
|
884
897
|
return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
@@ -890,6 +903,7 @@ var no_component_will_update_default = createRule({
|
|
|
890
903
|
description: "disallow using 'componentWillReceiveProps'",
|
|
891
904
|
[Symbol.for("rule_features")]: RULE_FEATURES20
|
|
892
905
|
},
|
|
906
|
+
fixable: "code",
|
|
893
907
|
messages: {
|
|
894
908
|
noComponentWillUpdate: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead."
|
|
895
909
|
},
|
|
@@ -909,7 +923,11 @@ var no_component_will_update_default = createRule({
|
|
|
909
923
|
if (isComponentWillUpdate2(member)) {
|
|
910
924
|
context.report({
|
|
911
925
|
messageId: "noComponentWillUpdate",
|
|
912
|
-
node: member
|
|
926
|
+
node: member,
|
|
927
|
+
fix(fixer) {
|
|
928
|
+
if (!("key" in member)) return null;
|
|
929
|
+
return fixer.replaceText(member.key, "UNSAFE_componentWillUpdate");
|
|
930
|
+
}
|
|
913
931
|
});
|
|
914
932
|
}
|
|
915
933
|
}
|
|
@@ -922,7 +940,7 @@ var no_component_will_update_default = createRule({
|
|
|
922
940
|
var RULE_NAME21 = "no-context-provider";
|
|
923
941
|
var RULE_FEATURES21 = [
|
|
924
942
|
"CHK",
|
|
925
|
-
"
|
|
943
|
+
"MOD"
|
|
926
944
|
];
|
|
927
945
|
var no_context_provider_default = createRule({
|
|
928
946
|
meta: {
|
|
@@ -1234,7 +1252,7 @@ var no_duplicate_key_default = createRule({
|
|
|
1234
1252
|
var RULE_NAME26 = "no-forward-ref";
|
|
1235
1253
|
var RULE_FEATURES26 = [
|
|
1236
1254
|
"CHK",
|
|
1237
|
-
"
|
|
1255
|
+
"MOD"
|
|
1238
1256
|
];
|
|
1239
1257
|
var no_forward_ref_default = createRule({
|
|
1240
1258
|
meta: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.20.0-next.
|
|
3
|
+
"version": "1.20.0-next.12",
|
|
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",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"is-immutable-type": "^5.0.0",
|
|
51
51
|
"ts-pattern": "^5.6.0",
|
|
52
|
-
"@eslint-react/ast": "1.20.0-next.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.20.0-next.12",
|
|
53
|
+
"@eslint-react/jsx": "1.20.0-next.12",
|
|
54
|
+
"@eslint-react/core": "1.20.0-next.12",
|
|
55
|
+
"@eslint-react/types": "1.20.0-next.12",
|
|
56
|
+
"@eslint-react/var": "1.20.0-next.12",
|
|
57
|
+
"@eslint-react/shared": "1.20.0-next.12",
|
|
58
|
+
"@eslint-react/tools": "1.20.0-next.12"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.1",
|