Skip to content

Commit 2a3294d

Browse files
authored
Chores: Add Types for ES2021 (#1337)
1 parent b75d312 commit 2a3294d

File tree

1 file changed

+48
-40
lines changed
  • typings/eslint-plugin-vue/util-types/ast

1 file changed

+48
-40
lines changed

typings/eslint-plugin-vue/util-types/ast/es-ast.ts

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -351,68 +351,76 @@ export interface SequenceExpression extends HasParentNode {
351351
type: 'SequenceExpression'
352352
expressions: Expression[]
353353
}
354+
export type UnaryOperator = '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete'
354355
export interface UnaryExpression extends HasParentNode {
355356
type: 'UnaryExpression'
356-
operator: '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete'
357+
operator: UnaryOperator
357358
prefix: boolean
358359
argument: Expression
359360
}
361+
export type BinaryOperator =
362+
| '=='
363+
| '!='
364+
| '==='
365+
| '!=='
366+
| '<'
367+
| '<='
368+
| '>'
369+
| '>='
370+
| '<<'
371+
| '>>'
372+
| '>>>'
373+
| '+'
374+
| '-'
375+
| '*'
376+
| '/'
377+
| '%'
378+
| '|'
379+
| '^'
380+
| '&'
381+
| 'in'
382+
| 'instanceof'
383+
| '**'
360384
export interface BinaryExpression extends HasParentNode {
361385
type: 'BinaryExpression'
362-
operator:
363-
| '=='
364-
| '!='
365-
| '==='
366-
| '!=='
367-
| '<'
368-
| '<='
369-
| '>'
370-
| '>='
371-
| '<<'
372-
| '>>'
373-
| '>>>'
374-
| '+'
375-
| '-'
376-
| '*'
377-
| '/'
378-
| '%'
379-
| '**'
380-
| '|'
381-
| '^'
382-
| '&'
383-
| 'in'
384-
| 'instanceof'
386+
operator: BinaryOperator
385387
left: Expression
386388
right: Expression
387389
}
390+
export type AssignmentOperator =
391+
| '='
392+
| '+='
393+
| '-='
394+
| '*='
395+
| '/='
396+
| '%='
397+
| '<<='
398+
| '>>='
399+
| '>>>='
400+
| '|='
401+
| '^='
402+
| '&='
403+
| '**='
404+
| '||='
405+
| '&&='
406+
| '??='
388407
export interface AssignmentExpression extends HasParentNode {
389408
type: 'AssignmentExpression'
390-
operator:
391-
| '='
392-
| '+='
393-
| '-='
394-
| '*='
395-
| '/='
396-
| '%='
397-
| '**='
398-
| '<<='
399-
| '>>='
400-
| '>>>='
401-
| '|='
402-
| '^='
403-
| '&='
409+
operator: AssignmentOperator
404410
left: Pattern
405411
right: Expression
406412
}
413+
export type UpdateOperator = '++' | '--'
407414
export interface UpdateExpression extends HasParentNode {
408415
type: 'UpdateExpression'
409-
operator: '++' | '--'
416+
operator: UpdateOperator
410417
argument: Expression
411418
prefix: boolean
412419
}
420+
export type LogicalOperator = '||' | '&&' | '??'
413421
export interface LogicalExpression extends HasParentNode {
414422
type: 'LogicalExpression'
415-
operator: '||' | '&&' | '??'
423+
operator: LogicalOperator
416424
left: Expression
417425
right: Expression
418426
}

0 commit comments

Comments
 (0)