Repository navigation
chore: use npm run format for repo-wide Prettier - #463
Conversation
There was a problem hiding this comment.
Pull request overview
Updates repo tooling so Prettier formatting can be applied (and checked) across the repository, and reformats existing files accordingly.
Changes:
- Add a repo-level Prettier config and expand
.prettierignorefor generated/locked artifacts. - Replace
format:jswithformat, and update CI to runnpm run format -- --check. - Apply formatting updates across configs, workflows, docs, and E2E fixture JSON.
Reviewed changes
Copilot reviewed 10 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tsconfig.json |
Applies consistent formatting to TS config arrays/sections. |
tests/e2e-request-mocking/responses/OpenAI/review-notes-responses.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/OpenAI/review-notes-completions.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/OpenAI/responses.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/OpenAI/models.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/OpenAI/image.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/OpenAI/content-classification-responses.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/OpenAI/content-classification-completions.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/OpenAI/completions.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/Google/models.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/Google/imagen.json |
Reformat E2E fixture JSON. |
tests/e2e-request-mocking/responses/Google/gemini-image.json |
Reformat E2E fixture JSON. |
tests/Integration/Includes/MainTest.php |
Removes extra blank lines to match formatting rules. |
routes/ai-home/package.json |
Reformat route package manifest JSON. |
package.json |
Adds format script and updates formatting. |
composer.json |
Formatting-only changes to JSON structure. |
CONTRIBUTING.md |
Updates contributor commands to include npm run format and adjusts test command. |
.wp-env.json |
Reformat WP-Env config for readability. |
.wordpress-org/blueprints/blueprint.json |
Reformat blueprint JSON. |
.prettierrc.js |
Adds repo-level Prettier configuration with WP defaults + overrides. |
.prettierignore |
Expands ignore list (build outputs, lockfiles, etc.). |
.github/workflows/wporg-plugin-deploy.yml |
Formatting-only YAML updates. |
.github/workflows/test.yml |
Adds Prettier check step; formatting-only YAML updates elsewhere. |
.github/workflows/pr-playground-preview.yml |
Formatting-only YAML updates. |
.github/workflows/plugin-check.yml |
Formatting-only YAML updates. |
.github/workflows/build-plugin-zip.yml |
Formatting-only YAML updates. |
.github/dependency-review-config.yml |
Formatting-only YAML updates. |
ðĄ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Reportâ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #463 +/- ##
==========================================
Coverage 69.06% 69.06%
Complexity 958 958
==========================================
Files 60 60
Lines 4513 4513
==========================================
Hits 3117 3117
Misses 1396 1396
Flags with carried forward coverage won't be shown. Click here to find out more. â View full report in Codecov by Sentry. ð New features to boost your workflow:
|
859c13d to
eeab05f
Compare
|
Holding on merging this until the final item in 0.8.0 so we can ensure any related updates that get merged in are similarly updated as this PR |
@jeffpaul - I should be around until late this evening PST, if you ping me on Slack I'd be happy to handle any pre-merge cleanup we need |
|
@justlevine I'm going to start preparing the 0.8.0 release, mind checking if there's any additional updates needed related to this PR (otherwise feel free to merge)? |
|
Merge went in clean, but for some reason the E2E tests are flaking (this is not a unique problem I see most runs are taking 6-7 minutes just to run the tests and lots of 404s). Just retriggered, will (squash) merge as soon as it's green. |
What?
This PR fixes Prettier so our WPCS-formatting is applied to the entire repo. Then it applies it.
Important
Immediately before merging, this branch should be updated to the latest
developandnpm run formatshould be rerun to ensure any new files are formatted.Merge conflicts can be be resolved by reverting to the version from
developand re-runningnpm run formatWhy?
This was missed during the initial scaffold.
/srcshould adhere to our coding standards, and more importantly should be easily autofixable by humans and agents.The sooner we merge this, the fewer merge conflicts we'll get - it's like ripping off a baidaid.
How?
More specificially it:
npm run format:jswithnpm run format.npm run format -- --checkprettier.cjs=>prettier.js, since wp-scripts does not recognize non.jsfiles.@wordpress/prettier-configto the list ofdevDependenciesnpm run formatagainst the existing codebase.Use of AI Tools
None
Testing Instructions
npm run format.Changelog Entry