Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional chain expression to typings #140

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ast/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ export type ESLintExpression =
| ESLintMetaProperty
| ESLintIdentifier
| ESLintAwaitExpression
| ESLintChainExpression

export interface ESLintIdentifier extends HasLocation, HasParent {
type: "Identifier"
Expand Down Expand Up @@ -493,6 +494,7 @@ export interface ESLintConditionalExpression extends HasLocation, HasParent {

export interface ESLintCallExpression extends HasLocation, HasParent {
type: "CallExpression"
optional: boolean
callee: ESLintExpression | ESLintSuper
arguments: (ESLintExpression | ESLintSpreadElement)[]
}
Expand All @@ -509,6 +511,7 @@ export interface ESLintNewExpression extends HasLocation, HasParent {

export interface ESLintMemberExpression extends HasLocation, HasParent {
type: "MemberExpression"
optional: boolean
computed: boolean
object: ESLintExpression | ESLintSuper
property: ESLintExpression
Expand Down Expand Up @@ -604,6 +607,11 @@ export interface ESLintAssignmentPattern extends HasLocation, HasParent {
right: ESLintExpression
}

export interface ESLintChainExpression extends HasLocation, HasParent {
type: "ChainExpression"
expression: ESLintExpression
}

/**
* Legacy for babel-eslint and espree.
*/
Expand Down