Setup Biome + Ultracite
What This Sets Up
- Biome linter/formatter with Ultracite opinionated preset
biome.jsoncextendingultracite/biome/core+ultracite/biome/react- Stop hook that auto-fixes lint/format on all changed JS/TS files (skips
noUnusedImportsto avoid import deletion loops) - Strict overrides:
noConsole, cognitive complexity 15,noDeprecatedImports, restricted imports
Steps
1. Install dependencies
bun add -D @biomejs/biome ultracite --yarn2. Create biome.jsonc
Use the config from REFERENCE.md. Key points:
- Extends
ultracite/biome/coreandultracite/biome/react - VCS enabled with git,
useIgnoreFile: true - Overrides:
noConsole: error, cognitive complexity max 15,noDeprecatedImports: error - Restricted imports:
moment,lodash,classnames,mobx,yup - Test files still enforce
noExplicitAny(ultracite disables it in tests — we re-enable)
3. Add package.json scripts
{
"scripts": {
"lint": "biome check .",
"lint:fix": "biome check --write .",
"lint:file": "biome check",
"lint:fix:file": "biome check --write"
}
}lint/lint:fix scan the whole project (. hardcoded). lint:file/lint:fix:file have no hardcoded path — hooks pass specific files via -- file1 file2.
4. Create hook script
Copy scripts/biome-autofix.sh into .claude/hooks/. Make executable.
5. Configure hook in .claude/settings.json
Add to hooks config: Stop: .claude/hooks/biome-autofix.sh
6. Verify
biome.jsoncexists with correct extendsbun run lintworksbun run lint:fixworks.claude/hooks/biome-autofix.shis executable- Hook configured in
.claude/settings.json
7. Commit
Stage all files and commit: Add Biome + Ultracite with auto-fix Stop hook