eslint-plugin-react-x 2.6.2 → 2.6.3-beta.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 +6 -5
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __exportAll = (all, symbols) => {
|
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region package.json
|
|
36
36
|
var name$6 = "eslint-plugin-react-x";
|
|
37
|
-
var version = "2.6.
|
|
37
|
+
var version = "2.6.3-beta.0";
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/utils/create-rule.ts
|
|
@@ -1214,7 +1214,7 @@ function create$36(context) {
|
|
|
1214
1214
|
break;
|
|
1215
1215
|
}
|
|
1216
1216
|
default: {
|
|
1217
|
-
const call = AST.findParentNode(jsxElement, AST.
|
|
1217
|
+
const call = AST.findParentNode(jsxElement, AST.isArrayMapCallLoose);
|
|
1218
1218
|
const iter = AST.findParentNode(jsxElement, (n) => n === call || AST.isFunction(n));
|
|
1219
1219
|
if (!AST.isFunction(iter)) return;
|
|
1220
1220
|
const arg0 = call?.arguments[0];
|
|
@@ -1615,7 +1615,7 @@ function create$30(context) {
|
|
|
1615
1615
|
CallExpression(node) {
|
|
1616
1616
|
state.isWithinChildrenToArray ||= isChildrenToArrayCall(context, node);
|
|
1617
1617
|
if (state.isWithinChildrenToArray) return;
|
|
1618
|
-
const callback = match(node).when(AST.
|
|
1618
|
+
const callback = match(node).when(AST.isArrayMapCallLoose, (n) => n.arguments[0]).when(AST.isArrayFromCallLoose, (n) => n.arguments[1]).otherwise(() => null);
|
|
1619
1619
|
if (!AST.isFunction(callback)) return;
|
|
1620
1620
|
const body = callback.body;
|
|
1621
1621
|
if (body.type === AST_NODE_TYPES.BlockStatement) {
|
|
@@ -2120,8 +2120,9 @@ function create$20(context) {
|
|
|
2120
2120
|
} };
|
|
2121
2121
|
}
|
|
2122
2122
|
function isArrayMethodCallback(node) {
|
|
2123
|
-
|
|
2124
|
-
if (
|
|
2123
|
+
const parent = node.parent;
|
|
2124
|
+
if (parent?.type !== AST_NODE_TYPES.CallExpression) return false;
|
|
2125
|
+
if (!AST.isArrayMapCallLoose(parent) && !AST.isArrayFromCallLoose(parent)) return false;
|
|
2125
2126
|
return AST.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(AST.getUnderlyingExpression(node));
|
|
2126
2127
|
}
|
|
2127
2128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3-beta.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/ast": "2.6.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/eff": "2.6.
|
|
52
|
-
"@eslint-react/var": "2.6.
|
|
53
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "2.6.3-beta.0",
|
|
50
|
+
"@eslint-react/core": "2.6.3-beta.0",
|
|
51
|
+
"@eslint-react/eff": "2.6.3-beta.0",
|
|
52
|
+
"@eslint-react/var": "2.6.3-beta.0",
|
|
53
|
+
"@eslint-react/shared": "2.6.3-beta.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.8",
|