]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/func-name-matching.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / func-name-matching.js
index 391b2a2783639e4fabbe6dff9112e2a8252af1e4..b9555d6bdf4e3aabfad3bdda792524e43c006482 100644 (file)
@@ -44,7 +44,7 @@ function isModuleExports(pattern) {
  * @returns {boolean} True if the string is a valid identifier
  */
 function isIdentifier(name, ecmaVersion) {
-    if (ecmaVersion >= 6) {
+    if (ecmaVersion >= 2015) {
         return esutils.keyword.isIdentifierES6(name);
     }
     return esutils.keyword.isIdentifierES5(name);
@@ -76,7 +76,7 @@ module.exports = {
         docs: {
             description: "Require function names to match the name of the variable or property to which they are assigned",
             recommended: false,
-            url: "https://eslint.org/docs/rules/func-name-matching"
+            url: "https://eslint.org/docs/latest/rules/func-name-matching"
         },
 
         schema: {
@@ -104,7 +104,7 @@ module.exports = {
         const nameMatches = typeof context.options[0] === "string" ? context.options[0] : "always";
         const considerPropertyDescriptor = options.considerPropertyDescriptor;
         const includeModuleExports = options.includeCommonJSModuleExports;
-        const ecmaVersion = context.parserOptions && context.parserOptions.ecmaVersion ? context.parserOptions.ecmaVersion : 5;
+        const ecmaVersion = context.languageOptions.ecmaVersion;
 
         /**
          * Check whether node is a certain CallExpression.