biome
Biome linter and formatter for JavaScript/TypeScript. Covers configuration, rules, and integration patterns. Replaces ESLint + Prettier for faster development experience. USE WHEN: user mentions "biome", "linting", "formatting", "code style", "biome.json", asks about "setup linter", "format code", "migrate from ESLint", "migrate from Prettier", "biome rules", "biome configuration" DO NOT USE FOR: ESLint configuration - Biome is an ESLint replacement, Prettier configuration - Biome is a Prettier replacement, TypeScript compilation - use TypeScript compiler, Code quality principles - use `clean-code` skill
What this skill does
# Biome Configuration
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `biome` for comprehensive documentation.
## When NOT to Use This Skill
This skill is specific to Biome tooling. Do NOT use for:
- **ESLint configuration** - Biome replaces ESLint; migrate or use ESLint skills
- **Prettier configuration** - Biome replaces Prettier; migrate or use Prettier docs
- **TypeScript type checking** - Use `tsc`, not Biome (Biome doesn't type check)
- **Build process** - Use bundler skills (Vite, Webpack, etc.)
- **Testing setup** - Use testing framework skills (Vitest, Jest, etc.)
- **Code quality principles** - Use `clean-code` skill for what to fix, not how to configure
## Anti-Patterns
| Anti-Pattern | Why It's Bad | Biome Best Practice |
|--------------|--------------|---------------------|
| **Disabling recommended rules** | Misses important issues | Keep recommended, customize only what's needed |
| **Ignoring all warnings** | Warnings indicate real issues | Fix warnings or suppress with reason |
| **No CI integration** | Issues slip through | Use `biome ci` in CI pipeline |
| **Manual formatting** | Inconsistent, waste time | Use format on save + pre-commit hooks |
| **Mixing ESLint + Biome** | Conflicting rules, confusion | Fully migrate to Biome or stay with ESLint |
| **No VS Code integration** | Manual CLI runs | Install Biome extension, enable format on save |
| **Ignoring complexity rules** | Allows unmaintainable code | Set cognitive complexity limits |
| **Committing formatting issues** | Messy diffs | Use pre-commit hooks with lint-staged |
## Quick Troubleshooting
| Issue | Check | Solution |
|-------|-------|----------|
| **Biome not formatting** | VS Code extension installed? | Install `biomejs.biome`, set as default formatter |
| **Format on save not working** | Settings.json configured? | Add `"editor.formatOnSave": true` |
| **Rules not applying** | biome.json syntax valid? | Run `biome check` to validate config |
| **Too many warnings** | Rules too strict? | Adjust severity levels or disable specific rules |
| **CI failing** | Different results locally? | Ensure same Biome version, check ignore patterns |
| **Conflicts with Prettier** | Both running? | Remove Prettier, Biome replaces it |
| **Slow on large codebase** | Checking too many files? | Add ignore patterns in biome.json |
| **Can't migrate from ESLint** | Complex config? | Use `biome migrate eslint`, review output |
## Installation
```bash
npm install --save-dev @biomejs/biome
# Initialize configuration
npx @biomejs/biome init
```
## biome.json Configuration
```json
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExcessiveCognitiveComplexity": {
"level": "warn",
"options": {
"maxAllowedComplexity": 15
}
}
},
"correctness": {
"noUnusedVariables": "warn",
"noUnusedImports": "warn",
"useExhaustiveDependencies": "warn"
},
"style": {
"noNonNullAssertion": "off",
"useImportType": "warn"
},
"suspicious": {
"noExplicitAny": "warn"
}
}
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingCommas": "es5",
"semicolons": "always"
}
},
"files": {
"ignore": [
"node_modules",
"dist",
"build",
".next",
"coverage",
"*.gen.ts"
]
}
}
```
## Package.json Scripts
```json
{
"scripts": {
"lint": "biome check .",
"lint:fix": "biome check --write .",
"format": "biome format --write .",
"check": "biome check --write --unsafe ."
}
}
```
## Common Rules
| Rule | Level | Description |
|------|-------|-------------|
| `noUnusedVariables` | warn | Flag unused variables |
| `noUnusedImports` | warn | Flag unused imports |
| `noExplicitAny` | warn | Discourage `any` type |
| `useExhaustiveDependencies` | warn | Check React hook deps |
| `noNonNullAssertion` | off | Allow `!` operator |
| `useImportType` | warn | Prefer `import type` |
## VS Code Integration
```json
// .vscode/settings.json
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
```
## Pre-commit Hook
```bash
# Install husky
npm install --save-dev husky lint-staged
# package.json
{
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"biome check --write --no-errors-on-unmatched"
]
}
}
```
## Migration from ESLint/Prettier
```bash
# Biome can migrate your config
npx @biomejs/biome migrate eslint --write
npx @biomejs/biome migrate prettier --write
```
## CLI Commands
```bash
# Check all files
biome check .
# Fix issues
biome check --write .
# Format only
biome format --write .
# Lint only
biome lint .
# Check specific files
biome check src/components/**/*.tsx
# CI mode (exit with error)
biome ci .
```
## Ignoring Code
```typescript
// Ignore next line
// biome-ignore lint/suspicious/noExplicitAny: needed for legacy API
const data: any = await fetch('/api');
// Ignore whole file (at top)
// biome-ignore-all lint/style/useImportType
```
## Production Readiness
### Recommended Configuration
```json
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"a11y": {
"recommended": true
},
"complexity": {
"noExcessiveCognitiveComplexity": {
"level": "error",
"options": { "maxAllowedComplexity": 15 }
},
"noExcessiveNestedTestSuites": "warn"
},
"correctness": {
"noUnusedVariables": "error",
"noUnusedImports": "error",
"useExhaustiveDependencies": "error"
},
"performance": {
"noAccumulatingSpread": "warn",
"noDelete": "warn"
},
"security": {
"noDangerouslySetInnerHtml": "error",
"noGlobalEval": "error"
},
"suspicious": {
"noExplicitAny": "warn",
"noConsoleLog": "warn"
}
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingCommas": "es5",
"semicolons": "always"
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
```
### CI Integration
```yaml
# .github/workflows/lint.yml
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Biome CI
run: npx @biomejs/biome ci .
# Or with caching
- name: Cache Biome
uses: actions/cache@v4
with:
path: ~/.cache/biome
key: ${{ runner.os }}-biome-${{ hashFiles('biome.json') }}
- name: Check
run: npx @biomejs/biome check --diagnostic-level=error .
```
### Git Hooks
```json
// package.json
{
"scripts": {
"prepare": "husky install",
"lint": "biome check .",
"lint:fix": "biome check --write .",
"lint:ci": "biome ci ."
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json}": [
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
]
}
}
```
```bash
# .husky/pre-commit
#!/usr/bin/env sh
. "$(dirname -- "Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.