Skip to content

Build/Test Tools: Remove the orphaned .eslintrc-jsdoc.js and rename lint:jsdoc - #73

Draft
mukeshpanchal27 wants to merge 2 commits into
trunkfrom
deps/remove-dead-jsdoc-eslint-config
Draft

Build/Test Tools: Remove the orphaned .eslintrc-jsdoc.js and rename lint:jsdoc#73
mukeshpanchal27 wants to merge 2 commits into
trunkfrom
deps/remove-dead-jsdoc-eslint-config

Conversation

@mukeshpanchal27

Copy link
Copy Markdown
Owner

Problem

npm run lint:jsdoc does not lint JSDoc.

"lint:jsdoc": "wp-scripts lint-js",
"lint:jsdoc:fix": "wp-scripts lint-js --fix",

There is a .eslintrc-jsdoc.js at the repo root containing the intended rules, but:

  • A repo-wide grep for eslintrc-jsdoc (excluding node_modules and package-lock.json)
    returns zero matches. The file is referenced nowhere.
  • .eslintrc-jsdoc.js is not a filename ESLint resolves automatically, and the scripts pass
    no -c flag.

So wp-scripts lint-js falls back to the @wordpress/scripts default config and the JSDoc
rules never load. Nothing catches this, because neither script runs in CI — JS coding
standards runs npm run grunt jshint instead.

Why wiring it up is not the fix

package-lock.json resolves eslint to 10.7.0. The config file is dead in two
independent ways:

  • ESLint 10 dropped legacy .eslintrc support. Confirmed structurally: eslint 10.7.0
    declares no @eslint/eslintrc dependency, and no package matching eslintrc appears
    anywhere in the lock tree. That package provides legacy config loading.
  • valid-jsdoc and require-jsdoc — the only two rules the file configures — were
    deprecated in ESLint 5.10 and removed in ESLint 9.

Passing -c .eslintrc-jsdoc.js would hard-fail on an unreadable config referencing rules
that no longer exist.

Change

  • Deletes the orphaned .eslintrc-jsdoc.js.
  • Renames lint:jsdoc / lint:jsdoc:fix to lint:js / lint:js:fix, which is what they
    actually do.

Follow-up (not in this PR)

.eslintignore is 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.

…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.
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.

1 participant