@eslint-react/ast 4.2.3-beta.1 → 4.2.4-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.
Files changed (2) hide show
  1. package/dist/index.d.ts +32 -33
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,75 +1,74 @@
1
1
  import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/types";
2
- import { TSESTree as TSESTree$1 } from "@typescript-eslint/utils";
3
2
 
4
3
  //#region src/node-types.d.ts
5
4
  /**
6
5
  * Represents function expressions and declarations in TSESTree
7
6
  */
8
- type TSESTreeFunction = TSESTree$1.ArrowFunctionExpression | TSESTree$1.FunctionDeclaration | TSESTree$1.FunctionExpression;
7
+ type TSESTreeFunction = TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression;
9
8
  /**
10
9
  * Represents all function-related types including TypeScript function types
11
10
  */
12
- type TSESTreeFunctionType = TSESTree$1.TSCallSignatureDeclaration | TSESTree$1.TSConstructSignatureDeclaration | TSESTree$1.TSDeclareFunction | TSESTree$1.TSEmptyBodyFunctionExpression | TSESTree$1.TSFunctionType | TSESTree$1.TSMethodSignature | TSESTreeFunction;
11
+ type TSESTreeFunctionType = TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature | TSESTreeFunction;
13
12
  /**
14
13
  * Represents class declarations and expressions in TSESTree
15
14
  */
16
- type TSESTreeClass = TSESTree$1.ClassDeclaration | TSESTree$1.ClassExpression;
15
+ type TSESTreeClass = TSESTree.ClassDeclaration | TSESTree.ClassExpression;
17
16
  /**
18
17
  * Represents method definitions and property definitions in classes
19
18
  */
20
- type TSESTreeMethodOrProperty = TSESTree$1.PropertyDefinition | TSESTree$1.MethodDefinition;
19
+ type TSESTreeMethodOrProperty = TSESTree.PropertyDefinition | TSESTree.MethodDefinition;
21
20
  /**
22
21
  * Represents loop statements in TSESTree
23
22
  */
24
- type TSESTreeLoop = TSESTree$1.DoWhileStatement | TSESTree$1.ForInStatement | TSESTree$1.ForOfStatement | TSESTree$1.ForStatement | TSESTree$1.WhileStatement;
23
+ type TSESTreeLoop = TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
25
24
  /**
26
25
  * Represents TypeScript array and tuple types
27
26
  */
28
- type TSESTreeArrayTupleType = TSESTree$1.TSArrayType | TSESTree$1.TSTupleType;
27
+ type TSESTreeArrayTupleType = TSESTree.TSArrayType | TSESTree.TSTupleType;
29
28
  /**
30
29
  * Represents property-like nodes in TSESTree
31
30
  */
32
- type TSESTreeProperty = TSESTree$1.PropertyDefinition | TSESTree$1.TSIndexSignature | TSESTree$1.TSParameterProperty | TSESTree$1.TSPropertySignature;
31
+ type TSESTreeProperty = TSESTree.PropertyDefinition | TSESTree.TSIndexSignature | TSESTree.TSParameterProperty | TSESTree.TSPropertySignature;
33
32
  /**
34
33
  * Represents all JSX-related nodes in TSESTree
35
34
  * Note: This type is for type-level operations. The isJSX() runtime guard in node-is.ts
36
35
  * has a slightly different set of nodes as it includes JSXExpressionContainer which is
37
36
  * commonly needed for runtime checks but not included in this type union.
38
37
  */
39
- type TSESTreeJSX = TSESTree$1.JSXAttribute | TSESTree$1.JSXChild | TSESTree$1.JSXClosingElement | TSESTree$1.JSXClosingFragment | TSESTree$1.JSXEmptyExpression | TSESTree$1.JSXIdentifierToken | TSESTree$1.JSXOpeningElement | TSESTree$1.JSXOpeningFragment | TSESTree$1.JSXSpreadAttribute | TSESTree$1.JSXTagNameExpression | TSESTree$1.JSXTextToken;
40
- type TSESTreeJSXElementLike = TSESTree$1.JSXElement | TSESTree$1.JSXFragment;
38
+ type TSESTreeJSX = TSESTree.JSXAttribute | TSESTree.JSXChild | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXEmptyExpression | TSESTree.JSXIdentifierToken | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXTagNameExpression | TSESTree.JSXTextToken;
39
+ type TSESTreeJSXElementLike = TSESTree.JSXElement | TSESTree.JSXFragment;
41
40
  /**
42
41
  * Represents JSX attribute-like nodes (attributes and spread attributes)
43
42
  */
44
- type TSESTreeJSXAttributeLike = TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute;
43
+ type TSESTreeJSXAttributeLike = TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute;
45
44
  /**
46
45
  * Represents destructuring patterns in variable declarations
47
46
  */
48
- type TSESTreeDestructuringPattern = TSESTree$1.ArrayPattern | TSESTree$1.AssignmentPattern | TSESTree$1.ObjectPattern | TSESTree$1.RestElement;
47
+ type TSESTreeDestructuringPattern = TSESTree.ArrayPattern | TSESTree.AssignmentPattern | TSESTree.ObjectPattern | TSESTree.RestElement;
49
48
  /**
50
49
  * Represents TypeScript type declaration nodes
51
50
  */
52
- type TSESTreeTypeDeclaration = TSESTree$1.TSInterfaceDeclaration | TSESTree$1.TSTypeAliasDeclaration;
51
+ type TSESTreeTypeDeclaration = TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration;
53
52
  /**
54
53
  * Represents TypeScript type expression nodes (type assertions, non-null expressions, etc.)
55
54
  */
56
- type TSESTreeTypeExpression = TSESTree$1.TSAsExpression | TSESTree$1.TSNonNullExpression | TSESTree$1.TSSatisfiesExpression | TSESTree$1.TSTypeAssertion | TSESTree$1.TSInstantiationExpression;
55
+ type TSESTreeTypeExpression = TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.TSInstantiationExpression;
57
56
  /**
58
57
  * Represents TypeScript type assertion expressions (excluding instantiation expressions)
59
58
  */
60
- type TSESTreeTypeAssertionExpression = TSESTree$1.TSAsExpression | TSESTree$1.TSNonNullExpression | TSESTree$1.TSSatisfiesExpression | TSESTree$1.TSTypeAssertion;
59
+ type TSESTreeTypeAssertionExpression = TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
61
60
  /**
62
61
  * Represents a directive expression statement in TSESTree (ex: "use strict";)
63
62
  */
64
- type TSESTreeDirective = TSESTree$1.ExpressionStatement & {
63
+ type TSESTreeDirective = TSESTree.ExpressionStatement & {
65
64
  directive: string;
66
- expression: TSESTree$1.StringLiteral;
65
+ expression: TSESTree.StringLiteral;
67
66
  };
68
67
  /**
69
68
  * Represents a directive-like expression statement in TSESTree
70
69
  */
71
- type TSESTreeDirectiveLike = TSESTree$1.ExpressionStatement & {
72
- expression: TSESTree$1.StringLiteral;
70
+ type TSESTreeDirectiveLike = TSESTree.ExpressionStatement & {
71
+ expression: TSESTree.StringLiteral;
73
72
  };
74
73
  //#endregion
75
74
  //#region src/class-id.d.ts
@@ -200,7 +199,7 @@ declare function isDirectiveInFunction(node: TSESTreeFunction, name: string): bo
200
199
  * where JS gives anonymous function expressions names. We roughly detect the
201
200
  * same AST nodes with some exceptions to better fit our use case.
202
201
  */
203
- declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression | TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.TemplateLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldExpression | TSESTree.PrivateIdentifier | null;
202
+ declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldExpression | null;
204
203
  /**
205
204
  * Type representing the return type of getFunctionId
206
205
  */
@@ -326,13 +325,13 @@ declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TS
326
325
  * @param node The node to check
327
326
  * @returns True if the node is a function type
328
327
  */
329
- declare const isFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
328
+ declare const isFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
330
329
  /**
331
330
  * Check if a node is a class declaration or expression
332
331
  * @param node The node to check
333
332
  * @returns True if the node is a class
334
333
  */
335
- declare const isClass: (node: TSESTree.Node | null | undefined) => node is TSESTree.ClassExpression | TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName;
334
+ declare const isClass: (node: TSESTree.Node | null | undefined) => node is TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.ClassExpression;
336
335
  /**
337
336
  * Check if a node is a method or property definition
338
337
  * @param node The node to check
@@ -375,7 +374,7 @@ declare const isJSXTagNameExpression: (node: TSESTree.Node | null | undefined) =
375
374
  * @returns True if the node is a JSX node
376
375
  * @see TSESTreeJSX
377
376
  */
378
- declare const isJSX: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.JSXAttribute | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXEmptyExpression | TSESTree.JSXExpressionContainer | TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXSpreadChild | TSESTree.JSXText;
377
+ declare const isJSX: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXAttribute | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXElement | TSESTree.JSXEmptyExpression | TSESTree.JSXExpressionContainer | TSESTree.JSXFragment | TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXSpreadChild | TSESTree.JSXText;
379
378
  /**
380
379
  * Check if a node is a loop statement
381
380
  * @param node The node to check
@@ -393,7 +392,7 @@ declare const isControlFlow: (data: TSESTree.Node | null | undefined) => data is
393
392
  * @param node The node to check
394
393
  * @returns True if the node is conditional
395
394
  */
396
- declare const isConditional: (data: TSESTree.Node | null | undefined) => data is TSESTree.ConditionalExpression | TSESTree.LogicalExpression | TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.IfStatement | TSESTree.SwitchStatement | TSESTree.WhileStatement;
395
+ declare const isConditional: (data: TSESTree.Node | null | undefined) => data is TSESTree.ConditionalExpression | TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.IfStatement | TSESTree.LogicalExpression | TSESTree.SwitchStatement | TSESTree.WhileStatement;
397
396
  /**
398
397
  * Check if a node is a TypeScript type expression
399
398
  * @param node The node to check
@@ -421,28 +420,28 @@ declare function getFullyQualifiedName(node: TSESTree.Node, getText: (node: TSES
421
420
  /**
422
421
  * Represents an arrow function expression with an implicit return
423
422
  */
424
- type ImplicitReturnArrowFunctionExpression = TSESTree$1.ArrowFunctionExpression & {
425
- body: TSESTree$1.Expression;
423
+ type ImplicitReturnArrowFunctionExpression = TSESTree.ArrowFunctionExpression & {
424
+ body: TSESTree.Expression;
426
425
  };
427
426
  /**
428
427
  * Represents a variable declarator with object destructuring and an identifier initializer
429
428
  */
430
- type ObjectDestructuringVariableDeclarator = TSESTree$1.VariableDeclarator & {
431
- id: TSESTree$1.ObjectPattern;
432
- init: TSESTree$1.Identifier;
429
+ type ObjectDestructuringVariableDeclarator = TSESTree.VariableDeclarator & {
430
+ id: TSESTree.ObjectPattern;
431
+ init: TSESTree.Identifier;
433
432
  };
434
433
  /**
435
434
  * Represents an assignment expression that assigns to a displayName property
436
435
  */
437
- type DisplayNameAssignmentExpression = TSESTree$1.AssignmentExpression & {
436
+ type DisplayNameAssignmentExpression = TSESTree.AssignmentExpression & {
438
437
  type: "AssignmentExpression";
439
- left: TSESTree$1.MemberExpression & {
440
- property: TSESTree$1.Identifier & {
438
+ left: TSESTree.MemberExpression & {
439
+ property: TSESTree.Identifier & {
441
440
  name: "displayName";
442
441
  };
443
442
  };
444
443
  operator: "=";
445
- right: TSESTree$1.Literal;
444
+ right: TSESTree.Literal;
446
445
  };
447
446
  /**
448
447
  * Selector for arrow function expressions with implicit return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "4.2.3-beta.1",
3
+ "version": "4.2.4-beta.0",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {