Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By leonardo-marzialiv0.2.0Apache-2.0In 1 marketplace
Format files with Prettier as Claude edits them.
Claude loads one when your task matches it, or you run it by name.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Plugin that formats files with Prettier as Claude edits them.
PostToolUse hook runs prettier --write --ignore-unknown on the
files a tool call just wrote, immediately — no session-tracking, no
batching. For Edit/Write/MultiEdit that's the file they name; for
Bash, PowerShell and MCP tools, a PreToolUse snapshot finds
whatever the call changed (also on PostToolUseFailure, for a command
that wrote files and then failed). A run_in_background command's files
are formatted on later tool calls, for up to 2 hours; what it writes
after the last tool call isn't. Prettier is fast and deterministic per
file, so this keeps diffs clean as you go.--ignore-unknown lets Prettier itself decide whether it has a parser
for the file; files it doesn't recognize are left untouched..prettierrc*/.prettierignore discovery (including per-package configs
in a monorepo) behaves exactly as it would from the command line.0. A
formatting failure never blocks the session.node_modules/ or .git/ are always skipped.npx prettier, so it resolves the target project's own installed
version if present, and still works in a project that hasn't installed
Prettier itself. The npx shim is located next to the running Node
binary (hooks don't inherit a login shell, so PATH may not have it),
falling back to a PATH lookup — and on Windows it resolves npx.cmd and
routes through a shell, which Node requires for a batch shim./prettier:format [path]): explicitly format files at
path (or the whole project if omitted), including files this session
never touched. This is the deliberate escape hatch for formatting
pre-existing files. Manual invocation only — Claude won't trigger it on
its own.Add this repository as a plugin marketplace in Claude Code and install
the prettier plugin from it, or copy the plugins/prettier directory
into your own plugin setup.
Once installed, this plugin automatically formats every file Claude edits
or writes. Pre-existing files are never touched by the hook. Run
/prettier:format [path] to explicitly format pre-existing files.
Configure Prettier the normal way, by adding a configuration file to
directories you want formatted a particular way — see Prettier's
configuration docs. A .prettierignore file excludes
paths from formatting entirely.
The hook (scripts/hooks/format.js) has a versioned test suite under
scripts/hooks/__tests__/, using Node's built-in test runner. The hook's
one runtime dependency, @leonardo-marziali/ad-lfl-kit, is pinned in
package-lock.json; install it with npm ci first — the same install
Claude Code runs when it caches the plugin.
cd plugins/prettier
npm ci
pnpm test
It covers the Edit/Write matcher, the node_modules/.git guard,
--ignore-unknown behavior for files Prettier can't parse, the
non-blocking exit behavior when Prettier fails, and cross-platform
resolution and quoting of the npx shim. These are integration
tests that shell out to the real npx prettier (same as the hook does at
runtime). Test scratch directories are created under this repo's own
.scratch/ (gitignored) rather than the OS temp dir, so npx's local-bin
lookup walks up and finds this repo's root-level prettier devDependency
directly — no network access needed to run the suite here.
Coverage uses Node's built-in test-runner coverage (no extra dependency):
pnpm test:coverage
This writes coverage/lcov.info, which the
Plugin Tests GitHub Actions
workflow uploads to Codecov under the prettier-plugin flag — that's what
the badge above reflects.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub leonardo-marziali/agentic-development-kit --plugin prettierPlugins from other owners that cover similar ground