Prettier
$ prettier Community Low RiskWidely adopted code formatter supporting JS, TS, CSS, HTML, JSON, YAML, and Markdown. Offers deterministic --check and --list-different read-only verification before running --write, though it emits plain text rather than JSON.
npm install -D prettier Formats local workspace files directly; MCP adds latency for zero gain.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive --check, --list-different, and --no-color with clean exit codes, though lacks --json output.
--checkand--list-differentprovide clean pass/fail exit codes- No
--jsondiagnostic output flag
Read-only unless --write is explicitly supplied, and preserves AST semantics.
- Only modifies files when
--writeis passed
Standard npm package running anywhere Node.js is installed.
- Cross-platform Node.js CLI
Covers web frontend, Markdown, JSON, and YAML formatting consistently.
- Broad multi-language formatting support beyond JS/TS
Long-standing MIT project with massive industry adoption.
- Active
prettier/prettierrepository
Clear CLI flag documentation at prettier.io/docs/en/cli.
- Official CLI reference at prettier.io
Security, Auth & Guardrails
Purely local file formatting; no credentials stored or required.
MIT open-source npm package; completely free.
# Prettier (prettier) Agent Rules - Use `prettier --list-different` or `prettier --check` to verify formatting before rewriting files. - Scope `prettier --write` to files you touched so unrelated formatting diffs stay clean.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx prettier --list-different --no-color .
Prints file paths that differ from Prettier formatting and exits non-zero if any need formatting.
Controlled Writes & Previews
npx prettier --write src/index.ts
Reformats specified files in place using the repository's .prettierrc config.
Strengths for Agents
- +
--list-differentoutputs exact file paths needing formatting for minimal token usage. - + Broad language coverage including Markdown, YAML, HTML, CSS, and TS.
- + Zero interactive prompts and deterministic formatting.
Caveats & Pitfalls
- ! Lacks structured
--jsonoutput. - ! Slower than Rust formatters (
biome) on large repositories.