Skip to content

Commit 0c90a51

Browse files
committed
chore: remove compat for getDeclaredVariables
1 parent f06309c commit 0c90a51

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/utils/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,7 @@ function wrapContextToOverrideTokenMethods(context, tokenStore, options) {
325325
*/
326326
function getDeclaredVariables(node) {
327327
const scope = getContainerScope(node)
328-
return (
329-
scope?.getDeclaredVariables?.(node) ??
330-
context.getDeclaredVariables?.(node) ??
331-
[]
332-
)
328+
return scope?.getDeclaredVariables(node) ?? []
333329
}
334330
}
335331

typings/eslint/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export namespace Scope {
1919
globalScope: Scope | null
2020
acquire(node: VAST.ESNode | VAST.Program, inner?: boolean): Scope | null
2121
/** @since ESLint v8.38.0 */
22-
getDeclaredVariables?(node: VAST.ESNode): Variable[]
22+
getDeclaredVariables(node: VAST.ESNode): Variable[]
2323
}
2424
interface Scope {
2525
type:

0 commit comments

Comments
 (0)