-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict" | ||
|
||
function getDeclaredVariables(context, node) { | ||
return ( | ||
getSourceCode(context).getDeclaredVariables?.(node) ?? | ||
context.getDeclaredVariables(node) | ||
Check failure on line 6 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@6)
Check failure on line 6 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@7)
Check failure on line 6 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@8)
|
||
) | ||
} | ||
|
||
function getSourceCode(context) { | ||
return context.sourceCode ?? context.getSourceCode() | ||
Check failure on line 11 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@6)
Check failure on line 11 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@7)
Check failure on line 11 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@8)
|
||
} | ||
|
||
function getScope(context, node) { | ||
return getSourceCode(context).getScope?.(node) ?? context.getScope() | ||
Check failure on line 15 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@6)
Check failure on line 15 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@7)
Check failure on line 15 in lib/eslint-compat.js GitHub Actions / ⬣ Lint (ESLint@8)
|
||
} | ||
|
||
module.exports = { | ||
getDeclaredVariables, | ||
getSourceCode, | ||
getScope, | ||
} |