Skip to content

Commit

Permalink
Fixed false negatives in vue/camelcase when using ESLint>=v8.38 (#2131
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ota-meshi committed Apr 13, 2023
1 parent df31785 commit 6c32bf5
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -246,15 +248,21 @@ 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)
}
}

/**
Expand Down

0 comments on commit 6c32bf5

Please sign in to comment.