* @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);
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: {
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.