From 2a3294d248e1225325d8176d0f737e6404cf3885 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Sun, 18 Oct 2020 22:42:48 +0900 Subject: [PATCH] Chores: Add Types for ES2021 (#1337) --- .../util-types/ast/es-ast.ts | 88 ++++++++++--------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/typings/eslint-plugin-vue/util-types/ast/es-ast.ts b/typings/eslint-plugin-vue/util-types/ast/es-ast.ts index 035c113f4..9af1e7d06 100644 --- a/typings/eslint-plugin-vue/util-types/ast/es-ast.ts +++ b/typings/eslint-plugin-vue/util-types/ast/es-ast.ts @@ -351,68 +351,76 @@ export interface SequenceExpression extends HasParentNode { type: 'SequenceExpression' expressions: Expression[] } +export type UnaryOperator = '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete' export interface UnaryExpression extends HasParentNode { type: 'UnaryExpression' - operator: '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete' + operator: UnaryOperator prefix: boolean argument: Expression } +export type BinaryOperator = + | '==' + | '!=' + | '===' + | '!==' + | '<' + | '<=' + | '>' + | '>=' + | '<<' + | '>>' + | '>>>' + | '+' + | '-' + | '*' + | '/' + | '%' + | '|' + | '^' + | '&' + | 'in' + | 'instanceof' + | '**' export interface BinaryExpression extends HasParentNode { type: 'BinaryExpression' - operator: - | '==' - | '!=' - | '===' - | '!==' - | '<' - | '<=' - | '>' - | '>=' - | '<<' - | '>>' - | '>>>' - | '+' - | '-' - | '*' - | '/' - | '%' - | '**' - | '|' - | '^' - | '&' - | 'in' - | 'instanceof' + operator: BinaryOperator left: Expression right: Expression } +export type AssignmentOperator = + | '=' + | '+=' + | '-=' + | '*=' + | '/=' + | '%=' + | '<<=' + | '>>=' + | '>>>=' + | '|=' + | '^=' + | '&=' + | '**=' + | '||=' + | '&&=' + | '??=' export interface AssignmentExpression extends HasParentNode { type: 'AssignmentExpression' - operator: - | '=' - | '+=' - | '-=' - | '*=' - | '/=' - | '%=' - | '**=' - | '<<=' - | '>>=' - | '>>>=' - | '|=' - | '^=' - | '&=' + operator: AssignmentOperator left: Pattern right: Expression } +export type UpdateOperator = '++' | '--' export interface UpdateExpression extends HasParentNode { type: 'UpdateExpression' - operator: '++' | '--' + operator: UpdateOperator argument: Expression prefix: boolean } +export type LogicalOperator = '||' | '&&' | '??' export interface LogicalExpression extends HasParentNode { type: 'LogicalExpression' - operator: '||' | '&&' | '??' + operator: LogicalOperator left: Expression right: Expression }