setup-biome-husky
Set up Biome, Husky pre-commit with lint-staged and format-on-save for a plain TS or Node project. Use when asked to add linting, formatting or pre-commit hooks to a non-Angular project.
Files4
View on GitHubSKILL.md.claude/skills/setup-biome-husky/SKILL.md
GitHubSet up Biome and Husky for a plain TypeScript or Node.js project. Paths to scripts/ and templates/ are relative to this skill's directory. Angular projects use setup-prettier-eslint-husky instead (Biome has no Angular template support and does not format SCSS).
Stack
- Biome (
biome.json): one tool for formatting and linting*.ts,*.js,*.json,*.md,*.yml,*.yaml(Markdown and YAML need Biome >= 2.6) - Husky + lint-staged running
biome check --writeon staged files
Steps
Ask: IDE (VS Code / WebStorm / both / none). If
angular.jsonexists, stop and usesetup-prettier-eslint-husky.Run the setup script:
pwsh scripts/Setup-Biome.ps1 [-IDE vscode]It installs
@biomejs/biome,huskyandlint-stagedwith pnpm or npm (detected from the lockfile /packageManagerfield), copiesbiome.jsonunless one exists, initializes Husky, adds thelint-stagedblock and theformat,format:checkandlintscripts topackage.json, and writes the IDE settings.Format the project once:
npx biome check --write .; put that commit into.git-blame-ignore-revs.Verify:
npx biome check .
Templates
| File | Purpose |
|---|---|
biome.json.template (copied as biome.json) |
2 spaces, line width 100, single quotes, semicolons, trailing commas all, recommended lint rules, git ignore file honoured, Markdown frontmatter parsed as YAML, prose kept as written |
.husky/pre-commit |
Runs npx lint-staged on commit |
Constraints
- Never keep Prettier and Biome on the same files; two formatters fight
- An existing
biome.jsonis kept, not overwritten detect-techstackreportsbiomeoncebiome.json[c]exists;implementationthen formats withbiome check --write