Skip to content

Add lint:jsdoc grunt task to precommit:js task. - #13336

Closed
afercia wants to merge 1 commit into
WordPress:trunkfrom
afercia:lint-jsdoc-grunt-task
Closed

Add lint:jsdoc grunt task to precommit:js task.#13336
afercia wants to merge 1 commit into
WordPress:trunkfrom
afercia:lint-jsdoc-grunt-task

Conversation

@afercia

@afercia afercia commented Aug 31, 2026

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/65950

Important

Do not merge before #10743 otherwise the tests on CI will fail for any pull request.

Adds a Grunt task to run the lint:jsdoc as part of the precommit task.

Needs #10743 to be merged first.

Test instructions:

  • Make a temporary change to any admin JS file.
  • From the terminal, run grunt precommit.
  • The task should detect that only JS files have been modified and only run the JS tests and sub-tasks, see precommit:js.
  • Observe lint:jsdoc runs as part of precommit:js..
  • Note that until Improve Customizer JSDoc #10743 isn't merged yet, lint:jsdoc will report several violations.

Use of AI Tools


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props afercia, westonruter.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@afercia
afercia force-pushed the lint-jsdoc-grunt-task branch 2 times, most recently from 64beb5f to e654681 Compare September 4, 2026 05:58
@afercia
afercia requested a review from westonruter September 4, 2026 05:58

@westonruter westonruter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@afercia

afercia commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Now that all the remaining improvements to the Customizer JS documentation have been committed in Core-40831 running npm run lint:jsdoc on trunk reports 0 errors. It's a good time to make it run on CI.

Further improvements to the JavaScript inline documentation and the JSDoc configuration will be addressed in Core-66033 for the WordPress 7.2 release cycle.

@afercia
afercia force-pushed the lint-jsdoc-grunt-task branch from e654681 to 08d8e08 Compare September 4, 2026 06:33
wporg-sync pushed a commit that referenced this pull request Sep 4, 2026
…flow.

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 WordPress/gutenberg#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 #13336

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


git-svn-id: https://develop.svn.wordpress.org/trunk@63464 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Sep 4, 2026
…flow.

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 WordPress/gutenberg#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 WordPress/wordpress-develop#13336

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

Built from https://develop.svn.wordpress.org/trunk@63464


git-svn-id: http://core.svn.wordpress.org/trunk@62644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@afercia

afercia commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

@afercia afercia closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants