Skip to content

Commit 6c32bf5

Browse files
authored
Fixed false negatives in vue/camelcase when using ESLint>=v8.38 (#2131)
1 parent df31785 commit 6c32bf5

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

lib/utils/index.js

+16-8
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ function wrapContextToOverrideTokenMethods(context, tokenStore, options) {
189189
get tokensAndComments() {
190190
return getTokensAndComments()
191191
},
192-
getNodeByRangeIndex
192+
getNodeByRangeIndex,
193+
// @ts-expect-error -- Added in ESLint v8.38.0
194+
getDeclaredVariables
193195
},
194196
tokenStore
195197
)
@@ -246,15 +248,21 @@ function wrapContextToOverrideTokenMethods(context, tokenStore, options) {
246248
getSourceCode() {
247249
return sourceCode
248250
},
249-
getDeclaredVariables(node) {
250-
const scope = getContainerScope(node)
251-
if (scope) {
252-
return scope.getDeclaredVariables(node)
253-
}
251+
getDeclaredVariables
252+
})
254253

255-
return context.getDeclaredVariables(node)
254+
/**
255+
* @param {ESNode} node
256+
* @returns {Variable[]}
257+
*/
258+
function getDeclaredVariables(node) {
259+
const scope = getContainerScope(node)
260+
if (scope) {
261+
return scope.getDeclaredVariables(node)
256262
}
257-
})
263+
264+
return context.getDeclaredVariables(node)
265+
}
258266
}
259267

260268
/**

0 commit comments

Comments
 (0)