
javascript-format
Formatter and linter for JavaScript, TypeScript, JSX and JSON that runs only where Biome is configured.
- GitHub stars
- 32
What it does
- Adds
/javascript-format:setupand a silentPostToolBatchhook that formats each batch of edited files once per turn - Registers git pre-commit entries for format (rewrites staged files) and lint (blocks commits on new findings only)
- Enforces an opt-in rule: nothing runs unless a
biome.jsonorbiome.jsoncgoverns the file, and no lint fix is ever applied - Designed for repositories already using Biome that want formatting and lint checks at commit for every author
Formats JavaScript, TypeScript, JSX and JSON with Biome once per batch of tool calls and at git pre-commit, and reports Biome lint findings at commit, only where a biome.json governs the file; formatting and linting are separate, no lint fix runs, and hooks never run an ecosystem record's command.
Add marketplace
/plugin marketplace add melodic-software/claude-code-pluginsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install javascript-format@melodic-softwareRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceReadme
javascript-format
A Claude Code plugin that formats and lints JavaScript, TypeScript, JSX and JSON with
Biome, as two separate concerns, wherever your repository has opted into
Biome. Formatting runs once per batch of tool calls in a Claude Code session and again at git
pre-commit for every author; linting reports at pre-commit, on the lines the commit adds. No lint
fix runs in either place, and no finding reaches Claude on each edit. Both cover .ts, .tsx,
.js, .jsx, .mjs, .cjs, .mts, .cts, .json and .jsonc files.
The hooks run only the shipped Biome adapter, when a biome.json or biome.jsonc governs the
file: biome check --write --linter-enabled=false for format (the formatter and the assist actions
your config enables, import sorting by default), biome lint for lint. A repository without one is
left untouched, and /javascript-format:setup check reports the concern unresolved.
The hooks never run a command from your typescript, javascript or json record
(.claude/ecosystems/<id>.yaml, the ecosystem-commands contract in the marketplace repository).
That record names any formatter and linter you use, and /toolchain:lint and /toolchain:check
run it when you ask.
The plugin ships no rules of its own.
Behavior
- One format per batch, silent. A
PostToolBatchrow runs after the tool calls of a turn step resolve. It takes the files thatWrite,EditorMultiEditcalls in the batch named and runs the Biome adapter once per config directory over all of them. It prints nothing and exits0: no finding and no notice goes to Claude or the user. A file thatReadnamed is never rewritten.- The row has no matcher or
if(neither applies toPostToolBatch), and the launcher's text filter takes one string, which cannot cover ten extensions. The script therefore decides in a pattern match before any other process starts, so a batch without a Biome file costs thenodelauncher and onebash. - Pointer: when deciding what filters a
PostToolBatchrow, fetch hooks: PostToolBatch live.
- The row has no matcher or
- Opt-in on
biome.json. The adapter runs only when abiome.jsonorbiome.jsoncgoverns the edited file, found by walking up from the file to the repository root. A repo without a Biome config is left untouched rather than rewritten to Biome's built-in defaults. (The hidden.biome.json/.biome.jsoncnames are intentionally not treated as the opt-in: Biome only loads them from 2.4 onward, so honoring them here would risk reformatting with built-in defaults on an older Biome. Use a canonicalbiome.json/biome.jsonc.) - Config discovery from your repo. The topmost governing
biome.jsonwins, and Biome runs from that config's directory with the files named relative to it, so a single repo-root (or subtree) config governs files in subdirectories beneath it and nested configs extend it.BIOME_CONFIG_PATHis unset for the run, so a stray export cannot swap the repo's config. - Format only. The linter is off for the format run, so no lint fix applies, safe or unsafe;
the
lintentry reports what it finds. Assist actions your config turns off stay off.- Pointer: when deciding what each flag applies, fetch CLI: biome check live.
- Pre-existing drift is rewritten whole. The batch payload carries no pre-edit bytes, so a file that already drifted from your config is formatted in full, as the pre-commit entry would.
- Respects your ignores. Biome honors your config's
files.includesignore rules even for an explicitly passed path, so a path your config excludes (generated or vendored code) is left untouched. Files under.githooks/(installed copies) and gitignored files (unlessjavascript_format_lint_gitignoredis set) are skipped.
Git pre-commit entries
The plugin ships two git-hook entries (git-hooks/entries.json):
formatrewrites. At commit it refuses a partly staged Biome file untouched, runs the resolved format command over the staged files, and re-stages what changed.lintreports. It runs the resolved lint command and blocks the commit only on a finding on a line the commit adds (errors, and warnings via--error-on-warnings), printed as<path>:<line>: <message>. A linter that exits non-zero with no such line, such as Biome refusing a config it cannot parse, fails the commit and shows its output.
They reach every author, not only Claude, once
/javascript-format:setup apply install-git-hooks [scope=local|shared] registers them with the
repository's hook manager (lefthook, husky or plain git hooks). Local scope stays in this clone;
shared scope commits the copies under .githooks/javascript-format/. /javascript-format:setup check reports drift, including a copy of the earlier single biome-check entry, which that action
retires; a decline of biome-check carries to both.
Biome comes from a node_modules/.bin the repository does not commit, walking up from the file,
else PATH. When it is missing, an agent's commit fails with the install command; a person's commit
gets a one-line notice and goes through. git -c checks.skipmissing=biome commit ... skips the
entry while biome is absent. The placement rules are the check-placement convention in the
marketplace repository.
An opt-in Stop row (javascript_format_end_of_turn) runs the lint entry over the uncommitted
changes at the end of a turn and hands findings back to Claude once per turn.
Requirements
- Bash. The hook is a Bash script. On native Windows, install Git for Windows so Claude Code can run it under Git Bash.
- Node.js on
PATH. Every hook row launches throughnode hooks/exec-bash.mjs, which finds Bash. A missingnodeis a hook launch error, not a skip notice. - jq on
PATH. Reads the file paths from thePostToolBatchpayload. Absent: the batch row does nothing, and the SessionStart probe reports it. Install jq. - Biome available to the repo, in its
node_modulesor onPATH. Biome is never downloaded on the fly; if it is not present while a Biome config governs the repo, the batch row skips the file. Biome 2.x is recommended (tested against 2.6.7): the adapter passes--write,--linter-enabled=false,--error-on-warnings,--reporter=concise,--max-diagnostics=noneand--no-errors-on-unmatched, and on much older releases those flags may be absent. - A
biome.jsonorbiome.jsoncin the repo, the opt-in. - A SessionStart probe reports a missing
biomeonce per session, fromprerequisites.json, only where abiome.jsonorbiome.jsoncsits in the project directory or above it or is tracked anywhere in its repository, and a drifted git-hook entry. A repository whose only Biome config is nested and untracked gets no probe line, though the hooks still run there. Runnode "<plugin root>/lib/prerequisites.mjs" check "<plugin root>"to see what resolves; it is read-only and installs nothing.
The hook scripts run on Bash 3.2+.
Hook budget accounting
Per docs/contracts/hook-budget/README.md,
the PostToolBatch row is always-on: the event has no matcher, so it fires on every batch of every
session. Measured on WSL2 Ubuntu (bash 5.3.9, Biome 2.5.15 behind a node launcher script like
npm's, node 24) on 2026-10-15, with the row launched as hooks.json registers it, ten fires per
case; spawns are from scripts/hook-census.sh:
| Batch | Median wall | Min-max | Spawns |
|---|---|---|---|
| No Biome file in the payload | 0.029 s | 0.027-0.036 s | 3 (the node launcher and one bash) |
A Read of a .ts file, nothing to rewrite | 0.029 s | 0.026-0.034 s | 6 |
One Edit of a .ts file that needs a rewrite | 0.091 s | 0.086-0.103 s | 16 |
The ceiling for a per-batch formatter row is 1 s median per fire. Fences:
.performance/ratchets.json holds the no-Biome-file row at 3 spawns, and the Stop row with
javascript_format_end_of_turn off (its default) at 1 spawn. The Biome adapter path, one Edit
of a .ts file under a biome.json with the native Biome binary on PATH, measured 16 spawns
before and after the resolver landed (2026-11-17, WSL2 Ubuntu, bash 5.3.9).
Install
/plugin marketplace add melodic-software/claude-code-plugins
/plugin install javascript-format@melodic-software
Then verify prerequisites with /javascript-format:setup check or
node "<plugin root>/lib/prerequisites.mjs" check "<plugin root>".
Configuration
The formatting rules come from the biome.json already in your repository, which
the plugin reads automatically. To change the rules, edit that file.
Three userConfig options tune the hooks themselves:
| Option | Default | Effect |
|---|---|---|
javascript_format_enabled | true | Kill switch. Set false for a clean no-op. |
javascript_format_lint_gitignored | false | Set true to rewrite a file the repository gitignores. Off by default. |
javascript_format_end_of_turn | false | Set true to run the pre-commit lint entry over the uncommitted changes when a turn ends; findings go back to Claude once per turn so they are fixed before it stops. Nothing is rewritten. |
Set them interactively with /plugin configure javascript-format@<marketplace>, or headless on the
install command:
claude plugin install javascript-format@<marketplace> --config javascript_format_enabled=false
Options reference
Generated from this plugin's .claude-plugin/plugin.json. For how Claude Code asks for
these and hands them to the plugin, see User configuration.
| Option | Type | Default | Description |
|---|---|---|---|
javascript_format_enabled | boolean | true | After each batch of tool calls, run the resolved format command over the JavaScript, TypeScript and JSON files it wrote |
javascript_format_lint_gitignored | boolean | false | By default the hook leaves a file the repository gitignores alone: it is not rewritten or linted, since a rewrite of an ignored file has no git checkout to undo it. Set true to act on gitignored files too. A tracked file that matches an ignore pattern is always in scope. |
javascript_format_end_of_turn | boolean | false | At the end of each turn, run the pre-commit lint entry over the lines changed since the last commit and hand any findings back so they are fixed before the turn ends, at most once per turn. Nothing is rewritten. Off by default. |
How to set these
Set the options above for javascript-format@<marketplace>, replacing <marketplace> with the
marketplace you installed this plugin from:
- In a session or headless:
/pluginin a session orclaude plugin configure. The configure command is the preferred headless route in the plugin-reconfiguration convention, which records its limits. - By hand: under
pluginConfigsin your user settings.
Do not uninstall the plugin to reconfigure it: see What an uninstall deletes and keeps.
For a Claude Code release without plugin configure, see Plugin install.
Upstream documentation
- User configuration
- Plugin configure
- Plugin install options
- Plugins and skills settings
- Settings files and who they affect
- Manage installed plugins
License
MIT (SPDX-License-Identifier: MIT).
Details
- Marketplace
- melodic-software/claude-code-plugins
- Source
- plugins/javascript-format
- Category
- Development
More from melodic-software/claude-code-plugins
All 139- kindle-dedrm
- knowledge
- machine-health
- markdown-format
- mcp-tools
- melodic-softwarev1.0.0
- microsoftv1.0.0
- milan-jovanovicv1.0.0
- miro
- multi-agent
- mutation-testing
- naming
- openai-ecosystemv1.0.0
- overengineering
- performance
- pixel-art
- planning
- playbooks
- playgrounds
- playwright
- plugin-diagnostics
- plugin-profiles
- plugin-quality
- powershell-format
Similar to javascript-format
More Development Tools
reamorluto/rea466.8K starsReverse engineer anything with agents, from app behavior down to native binaries.
superpowersobra/superpowers319.5K starsCore skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques
claude-apianthropics/skills196.9K starsClaude API and SDK documentation skill for building LLM-powered applications
prompts.chatf/prompts.chat178.2K starsAccess thousands of AI prompts and skills directly in your AI coding assistant. Search prompts, discover skills, save your own, and improve prompts with AI.
agent-sdk-devanthropics/claude-code156.1K starsDevelopment kit for working with the Claude Agent SDK
ui-ux-pro-maxnextlevelbuilder/ui-ux-pro-max-skill152.6K starsProfessional UI/UX design intelligence for AI coding assistants. Includes searchable databases of styles, colors, typography, charts, and UX guidelines for Reac