Build/Test Tools: Remove the orphaned .eslintrc-jsdoc.js and rename lint:jsdoc - #73
Draft
mukeshpanchal27 wants to merge 2 commits into
Draft
Build/Test Tools: Remove the orphaned .eslintrc-jsdoc.js and rename lint:jsdoc#73mukeshpanchal27 wants to merge 2 commits into
mukeshpanchal27 wants to merge 2 commits into
Conversation
…int:jsdoc See the PR description for the full rationale and evidence.
The scripts never loaded the JSDoc config; rename them to match what they do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npm run lint:jsdocdoes not lint JSDoc.There is a
.eslintrc-jsdoc.jsat the repo root containing the intended rules, but:eslintrc-jsdoc(excludingnode_modulesandpackage-lock.json)returns zero matches. The file is referenced nowhere.
.eslintrc-jsdoc.jsis not a filename ESLint resolves automatically, and the scripts passno
-cflag.So
wp-scripts lint-jsfalls back to the@wordpress/scriptsdefault config and the JSDocrules never load. Nothing catches this, because neither script runs in CI — JS coding
standards runs
npm run grunt jshintinstead.Why wiring it up is not the fix
package-lock.jsonresolveseslintto 10.7.0. The config file is dead in twoindependent ways:
.eslintrcsupport. Confirmed structurally: eslint 10.7.0declares no
@eslint/eslintrcdependency, and no package matchingeslintrcappearsanywhere in the lock tree. That package provides legacy config loading.
valid-jsdocandrequire-jsdoc— the only two rules the file configures — weredeprecated in ESLint 5.10 and removed in ESLint 9.
Passing
-c .eslintrc-jsdoc.jswould hard-fail on an unreadable config referencing rulesthat no longer exist.
Change
.eslintrc-jsdoc.js.lint:jsdoc/lint:jsdoc:fixtolint:js/lint:js:fix, which is what theyactually do.
Follow-up (not in this PR)
.eslintignoreis also legacy eslintrc-era configuration that ESLint 10 no longer reads —ignores now live in flat config.
Draft proposal from a review of
composer.json/package.json. Opened as a draft for discussion — not intended to merge as-is.