]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/no-extend-native.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / no-extend-native.js
index 52c6bd3110331e9988b507580702406a01efd4ca..fcbb3855725a6f4c062f2f274ca987c995272558 100644 (file)
@@ -24,7 +24,7 @@ module.exports = {
         docs: {
             description: "Disallow extending native types",
             recommended: false,
-            url: "https://eslint.org/docs/rules/no-extend-native"
+            url: "https://eslint.org/docs/latest/rules/no-extend-native"
         },
 
         schema: [
@@ -51,6 +51,7 @@ module.exports = {
     create(context) {
 
         const config = context.options[0] || {};
+        const sourceCode = context.sourceCode;
         const exceptions = new Set(config.exceptions || []);
         const modifiedBuiltins = new Set(
             Object.keys(globals.builtin)
@@ -159,8 +160,8 @@ module.exports = {
 
         return {
 
-            "Program:exit"() {
-                const globalScope = context.getScope();
+            "Program:exit"(node) {
+                const globalScope = sourceCode.getScope(node);
 
                 modifiedBuiltins.forEach(builtin => {
                     const builtinVar = globalScope.set.get(builtin);