// Helpers
//------------------------------------------------------------------------------
-const { findVariable } = require("eslint-utils");
+const { findVariable } = require("@eslint-community/eslint-utils");
const astUtils = require("./utils/ast-utils");
const WellKnownMutationFunctions = {
docs: {
description: "Disallow assigning to imported bindings",
recommended: true,
- url: "https://eslint.org/docs/rules/no-import-assign"
+ url: "https://eslint.org/docs/latest/rules/no-import-assign"
},
schema: [],
},
create(context) {
+ const sourceCode = context.sourceCode;
+
return {
ImportDeclaration(node) {
- const scope = context.getScope();
+ const scope = sourceCode.getScope(node);
- for (const variable of context.getDeclaredVariables(node)) {
+ for (const variable of sourceCode.getDeclaredVariables(node)) {
const shouldCheckMembers = variable.defs.some(
d => d.node.type === "ImportNamespaceSpecifier"
);