Repository navigation
General: Enable more JSDoc rules - #16166
faisalahammad wants to merge 1 commit into
Conversation
Enables the following JSDoc rules: - `jsdoc/check-access` - `jsdoc/check-template-names` - `jsdoc/empty-tags` - `jsdoc/implements-on-classes` - `jsdoc/multiline-blocks` - `jsdoc/no-multi-asterisks` - `jsdoc/require-asterisk-prefix` - `jsdoc/require-yields` Fixes all the related violations, and corrects an incomplete `@since` version in the media modal view. Part of the effort to improve JS inline documentation for 7.3. See #66745.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Enables eight more rules in
.eslintrc-jsdoc.jsand fixes the violations they report:jsdoc/check-accessjsdoc/check-template-namesjsdoc/empty-tagsjsdoc/implements-on-classesjsdoc/multiline-blocksjsdoc/no-multi-asterisksjsdoc/require-asterisk-prefixjsdoc/require-yieldsFixes:
src/js/_enqueues/lib/nav-menu.js: removes@package WordPress, whichempty-tagsexpects to be empty and which is not part of the JS inline documentation standard.src/js/media/models/attachments.js: moves the description text that followed@staticabove the tag, matching the other filters in the file (empty-tags).src/js/media/models/post-image.js: changes the closing**/to*/(no-multi-asterisks).src/js/media/views/modal.js: changes@since 6.7to@since 6.7.0.Six of the rules report no violations today, so they only guard against new ones. Comments and lint config only, no functional changes.
npm run lint:jsdocandnpm run typecheck:jsboth pass.Left out on purpose:
jsdoc/check-values: 29 of its 30 reports are the core@since x.y.z Description.format, which the rule does not accept. The one real issue is fixed by hand above.jsdoc/no-bad-blocks: all 11 reports are/* */multi-line inline comments containing tags, which the JS standard allows. A few of them look like broken docblocks and could be handled separately.Trac ticket: https://core.trac.wordpress.org/ticket/66745
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Counting violations for each unused JSDoc rule, picking the rules to enable and applying the doc fixes; changes were reviewed by me.
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.