eslint-plugin-react-x 2.7.0-next.0 → 2.7.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/dist/index.js +4 -4
- 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.7.0
|
|
71
|
+
var version = "2.7.0";
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region src/utils/create-rule.ts
|
|
@@ -1248,7 +1248,7 @@ function create$36(context) {
|
|
|
1248
1248
|
break;
|
|
1249
1249
|
}
|
|
1250
1250
|
default: {
|
|
1251
|
-
const call = AST.findParentNode(jsxElement, AST.
|
|
1251
|
+
const call = AST.findParentNode(jsxElement, AST.isArrayMapCall);
|
|
1252
1252
|
const iter = AST.findParentNode(jsxElement, (n) => n === call || AST.isFunction(n));
|
|
1253
1253
|
if (!AST.isFunction(iter)) return;
|
|
1254
1254
|
const arg0 = call?.arguments[0];
|
|
@@ -1649,7 +1649,7 @@ function create$30(context) {
|
|
|
1649
1649
|
CallExpression(node) {
|
|
1650
1650
|
state.isWithinChildrenToArray ||= isChildrenToArrayCall(context, node);
|
|
1651
1651
|
if (state.isWithinChildrenToArray) return;
|
|
1652
|
-
const callback = match(node).when(AST.
|
|
1652
|
+
const callback = match(node).when(AST.isArrayMapCall, (n) => n.arguments[0]).when(AST.isArrayFromCall, (n) => n.arguments[1]).otherwise(() => null);
|
|
1653
1653
|
if (!AST.isFunction(callback)) return;
|
|
1654
1654
|
const body = callback.body;
|
|
1655
1655
|
if (body.type === AST_NODE_TYPES.BlockStatement) {
|
|
@@ -2168,7 +2168,7 @@ function create$20(context) {
|
|
|
2168
2168
|
function isArrayMethodCallback(node) {
|
|
2169
2169
|
const parent = node.parent;
|
|
2170
2170
|
if (parent?.type !== AST_NODE_TYPES.CallExpression) return false;
|
|
2171
|
-
if (!AST.
|
|
2171
|
+
if (!AST.isArrayMapCall(parent) && !AST.isArrayFromCall(parent)) return false;
|
|
2172
2172
|
return AST.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(AST.getUnderlyingExpression(node));
|
|
2173
2173
|
}
|
|
2174
2174
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.7.0
|
|
3
|
+
"version": "2.7.0",
|
|
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/
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/eff": "2.7.0",
|
|
50
|
+
"@eslint-react/ast": "2.7.0",
|
|
51
|
+
"@eslint-react/shared": "2.7.0",
|
|
52
|
+
"@eslint-react/core": "2.7.0",
|
|
53
|
+
"@eslint-react/var": "2.7.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.8",
|