]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/no-import-assign.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / no-import-assign.js
index fc104fe6c46b69cb365bf84381892b31678ad6a3..c69988666ab8f28938cdc4e0faca36fa53675c00 100644 (file)
@@ -9,7 +9,7 @@
 // Helpers
 //------------------------------------------------------------------------------
 
-const { findVariable } = require("eslint-utils");
+const { findVariable } = require("@eslint-community/eslint-utils");
 const astUtils = require("./utils/ast-utils");
 
 const WellKnownMutationFunctions = {
@@ -182,7 +182,7 @@ module.exports = {
         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: [],
@@ -194,11 +194,13 @@ module.exports = {
     },
 
     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"
                     );