Loading...
Loading...
Fast linting/formatting for TypeScript/React. Use when setting up linter, migrating from ESLint/Prettier, or running code quality checks.
npx skill4agent add beshkenadze/claude-skills-marketplace biome# npm/pnpm/yarn
npm install --save-dev --save-exact @biomejs/biome
npx @biomejs/biome init
# Bun
bun add -D -E @biomejs/biome
bunx @biomejs/biome init{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"domains": {
"react": "recommended"
},
"correctness": {
"noUnusedVariables": "error"
},
"nursery": {
"noFloatingPromises": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingCommas": "all",
"semicolons": "always"
}
},
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["node_modules", "dist", "build", ".next", "coverage"]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}{
"scripts": {
"check": "biome check .",
"check:fix": "biome check --write .",
"lint": "biome lint .",
"lint:fix": "biome lint --write .",
"format": "biome format --write .",
"ci": "biome ci ."
}
}# Check all (lint + format + imports) - recommended
npx @biomejs/biome check --write
# CI mode (fails on issues, no auto-fix)
npx @biomejs/biome ci
# Format only
npx @biomejs/biome format --write .
# Lint only
npx @biomejs/biome lint --write .# Auto-migrate configs
npx @biomejs/biome migrate eslint --write
npx @biomejs/biome migrate prettier --writebiome.json.eslintrc.*.prettierrc.*.eslintignore.prettierignorepackage.json{
"linter": {
"rules": {
"domains": {
"react": "recommended",
"next": "recommended",
"test": "all"
}
}
}
}package.json{
"linter": {
"rules": {
"nursery": {
"noFloatingPromises": "error"
}
}
}
}{
"linter": {
"rules": {
"nursery": {
"noImportCycles": "error",
"noPrivateImports": "error"
}
}
}
}// Single line
// biome-ignore lint/suspicious/noExplicitAny: legacy code
const data: any = fetchData();
// Entire file
// biome-ignore-all lint/suspicious/noExplicitAny
// Range
// biome-ignore-start lint/style/noVar
var legacy = "code";
// biome-ignore-end{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"formatter": { "indentStyle": "space", "indentWidth": 2 },
"linter": { "rules": { "recommended": true } }
}packages/web/biome.json{
"root": false,
"extends": "//",
"linter": {
"rules": {
"domains": { "react": "recommended" }
}
}
}npm install -D lefthook
npx lefthook installpre-commit:
commands:
biome:
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
stage_fixed: true{
"lint-staged": {
"*.{js,ts,jsx,tsx,json,css}": ["biome check --write --no-errors-on-unmatched"]
}
}{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"biome.enabled": true,
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"source.fixAll.biome": "explicit"
}
}name: Code Quality
on: [push, pull_request]
jobs:
biome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: biomejs/setup-biome@v2
- run: biome ci --changed| Task | Command |
|---|---|
| Check all + fix | |
| CI mode | |
| Lint only | |
| Format only | |
| Migrate ESLint | |
| Migrate Prettier | |
biome check --writebiome.json--changed--no-errors-on-unmatched--writenursery| Limitation | Workaround |
|---|---|
| JSON-only config | Use |
| Vue/Svelte/Astro | Partial support (improving) |
| YAML/Markdown | Not supported |
| Some ESLint plugins | Check rule compatibility |