@@ -55,8 +55,12 @@ export type ESLintNode =
5555 | ESLintPattern
5656 | ESLintClassBody
5757 | ESLintMethodDefinition
58+ | ESLintPropertyDefinition
59+ | ESLintStaticBlock
60+ | ESLintPrivateIdentifier
5861 | ESLintModuleDeclaration
5962 | ESLintModuleSpecifier
63+ | ESLintImportExpression
6064 | ESLintLegacyRestProperty
6165
6266/**
@@ -165,6 +169,7 @@ export interface ESLintForOfStatement extends HasLocation, HasParent {
165169 left : ESLintVariableDeclaration | ESLintPattern
166170 right : ESLintExpression
167171 body : ESLintStatement
172+ await : boolean
168173}
169174
170175export interface ESLintLabeledStatement extends HasLocation , HasParent {
@@ -202,7 +207,7 @@ export interface ESLintTryStatement extends HasLocation, HasParent {
202207
203208export interface ESLintCatchClause extends HasLocation , HasParent {
204209 type : "CatchClause"
205- param : ESLintPattern
210+ param : ESLintPattern | null
206211 body : ESLintBlockStatement
207212}
208213
@@ -251,17 +256,41 @@ export interface ESLintClassDeclaration extends HasLocation, HasParent {
251256
252257export interface ESLintClassBody extends HasLocation , HasParent {
253258 type : "ClassBody"
254- body : ESLintMethodDefinition [ ]
259+ body : (
260+ | ESLintMethodDefinition
261+ | ESLintPropertyDefinition
262+ | ESLintStaticBlock
263+ ) [ ]
255264}
256265
257266export interface ESLintMethodDefinition extends HasLocation , HasParent {
258267 type : "MethodDefinition"
259268 kind : "constructor" | "method" | "get" | "set"
260269 computed : boolean
261270 static : boolean
262- key : ESLintExpression
271+ key : ESLintExpression | ESLintPrivateIdentifier
263272 value : ESLintFunctionExpression
264273}
274+ export interface ESLintPropertyDefinition extends HasLocation , HasParent {
275+ type : "PropertyDefinition"
276+ computed : boolean
277+ static : boolean
278+ key : ESLintExpression | ESLintPrivateIdentifier
279+ value : ESLintExpression | null
280+ }
281+
282+ export interface ESLintStaticBlock
283+ extends HasLocation ,
284+ HasParent ,
285+ Omit < ESLintBlockStatement , "type" > {
286+ type : "StaticBlock"
287+ body : ESLintStatement [ ]
288+ }
289+
290+ export interface ESLintPrivateIdentifier extends HasLocation , HasParent {
291+ type : "PrivateIdentifier"
292+ name : string
293+ }
265294
266295export type ESLintModuleDeclaration =
267296 | ESLintImportDeclaration
@@ -287,7 +316,7 @@ export interface ESLintImportDeclaration extends HasLocation, HasParent {
287316
288317export interface ESLintImportSpecifier extends HasLocation , HasParent {
289318 type : "ImportSpecifier"
290- imported : ESLintIdentifier
319+ imported : ESLintIdentifier | ESLintStringLiteral
291320 local : ESLintIdentifier
292321}
293322
@@ -301,6 +330,11 @@ export interface ESLintImportNamespaceSpecifier extends HasLocation, HasParent {
301330 local : ESLintIdentifier
302331}
303332
333+ export interface ESLintImportExpression extends HasLocation , HasParent {
334+ type : "ImportExpression"
335+ source : ESLintExpression
336+ }
337+
304338export interface ESLintExportNamedDeclaration extends HasLocation , HasParent {
305339 type : "ExportNamedDeclaration"
306340 declaration ?: ESLintDeclaration | null
@@ -310,8 +344,8 @@ export interface ESLintExportNamedDeclaration extends HasLocation, HasParent {
310344
311345export interface ESLintExportSpecifier extends HasLocation , HasParent {
312346 type : "ExportSpecifier"
313- local : ESLintIdentifier
314- exported : ESLintIdentifier
347+ local : ESLintIdentifier | ESLintStringLiteral
348+ exported : ESLintIdentifier | ESLintStringLiteral
315349}
316350
317351export interface ESLintExportDefaultDeclaration extends HasLocation , HasParent {
@@ -321,6 +355,7 @@ export interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {
321355
322356export interface ESLintExportAllDeclaration extends HasLocation , HasParent {
323357 type : "ExportAllDeclaration"
358+ exported : ESLintIdentifier | ESLintStringLiteral | null
324359 source : ESLintLiteral
325360}
326361
@@ -354,15 +389,55 @@ export interface ESLintIdentifier extends HasLocation, HasParent {
354389 type : "Identifier"
355390 name : string
356391}
357-
358- export interface ESLintLiteral extends HasLocation , HasParent {
392+ interface ESLintLiteralBase extends HasLocation , HasParent {
359393 type : "Literal"
360- value : string | boolean | null | number | RegExp
394+ value : string | boolean | null | number | RegExp | bigint
361395 regex ?: {
362396 pattern : string
363397 flags : string
364398 }
399+ bigint ?: string
365400}
401+ export interface ESLintStringLiteral extends ESLintLiteralBase {
402+ value : string
403+ regex ?: undefined
404+ bigint ?: undefined
405+ }
406+ export interface ESLintBooleanLiteral extends ESLintLiteralBase {
407+ value : boolean
408+ regex ?: undefined
409+ bigint ?: undefined
410+ }
411+ export interface ESLintNullLiteral extends ESLintLiteralBase {
412+ value : null
413+ regex ?: undefined
414+ bigint ?: undefined
415+ }
416+ export interface ESLintNumberLiteral extends ESLintLiteralBase {
417+ value : number
418+ regex ?: undefined
419+ bigint ?: undefined
420+ }
421+ export interface ESLintRegExpLiteral extends ESLintLiteralBase {
422+ value : null | RegExp
423+ regex : {
424+ pattern : string
425+ flags : string
426+ }
427+ bigint ?: undefined
428+ }
429+ export interface ESLintBigIntLiteral extends ESLintLiteralBase {
430+ value : null | bigint
431+ regex ?: undefined
432+ bigint : string
433+ }
434+ export type ESLintLiteral =
435+ | ESLintStringLiteral
436+ | ESLintBooleanLiteral
437+ | ESLintNullLiteral
438+ | ESLintNumberLiteral
439+ | ESLintRegExpLiteral
440+ | ESLintBigIntLiteral
366441
367442export interface ESLintThisExpression extends HasLocation , HasParent {
368443 type : "ThisExpression"
@@ -447,7 +522,7 @@ export interface ESLintBinaryExpression extends HasLocation, HasParent {
447522 | "&"
448523 | "in"
449524 | "instanceof"
450- left : ESLintExpression
525+ left : ESLintExpression | ESLintPrivateIdentifier
451526 right : ESLintExpression
452527}
453528
@@ -467,6 +542,9 @@ export interface ESLintAssignmentExpression extends HasLocation, HasParent {
467542 | "|="
468543 | "^="
469544 | "&="
545+ | "||="
546+ | "&&="
547+ | "??="
470548 left : ESLintPattern
471549 right : ESLintExpression
472550}
@@ -480,7 +558,7 @@ export interface ESLintUpdateExpression extends HasLocation, HasParent {
480558
481559export interface ESLintLogicalExpression extends HasLocation , HasParent {
482560 type : "LogicalExpression"
483- operator : "||" | "&&"
561+ operator : "||" | "&&" | "??"
484562 left : ESLintExpression
485563 right : ESLintExpression
486564}
@@ -514,7 +592,7 @@ export interface ESLintMemberExpression extends HasLocation, HasParent {
514592 optional : boolean
515593 computed : boolean
516594 object : ESLintExpression | ESLintSuper
517- property : ESLintExpression
595+ property : ESLintExpression | ESLintPrivateIdentifier
518596}
519597
520598export interface ESLintYieldExpression extends HasLocation , HasParent {
@@ -544,7 +622,7 @@ export interface ESLintTemplateElement extends HasLocation, HasParent {
544622 type : "TemplateElement"
545623 tail : boolean
546624 value : {
547- cooked : string
625+ cooked : string | null
548626 raw : string
549627 }
550628}
@@ -607,9 +685,11 @@ export interface ESLintAssignmentPattern extends HasLocation, HasParent {
607685 right : ESLintExpression
608686}
609687
688+ export type ESLintChainElement = ESLintCallExpression | ESLintMemberExpression
689+
610690export interface ESLintChainExpression extends HasLocation , HasParent {
611691 type : "ChainExpression"
612- expression : ESLintExpression
692+ expression : ESLintChainElement
613693}
614694
615695/**
0 commit comments