From 6f9040d157deecff2a8ad7cfa6923b8d74bd66ec Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Thu, 13 Apr 2023 23:20:09 +0900 Subject: [PATCH 1/2] Fixed false positives in `vue/camelcase` when using ESLint>=v8.38 --- lib/utils/index.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/utils/index.js b/lib/utils/index.js index 8e0f65999..95536f5a9 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -189,7 +189,9 @@ function wrapContextToOverrideTokenMethods(context, tokenStore, options) { get tokensAndComments() { return getTokensAndComments() }, - getNodeByRangeIndex + getNodeByRangeIndex, + // @ts-expect-error -- Added in ESLint v8.38.0 + getDeclaredVariables, }, tokenStore ) @@ -246,15 +248,22 @@ function wrapContextToOverrideTokenMethods(context, tokenStore, options) { getSourceCode() { return sourceCode }, - getDeclaredVariables(node) { - const scope = getContainerScope(node) - if (scope) { - return scope.getDeclaredVariables(node) - } + getDeclaredVariables + }) - return context.getDeclaredVariables(node) + /** + * @param {ESNode} node + * @returns {Variable[]} + */ + function getDeclaredVariables(node) { + const scope = getContainerScope(node) + if (scope) { + return scope.getDeclaredVariables(node) } - }) + + return context.getDeclaredVariables(node) + + } } /** From f2294137a7db113a9e8ea7fd51a67a6d13900146 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Thu, 13 Apr 2023 23:24:02 +0900 Subject: [PATCH 2/2] fix lint error --- lib/utils/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/utils/index.js b/lib/utils/index.js index 95536f5a9..249097418 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -191,7 +191,7 @@ function wrapContextToOverrideTokenMethods(context, tokenStore, options) { }, getNodeByRangeIndex, // @ts-expect-error -- Added in ESLint v8.38.0 - getDeclaredVariables, + getDeclaredVariables }, tokenStore ) @@ -262,7 +262,6 @@ function wrapContextToOverrideTokenMethods(context, tokenStore, options) { } return context.getDeclaredVariables(node) - } }