prettier-compare
Compares code formatting and formatting IR between Biome and Prettier to ensure that Biome's formatting is consistent and correct. Use when validating formatter changes, debugging formatting differences, or comparing output for JavaScript, TypeScript, CSS, or other languages.
How do I install this agent skill?
npx skills add https://github.com/biomejs/biome --skill prettier-compareIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides instructions for comparing Biome and Prettier formatting output using a local utility. It uses standard development tools and scripts within the Biome repository.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
1/1 file flagged
What does this agent skill do?
Purpose
Use packages/prettier-compare/ to inspect any differences between Biome and Prettier formatting (including IR output) before shipping formatter changes.
Prerequisites
- Run every command from the repository root so relative paths resolve correctly.
- Use
bun(the CLI is a Bun script) and ensure dependencies have been installed. - Always pass
--rebuildso the Biome WASM bundle matches your current Rust changes.
Code Standards
CRITICAL: No Emojis
Emojis are BANNED in all Prettier comparison code and output:
- NO emojis in comparison scripts
- NO emojis in test files
- NO emojis in output or diagnostic messages
Keep all code professional and emoji-free.
Common workflows
Snippets passed as CLI args:
bun packages/prettier-compare/bin/prettier-compare.js --rebuild 'const x={a:1,b:2}'
Force a language (useful when the tool cannot infer it from a filename):
bun packages/prettier-compare/bin/prettier-compare.js --rebuild -l ts 'const x: number = 1'
Compare files on disk:
bun packages/prettier-compare/bin/prettier-compare.js --rebuild -f src/example.tsx
Read from stdin (great for piping editor selections):
echo 'const x = 1' | bun packages/prettier-compare/bin/prettier-compare.js --rebuild -l js
Tips
- Use
-l/--languagewhen formatting code without an extension so both formatters pick the correct parser. - Use
-f/--filefor large samples or snapshot tests so you can iterate directly on project fixtures. - Reference
packages/prettier-compare/README.mdfor deeper CLI details; mirror any updates here, keeping the hard requirement that commands include--rebuild. - Use single quotes for code snippets passed as CLI arguments to avoid shell interpretation issues.
- "\n" does not get escaped into a newline when passed as a CLI argument. You should write a literal newline or use a file instead.
- The tool is OK to run in read-only/planning modes even when running it with
--rebuildsince it only rebuilds the Biome WASM bundle and does not modify any source files.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/biomejs/biome/prettier-compare">View prettier-compare on skillZs</a>