eslint-plugin-es-x
Advanced tools
Comparing version 7.3.0 to 7.4.0
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Array: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Array: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Array: { |
@@ -11,2 +11,3 @@ /** | ||
} = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -29,3 +30,3 @@ module.exports = { | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
@@ -32,0 +33,0 @@ /** |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Atomics: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Atomics: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -33,4 +34,7 @@ module.exports = { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
const references = tracker.iterateGlobalReferences({ | ||
@@ -37,0 +41,0 @@ BigInt: { [ReferenceTracker.READ]: true }, |
@@ -11,2 +11,3 @@ /** | ||
} = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -66,2 +67,5 @@ /** | ||
PropertyDefinition(node) { | ||
if (node.declare || node.parent.parent.declare) { | ||
return | ||
} | ||
context.report({ | ||
@@ -73,3 +77,3 @@ node: node.key, | ||
node, | ||
context.getSourceCode(), | ||
getSourceCode(context), | ||
), | ||
@@ -89,3 +93,3 @@ }, | ||
node.value, | ||
context.getSourceCode(), | ||
getSourceCode(context), | ||
), | ||
@@ -92,0 +96,0 @@ }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Date: { |
@@ -14,2 +14,3 @@ /** | ||
} = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -83,2 +84,3 @@ /** | ||
create(context) { | ||
const sourceCode = getSourceCode(context) | ||
/** @type {Array<{ classNode: ClassNode, superCallNode: CallExpression }>} */ | ||
@@ -117,3 +119,6 @@ const maybeErrorSubclasses = [] | ||
// new Error("msg", { cause: foo }) | ||
return getPropertyName(property, context.getScope()) === "cause" | ||
return ( | ||
getPropertyName(property, sourceCode.getScope(node)) === | ||
"cause" | ||
) | ||
}) | ||
@@ -170,4 +175,6 @@ } | ||
}, | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences( | ||
@@ -174,0 +181,0 @@ errorsTraceMap, |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ escape: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ globalThis: { [READ]: true }, |
"use strict" | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
module.exports = { | ||
@@ -21,3 +23,3 @@ meta: { | ||
Program() { | ||
const firstComment = context.getSourceCode().ast.comments[0] | ||
const firstComment = getSourceCode(context).ast.comments[0] | ||
if (firstComment && firstComment.type === "Shebang") { | ||
@@ -24,0 +26,0 @@ context.report({ |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
"use strict" | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -22,4 +23,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -26,0 +30,0 @@ Intl: { |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { definePatternSearchGenerator } = require("../utils") | ||
@@ -27,3 +28,3 @@ const iterateTargetChars = definePatternSearchGenerator(/[\u2028\u2029]/gu) | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
return { | ||
@@ -30,0 +31,0 @@ Literal(node) { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ JSON: { [READ]: true }, |
@@ -7,2 +7,3 @@ "use strict" | ||
} = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -75,3 +76,4 @@ const LEGACY_ACCESSOR_METHODS = new Set([ | ||
} | ||
const scopeManager = context.getSourceCode().scopeManager | ||
const sourceCode = getSourceCode(context) | ||
const scopeManager = sourceCode.scopeManager | ||
if ( | ||
@@ -83,3 +85,6 @@ // Not defined as global variables. | ||
) { | ||
const variable = findVariable(context.getScope(), node) | ||
const variable = findVariable( | ||
sourceCode.getScope(node), | ||
node, | ||
) | ||
if (!variable) { | ||
@@ -86,0 +91,0 @@ return |
@@ -8,2 +8,3 @@ /** | ||
const utils = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -26,3 +27,3 @@ module.exports = { | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
return { | ||
@@ -29,0 +30,0 @@ "AssignmentExpression[operator=/(?:\\|\\||&&|\\?\\?)=/]"(node) { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Map: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Math: { |
@@ -7,2 +7,4 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
/** | ||
@@ -36,5 +38,6 @@ * Checks if the given token is a nullish coalescing operator or not. | ||
context.report({ | ||
node: context | ||
.getSourceCode() | ||
.getTokenAfter(node.left, isNullishCoalescingOperator), | ||
node: getSourceCode(context).getTokenAfter( | ||
node.left, | ||
isNullishCoalescingOperator, | ||
), | ||
messageId: "forbidden", | ||
@@ -41,0 +44,0 @@ }) |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Number: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { ReferenceTracker, READ } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -28,4 +29,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -32,0 +36,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -28,4 +29,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -32,0 +36,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Object: { |
@@ -7,2 +7,4 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
module.exports = { | ||
@@ -24,3 +26,3 @@ meta: { | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
@@ -27,0 +29,0 @@ /** |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Promise: { allSettled: { [READ]: true } }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -28,4 +29,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -32,0 +36,0 @@ AggregateError: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Promise: { [READ]: true }, |
@@ -11,2 +11,3 @@ /** | ||
} = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -29,3 +30,3 @@ module.exports = { | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
@@ -32,0 +33,0 @@ /** |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Proxy: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Reflect: { [READ]: true }, |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { getRegExpCalls } = require("../utils") | ||
@@ -33,4 +34,5 @@ | ||
"Program:exit"() { | ||
const scope = context.getScope() | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const scope = sourceCode.getScope(program) | ||
@@ -37,0 +39,0 @@ for (const { node, flags } of getRegExpCalls(scope)) { |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { getRegExpCalls } = require("../utils") | ||
@@ -33,4 +34,5 @@ | ||
"Program:exit"() { | ||
const scope = context.getScope() | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const scope = sourceCode.getScope(program) | ||
@@ -37,0 +39,0 @@ for (const { node, flags } of getRegExpCalls(scope)) { |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { getRegExpCalls } = require("../utils") | ||
@@ -33,4 +34,5 @@ | ||
"Program:exit"() { | ||
const scope = context.getScope() | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const scope = sourceCode.getScope(program) | ||
@@ -37,0 +39,0 @@ for (const { node, flags } of getRegExpCalls(scope)) { |
"use strict" | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { getRegExpCalls } = require("../utils") | ||
@@ -28,4 +29,5 @@ | ||
"Program:exit"() { | ||
const scope = context.getScope() | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const scope = sourceCode.getScope(program) | ||
@@ -32,0 +34,0 @@ for (const { node, flags } of getRegExpCalls(scope)) { |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { getRegExpCalls } = require("../utils") | ||
@@ -33,4 +34,5 @@ | ||
"Program:exit"() { | ||
const scope = context.getScope() | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const scope = sourceCode.getScope(program) | ||
@@ -37,0 +39,0 @@ for (const { node, flags } of getRegExpCalls(scope)) { |
@@ -10,2 +10,3 @@ "use strict" | ||
} = require("../util/define-prototype-method-handler") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -65,4 +66,7 @@ /** | ||
), | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -69,0 +73,0 @@ ArrayBuffer: { [CONSTRUCT]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Set: { [READ]: true }, |
"use strict" | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
module.exports = { | ||
@@ -20,5 +22,6 @@ meta: { | ||
create(context) { | ||
const sourceCode = getSourceCode(context) | ||
return { | ||
"CatchClause > Identifier.param:exit"(node) { | ||
const scope = context.getScope() | ||
const scope = sourceCode.getScope(node) | ||
const shadowingVar = scope.variableScope.set.get(node.name) | ||
@@ -25,0 +28,0 @@ if (!shadowingVar) { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ SharedArrayBuffer: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ String: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ String: { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Array: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Symbol: { [READ]: true }, |
@@ -7,2 +7,4 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
/** | ||
@@ -62,3 +64,3 @@ * Checks whether it is string literal | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
return { | ||
@@ -65,0 +67,0 @@ "TaggedTemplateExpression, :not(TaggedTemplateExpression) > TemplateLiteral"( |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { isCommaToken } = require("../utils") | ||
@@ -27,3 +28,3 @@ | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
return { | ||
@@ -30,0 +31,0 @@ "ArrayExpression, ArrayPattern, ObjectExpression, ObjectPattern"( |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { isCommaToken } = require("../utils") | ||
@@ -28,3 +29,3 @@ | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
return { | ||
@@ -31,0 +32,0 @@ ":function"(node) { |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ Int8Array: { [READ]: true }, |
@@ -7,2 +7,3 @@ /** | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { definePatternSearchGenerator } = require("../utils") | ||
@@ -38,3 +39,3 @@ const codePointEscapeSearchGenerator = | ||
create(context) { | ||
const sourceCode = context.getSourceCode() | ||
const sourceCode = getSourceCode(context) | ||
@@ -41,0 +42,0 @@ /** |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ WeakMap: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -27,4 +28,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -31,0 +35,0 @@ WeakSet: { [READ]: true }, |
@@ -8,2 +8,3 @@ /** | ||
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -28,4 +29,7 @@ module.exports = { | ||
return { | ||
"Program:exit"() { | ||
const tracker = new ReferenceTracker(context.getScope()) | ||
"Program:exit"(program) { | ||
const sourceCode = getSourceCode(context) | ||
const tracker = new ReferenceTracker( | ||
sourceCode.getScope(program), | ||
) | ||
for (const { node, path } of tracker.iterateGlobalReferences({ | ||
@@ -32,0 +36,0 @@ FinalizationRegistry: { [READ]: true }, |
@@ -6,2 +6,3 @@ "use strict" | ||
const { buildObjectTypeCheckerForTS } = require("./object-type-checker-for-ts") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -28,2 +29,3 @@ /** | ||
function definePrototypeMethodHandler(context, nameMap, options) { | ||
const sourceCode = getSourceCode(context) | ||
const aggressiveOption = getAggressiveOption(context) | ||
@@ -77,3 +79,6 @@ const aggressiveResult = aggressiveOption ? "aggressive" : false | ||
MemberExpression(node) { | ||
const propertyName = getPropertyName(node, context.getScope()) | ||
const propertyName = getPropertyName( | ||
node, | ||
sourceCode.getScope(node), | ||
) | ||
let objectTypeResult = undefined | ||
@@ -107,3 +112,6 @@ if ( | ||
MemberExpression(node) { | ||
const propertyName = getPropertyName(node, context.getScope()) | ||
const propertyName = getPropertyName( | ||
node, | ||
sourceCode.getScope(node), | ||
) | ||
for (const [className, methodNames] of nameMapEntries) { | ||
@@ -110,0 +118,0 @@ let objectTypeResult = undefined |
"use strict" | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
const { optionalRequire } = require("../optional-require") | ||
@@ -20,8 +21,9 @@ /** @type {import("typescript")} */ | ||
function buildObjectTypeCheckerForTS(context, aggressiveResult) { | ||
const sourceCode = getSourceCode(context) | ||
/** @type {ReadonlyMap<any, import("typescript").Node>} */ | ||
const tsNodeMap = context.parserServices.esTreeNodeToTSNodeMap | ||
const tsNodeMap = sourceCode.parserServices.esTreeNodeToTSNodeMap | ||
/** @type {import("typescript").TypeChecker} */ | ||
const checker = | ||
context.parserServices.program && | ||
context.parserServices.program.getTypeChecker() | ||
sourceCode.parserServices.program && | ||
sourceCode.parserServices.program.getTypeChecker() | ||
@@ -32,3 +34,4 @@ const isTS = Boolean(ts && tsNodeMap && checker) | ||
} | ||
const hasFullType = context.parserServices.hasFullTypeInformation !== false | ||
const hasFullType = | ||
sourceCode.parserServices.hasFullTypeInformation !== false | ||
@@ -35,0 +38,0 @@ return function (memberAccessNode, className) { |
"use strict" | ||
const { findVariable } = require("@eslint-community/eslint-utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -150,3 +151,3 @@ module.exports = { buildObjectTypeChecker, buildExpressionTypeProvider } | ||
function buildExpressionTypeProvider(context) { | ||
const key = context.getSourceCode().ast | ||
const key = getSourceCode(context).ast | ||
let result = cache.get(key) | ||
@@ -229,3 +230,3 @@ if (!result) { | ||
return findVariable( | ||
context.getSourceCode().scopeManager.globalScope, | ||
getSourceCode(context).scopeManager.globalScope, | ||
node, | ||
@@ -232,0 +233,0 @@ ) |
@@ -5,2 +5,3 @@ "use strict" | ||
const { getRegExpCalls } = require("../utils") | ||
const { getSourceCode } = require("eslint-compat-utils") | ||
@@ -19,3 +20,4 @@ const allVisitorBuilder = new WeakMap() | ||
function defineRegExpHandler(context, visitorBuilder) { | ||
const programNode = context.getSourceCode().ast | ||
const sourceCode = getSourceCode(context) | ||
const programNode = sourceCode.ast | ||
@@ -36,3 +38,3 @@ let handler = {} | ||
const scope = context.getScope() | ||
const scope = sourceCode.getScope(programNode) | ||
for (const { node, pattern, flags } of getRegExpCalls(scope)) { | ||
@@ -39,0 +41,0 @@ visitRegExp(builders, node, pattern || "", flags || "") |
{ | ||
"name": "eslint-plugin-es-x", | ||
"version": "7.3.0", | ||
"version": "7.4.0", | ||
"description": "ESLint plugin about ECMAScript syntactic features.", | ||
@@ -17,3 +17,4 @@ "engines": { | ||
"@eslint-community/eslint-utils": "^4.1.2", | ||
"@eslint-community/regexpp": "^4.6.0" | ||
"@eslint-community/regexpp": "^4.6.0", | ||
"eslint-compat-utils": "^0.1.2" | ||
}, | ||
@@ -20,0 +21,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
362646
10640
4
+ Addedeslint-compat-utils@^0.1.2
+ Addedeslint-compat-utils@0.1.2(transitive)