#65951 closed defect (bug) (fixed)
Fix all the JSDocs
| Reported by: | afercia | Owned by: | afercia |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | javascript, docs, coding-standards |
Description
After the JSDoc ESLint script is fixed in #65939, all the 37 errors and 3 warnings reported by JSDoc across the Core JS files should be fixed.
Attachments (1)
Change History (23)
This ticket was mentioned in PR #13251 on WordPress/wordpress-develop by @afercia.
3 months ago
#1
- Keywords has-patch added
@afercia commented on PR #13251:
3 months ago
#2
Regarding the optional hyphen before the param description, it can be disallowed or required via the jsdoc/require-hyphen-before-param-description rule.
However, as mentioned in the review comments, making it required would need a proposal to change the JS docs coding standards.
@afercia commented on PR #13251:
3 months ago
#3
The missing param types were not flagged because of a typo in the new configuration I'm using to lint the files, where jsdoc/require-param-type was duplicated and ultimately set to 'off'.
@afercia commented on PR #13251:
3 months ago
#4
Now thaat the new JSDoc configuration has been merged in core, I rebased this PR on top of trunk. Running:
npm run lint:jsdoc
should now report no errors.
@westonruter commented on PR #13251:
3 months ago
#5
Per https://github.com/WordPress/wordpress-develop/pull/13251#discussion_r3883382337, I'll adopt all of the Customizer changes to work on separately for Core-40831 to merge with https://github.com/WordPress/wordpress-develop/pull/10743.
@afercia commented on PR #13251:
3 months ago
#6
@westonruter thank you for all the feedback and assistance on this PR. It's a pleasure and an excellent learning opportunity for me.
On the other hand, I feel like we are loosing focus on the main goal of this PR. We're not aiming at perfection in documenting all these docblocks. Rather, this is a necessary step to solve all the errors reported so far by the minimal, temporary, JSDoc configuration that was updated in https://github.com/WordPress/wordpress-develop/pull/13237.
Once we have a clean JSDoc report, we can enforce the script on CI. Then, starting from there, a collective effort should start to introduce new rules and adjust accordingly to revive the the JavaScript Inline Docs Initiative which is a needed long-term project.
I'm also concerned about the size of this PR. While it's not that huge in terms of size of the diff, it touches more than 100 files. I'm not that comfortable with an SVN commit that touches such a large number of files. I will probably try to split it in chunks. But at this point It would be nice to not make it even larger. Is it good enough to be committed in your opinion?
@westonruter commented on PR #13251:
3 months ago
#7
@afercia:
On the other hand, I feel like we are loosing focus on the main goal of this PR. We're not aiming at perfection in documenting all these docblocks. Rather, this is a necessary step to solve all the errors reported so far by the minimal, temporary, JSDoc configuration that was updated in #13237.
Yeah, good point. You're right. It could be an endless rabbithole.
Once we have a clean JSDoc report, we can enforce the script on CI. Then, starting from there, a collective effort should start to introduce new rules and adjust accordingly to revive the the JavaScript Inline Docs Initiative which is a needed long-term project.
I've just filed Core-65997 as the umbrella ticket for further improvements to the TypeScript as the continuation of the initial fixing of the JSDoc you've done here.
I'm also concerned about the size of this PR. While it's not that huge in terms of size of the diff, it touches more than 100 files. I'm not that comfortable with an SVN commit that touches such a large number of files. I will probably try to split it in chunks. But at this point It would be nice to not make it even larger. Is it good enough to be committed in your opinion?
Remember you can revert the Customizer changes since those are being done in https://github.com/WordPress/wordpress-develop/pull/10743. So that's one of these such chunks that I'll take care of once you approve.
@afercia commented on PR #13251:
3 months ago
#8
As a first next step after this is merged, and to help revive the the JavaScript Inline Docs Initiative, I'd suggest to update the configuration to detect all the places where a docblock is missing entirely.
In a first phase, set jsdoc/require-jsdoc to warn, to not block CI;
By default, it reports 79 violations for FunctionDeclaration missing docblocks.
Including FunctionExpression, the errors are 1098.
@westonruter commented on PR #13251:
3 months ago
#9
In d84afe0 I've fixed the merge conflict in src/js/_enqueues/lib/embed-template.js by opting for what is now in trunk after r63400, r63402, and r63403.
And in 8f1a06b I've reverted the changes to the Customizer JS files since those changes have been extracted into a separate PR: https://github.com/WordPress/wordpress-develop/pull/10743.
@afercia commented on PR #13251:
3 months ago
#10
I've reverted the changes to the Customizer JS files
@westonruter thank you.
Just noting that this PR now triggers 144 errors when running npm run lint:jsdoc while the goal was to have a clean report. It will need to wait for https://github.com/WordPress/wordpress-develop/pull/10743 to be merged first.
This ticket was mentioned in PR #13331 on WordPress/wordpress-develop by @afercia.
3 months ago
#11
First chunk of the changes from https://github.com/WordPress/wordpress-develop/pull/13251
See https://core.trac.wordpress.org/ticket/65951
## Use of AI Tools
This ticket was mentioned in PR #13332 on WordPress/wordpress-develop by @afercia.
3 months ago
#12
Second chunk of the changes from https://github.com/WordPress/wordpress-develop/pull/13251
See https://core.trac.wordpress.org/ticket/65951
## Use of AI Tools
This ticket was mentioned in PR #13333 on WordPress/wordpress-develop by @afercia.
3 months ago
#13
Third chunk of the changes from https://github.com/WordPress/wordpress-develop/pull/13251
See https://core.trac.wordpress.org/ticket/65951
## Use of AI Tools
This ticket was mentioned in PR #13334 on WordPress/wordpress-develop by @afercia.
3 months ago
#14
Fourth chunk of the changes from https://github.com/WordPress/wordpress-develop/pull/13251
See https://core.trac.wordpress.org/ticket/65951
## Use of AI Tools
@afercia commented on PR #13251:
3 months ago
#15
Note that, in preparation of the SVN commit to bring in this change, I split this pull request into 4 smaller ones (listed above). I will commit them separately to not touch a large amount of files at the same time.
#16
@
3 months ago
- Component Build/Test Tools → General
- Focuses docs coding-standards added
- Owner set to
- Status new → assigned
#17
@
3 months ago
all the 37 errors and 3 warnings reported by JSDoc
Note for history: after the JSDoc configuration was refined, the actual amount of errors was way higher than 37. They where a few hundreds.
I split the PR linked above into 4 smaller ones to avoid touching a large amount of files in a single SVN commit:
Trac ticket: https://core.trac.wordpress.org/ticket/65951
Needs https://github.com/WordPress/wordpress-develop/pull/13237 to be merged first.
## Use of AI Tools
None