#62935 closed defect (bug) (fixed)
Fix JavaScript linting scripts
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | Cc: |
Description
The lint:jsdoc
and lint:jsdoc:fix
scripts are currently broken.
These should get fixed.
Additionally, the related ink-docstrap
direct dependency has not been updated in 7+ years. Under the hood, these scripts use wp-scripts
so ink-docstrap
may not even be necessary anymore. Ideally we are able to trim this dependency if the results are styled using other means in wp-scripts
.
ink-docstrap
was introduced in [41351], and the scripts were switched to using wp-scripts
in [48650].
Change History (16)
This ticket was mentioned in PR #8295 on WordPress/wordpress-develop by @ankitkumarshah.
6 weeks ago
#1
- Keywords has-patch added; needs-patch removed
#2
@
6 weeks ago
Hi @desrosj,
I have tried a solution and opened a PR that potentially resolves the issue could you please review and test it at your convenience.
Thank you!
5 weeks ago
#3
@Infinite-Null Taking a look at this, the update of wp-prettier
seems to be the only thing necessary. Can you explain why you think we also need to "Update .eslintignore patterns to be more specific"
@ankitkumarshah commented on PR #8295:
5 weeks ago
#4
Hi @aaronjorbin,
Thank you for your feedback! I added those ignore rules because when I ran npm run lint:jsdoc -- --debug
, I noticed that it was also running for .min.js
files and build directories like src/wp-content/plugins/gutenberg/build
. Since these files are not meant for linting, I believed excluding them would be appropriate.
Please guide me if I am wrong.
5 weeks ago
#5
Thanks for the quick response and explanation.
I think bringing .eslintignore
more inline with .gitignore
will make more sense. For example, the `# Files and folders that get created in wp-content` section can be used to block any plugins code from being scanned.
`# Files and folders related to build/test tools`
contains a number of folders worth excluding as well since those aren't being directly edited as a part of core development.
@ankitkumarshah commented on PR #8295:
5 weeks ago
#6
Hi @aaronjorbin,
Thanks for the feedback! I’ve updated .eslintignore
to better align with .gitignore
. Please review the changes and let me know if any further adjustments are needed.
@ankitkumarshah commented on PR #8295:
5 weeks ago
#7
Hi @aaronjorbin,
Thank you for the feedback!
I have made the changes, please review it at your convenience.
#8
@
5 weeks ago
- Focuses docs removed
- Milestone changed from Future Release to 6.8
ink-docstrap
was put in for the purposes of creating documentation that could live on developer.wordpress.org but it looks like that has stalled. See https://meta.trac.wordpress.org/ticket/3063
I don't know if removing it needs to be a part of this or if there are folks using it, but moving this ticket into 6.8 since fixing the eslinting is better done sooner than later.
5 weeks ago
#10
Committed in https://core.trac.wordpress.org/changeset/59848
Thanks @Infinite-Null !
#11
@
3 weeks ago
- Owner set to jorbin
- Status changed from new to assigned
@desrosj Do you still think ink-docstrap
needs to be addressed? I think we are fine keeping it as is
#12
@
3 weeks ago
My motivation around suggesting we eliminate or replace that package is that there are currently a small handful of minor vulnerabilities within transitive dependencies being privately reported by Dependabot that cannot be resolved due to version constraints within ink-docstrap
.
#14
@
2 weeks ago
@jorbin @desrosj If jsdoc isn't being used shall we just go ahead and remove it? The npm run grunt jsdoc
command successfully creates the docs but also exits with a bunch of parse errors.
Trac ticket: #62935
## Description
This PR updates the wp-prettier dependency from version 2.6.2 to 3.0.3 and refines the ESLint ignore patterns for better build management. The changes aim to fix the issues with
lint:jsdoc
andlint:jsdoc:fix
scripts.## Changes proposed in this Pull Request
build-module
andbuild-types
directories/build
withbuild
for consistency*.min.js
pattern to ignore minified files## Testing Instructions
npm install
to update dependenciesnpm run lint:jsdoc
to verify linting worksnpm run lint:jsdoc:fix
to verify auto-fixing works## Screenshots
