@eslint-react/ast 1.40.2-beta.0 → 1.40.2-beta.2
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 +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -415,21 +415,21 @@ function getNestedIdentifiers(node) {
|
|
|
415
415
|
return identifiers;
|
|
416
416
|
}
|
|
417
417
|
function getNestedReturnStatements(node) {
|
|
418
|
-
const
|
|
419
|
-
const
|
|
418
|
+
const statements = [];
|
|
419
|
+
const boundaryNode = isFunction(node) ? node : findParentNode(node, isFunction);
|
|
420
420
|
typescriptEstree.simpleTraverse(node, {
|
|
421
421
|
enter(node2) {
|
|
422
422
|
if (node2.type !== types.AST_NODE_TYPES.ReturnStatement) {
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
425
|
const parentFunction = findParentNode(node2, isFunction);
|
|
426
|
-
if (parentFunction !==
|
|
426
|
+
if (parentFunction !== boundaryNode) {
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
|
|
429
|
+
statements.push(node2);
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
|
-
return
|
|
432
|
+
return statements;
|
|
433
433
|
}
|
|
434
434
|
function getPropertyName(node) {
|
|
435
435
|
if (isTypeExpression(node)) {
|
package/dist/index.mjs
CHANGED
|
@@ -413,21 +413,21 @@ function getNestedIdentifiers(node) {
|
|
|
413
413
|
return identifiers;
|
|
414
414
|
}
|
|
415
415
|
function getNestedReturnStatements(node) {
|
|
416
|
-
const
|
|
417
|
-
const
|
|
416
|
+
const statements = [];
|
|
417
|
+
const boundaryNode = isFunction(node) ? node : findParentNode(node, isFunction);
|
|
418
418
|
simpleTraverse(node, {
|
|
419
419
|
enter(node2) {
|
|
420
420
|
if (node2.type !== AST_NODE_TYPES.ReturnStatement) {
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
423
|
const parentFunction = findParentNode(node2, isFunction);
|
|
424
|
-
if (parentFunction !==
|
|
424
|
+
if (parentFunction !== boundaryNode) {
|
|
425
425
|
return;
|
|
426
426
|
}
|
|
427
|
-
|
|
427
|
+
statements.push(node2);
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
|
-
return
|
|
430
|
+
return statements;
|
|
431
431
|
}
|
|
432
432
|
function getPropertyName(node) {
|
|
433
433
|
if (isTypeExpression(node)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/ast",
|
|
3
|
-
"version": "1.40.2-beta.
|
|
3
|
+
"version": "1.40.2-beta.2",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@typescript-eslint/utils": "^8.29.0",
|
|
41
41
|
"string-ts": "^2.2.1",
|
|
42
42
|
"ts-pattern": "^5.7.0",
|
|
43
|
-
"@eslint-react/eff": "1.40.2-beta.
|
|
43
|
+
"@eslint-react/eff": "1.40.2-beta.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "^8.4.0",
|