Repository navigation
Tooling: Make lint:pkg-json and lint:md:docs lint real files - #631
Open
huzaifaalmesbah wants to merge 1 commit into
Open
huzaifaalmesbah wants to merge 1 commit into
huzaifaalmesbah wants to merge 1 commit into
Conversation
Both scripts targeted ./src, which has no package.json and no Markdown files, so they always passed without checking anything. - lint:pkg-json now lints the root and storybook package.json files. Reorder properties and add the missing metadata to the storybook workspace, which is marked private. - lint:md:docs now lints README.md, CONTRIBUTING.md, .github/*.md and the Storybook docs. Fix the reported findings and add a .markdownlint.json that extends the wp-scripts defaults. Fixes WordPress#630.
Member
Author
|
This PR and #632 both edit the |
This branch has not been deployed
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.
What?
Points the
lint:pkg-jsonandlint:md:docsscripts at the repository's real files and fixes the errors they report.Why?
Fixes #630. Follow-up to #629.
Both scripts targeted
./src, which has nopackage.jsonand no Markdown files, so they always passed without linting anything.How?
lint:pkg-json→wp-scripts lint-pkg-json ..checks the rootpackage.jsonand thestorybookworkspace. The defaultwp-scriptsignore file already skipsnode_modules,vendor,buildandwordpress.package.json: reordered properties to match@wordpress/npm-package-json-lint-config(authorandlicensebeforekeywords;homepage,repository,bugsandenginesmoved up;devDependenciesbeforescripts). No values changed.storybook/package.json: addeddescription,author,license,keywords,homepage,repository(withdirectory) andbugs; marked it"private": truebecause it's an internal workspace that is never published; sorteddevDependencies; movedscriptsafterpeerDependencies.package-lock.json: one-line update for the workspace's newlicensefield (fromnpm install --package-lock-only).lint:md:docs→wp-scripts lint-md-docs README.md CONTRIBUTING.md \".github/*.md\" \"storybook/stories/**/*.md\"LICENSE.md(the GPL text) is left out. The defaultwp-scriptsignore still skipsnode_modules,vendorandbuild.<>and dropped$prompts inREADME.md; added a blank>line before the list inCONTRIBUTING.md; indented nested lists to 4 spaces indatabase-schema.md; addedphpandtextfence languages and a final newline intranslations.md..markdownlint.json, which extends thewp-scriptsdefault config and changes three rules:MD024siblings_only:develop.mdhas two "Running PHP unit tests" headings under different parent sections, which is intentional.MD033allows<details>and<summary>: the updated PR template in GitHub: Update the pull request template #625 uses them.MD041off:.github/PULL_REQUEST_TEMPLATE.mdstarts with an HTML comment by design. Adding a disable directive there would appear in every PR body.Note: the fix for #629 also edits the
scriptsblock inpackage.json. Whichever of the two PRs merges second will need a small rebase.Testing Instructions
npm ci.npm run lint:pkg-json. It exits 0.npm run lint:md:docs. It exits 0 with no findings."license"fromstorybook/package.jsonand runnpm run lint:pkg-json. It reportsrequire-licenseand exits with a non-zero code. Revert the change.- a, then- bon the next line) toREADME.md,.github/PULL_REQUEST_TEMPLATE.mdorstorybook/stories/docs/contributors/develop.md, then runnpm run lint:md:docs. It reportsMD007and exits with code 1. Revert the change.Screenshots or screencast
N/A
Use of AI Tools