eslint-plugin-react-x 2.0.0-next.187 → 2.0.0-next.189
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 +12 -12
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import ts from "typescript";
|
|
|
7
7
|
import * as AST from "@eslint-react/ast";
|
|
8
8
|
import * as VAR from "@eslint-react/var";
|
|
9
9
|
import * as ER from "@eslint-react/core";
|
|
10
|
-
import {
|
|
10
|
+
import { report, toRegExp } from "@eslint-react/kit";
|
|
11
11
|
import { constFalse, constTrue, flow, getOrElseUpdate, identity, unit } from "@eslint-react/eff";
|
|
12
12
|
import { compare } from "compare-versions";
|
|
13
13
|
import { camelCase } from "string-ts";
|
|
@@ -115,7 +115,7 @@ const settings = { ...settings$1 };
|
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region package.json
|
|
117
117
|
var name = "eslint-plugin-react-x";
|
|
118
|
-
var version = "2.0.0-next.
|
|
118
|
+
var version = "2.0.0-next.189";
|
|
119
119
|
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/utils/create-rule.ts
|
|
@@ -1682,6 +1682,9 @@ function create$29(context) {
|
|
|
1682
1682
|
const createCalls = [];
|
|
1683
1683
|
const displayNameAssignments = [];
|
|
1684
1684
|
return {
|
|
1685
|
+
[AST.SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION](node) {
|
|
1686
|
+
displayNameAssignments.push(node);
|
|
1687
|
+
},
|
|
1685
1688
|
CallExpression(node) {
|
|
1686
1689
|
if (!ER.isCreateContextCall(context, node)) return;
|
|
1687
1690
|
createCalls.push(node);
|
|
@@ -1720,9 +1723,6 @@ function create$29(context) {
|
|
|
1720
1723
|
}
|
|
1721
1724
|
});
|
|
1722
1725
|
}
|
|
1723
|
-
},
|
|
1724
|
-
[SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION](node) {
|
|
1725
|
-
displayNameAssignments.push(node);
|
|
1726
1726
|
}
|
|
1727
1727
|
};
|
|
1728
1728
|
}
|
|
@@ -1874,7 +1874,7 @@ function create$27(context) {
|
|
|
1874
1874
|
}
|
|
1875
1875
|
function isDevelopmentOnlyCheck(node) {
|
|
1876
1876
|
if (node.type !== AST_NODE_TYPES.IfStatement) return false;
|
|
1877
|
-
if (isProcessEnvNodeEnvCompare(node.test, "!==", "production")) return true;
|
|
1877
|
+
if (AST.isProcessEnvNodeEnvCompare(node.test, "!==", "production")) return true;
|
|
1878
1878
|
return false;
|
|
1879
1879
|
}
|
|
1880
1880
|
|
|
@@ -2482,7 +2482,7 @@ function create$15(context) {
|
|
|
2482
2482
|
if (AST.isFunctionEmpty(node)) continue;
|
|
2483
2483
|
if (WELL_KNOWN_HOOKS.includes(name$4)) continue;
|
|
2484
2484
|
if (containsUseComments(context, node)) continue;
|
|
2485
|
-
if (AST.findParentNode(node, isViMockCallback) != null) continue;
|
|
2485
|
+
if (AST.findParentNode(node, AST.isViMockCallback) != null) continue;
|
|
2486
2486
|
context.report({
|
|
2487
2487
|
messageId: "noUnnecessaryUsePrefix",
|
|
2488
2488
|
node: id ?? node,
|
|
@@ -2689,6 +2689,11 @@ function create$10(context) {
|
|
|
2689
2689
|
const declarators = /* @__PURE__ */ new WeakMap();
|
|
2690
2690
|
return {
|
|
2691
2691
|
...listeners,
|
|
2692
|
+
[AST.SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR](node) {
|
|
2693
|
+
const functionEntry = ctx.getCurrentEntry();
|
|
2694
|
+
if (functionEntry == null) return;
|
|
2695
|
+
getOrElseUpdate(declarators, functionEntry.node, () => []).push(node);
|
|
2696
|
+
},
|
|
2692
2697
|
"Program:exit"(program) {
|
|
2693
2698
|
const components = ctx.getAllComponents(program);
|
|
2694
2699
|
for (const { node: component } of components.values()) {
|
|
@@ -2714,11 +2719,6 @@ function create$10(context) {
|
|
|
2714
2719
|
});
|
|
2715
2720
|
}
|
|
2716
2721
|
}
|
|
2717
|
-
},
|
|
2718
|
-
[SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR](node) {
|
|
2719
|
-
const functionEntry = ctx.getCurrentEntry();
|
|
2720
|
-
if (functionEntry == null) return;
|
|
2721
|
-
getOrElseUpdate(declarators, functionEntry.node, () => []).push(node);
|
|
2722
2722
|
}
|
|
2723
2723
|
};
|
|
2724
2724
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.189",
|
|
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",
|
|
@@ -42,22 +42,22 @@
|
|
|
42
42
|
"is-immutable-type": "^5.0.1",
|
|
43
43
|
"string-ts": "^2.2.1",
|
|
44
44
|
"ts-pattern": "^5.8.0",
|
|
45
|
-
"@eslint-react/ast": "2.0.0-next.
|
|
46
|
-
"@eslint-react/core": "2.0.0-next.
|
|
47
|
-
"@eslint-react/kit": "2.0.0-next.
|
|
48
|
-
"@eslint-react/shared": "2.0.0-next.
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
45
|
+
"@eslint-react/ast": "2.0.0-next.189",
|
|
46
|
+
"@eslint-react/core": "2.0.0-next.189",
|
|
47
|
+
"@eslint-react/kit": "2.0.0-next.189",
|
|
48
|
+
"@eslint-react/shared": "2.0.0-next.189",
|
|
49
|
+
"@eslint-react/eff": "2.0.0-next.189",
|
|
50
|
+
"@eslint-react/var": "2.0.0-next.189"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "^19.1.13",
|
|
54
54
|
"@types/react-dom": "^19.1.9",
|
|
55
55
|
"ts-api-utils": "^2.1.0",
|
|
56
|
-
"tsdown": "^0.15.
|
|
56
|
+
"tsdown": "^0.15.4",
|
|
57
57
|
"@local/configs": "0.0.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"eslint": "^9.
|
|
60
|
+
"eslint": "^9.36.0",
|
|
61
61
|
"ts-api-utils": "^2.1.0",
|
|
62
62
|
"typescript": "^4.9.5 || ^5.4.5"
|
|
63
63
|
},
|