Make WordPress Core

Changeset 63464


Ignore:
Timestamp:
09/04/2026 11:04:27 AM (2 months ago)
Author:
afercia
Message:

Build/Test Tools: Integrate lint:jsdoc into the Core development workflow.

This changeset adds a lint:jsdoc Grunt task and includes it in the precommit:js task list.

The existing lint:jsdoc NPM script was restored to a working configuration in #65939. It broke with the upgrade of ESLint to version 10 in the @wordpress/scripts package in the Gutenberg repository. See ​https://github.com/WordPress/gutenberg/pull/76654.

By including lint:jsdoc into CI, future potential breakages will be detected soon. Also, this change aims to reinforce the long-term goal of improving the JavaScript inline documentation that was started years ago in the ​WordPress JavaScript Docs Coding Standards initiative. See ​https://make.wordpress.org/core/handbook/docs/inline/js/.
Future improvements will be part of ongoing maintenance work. See for example #66033.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13336

Props afercia, westonruter.
See #65939, #65950, #66033.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r63406 r63464  
    17621762                'webpack:prod',
    17631763                'jshint:corejs',
     1764                'lint:jsdoc',
    17641765                'typecheck:js',
    17651766                'uglify:imgareaselect',
    … …  
    23192320        } );
    23202321
     2322        grunt.registerTask( 'lint:jsdoc', 'Runs JSDoc linting on JavaScript files.', function() {
     2323                var done = this.async();
     2324
     2325                grunt.util.spawn( {
     2326                        cmd: 'npm',
     2327                        args: [ 'run', 'lint:jsdoc' ],
     2328                        opts: { stdio: 'inherit' }
     2329                }, function( error ) {
     2330                        done( ! error );
     2331                } );
     2332        } );
     2333
    23212334        grunt.registerTask( 'phpstan', 'Runs PHPStan on the entire codebase.', function() {
    23222335                var done = this.async();
Note: See TracChangeset for help on using the changeset viewer.