Skip to content

📝 document yarn format --write in AGENTS.md - #5125

Draft
thomas-lebeau wants to merge 1 commit into
mainfrom
thomas.lebeau/agents-md-format
Draft

thomas-lebeau wants to merge 1 commit into
mainfrom
thomas.lebeau/agents-md-format

Conversation

@thomas-lebeau

Copy link
Copy Markdown
Collaborator

Motivation

AGENTS.md listed yarn format under "Format code", but the script is prettier --check .: it only reports issues and never modifies files. Agents (and humans) following it after a bulk edit believe the code was formatted when it wasn't, and the format CI job fails afterwards — this happened on #5022. Agents also tend to fall back to calling yarn prettier directly, which can diverge from what CI checks.

Changes

Documentation only, root AGENTS.md "Key Commands":

  • Relabel yarn format as a check (--check, does not modify files).
  • Add yarn format --write to fix formatting (Yarn appends the flag; Prettier 3 accepts --check --write, rewrites the files and lists them).
  • Add a short note to always go through the yarn format script rather than yarn prettier, and to check its output after scripted/bulk edits.

Test instructions

printf 'const   x = {a:1}\n' > tmp-probe.ts
yarn format          # reports tmp-probe.ts, file unchanged
yarn format --write  # "Code style issues fixed", file rewritten
rm tmp-probe.ts

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

This branch has not been deployed

No deployments
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