]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/camelcase.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / camelcase.js
index ee1b6bf598d31e89f09252b8e066574a91a25009..51bb4122df094f83928bb1bd57102ac1b75ef6c2 100644 (file)
@@ -23,7 +23,7 @@ module.exports = {
         docs: {
             description: "Enforce camelcase naming convention",
             recommended: false,
-            url: "https://eslint.org/docs/rules/camelcase"
+            url: "https://eslint.org/docs/latest/rules/camelcase"
         },
 
         schema: [
@@ -73,6 +73,7 @@ module.exports = {
         const ignoreImports = options.ignoreImports;
         const ignoreGlobals = options.ignoreGlobals;
         const allow = options.allow || [];
+        const sourceCode = context.sourceCode;
 
         //--------------------------------------------------------------------------
         // Helpers
@@ -245,8 +246,8 @@ module.exports = {
         return {
 
             // Report camelcase of global variable references ------------------
-            Program() {
-                const scope = context.getScope();
+            Program(node) {
+                const scope = sourceCode.getScope(node);
 
                 if (!ignoreGlobals) {
 
@@ -295,7 +296,7 @@ module.exports = {
                 "ClassExpression",
                 "CatchClause"
             ]](node) {
-                for (const variable of context.getDeclaredVariables(node)) {
+                for (const variable of sourceCode.getDeclaredVariables(node)) {
                     if (isGoodName(variable.name)) {
                         continue;
                     }
@@ -345,7 +346,7 @@ module.exports = {
 
             // Report camelcase in import --------------------------------------
             ImportDeclaration(node) {
-                for (const variable of context.getDeclaredVariables(node)) {
+                for (const variable of sourceCode.getDeclaredVariables(node)) {
                     if (isGoodName(variable.name)) {
                         continue;
                     }