X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=eslint%2Flib%2Frules%2Fcamelcase.js;fp=eslint%2Flib%2Frules%2Fcamelcase.js;h=51bb4122df094f83928bb1bd57102ac1b75ef6c2;hb=f2a92ac62f5c8e72451bd86e77e46c05e75cf42e;hp=ee1b6bf598d31e89f09252b8e066574a91a25009;hpb=28ff354db001e368c2497fb14373081a5dfad2fd;p=pve-eslint.git diff --git a/eslint/lib/rules/camelcase.js b/eslint/lib/rules/camelcase.js index ee1b6bf..51bb412 100644 --- a/eslint/lib/rules/camelcase.js +++ b/eslint/lib/rules/camelcase.js @@ -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; }