AST Specification
The following auto-generated documentation describes the Abstract Syntax Tree (AST) generated by @typescript-eslint/typescript-estree for parsers such as @typescript-eslint/parser.
Enumerations
AST_NODE_TYPES
Enumeration Members
| Enumeration Member | Value |
|---|---|
AccessorProperty | "AccessorProperty" |
ArrayExpression | "ArrayExpression" |
ArrayPattern | "ArrayPattern" |
ArrowFunctionExpression | "ArrowFunctionExpression" |
AssignmentExpression | "AssignmentExpression" |
AssignmentPattern | "AssignmentPattern" |
AwaitExpression | "AwaitExpression" |
BinaryExpression | "BinaryExpression" |
BlockStatement | "BlockStatement" |
BreakStatement | "BreakStatement" |
CallExpression | "CallExpression" |
CatchClause | "CatchClause" |
ChainExpression | "ChainExpression" |
ClassBody | "ClassBody" |
ClassDeclaration | "ClassDeclaration" |
ClassExpression | "ClassExpression" |
ConditionalExpression | "ConditionalExpression" |
ContinueStatement | "ContinueStatement" |
DebuggerStatement | "DebuggerStatement" |
Decorator | "Decorator" |
DoWhileStatement | "DoWhileStatement" |
EmptyStatement | "EmptyStatement" |
ExportAllDeclaration | "ExportAllDeclaration" |
ExportDefaultDeclaration | "ExportDefaultDeclaration" |
ExportNamedDeclaration | "ExportNamedDeclaration" |
ExportSpecifier | "ExportSpecifier" |
ExpressionStatement | "ExpressionStatement" |
ForInStatement | "ForInStatement" |
ForOfStatement | "ForOfStatement" |
ForStatement | "ForStatement" |
FunctionDeclaration | "FunctionDeclaration" |
FunctionExpression | "FunctionExpression" |
Identifier | "Identifier" |
IfStatement | "IfStatement" |
ImportAttribute | "ImportAttribute" |
ImportDeclaration | "ImportDeclaration" |
ImportDefaultSpecifier | "ImportDefaultSpecifier" |
ImportExpression | "ImportExpression" |
ImportNamespaceSpecifier | "ImportNamespaceSpecifier" |
ImportSpecifier | "ImportSpecifier" |
JSXAttribute | "JSXAttribute" |
JSXClosingElement | "JSXClosingElement" |
JSXClosingFragment | "JSXClosingFragment" |
JSXElement | "JSXElement" |
JSXEmptyExpression | "JSXEmptyExpression" |
JSXExpressionContainer | "JSXExpressionContainer" |
JSXFragment | "JSXFragment" |
JSXIdentifier | "JSXIdentifier" |
JSXMemberExpression | "JSXMemberExpression" |
JSXNamespacedName | "JSXNamespacedName" |
JSXOpeningElement | "JSXOpeningElement" |
JSXOpeningFragment | "JSXOpeningFragment" |
JSXSpreadAttribute | "JSXSpreadAttribute" |
JSXSpreadChild | "JSXSpreadChild" |
JSXText | "JSXText" |
LabeledStatement | "LabeledStatement" |
Literal | "Literal" |
LogicalExpression | "LogicalExpression" |
MemberExpression | "MemberExpression" |
MetaProperty | "MetaProperty" |
MethodDefinition | "MethodDefinition" |
NewExpression | "NewExpression" |
ObjectExpression | "ObjectExpression" |
ObjectPattern | "ObjectPattern" |
PrivateIdentifier | "PrivateIdentifier" |
Program | "Program" |
Property | "Property" |
PropertyDefinition | "PropertyDefinition" |
RestElement | "RestElement" |
ReturnStatement | "ReturnStatement" |
SequenceExpression | "SequenceExpression" |
SpreadElement | "SpreadElement" |
StaticBlock | "StaticBlock" |
Super | "Super" |
SwitchCase | "SwitchCase" |
SwitchStatement | "SwitchStatement" |
TSAbstractAccessorProperty | "TSAbstractAccessorProperty" |
TSAbstractKeyword | "TSAbstractKeyword" |
TSAbstractMethodDefinition | "TSAbstractMethodDefinition" |
TSAbstractPropertyDefinition | "TSAbstractPropertyDefinition" |
TSAnyKeyword | "TSAnyKeyword" |
TSArrayType | "TSArrayType" |
TSAsExpression | "TSAsExpression" |
TSAsyncKeyword | "TSAsyncKeyword" |
TSBigIntKeyword | "TSBigIntKeyword" |
TSBooleanKeyword | "TSBooleanKeyword" |
TSCallSignatureDeclaration | "TSCallSignatureDeclaration" |
TSClassImplements | "TSClassImplements" |
TSConditionalType | "TSConditionalType" |
TSConstructSignatureDeclaration | "TSConstructSignatureDeclaration" |
TSConstructorType | "TSConstructorType" |
TSDeclareFunction | "TSDeclareFunction" |
TSDeclareKeyword | "TSDeclareKeyword" |
TSEmptyBodyFunctionExpression | "TSEmptyBodyFunctionExpression" |
TSEnumBody | "TSEnumBody" |
TSEnumDeclaration | "TSEnumDeclaration" |
TSEnumMember | "TSEnumMember" |
TSExportAssignment | "TSExportAssignment" |
TSExportKeyword | "TSExportKeyword" |
TSExternalModuleReference | "TSExternalModuleReference" |
TSFunctionType | "TSFunctionType" |
TSImportEqualsDeclaration | "TSImportEqualsDeclaration" |
TSImportType | "TSImportType" |
TSIndexSignature | "TSIndexSignature" |
TSIndexedAccessType | "TSIndexedAccessType" |
TSInferType | "TSInferType" |
TSInstantiationExpression | "TSInstantiationExpression" |
TSInterfaceBody | "TSInterfaceBody" |
TSInterfaceDeclaration | "TSInterfaceDeclaration" |
TSInterfaceHeritage | "TSInterfaceHeritage" |
TSIntersectionType | "TSIntersectionType" |
TSIntrinsicKeyword | "TSIntrinsicKeyword" |
TSLiteralType | "TSLiteralType" |
TSMappedType | "TSMappedType" |
TSMethodSignature | "TSMethodSignature" |
TSModuleBlock | "TSModuleBlock" |
TSModuleDeclaration | "TSModuleDeclaration" |
TSNamedTupleMember | "TSNamedTupleMember" |
TSNamespaceExportDeclaration | "TSNamespaceExportDeclaration" |
TSNeverKeyword | "TSNeverKeyword" |
TSNonNullExpression | "TSNonNullExpression" |
TSNullKeyword | "TSNullKeyword" |
TSNumberKeyword | "TSNumberKeyword" |
TSObjectKeyword | "TSObjectKeyword" |
TSOptionalType | "TSOptionalType" |
TSParameterProperty | "TSParameterProperty" |
TSPrivateKeyword | "TSPrivateKeyword" |
TSPropertySignature | "TSPropertySignature" |
TSProtectedKeyword | "TSProtectedKeyword" |
TSPublicKeyword | "TSPublicKeyword" |
TSQualifiedName | "TSQualifiedName" |
TSReadonlyKeyword | "TSReadonlyKeyword" |
TSRestType | "TSRestType" |
TSSatisfiesExpression | "TSSatisfiesExpression" |
TSStaticKeyword | "TSStaticKeyword" |
TSStringKeyword | "TSStringKeyword" |
TSSymbolKeyword | "TSSymbolKeyword" |
TSTemplateLiteralType | "TSTemplateLiteralType" |
TSThisType | "TSThisType" |
TSTupleType | "TSTupleType" |
TSTypeAliasDeclaration | "TSTypeAliasDeclaration" |
TSTypeAnnotation | "TSTypeAnnotation" |
TSTypeAssertion | "TSTypeAssertion" |
TSTypeLiteral | "TSTypeLiteral" |
TSTypeOperator | "TSTypeOperator" |
TSTypeParameter | "TSTypeParameter" |
TSTypeParameterDeclaration | "TSTypeParameterDeclaration" |
TSTypeParameterInstantiation | "TSTypeParameterInstantiation" |
TSTypePredicate | "TSTypePredicate" |
TSTypeQuery | "TSTypeQuery" |
TSTypeReference | "TSTypeReference" |
TSUndefinedKeyword | "TSUndefinedKeyword" |
TSUnionType | "TSUnionType" |
TSUnknownKeyword | "TSUnknownKeyword" |
TSVoidKeyword | "TSVoidKeyword" |
TaggedTemplateExpression | "TaggedTemplateExpression" |
TemplateElement | "TemplateElement" |
TemplateLiteral | "TemplateLiteral" |
ThisExpression | "ThisExpression" |
ThrowStatement | "ThrowStatement" |
TryStatement | "TryStatement" |
UnaryExpression | "UnaryExpression" |
UpdateExpression | "UpdateExpression" |
VariableDeclaration | "VariableDeclaration" |
VariableDeclarator | "VariableDeclarator" |
WhileStatement | "WhileStatement" |
WithStatement | "WithStatement" |
YieldExpression | "YieldExpression" |
AST_TOKEN_TYPES
Enumeration Members
| Enumeration Member | Value |
|---|---|
Block | "Block" |
Boolean | "Boolean" |
Identifier | "Identifier" |
JSXIdentifier | "JSXIdentifier" |
JSXText | "JSXText" |
Keyword | "Keyword" |
Line | "Line" |
Null | "Null" |
Numeric | "Numeric" |
Punctuator | "Punctuator" |
RegularExpression | "RegularExpression" |
String | "String" |
Template | "Template" |
Interfaces
AccessorPropertyComputedName
Extends
PropertyDefinitionComputedNameBase
Properties
| Property | Type | Overrides |
|---|---|---|
type | AccessorProperty | PropertyDefinitionComputedNameBase.type |
AccessorPropertyNonComputedName
Extends
PropertyDefinitionNonComputedNameBase
Properties
| Property | Type | Overrides |
|---|---|---|
type | AccessorProperty | PropertyDefinitionNonComputedNameBase.type |
ArrayExpression
Extends
Properties
| Property | Type | Description | Overrides |
|---|---|---|---|
elements | (null | Expression | SpreadElement)[] | an element will be null in the case of a sparse array: [1, ,3] | - |
type | ArrayExpression | - | BaseNode.type |
ArrayPattern
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
decorators | Decorator[] | - |
elements | (null | DestructuringPattern)[] | - |
optional | boolean | - |
type | ArrayPattern | BaseNode.type |
typeAnnotation | undefined | TSTypeAnnotation | - |
ArrowFunctionExpression
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
async | boolean | - |
body | Expression | BlockStatement | - |
expression | boolean | - |
generator | boolean | - |
id | null | - |
params | Parameter[] | - |
returnType | undefined | TSTypeAnnotation | - |
type | ArrowFunctionExpression | BaseNode.type |
typeParameters | undefined | TSTypeParameterDeclaration | - |
AssignmentExpression
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
left | Expression | - |
operator | ValueOf <AssignmentOperatorToText> | - |
right | Expression | - |
type | AssignmentExpression | BaseNode.type |
AssignmentOperatorToText
Extended by
Properties
| Property | Type |
|---|---|
64 | "=" |
65 | "+=" |
66 | "-=" |
67 | "*=" |
68 | "**=" |
69 | "/=" |
70 | "%=" |
71 | "<<=" |
72 | ">>=" |
73 | ">>>=" |
74 | "&=" |
75 | "|=" |
76 | "||=" |
77 | "&&=" |
78 | "??=" |
79 | "^=" |
AssignmentPattern
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
decorators | Decorator[] | - |
left | BindingName | - |
optional | boolean | - |
right | Expression | - |
type | AssignmentPattern | BaseNode.type |
typeAnnotation | undefined | TSTypeAnnotation | - |
AwaitExpression
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
argument | Expression | - |
type | AwaitExpression | BaseNode.type |
BaseNode
Extends
Extended by
ExportAllDeclarationExportDefaultDeclarationImportDeclarationTSEnumDeclarationTSInterfaceDeclarationTSNamespaceExportDeclarationTSTypeAliasDeclarationSpreadElementStaticBlockTSIndexSignatureArrayExpressionArrowFunctionExpressionAssignmentExpressionAwaitExpressionBinaryExpressionCallExpressionChainExpressionConditionalExpressionIdentifierImportExpressionJSXElementJSXFragmentLogicalExpressionMetaPropertyNewExpressionObjectExpressionSequenceExpressionSuperTaggedTemplateExpressionTemplateLiteralThisExpressionTSAsExpressionTSInstantiationExpressionTSNonNullExpressionTSSatisfiesExpressionTSTypeAssertionYieldExpressionJSXAttributeJSXClosingElementJSXClosingFragmentJSXEmptyExpressionJSXExpressionContainerJSXIdentifierJSXMemberExpressionJSXNamespacedNameJSXOpeningElementJSXOpeningFragmentJSXSpreadAttributeJSXSpreadChildJSXTextArrayPatternAssignmentPatternObjectPatternRestElementTSParameterPropertyCatchClauseClassBodyDecoratorEmptyStatementExportSpecifierImportAttributeImportDefaultSpecifierImportNamespaceSpecifierImportSpecifierPrivateIdentifierSwitchCaseTemplateElementTSEnumBodyTSExternalModuleReferenceTSInterfaceBodyTSModuleBlockTSTypeAnnotationTSTypeParameterTSTypeParameterDeclarationTSTypeParameterInstantiationBlockStatementBreakStatementContinueStatementDebuggerStatementDoWhileStatementExpressionStatementForInStatementForOfStatementForStatementIfStatementLabeledStatementReturnStatementSwitchStatementThrowStatementTryStatementTSExportAssignmentWhileStatementWithStatementTSAbstractKeywordTSAnyKeywordTSArrayTypeTSAsyncKeywordTSBigIntKeywordTSBooleanKeywordTSConditionalTypeTSDeclareKeywordTSExportKeywordTSImportTypeTSIndexedAccessTypeTSInferTypeTSIntersectionTypeTSIntrinsicKeywordTSLiteralTypeTSMappedTypeTSNamedTupleMemberTSNeverKeywordTSNullKeywordTSNumberKeywordTSObjectKeywordTSOptionalTypeTSPrivateKeywordTSProtectedKeywordTSPublicKeywordTSQualifiedNameTSReadonlyKeywordTSRestTypeTSStaticKeywordTSStringKeywordTSSymbolKeywordTSTemplateLiteralTypeTSThisTypeTSTupleTypeTSTypeLiteralTSTypeOperatorTSTypePredicateTSTypeQueryTSTypeReferenceTSUndefinedKeywordTSUnionTypeTSUnknownKeywordTSVoidKeyword
Properties
| Property | Type | Overrides |
|---|---|---|
type | AST_NODE_TYPES | NodeOrTokenData.type |
BigIntLiteral
Extends
LiteralBase
Properties
| Property | Type | Overrides |
|---|---|---|
bigint | string | - |
value | null | bigint | LiteralBase.value |
BinaryExpression
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
left | PrivateIdentifier | Expression | - |
operator | ValueOf <BinaryOperatorToText> | - |
right | Expression | - |
type | BinaryExpression | BaseNode.type |
BinaryOperatorToText
Properties
| Property | Type |
|---|---|
103 | "in" |
104 | "instanceof" |
30 | "<" |
32 | ">" |
33 | "<=" |
34 | ">=" |
35 | "==" |
36 | "!=" |
37 | "===" |
38 | "!==" |
40 | "+" |
41 | "-" |
42 | "*" |
43 | "**" |
44 | "/" |
45 | "%" |
48 | "<<" |
49 | ">>" |
50 | ">>>" |
51 | "&" |
52 | "|" |
53 | "^" |
56 | "&&" |
57 | "||" |
BlockComment
Extends
BaseToken
Properties
| Property | Type | Overrides |
|---|---|---|
type | Block | BaseToken.type |
BlockStatement
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
body | Statement[] | - |
type | BlockStatement | BaseNode.type |
BooleanLiteral
Extends
LiteralBase
Properties
| Property | Type | Overrides |
|---|---|---|
raw | "false" | "true" | LiteralBase.raw |
value | boolean | LiteralBase.value |
BooleanToken
Extends
BaseToken
Properties
| Property | Type | Overrides |
|---|---|---|
type | Boolean | BaseToken.type |
BreakStatement
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
label | null | Identifier | - |
type | BreakStatement | BaseNode.type |
CallExpression
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
arguments | CallExpressionArgument[] | - |
callee | Expression | - |
optional | boolean | - |
type | CallExpression | BaseNode.type |
typeArguments | undefined | TSTypeParameterInstantiation | - |
CatchClause
Extends
Properties
| Property | Type | Overrides |
|---|---|---|
body | BlockStatement | - |
param | null | BindingName | - |
type | CatchClause | BaseNode.type |