eslint-plugin-react-x 2.6.5-next.0 → 2.6.5-next.1
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 +15 -15
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -68,7 +68,7 @@ const rules$7 = {
|
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region package.json
|
|
70
70
|
var name$6 = "eslint-plugin-react-x";
|
|
71
|
-
var version = "2.6.5-next.
|
|
71
|
+
var version = "2.6.5-next.1";
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region src/utils/create-rule.ts
|
|
@@ -937,7 +937,7 @@ var no_class_component_default = createRule({
|
|
|
937
937
|
});
|
|
938
938
|
function create$45(context) {
|
|
939
939
|
if (!context.sourceCode.text.includes("Component")) return {};
|
|
940
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
940
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
941
941
|
return {
|
|
942
942
|
...listeners,
|
|
943
943
|
"Program:exit"(program) {
|
|
@@ -993,7 +993,7 @@ var no_component_will_mount_default = createRule({
|
|
|
993
993
|
});
|
|
994
994
|
function create$43(context) {
|
|
995
995
|
if (!context.sourceCode.text.includes("componentWillMount")) return {};
|
|
996
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
996
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
997
997
|
return {
|
|
998
998
|
...listeners,
|
|
999
999
|
"Program:exit"(program) {
|
|
@@ -1029,7 +1029,7 @@ var no_component_will_receive_props_default = createRule({
|
|
|
1029
1029
|
});
|
|
1030
1030
|
function create$42(context) {
|
|
1031
1031
|
if (!context.sourceCode.text.includes("componentWillReceiveProps")) return {};
|
|
1032
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
1032
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
1033
1033
|
return {
|
|
1034
1034
|
...listeners,
|
|
1035
1035
|
"Program:exit"(program) {
|
|
@@ -1065,7 +1065,7 @@ var no_component_will_update_default = createRule({
|
|
|
1065
1065
|
});
|
|
1066
1066
|
function create$41(context) {
|
|
1067
1067
|
if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
|
|
1068
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
1068
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
1069
1069
|
return {
|
|
1070
1070
|
...listeners,
|
|
1071
1071
|
"Program:exit"(program) {
|
|
@@ -1734,7 +1734,7 @@ var no_nested_component_definitions_default = createRule({
|
|
|
1734
1734
|
});
|
|
1735
1735
|
function create$28(context) {
|
|
1736
1736
|
const fCollector = useComponentCollector(context, { hint: ComponentDetectionHint.SkipArrayMapCallback | ComponentDetectionHint.SkipNullLiteral | ComponentDetectionHint.SkipUndefined | ComponentDetectionHint.SkipBooleanLiteral | ComponentDetectionHint.SkipStringLiteral | ComponentDetectionHint.SkipNumberLiteral | ComponentDetectionHint.StrictLogical | ComponentDetectionHint.StrictConditional });
|
|
1737
|
-
const cCollector = useComponentCollectorLegacy();
|
|
1737
|
+
const cCollector = useComponentCollectorLegacy(context);
|
|
1738
1738
|
return {
|
|
1739
1739
|
...fCollector.listeners,
|
|
1740
1740
|
...cCollector.listeners,
|
|
@@ -1855,7 +1855,7 @@ var no_nested_lazy_component_declarations_default = createRule({
|
|
|
1855
1855
|
function create$27(context) {
|
|
1856
1856
|
const hint = ComponentDetectionHint.None;
|
|
1857
1857
|
const collector = useComponentCollector(context, { hint });
|
|
1858
|
-
const collectorLegacy = useComponentCollectorLegacy();
|
|
1858
|
+
const collectorLegacy = useComponentCollectorLegacy(context);
|
|
1859
1859
|
const lazyComponentDeclarations = /* @__PURE__ */ new Set();
|
|
1860
1860
|
return {
|
|
1861
1861
|
...collector.listeners,
|
|
@@ -1940,7 +1940,7 @@ var no_redundant_should_component_update_default = createRule({
|
|
|
1940
1940
|
});
|
|
1941
1941
|
function create$25(context) {
|
|
1942
1942
|
if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
|
|
1943
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
1943
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
1944
1944
|
return {
|
|
1945
1945
|
...listeners,
|
|
1946
1946
|
"Program:exit"(program) {
|
|
@@ -2422,7 +2422,7 @@ var no_unsafe_component_will_mount_default = createRule({
|
|
|
2422
2422
|
});
|
|
2423
2423
|
function create$15(context) {
|
|
2424
2424
|
if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
|
|
2425
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
2425
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
2426
2426
|
return {
|
|
2427
2427
|
...listeners,
|
|
2428
2428
|
"Program:exit"(program) {
|
|
@@ -2453,7 +2453,7 @@ var no_unsafe_component_will_receive_props_default = createRule({
|
|
|
2453
2453
|
});
|
|
2454
2454
|
function create$14(context) {
|
|
2455
2455
|
if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) return {};
|
|
2456
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
2456
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
2457
2457
|
return {
|
|
2458
2458
|
...listeners,
|
|
2459
2459
|
"Program:exit"(program) {
|
|
@@ -2484,7 +2484,7 @@ var no_unsafe_component_will_update_default = createRule({
|
|
|
2484
2484
|
});
|
|
2485
2485
|
function create$13(context) {
|
|
2486
2486
|
if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
|
|
2487
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
2487
|
+
const { ctx, listeners } = useComponentCollectorLegacy(context);
|
|
2488
2488
|
return {
|
|
2489
2489
|
...listeners,
|
|
2490
2490
|
"Program:exit"(program) {
|
|
@@ -2683,7 +2683,7 @@ function create$10(context) {
|
|
|
2683
2683
|
function classExit() {
|
|
2684
2684
|
const currentClass = classStack.pop();
|
|
2685
2685
|
if (currentClass == null || !isClassComponent(currentClass)) return;
|
|
2686
|
-
const
|
|
2686
|
+
const id = AST.getClassId(currentClass);
|
|
2687
2687
|
const defs = propertyDefs.get(currentClass);
|
|
2688
2688
|
const usages = propertyUsages.get(currentClass);
|
|
2689
2689
|
if (defs == null) return;
|
|
@@ -2695,7 +2695,7 @@ function create$10(context) {
|
|
|
2695
2695
|
messageId: "noUnusedClassComponentMembers",
|
|
2696
2696
|
node: def,
|
|
2697
2697
|
data: {
|
|
2698
|
-
className:
|
|
2698
|
+
className: id != null ? context.sourceCode.getText(id) : "Component",
|
|
2699
2699
|
methodName
|
|
2700
2700
|
}
|
|
2701
2701
|
});
|
|
@@ -2892,13 +2892,13 @@ function create$8(context) {
|
|
|
2892
2892
|
function classExit() {
|
|
2893
2893
|
const currentClass = classStack.pop();
|
|
2894
2894
|
if (currentClass == null || !isClassComponent(currentClass)) return;
|
|
2895
|
-
const
|
|
2895
|
+
const id = AST.getClassId(currentClass);
|
|
2896
2896
|
const { node: defNode, isUsed = false } = stateDefs.get(currentClass) ?? {};
|
|
2897
2897
|
if (defNode == null || isUsed) return;
|
|
2898
2898
|
context.report({
|
|
2899
2899
|
messageId: "noUnusedState",
|
|
2900
2900
|
node: defNode,
|
|
2901
|
-
data: { className:
|
|
2901
|
+
data: { className: id != null ? context.sourceCode.getText(id) : "Component" }
|
|
2902
2902
|
});
|
|
2903
2903
|
}
|
|
2904
2904
|
function methodEnter(node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.6.5-next.
|
|
3
|
+
"version": "2.6.5-next.1",
|
|
4
4
|
"description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"string-ts": "^2.3.1",
|
|
47
47
|
"ts-api-utils": "^2.4.0",
|
|
48
48
|
"ts-pattern": "^5.9.0",
|
|
49
|
-
"@eslint-react/ast": "2.6.5-next.
|
|
50
|
-
"@eslint-react/core": "2.6.5-next.
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/var": "2.6.5-next.
|
|
49
|
+
"@eslint-react/ast": "2.6.5-next.1",
|
|
50
|
+
"@eslint-react/core": "2.6.5-next.1",
|
|
51
|
+
"@eslint-react/eff": "2.6.5-next.1",
|
|
52
|
+
"@eslint-react/shared": "2.6.5-next.1",
|
|
53
|
+
"@eslint-react/var": "2.6.5-next.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.8",
|