diff --git a/eslint/.eslintrc.js b/eslint/.eslintrc.js index 6dece593..9f13e650 100644 --- a/eslint/.eslintrc.js +++ b/eslint/.eslintrc.js @@ -219,6 +219,13 @@ module.exports = { // https://eslint.org/docs/rules/func-call-spacing 'func-call-spacing': [ 'error', 'never' ], + // requires function names to match the name of the variable or property to which they are assigned + // https://eslint.org/docs/rules/func-name-matching + 'func-name-matching': [ 'error', 'always', { + includeCommonJSModuleExports: false, + considerPropertyDescriptor: true + } ], + // enforces spacing between keys and values in object literal properties 'key-spacing': [ 'error', { beforeColon: false, afterColon: true } ], diff --git a/eslint/rules/copyright.js b/eslint/rules/copyright.js index b326ffa8..5c6c635b 100644 --- a/eslint/rules/copyright.js +++ b/eslint/rules/copyright.js @@ -15,7 +15,7 @@ module.exports = function( context ) { return { - Program: function checkCopyright( node ) { + Program: function( node ) { // Get the whole source code, not for node only. const comments = context.getSourceCode().getAllComments(); diff --git a/eslint/rules/dispose.js b/eslint/rules/dispose.js index 6db00bb3..e69af07c 100644 --- a/eslint/rules/dispose.js +++ b/eslint/rules/dispose.js @@ -27,7 +27,7 @@ module.exports = function( context ) { return { - ExpressionStatement: function checkForDispose( node ) { + ExpressionStatement: function( node ) { // look through the AST of a typical observer registration, see https://github.com/phetsims/chipper/issues/418 if ( node.expression && diff --git a/eslint/rules/no-html-constructors.js b/eslint/rules/no-html-constructors.js index 1d23410e..e88f8dd5 100644 --- a/eslint/rules/no-html-constructors.js +++ b/eslint/rules/no-html-constructors.js @@ -103,7 +103,7 @@ module.exports = function( context ) { * * @param {ASTNode} node */ - 'NewExpression:exit': function noHTMLConstructor( node ) { + 'NewExpression:exit': function( node ) { // Example... // diff --git a/eslint/rules/no-property-in-require-statement.js b/eslint/rules/no-property-in-require-statement.js index 3e2e2341..742ab078 100644 --- a/eslint/rules/no-property-in-require-statement.js +++ b/eslint/rules/no-property-in-require-statement.js @@ -15,7 +15,7 @@ module.exports = function( context ) { return { - VariableDeclaration: function noAttributesInRequireStatement( node ) { + VariableDeclaration: function( node ) { if ( node.declarations && node.declarations.length > 0 && diff --git a/eslint/rules/phet-io-require-contains-ifphetio.js b/eslint/rules/phet-io-require-contains-ifphetio.js index 7c125040..caf70908 100644 --- a/eslint/rules/phet-io-require-contains-ifphetio.js +++ b/eslint/rules/phet-io-require-contains-ifphetio.js @@ -15,7 +15,7 @@ module.exports = function( context ) { return { - VariableDeclaration: function phetioRequireContainsIfphetio( node ) { + VariableDeclaration: function( node ) { // Here is the AST of a typical require statement node, for reference // ( should be the same comment as in require-statement-match.js) diff --git a/eslint/rules/property-visibility-annotation.js b/eslint/rules/property-visibility-annotation.js index 56dd6407..751e1bbe 100644 --- a/eslint/rules/property-visibility-annotation.js +++ b/eslint/rules/property-visibility-annotation.js @@ -16,7 +16,7 @@ module.exports = function( context ) { return { - AssignmentExpression: function propertyVisibilityAnnotation( node ) { + AssignmentExpression: function( node ) { let isAnnotated = false; if ( node.left && node.left && node.left.object && node.left.object.type === 'ThisExpression' ) { diff --git a/eslint/rules/require-statement-match.js b/eslint/rules/require-statement-match.js index 2236d985..cd4390ae 100644 --- a/eslint/rules/require-statement-match.js +++ b/eslint/rules/require-statement-match.js @@ -15,7 +15,7 @@ module.exports = function( context ) { return { - VariableDeclaration: function requireStatementMatch( node ) { + VariableDeclaration: function( node ) { // Here is the AST of a typical require statement node, for reference //var exemplar = { diff --git a/eslint/rules/todo-should-have-issue.js b/eslint/rules/todo-should-have-issue.js index d5ca1619..aa7c11b2 100644 --- a/eslint/rules/todo-should-have-issue.js +++ b/eslint/rules/todo-should-have-issue.js @@ -28,7 +28,7 @@ if ( buildJSON && buildJSON.common && buildJSON.common.phetLibs ) { module.exports = function( context ) { return { - Program: function checkTodoShouldHaveIssue( node ) { + Program: function() { // Check whether the given directory matches the whitelist let directoryShouldBeChecked = false;