@eslint-react/ast
Advanced tools
+8
-1
@@ -92,3 +92,3 @@ import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/types"; | ||
| declare namespace extract_d_exports { | ||
| export { findProperty, getCalleeName, getFullyQualifiedName, getIdentifierAt, getPropertyName, unwrap }; | ||
| export { findProperty, getCalleeName, getFullyQualifiedName, getIdentifierAt, getInnermostCall, getPropertyName, unwrap }; | ||
| } | ||
@@ -115,2 +115,9 @@ /** | ||
| /** | ||
| * Unwrap curried call wrappers like `connect(...)(Component)` to get the innermost call expression. | ||
| * Type expressions and chain expressions around each callee are unwrapped along the way. | ||
| * @param node The outermost call expression to inspect. | ||
| * @returns The innermost call expression, whose callee is not itself a call expression. | ||
| */ | ||
| declare function getInnermostCall(node: TSESTree.CallExpression): TSESTree.CallExpression; | ||
| /** | ||
| * Get the static name of an object property's key. | ||
@@ -117,0 +124,0 @@ * @param property The property to inspect. |
+16
-0
@@ -645,2 +645,3 @@ import { t as __exportAll } from "./rolldown-runtime-w6R9maHv.js"; | ||
| getIdentifierAt: () => getIdentifierAt, | ||
| getInnermostCall: () => getInnermostCall, | ||
| getPropertyName: () => getPropertyName, | ||
@@ -686,2 +687,17 @@ unwrap: () => unwrap | ||
| /** | ||
| * Unwrap curried call wrappers like `connect(...)(Component)` to get the innermost call expression. | ||
| * Type expressions and chain expressions around each callee are unwrapped along the way. | ||
| * @param node The outermost call expression to inspect. | ||
| * @returns The innermost call expression, whose callee is not itself a call expression. | ||
| */ | ||
| function getInnermostCall(node) { | ||
| let call = node; | ||
| let callee = unwrap(call.callee); | ||
| while (callee.type === AST_NODE_TYPES.CallExpression) { | ||
| call = callee; | ||
| callee = unwrap(call.callee); | ||
| } | ||
| return call; | ||
| } | ||
| /** | ||
| * Get the static name of an object property's key. | ||
@@ -688,0 +704,0 @@ * @param property The property to inspect. |
+7
-7
| { | ||
| "name": "@eslint-react/ast", | ||
| "version": "5.18.2", | ||
| "version": "5.18.3", | ||
| "description": "ESLint React's TSESTree AST utility module.", | ||
@@ -32,9 +32,9 @@ "homepage": "https://github.com/Rel1cx/eslint-react", | ||
| "dependencies": { | ||
| "@typescript-eslint/types": "^8.65.0", | ||
| "@typescript-eslint/typescript-estree": "^8.65.0", | ||
| "@typescript-eslint/utils": "^8.65.0", | ||
| "@typescript-eslint/types": "^8.66.0", | ||
| "@typescript-eslint/typescript-estree": "^8.66.0", | ||
| "@typescript-eslint/utils": "^8.66.0", | ||
| "string-ts": "^2.3.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@typescript-eslint/parser": "^8.65.0", | ||
| "@typescript-eslint/parser": "^8.66.0", | ||
| "eslint": "^10.8.0", | ||
@@ -44,5 +44,5 @@ "tsdown": "^0.22.14", | ||
| "vitest": "^4.1.10", | ||
| "@local/eff": "0.0.0", | ||
| "@local/configs": "0.0.0", | ||
| "@local/testkit": "0.0.0", | ||
| "@local/configs": "0.0.0" | ||
| "@local/eff": "0.0.0" | ||
| }, | ||
@@ -49,0 +49,0 @@ "peerDependencies": { |
44109
2.44%1023
2.3%