Skip to content

Fixed false negatives in vue/camelcase when using ESLint>=v8.38 #2131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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