Skip to content

Add Prettier formatting checks#9

Merged
cnluzhang merged 1 commit into
mainfrom
chore/add-prettier-formatting
Jul 27, 2026
Merged

Add Prettier formatting checks#9
cnluzhang merged 1 commit into
mainfrom
chore/add-prettier-formatting

Conversation

@cnluzhang

Copy link
Copy Markdown
Contributor

Summary

  • pin Prettier 3.9.6 and establish a repository-wide formatting baseline
  • enforce format:check in pull-request CI, release validation, and prepublishOnly
  • preserve the existing bilingual Markdown policy: English prose wraps at 80 columns, Chinese *-zh.md prose remains unwrapped, and embedded code blocks stay hand-formatted
  • document the formatter workflow for contributors and agents

This is a formatting and developer-tooling change with no intended CLI runtime behavior change.

Validation

  • npm run format:check
  • prettier --debug-check .
  • npm run lint
  • npm run typecheck
  • npm test
  • npm audit --audit-level=moderate
  • npm pack --dry-run
  • npm run prepublishOnly
  • actionlint .github/workflows/ci.yml .github/workflows/release.yml
  • git diff --check

Markdown parsing was also compared before and after formatting; outside the intentional formatter documentation updates, the rendered document structure is unchanged.

Pin Prettier and format the existing codebase.
Enforce formatting in CI, release, and prepublish checks.
Preserve the bilingual Markdown wrapping rules.

Signed-off-by: Lu Zhang <lu@wdl.dev>
Copilot AI review requested due to automatic review settings July 27, 2026 04:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Establishes Prettier as the repo-wide formatter, applies a formatting baseline across source/docs/examples, and enforces formatting checks in CI and release/publish flows. This is a developer-tooling change intended to be behavior-neutral for the CLI.

Changes:

  • Pin Prettier 3.9.6, add format / format:check scripts, and introduce a repo .prettierrc.json that preserves the bilingual Markdown wrapping policy.
  • Enforce npm run format:check in PR CI, release validation, and prepublishOnly.
  • Apply the formatting baseline across CLI code, tests, docs, templates, and examples.

Reviewed changes

Copilot reviewed 80 out of 84 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Reformat include/exclude lists to the new baseline.
tests/unit/helpers.js Apply formatting baseline to test helpers.
tests/unit/cli-token.test.js Apply formatting baseline and factor an inline default controlFetch into a named helper.
tests/unit/cli-token-store.test.js Apply formatting baseline to token-store tests.
tests/unit/cli-stdin.test.js Apply formatting baseline to stdin tests.
tests/unit/cli-output.test.js Apply formatting baseline to output tests.
tests/unit/cli-ns-pattern.test.js Apply formatting baseline to ns-pattern tests.
tests/unit/cli-init.test.js Apply formatting baseline to init tests.
tests/unit/cli-control-fetch.test.js Apply formatting baseline to control-fetch tests.
tests/unit/cli-config-doctor.test.js Apply formatting baseline to config/doctor tests.
tests/unit/cli-command.test.js Apply formatting baseline to command framework tests.
tests/unit/cli-bundle-modules.test.js Apply formatting baseline to bundle-modules tests.
templates/AGENTS.md Rewrap prose per Markdown formatting rules (agent template).
README.md Rewrap prose per Markdown formatting rules.
package.json Add Prettier scripts, pin Prettier, and gate prepublishOnly on format:check.
package-lock.json Lockfile update for pinned Prettier dependency.
lib/wrangler/modules.js Apply formatting baseline.
lib/wrangler/config.js Apply formatting baseline.
lib/wrangler/command.js Apply formatting baseline.
lib/wrangler/bindings.js Apply formatting baseline.
lib/wrangler/assets.js Apply formatting baseline.
lib/wrangler-pack.js Apply formatting baseline.
lib/workflows-format.js Apply formatting baseline.
lib/workers-format.js Apply formatting baseline.
lib/whoami.js Apply formatting baseline.
lib/token-store.js Apply formatting baseline.
lib/stdin.js Apply formatting baseline.
lib/secret-envelope-errors.js Apply formatting baseline.
lib/output.js Apply formatting baseline.
lib/dotenv.js Apply formatting baseline.
lib/delete-format.js Apply formatting baseline.
lib/d1-format.js Apply formatting baseline.
lib/d1-files.js Apply formatting baseline.
lib/credentials.js Apply formatting baseline.
lib/control-fetch.js Apply formatting baseline.
lib/config-state.js Apply formatting baseline.
lib/common.js Apply formatting baseline.
lib/command.js Apply formatting baseline.
lib/bundle-modules.js Apply formatting baseline.
examples/queues-demo/src/index.js Apply formatting baseline to example worker code.
examples/pages-assets/wrangler.jsonc Apply formatting baseline (JSONC trailing commas).
examples/pages-assets/src/index.js Apply formatting baseline to example worker code.
examples/pages-assets/public/style.css Apply formatting baseline to CSS example.
examples/kv-demo/src/index.js Apply formatting baseline to example worker code.
examples/inspection-demo/src/index.js Apply formatting baseline to example worker code.
examples/inspection-demo/public/style.css Apply formatting baseline to CSS example.
examples/inspection-demo/public/app.js Apply formatting baseline to JS example.
examples/hello-jsonc/wrangler.jsonc Apply formatting baseline (JSONC trailing commas).
examples/durable-objects-demo/src/index.js Apply formatting baseline to example worker code.
examples/d1-demo/src/index.js Apply formatting baseline to example worker code.
eslint.config.js Apply formatting baseline to ESLint config.
docs/workflows.md Rewrap prose per Markdown formatting rules.
docs/token.md Rewrap prose per Markdown formatting rules.
docs/secrets.md Rewrap prose per Markdown formatting rules.
docs/queues.md Rewrap prose per Markdown formatting rules.
docs/deploy.md Rewrap prose per Markdown formatting rules.
docs/d1.md Rewrap prose per Markdown formatting rules.
docs/cron-triggers.md Rewrap prose per Markdown formatting rules.
CONTRIBUTING.md Document formatter workflow and add format:check to the contributor checks list.
commands/workflows.js Apply formatting baseline.
commands/whoami.js Apply formatting baseline.
commands/token.js Apply formatting baseline.
commands/tail.js Apply formatting baseline.
commands/secret.js Apply formatting baseline.
commands/r2.js Apply formatting baseline.
commands/init.js Apply formatting baseline.
commands/doctor.js Apply formatting baseline.
commands/deploy.js Apply formatting baseline.
commands/delete.js Apply formatting baseline.
commands/d1.js Apply formatting baseline.
commands/config.js Apply formatting baseline.
CHANGELOG.md Rewrap prose per Markdown formatting rules.
bin/wdl.js Apply formatting baseline.
AGENTS.md Document format / format:check and update formatting/CI workflow notes.
.prettierrc.json Add Prettier config (print widths + Markdown overrides for bilingual policy).
.github/workflows/release.yml Add npm run format:check to release validation.
.github/workflows/ci.yml Add npm run format:check to PR CI.
.claude/skills/wdl-deploy/SKILL.md Rewrap prose per Markdown formatting rules (skill doc).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cnluzhang
cnluzhang marked this pull request as ready for review July 27, 2026 04:27
@cnluzhang
cnluzhang merged commit 53794b1 into main Jul 27, 2026
7 checks passed
@cnluzhang
cnluzhang deleted the chore/add-prettier-formatting branch July 27, 2026 05:22
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.

2 participants