Skip to content

chore: use npm run format for repo-wide Prettier - #463

Merged
justlevine merged 2 commits into
WordPress:developfrom
justlevine:chore/prettier-everything
Apr 23, 2026
Merged

justlevine merged 2 commits into
WordPress:developfrom
justlevine:chore/prettier-everything

Conversation

@justlevine

@justlevine justlevine commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

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 develop and npm run format should be rerun to ensure any new files are formatted.
Merge conflicts can be be resolved by reverting to the version from develop and re-running npm run format

Why?

This was missed during the initial scaffold. /src should 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:

  1. Replaces npm run format:js with npm run format.
  2. Updates the CI to run npm run format -- --check
  3. Renames prettier.cjs => prettier.js, since wp-scripts does not recognize non .js files.
  4. Add @wordpress/prettier-config to the list of devDependencies
  5. Runs npm run format against the existing codebase.

Use of AI Tools

None

Testing Instructions

  1. Add a .json file that uses spaces for indentation instead of tabs, and then run npm run format.

Changelog Entry

Development Update - Add npm run format, and apply repo-wide formatting.

Open WordPress Playground Preview

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .prettierignore for generated/locked artifacts.
  • Replace format:js with format, and update CI to run npm 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.

@justlevine
justlevine marked this pull request as ready for review April 22, 2026 18:33
@github-actions

github-actions Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: justlevine <justlevine@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov

codecov Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.06%. Comparing base (e366ebd) to head (65352b7).
⚠ïļ Report is 1 commits behind head on develop.

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           
Flag Coverage Δ
unit 69.06% <Ãļ> (Ãļ)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
ðŸ“Ē Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄ïļ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • ðŸ“Ķ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeffpaul jeffpaul added this to the 0.8.0 milestone Apr 22, 2026
@jeffpaul jeffpaul moved this to Needs review in WordPress AI Roadmap Apr 22, 2026
@jeffpaul
jeffpaul requested a review from dkotter April 22, 2026 18:49
@justlevine
justlevine force-pushed the chore/prettier-everything branch from 859c13d to eeab05f Compare April 22, 2026 19:28
@jeffpaul jeffpaul mentioned this pull request Apr 22, 2026
27 tasks done
Comment thread package-lock.json
@jeffpaul

jeffpaul commented Apr 23, 2026 •

Copy link
Copy Markdown
Member

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

@justlevine

Copy link
Copy Markdown
Contributor Author

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

@jeffpaul

Copy link
Copy Markdown
Member

@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)?

@justlevine

Copy link
Copy Markdown
Contributor Author

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.

@justlevine
justlevine merged commit b783fd3 into WordPress:develop Apr 23, 2026
27 of 28 checks passed
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Roadmap Apr 23, 2026
@justlevine
justlevine deleted the chore/prettier-everything branch April 23, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants