From 3baeec52c2d015e9fd023914372cef1796dc9102 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Wed, 14 Jul 2021 14:36:43 +0900 Subject: [PATCH] Chores: Add private-fields-in-in AST to typings (#1564) --- lib/rules/require-valid-default-prop.js | 2 +- typings/eslint-plugin-vue/util-types/ast/es-ast.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/rules/require-valid-default-prop.js b/lib/rules/require-valid-default-prop.js index 2b711b56c..ab0355206 100644 --- a/lib/rules/require-valid-default-prop.js +++ b/lib/rules/require-valid-default-prop.js @@ -427,7 +427,7 @@ module.exports = { } } }, - onDefinePropsExit(node) { + onDefinePropsExit() { scriptSetupPropsContexts.pop() } }) 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 26c433a2e..ba320a979 100644 --- a/typings/eslint-plugin-vue/util-types/ast/es-ast.ts +++ b/typings/eslint-plugin-vue/util-types/ast/es-ast.ts @@ -441,12 +441,21 @@ export type BinaryOperator = | 'in' | 'instanceof' | '**' -export interface BinaryExpression extends HasParentNode { +interface BinaryExpressionWithoutIn extends HasParentNode { type: 'BinaryExpression' - operator: BinaryOperator + operator: Exclude left: Expression right: Expression } +interface BinaryExpressionWithIn extends HasParentNode { + type: 'BinaryExpression' + operator: 'in' + left: Expression | PrivateIdentifier + right: Expression +} +export type BinaryExpression = + | BinaryExpressionWithoutIn + | BinaryExpressionWithIn export type AssignmentOperator = | '=' | '+='