@eslint-react/ast 2.6.1 → 2.6.2-next.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.d.ts CHANGED
@@ -2,9 +2,6 @@ import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/types";
2
2
  import { unit } from "@eslint-react/eff";
3
3
  import { TSESTree as TSESTree$1 } from "@typescript-eslint/utils";
4
4
 
5
- //#region src/array-index.d.ts
6
- declare function getArrayMethodCallbackIndexParamPosition(methodName: string): number;
7
- //#endregion
8
5
  //#region src/array-method.d.ts
9
6
  declare function isArrayFromCall(node: TSESTree.Node, loose?: boolean): node is TSESTree.CallExpression;
10
7
  declare function isArrayMapCall(node: TSESTree.Node, loose?: boolean): node is TSESTree.CallExpression;
@@ -58,7 +55,7 @@ declare function getUnderlyingExpression(node: TSESTree.Node): Exclude<TSESTree.
58
55
  * @param node The expression node to check
59
56
  * @returns true if the expression is a ThisExpression, false otherwise
60
57
  */
61
- declare function isThisExpression(node: TSESTree.Expression): boolean;
58
+ declare function isThisExpressionLoose(node: TSESTree.Expression): boolean;
62
59
  //#endregion
63
60
  //#region src/expression-nested.d.ts
64
61
  /**
@@ -264,4 +261,4 @@ declare function isViMock(node: TSESTree.Node | null | unit): node is TSESTree.M
264
261
  */
265
262
  declare function isViMockCallback(node: TSESTree.Node | null | unit): boolean;
266
263
  //#endregion
267
- export { DisplayNameAssignmentExpression, FunctionInitPath, ImplicitReturnArrowFunctionExpression, ObjectDestructuringVariableDeclarator, SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, TSESTreeArrayTupleType, TSESTreeClass, TSESTreeDestructuringPattern, TSESTreeFunction, TSESTreeFunctionType, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeLoop, TSESTreeMethodOrProperty, TSESTreeProperty, TSESTreeTypeAssertionExpression, TSESTreeTypeDeclaration, TSESTreeTypeExpression, findParentNode, getArrayMethodCallbackIndexParamPosition, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeExpression, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
264
+ export { DisplayNameAssignmentExpression, FunctionInitPath, ImplicitReturnArrowFunctionExpression, ObjectDestructuringVariableDeclarator, SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, TSESTreeArrayTupleType, TSESTreeClass, TSESTreeDestructuringPattern, TSESTreeFunction, TSESTreeFunctionType, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeLoop, TSESTreeMethodOrProperty, TSESTreeProperty, TSESTreeTypeAssertionExpression, TSESTreeTypeDeclaration, TSESTreeTypeExpression, findParentNode, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
package/dist/index.js CHANGED
@@ -4,26 +4,6 @@ import { ASTUtils } from "@typescript-eslint/utils";
4
4
  import { simpleTraverse } from "@typescript-eslint/typescript-estree";
5
5
  import { delimiterCase, replace, toLowerCase } from "string-ts";
6
6
 
7
- //#region src/array-index.ts
8
- const indexParamPosition = new Map([
9
- ["every", 1],
10
- ["filter", 1],
11
- ["find", 1],
12
- ["findIndex", 1],
13
- ["findLast", 1],
14
- ["findLastIndex", 1],
15
- ["flatMap", 1],
16
- ["forEach", 1],
17
- ["map", 1],
18
- ["reduce", 2],
19
- ["reduceRight", 2],
20
- ["some", 1]
21
- ]);
22
- function getArrayMethodCallbackIndexParamPosition(methodName) {
23
- return indexParamPosition.get(methodName) ?? -1;
24
- }
25
-
26
- //#endregion
27
7
  //#region src/array-method.ts
28
8
  function isArrayFromCall(node, loose = true) {
29
9
  if (node.type !== AST_NODE_TYPES.CallExpression) return false;
@@ -187,7 +167,7 @@ const isNodeEqual = dual(2, (a, b) => {
187
167
  * @param node The expression node to check
188
168
  * @returns true if the expression is a ThisExpression, false otherwise
189
169
  */
190
- function isThisExpression(node) {
170
+ function isThisExpressionLoose(node) {
191
171
  return getUnderlyingExpression(node).type === AST_NODE_TYPES.ThisExpression;
192
172
  }
193
173
 
@@ -636,4 +616,4 @@ function isViMockCallback(node) {
636
616
  }
637
617
 
638
618
  //#endregion
639
- export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, findParentNode, getArrayMethodCallbackIndexParamPosition, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeExpression, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
619
+ export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, findParentNode, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "2.6.1",
3
+ "version": "2.6.2-next.0",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -34,7 +34,7 @@
34
34
  "@typescript-eslint/typescript-estree": "^8.53.0",
35
35
  "@typescript-eslint/utils": "^8.53.0",
36
36
  "string-ts": "^2.3.1",
37
- "@eslint-react/eff": "2.6.1"
37
+ "@eslint-react/eff": "2.6.2-next.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "tsdown": "^0.20.0-beta.3",