
Biome
- 55 installs
- 2 repo stars
- Updated August 3, 2026
- fandhe-ai/agent-reference-skills
Helps with ai & agent building tasks.
About
biome is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- biome
- AI & Agent Building
- AI-coding skill
Biome by the numbers
- 55 all-time installs (skills.sh)
- Ranked #6,762 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/fandhe-ai/agent-reference-skills --skill biomeAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 55 |
|---|---|
| repo stars | ★ 2 |
| Last updated | August 3, 2026 |
| Repository | fandhe-ai/agent-reference-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Biome リファレンス
Biome(biomejs.dev)の全ドキュメントを網羅したスキル。 ユーザーのタスクに応じて適切な README.md を読み、そこから個別ファイルへ辿ること。
ディレクトリ構成
skills/biome/
SKILL.md
references/
guides/
README.md
getting-started.md
configure-biome.md
integrate-in-vcs.md
migrate-eslint-prettier.md
big-projects.md
manual-installation.md
investigate-slowness.md
upgrade-to-biome-v2.md
formatter/
README.md
introduction.md
differences-with-prettier.md
option-philosophy.md
analyzer/
README.md
suppressions.md
linter/
README.md
introduction.md
domains.md
plugins.md
javascript-rules.md
javascript-sources.md
css-rules.md
css-sources.md
json-rules.md
json-sources.md
graphql-rules.md
graphql-sources.md
html-rules.md
assist/
README.md
introduction.md
javascript-actions.md
javascript-sources.md
css-actions.md
html-actions.md
json-actions.md
reference/
README.md
cli.md
configuration.md
diagnostics.md
gritql.md
reporters.md
vscode.md
zed.md
environment-variables.md
recipes/
README.md
continuous-integration.md
git-hooks.md
badges.md
renovate.md
internals/
README.md
language-support.md
philosophy.md
samples/
README.md
getting-started.md
format-and-lint.md
configuration.md
vcs-integration.md
git-hooks.md
ci-github-actions.md
monorepo-setup.md
suppressions.md
migrate-from-eslint-prettier.md
scripts/
README.md
install.md
setup.md
cli.md
ci.md
migrate.md
docker.md探索手順
タスクからカテゴリを引き、カテゴリの README.md で目的のページを特定する:
1. 下記マッピング表でタスクに対応するカテゴリを探す 2. そのカテゴリの references/{category}/README.md を参照して目的のページを特定する 3. 該当ページの .md を Read して詳細を確認する
タスク → カテゴリ マッピング
| タスク | カテゴリ | 参照 README |
|---|---|---|
| インストール、初期設定、biome init | guides | references/guides/README.md |
| ESLint/Prettier からの移行、biome migrate | guides | references/guides/README.md |
| モノレポ対応、extends、共有設定 | guides | references/guides/README.md |
| VCS 統合、--changed、--staged | guides | references/guides/README.md |
| パフォーマンス問題、遅い、トレーシング | guides | references/guides/README.md |
| コードフォーマット、インデント、行幅 | formatter | references/formatter/README.md |
| Prettier との違い、フォーマット差異、オプション哲学 | formatter | references/formatter/README.md |
| biome-ignore、抑制コメント、suppress | analyzer | references/analyzer/README.md |
| リンタールール、lint エラー、ルール設定 | linter | references/linter/README.md |
| ドメイン(React, Next.js, Vue)設定 | linter | references/linter/README.md |
| GritQL プラグイン、カスタムルール | linter | references/linter/README.md |
| ESLint / Stylelint ルールとの対応表 | linter | references/linter/README.md |
| import ソート、キーソート、organizeImports | assist | references/assist/README.md |
| useSortedKeys、useSortedProperties、CSS アクション | assist | references/assist/README.md |
| CLI コマンド、biome check/lint/format/ci | reference | references/reference/README.md |
| biome.json 設定、全オプション | reference | references/reference/README.md |
| 診断、レポーター、環境変数 | reference | references/reference/README.md |
| VS Code 拡張、Zed 設定、GritQL 構文 | reference | references/reference/README.md |
| CI/CD、GitHub Actions、Git Hooks | recipes | references/recipes/README.md |
| Renovate による biome.json 自動更新 | recipes | references/recipes/README.md |
| 言語サポート状況、対応言語 | internals | references/internals/README.md |
| 開発哲学、プロジェクト原則 | internals | references/internals/README.md |
| 典型的な使い方を知りたい | samples | samples/README.md |
| インストール・CLI コマンドを知りたい | scripts | scripts/README.md |
Analyzer
| Name | Description | Path |
|---|---|---|
| 抑制(Suppressions) | Biome Analyzer の抑制エンジンは linter と assist で共有。抑制コメントで特定行・範囲・ファイル全体のルールを無効化できる。 | suppressions.md |
抑制(Suppressions)
Source: https://biomejs.dev/analyzer/suppressions
概要
Biome Analyzer の抑制エンジンは linter と assist で共有。抑制コメントで特定行・範囲・ファイル全体のルールを無効化できる。
抑制コメントの構文
// biome-ignore <category>[/<group>[/<rule>]]: <reason>カテゴリ
lint— リンタールールassist— アシストアクションsyntax— 構文チェックformat— フォーマッター
3つの抑制パターン
1. インライン抑制(次行限定)
// biome-ignore lint/suspicious/noDebugger: デバッグ用
debugger; // 抑制される
debugger; // 抑制されない2. ファイルレベル抑制(biome-ignore-all)
ファイル最上部に配置。ファイル全体に適用。
// biome-ignore-all lint/suspicious/noDebugger: テストファイル
debugger; // 抑制される
debugger; // 抑制される最上部以外に配置すると「未使用」と判定され suppression/unused 診断が発生。
3. 範囲抑制(biome-ignore-start / biome-ignore-end)
// biome-ignore-start lint/suspicious/noDoubleEquals: レガシーコード
a == b; // 抑制される
c == d; // 抑制される
// biome-ignore-end lint/suspicious/noDoubleEquals: レガシーコード
f == g; // 抑制されない複数ネスト可能。各 start には対応する end が必須。
詳細度の制御
一般的(lint:)から具体的(lint/group/rule)まで指定可能。
ルール値指定
括弧内で値指定可能: biome-ignore lint/style/useNamingConvention(foo): reason
CSS アクション + ソース
アクション一覧
| アクション | 推奨 | 説明 |
|---|---|---|
| useSortedProperties | — | CSS プロパティとネストされたルールの順序を強制 |
IDE コードアクション名
source.action.useSortedProperties.biome
ソース
Biome 独自
- useSortedProperties は Biome 独自に開発されたアクション
HTML / GraphQL アクション + ソース
HTML アクション
| アクション | 推奨 | 説明 |
|---|---|---|
| noDuplicateClasses | ○ | 重複する CSS クラスを削除 |
GraphQL アクション
現在、GraphQL 向けのアシストアクションは提供されていない。
ソース
HTML
| ESLint プラグインルール | Biome アクション |
|---|---|
| no-duplicate-classes (eslint-plugin-better-tailwindcss) | noDuplicateClasses |
GraphQL
Biome 独自のアクションのみ(現在なし)。
Assist
概要
Biome Assist はコード改善アクションを提供。リンタールールとは異なり、アシストアクションは常にコード修正を提供する。プロパティのソート、式の簡素化、リファクタリングなどを実行。現在 6 つのアシストアクションが利用可能。
セーフな修正
アシスト修正は一般的に安全に適用できるよう設計。修正がコードを破壊する場合はバグと見なされる。
IDE での使い方
VS Code
{
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit"
}
}個別アクション:
{
"editor.codeActionsOnSave": {
"source.action.useSortedKeys.biome": "explicit"
}
}Zed
{
"code_actions_on_format": {
"source.fixAll.biome": true
}
}CLI での実行
# アシストのみ実行
biome check --formatter-enabled=false --linter-enabled=false
# 診断エラーを抑制
biome check --enforce-assist=false設定
{
"assist": {
"enabled": true,
"actions": {
"source": {
"useSortedKeys": "on"
}
}
}
}アシストはデフォルトで有効。一部ルールは推奨ルールセットに含まれる。
グループ
- source: 保存時に安全に適用可能なアクション
JavaScript/TypeScript アクション
source カテゴリ
| アクション | 推奨 | 説明 |
|---|---|---|
| organizeImports | ○ (info) | インポート・エクスポートを自動ソート。組み込みまたはカスタム順序ロジック使用 |
| useSortedKeys | — | JS オブジェクトのプロパティを自然順でソート |
| useSortedAttributes | — | JSX 要素の属性をソート |
| useSortedInterfaceMembers | — | interface メンバーをキーでソート |
| noDuplicateClasses | — | 重複する CSS クラスを削除 |
IDE コードアクション名
| アクション | コードアクション |
|---|---|
| organizeImports | source.organizeImports.biome |
| useSortedKeys | source.action.useSortedKeys.biome |
| useSortedAttributes | source.action.useSortedAttributes.biome |
| useSortedInterfaceMembers | source.action.useSortedInterfaceMembers.biome |
| noDuplicateClasses | source.action.noDuplicateClasses.biome |
JavaScript/TypeScript アクションのソース
Biome 独自アクション
一部のアクションは Biome 独自に開発。
ESLint プラグイン対応
| ESLint プラグインルール | Biome アクション |
|---|---|
| no-duplicate-imports (eslint) | organizeImports |
| sort-imports (eslint) | organizeImports |
| sort-keys (eslint) | useSortedKeys |
| jsx-sort-props (eslint-plugin-react) | useSortedAttributes |
| sort-interfaces (eslint-plugin-typescript-sort-keys) | useSortedInterfaceMembers |
| no-duplicate-classes (eslint-plugin-better-tailwindcss) | noDuplicateClasses |
注意: 一部の Biome ルールは元のルールと比べてオプションを持たない場合がある。
JSON アクション + ソース
アクション一覧
| アクション | 推奨 | 説明 |
|---|---|---|
| useSortedKeys | — | JSON オブジェクトのキーを自然順でソート |
IDE コードアクション名
source.action.useSortedKeys.biome
ソース
| ESLint プラグインルール | Biome アクション |
|---|---|
| sort-keys (@eslint/json) | useSortedKeys |
assist
| Name | Description | Path |
|---|---|---|
| CSS アクション + ソース | CSS プロパティとネストされたルールの順序を強制する useSortedPropert… | css-actions.md |
| HTML / GraphQL アクション + ソース | 重複する CSS クラスを削除する HTML アクション。GraphQL 向けア… | html-actions.md |
| Assist | Biome Assist はコード改善アクションを提供。リンタールールとは異なり… | introduction.md |
| JavaScript/TypeScript アクション | インポート・エクスポート、オブジェクト、JSX 属性、interface メンバ… | javascript-actions.md |
| JavaScript/TypeScript アクションのソース | ESLint プラグインルールと Biome アクションのマッピング。organizeImp… | javascript-sources.md |
| JSON アクション + ソース | JSON オブジェクトのキーを自然順でソートする useSortedKeys アクション… | json-actions.md |
Prettier との違い
Source: https://biomejs.dev/formatter/differences-with-prettier
Biome と Prettier の意図的な差異。
1. オブジェクトプロパティのクォート削除
Biome は ES2015 以降の全有効識別子のクォートを削除。Prettier は ES5 識別子のみ。 例: Unicode 識別子 "𐊧" — Biome は削除、Prettier は保持。
2. 計算キーの代入における括弧
Prettier はオブジェクトプロパティの計算キーで [(x = 0)] と括弧追加するが、クラスプロパティでは追加しない矛盾がある。Biome は両方で括弧を省略し一貫性を保つ。
3. アロー関数の型パラメータの末尾カンマ
<T = unknown>() => {} — Prettier は <T = unknown,> と末尾カンマ追加。Biome は追加しない。JSX 区別が不要な場合は不要という元の意図を尊重。
4. Non-null アサーション付きオプショナルチェーン
TypeScript の (a.?.b)! と a.?.b! — Prettier は括弧の有無を保持。Biome は統一。
5. 無効な構文の扱い
Prettier は構文エラーを見過ごして整形:
- 重複修飾子:
private public a = 1 - オプショナルチェーンへの代入:
(a?.b) = c - 不正な型パラメータ修飾子
- トップレベル return
- 不正な自己増減:
(1)++
Biome は「Bogus」ノードとして逐語的に出力。
6. TypeScript/Babel パーサー間の矛盾
Prettier はパーサー選択で出力が異なることがある。Biome は独自パーサーで統一出力。
Formatter
Source: https://biomejs.dev/formatter/
概要
Biome はオピニオン型フォーマッターで、複数の言語をサポート。Prettier と同じ哲学に基づき、設定オプションを意図的に制限している。
対応言語
JavaScript, TypeScript, JSX, TSX, JSON, JSONC, CSS, GraphQL, HTML
CLI での使い方
# フォーマットチェック(変更なし)
biome format ./src
# フォーマット適用
biome format --write ./srcデフォルト設定(言語共通)
| オプション | デフォルト | 説明 |
|---|---|---|
| indentStyle | tab | インデント方式(tab / space) |
| indentWidth | 2 | インデント幅 |
| lineWidth | 80 | 1行の最大文字数 |
| lineEnding | lf | 改行コード(lf / crlf / cr) |
JavaScript 固有オプション
| オプション | デフォルト |
|---|---|
| quoteStyle | double |
| jsxQuoteStyle | double |
| trailingCommas | all |
| semicolons | always |
| arrowParentheses | always |
| bracketSpacing | true |
| bracketSameLine | false |
抑制方法
ファイルレベル
// biome-ignore-all format: reason部分的
// biome-ignore format: reason
const x = 1;.editorconfig 統合
v1.9 以降で .editorconfig の読み込みをサポート。formatter.useEditorconfig: true で有効化。
オプション哲学
Source: https://biomejs.dev/formatter/option-philosophy
原則
Biome はオピニオン型フォーマッター。コードのフォーマット方法は1つだけが正しいと考える。スタイル論争を消滅させ、コードレビューを簡潔にする。
既存オプション
当初は最も議論の余地がある3つに限定:
- インデントスタイル(タブ vs スペース)
- インデント幅
- セミコロン強制
Prettier チャレンジへの対応で互換性のため全オプションを実装。これらは「歴史的遺物」と見なされ、将来の追加オプションの正当化には使用されない。
新しいオプション
現在のオプションセットは安定。新しいオプション追加には応じない。 スタイルは継続的に改善される可能性があるが、変更は普遍的に適用される(設定可能なオプションにはならない)。
Formatter
| Name | Description | Path |
|---|---|---|
| Prettier との違い | Biome と Prettier の意図的な差異。 | differences-with-prettier.md |
| Formatter | Biome はオピニオン型フォーマッターで、複数の言語をサポート。 | introduction.md |
| オプション哲学 | Biome はオピニオン型フォーマッター。コードのフォーマット方法は1つだけが正しい。 | option-philosophy.md |
Big Projects
Source: https://biomejs.dev/guides/big-projects
モノレポでの Biome 設定
大規模プロジェクトやモノレポで Biome を効果的に設定する方法。
ルート設定
プロジェクト直下に biome.json を配置する。全パッケージ共通の設定を記述する。
ネスト設定
各パッケージに独自の biome.json を配置し、ルート設定を継承する。
{
"root": false,
"extends": "//"
}"root": false-- このファイルがルート設定ではないことを示す"extends": "//"-- ルート設定(プロジェクト直下の biome.json)を継承する
独立設定
extends を省略すると、ルート設定を継承せず完全に独立した設定になる。
共有設定
相対パスで共有
{
"extends": ["./common.json"]
}NPM パッケージで共有
{
"extends": ["@org/shared-configs/biome"]
}NPM パッケージ側の package.json で exports を設定する:
{
"exports": {
"./biome": "./biome.json"
}
}Configure Biome
Source: https://biomejs.dev/guides/configure-biome
設定ファイル
- ファイル名:
biome.jsonまたはbiome.jsonc - 配置場所: プロジェクトルート(package.json の隣)
3つのツール
Biome は以下の3つのツールを中心に構成される:
1. Formatter -- コードフォーマッター 2. Linter -- 静的解析 3. Assist -- インポート整理などの補助機能
基本構造
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"formatter": { "enabled": true },
"linter": { "enabled": true }
}言語別設定
<language>.<tool> パターンで言語ごとにツールの挙動を制御できる。
{
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
}ファイル探索順序
Biome は設定ファイルを以下の順序で探索する:
1. カレントディレクトリ 2. 親フォルダ(再帰的に上方向へ) 3. ホームディレクトリ
ファイル処理の制御
files.includes-- 処理対象ファイルの指定<tool>.includes-- ツールごとの対象ファイル指定!プレフィックス -- ファイルを除外!!プレフィックス -- ファイルを完全除外(オーバーライド不可)
Getting Started
Source: https://biomejs.dev/guides/getting-started/
インストール
Biome はプロジェクトのローカル依存としてインストールする。-E フラグでバージョンを固定することを推奨。
# npm
npm install -D -E @biomejs/biome
# pnpm
pnpm add -D -E @biomejs/biome
# yarn
yarn add -D -E @biomejs/biome
# bun
bun add -D -E @biomejs/biome
# deno
deno add -D npm:@biomejs/biome初期設定
biome.json 設定ファイルを生成する:
npx @biomejs/biome init基本コマンド
| コマンド | 説明 |
|---|---|
biome format --write | フォーマットを実行し、ファイルに書き込む |
biome lint --write | リントを実行し、安全な修正を適用する |
biome check --write | フォーマット + リント + インポート整理をまとめて実行 |
CI 環境
CI では biome ci を使用する。読み取り専用モードで動作し、ファイルへの修正は行わない。フォーマットやリントの問題があればエラーとして報告される。
biome ciIntegrate in VCS
Source: https://biomejs.dev/guides/integrate-in-vcs
VCS 統合設定
VCS 統合はオプション機能であり、明示的に有効化する必要がある。
{
"vcs": {
"enabled": true,
"clientKind": "git"
}
}.gitignore の尊重
vcs.useIgnoreFile を有効にすると、.gitignore と .ignore に記載されたファイルを処理対象から除外する。
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}変更ファイルのみ処理
--changed フラグ
デフォルトブランチからの変更ファイルのみを処理する。vcs.defaultBranch の設定が必要。
{
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main"
}
}biome check --changed--since=<branch> フラグ
指定したブランチとの差分ファイルのみを処理する。
biome check --since=develop--staged フラグ
ステージ済み(git add 済み)のファイルのみを処理する。pre-commit フックでの使用に適している。
biome check --staged注意: --staged は CI 環境では使用できない。
Investigate Slowness
Source: https://biomejs.dev/guides/investigate-slowness
初期確認
パフォーマンスの問題が発生した場合、まず以下を確認する:
1. dist/build フォルダを除外する -- !! を使って完全除外する 2. プロジェクトルールを無効化する -- 高度な分析を行うプロジェクトルールがパフォーマンスに影響している可能性がある 3. node_modules を除外する -- !! を使って完全除外する
{
"files": {
"includes": ["!!dist", "!!build", "!!node_modules"]
}
}トレーシング
詳細なパフォーマンス分析にはトレーシングを使用する:
biome lint --log-level=tracing --log-kind=json --log-file=tracing.jsonjq による分析
トレーシング出力を jq で解析して、ボトルネックを特定する。
モジュールグラフの構築時間
cat tracing.json | jq 'select(.span.name == "update_module_graph_internal")'遅い診断分析の特定
cat tracing.json | jq 'select(.span.name == "pull_diagnostics")'注目すべきスパン
format_file-- 個々のファイルのフォーマット処理時間open_file_internal-- ファイルを開く処理の時間
Manual Installation
Source: https://biomejs.dev/guides/manual-installation
Node.js/npm なしでのインストール方法
npm を使わずに Biome をインストールする方法。
Homebrew
brew install biomeDocker
docker run -v $(pwd):/code ghcr.io/biomejs/biome lintバイナリ直接ダウンロード
GitHub Releases からプラットフォームに合ったバイナリを直接ダウンロードできる。
https://github.com/biomejs/biome/releases
サポートプラットフォーム
| CPU | Windows | macOS | Linux | Linux (musl) |
|---|---|---|---|---|
| arm64 | win32-arm64 | darwin-arm64 | linux-arm64 | linux-arm64-musl |
| x64 | win32-x64 | darwin-x64 | linux-x64 | linux-x64-musl |
Migrate from ESLint & Prettier
Source: https://biomejs.dev/guides/migrate-eslint-prettier
ESLint からの移行
biome migrate eslint --write- レガシー設定(
.eslintrc.*)とフラット設定(eslint.config.*)の両方に対応 extends、共有設定、プラグインの読み込みを処理.eslintignoreのパターンも移行される--include-inspiredオプションで ESLint ルールに「inspired」された Biome ルールも含める- 命名規則の違い: Biome は camelCase、ESLint は kebab-case
Prettier からの移行
biome migrate prettier --write- デフォルト値の違いに注意:
- Prettier: スペースインデント
- Biome: タブインデント
- JSON5、TOML、YAML 形式の Prettier 設定ファイルは非対応
注意事項
- VCS 統合の有効化を推奨する(
.gitignoreのパターンを尊重するため) - 完全に同一の動作は期待できない。一部のルールオプションは Biome に実装されていない。
Guides
| Name | Description | Path |
|---|---|---|
| Big Projects | 大規模プロジェクトやモノレポで Biome を効果的に設定する… | big-projects.md |
| Configure Biome | ファイル名は biome.json または biome.jsonc。プロジェ… | configure-biome.md |
| Getting Started | Biome はプロジェクトのローカル依存としてインストール… | getting-started.md |
| Integrate in VCS | VCS 統合はオプション機能であり、明示的に有効化する… | integrate-in-vcs.md |
| Investigate Slowness | パフォーマンスの問題が発生した場合、まず以下を確認… | investigate-slowness.md |
| Manual Installation | npm を使わずに Biome をインストールする方法。 | manual-installation.md |
| Migrate from ESLint & Prettier | ESLint からの移行。レガシー設定とフラット設定の両方… | migrate-eslint-prettier.md |
| Upgrade to Biome v2 | アップグレード手順。パッケージを更新して biome mig… | upgrade-to-biome-v2.md |
Upgrade to Biome v2
Source: https://biomejs.dev/guides/upgrade-to-biome-v2
アップグレード手順
1. パッケージを更新する 2. biome migrate --write を実行して設定を自動移行する
破壊的変更
1. Rome 関連サポート終了
rome.jsonは認識されなくなった。biome.jsonに移行すること。// rome-ignoreコメントは無効。// biome-ignoreに変更すること。
2. --config-path 廃止
CLI の --config-path オプションは廃止された。エディタ設定で対応する。
3. ignore/include が includes に統合
従来の ignore と include は includes に統合された。
4. パス・グロブが設定ファイル位置基準に変更
グロブパターンは設定ファイルが置かれているディレクトリを基準に解決されるようになった。
5. linter の all オプション廃止
all オプションは廃止された。代わりに domains を使用する。
6. assert から with 構文へ
インポートアサーションの assert キーワードは with に変更された。
7. ルールのデフォルト重大度が変更
一部ルールのデフォルト重大度(severity)が変更された。
8. style ルールの挙動変更
style ルールは明示的に設定しない限りエラーを発行しなくなった。
9. package.json のフォーマット変更
package.json は常に複数行でフォーマットされるようになった。
10. インポート整理のソート順変更
インポートのソートアルゴリズムが変更された。
言語サポート
サポート状況一覧
| 言語 | 解析 | フォーマット | リント | プラグイン |
|---|---|---|---|---|
| JavaScript | ✅ | ✅ | ✅ | ✅ |
| TypeScript | ✅ | ✅ | ✅ | ✅ |
| JSX | ✅ | ✅ | ✅ | ✅ |
| TSX | ✅ | ✅ | ✅ | ✅ |
| JSON | ✅ | ✅ | ✅ | ✅ |
| JSONC | ✅ | ✅ | ✅ | ✅ |
| HTML | ✅ | ✅ | ✅ | ✅ |
| CSS | ✅ | ✅ | ✅ | ✅ |
| GraphQL | ✅ | ✅ | ✅ | — |
| Vue | 🟡 | 🟡 | 🟡 | 🟡 |
| Svelte | 🟡 | 🟡 | 🟡 | 🟡 |
| Astro | 🟡 | 🟡 | 🟡 | 🟡 |
| SCSS | ⏳ | ⏳ | — | — |
| YAML | ⏳ | ⏳ | — | — |
| Markdown | ⏳ | ⏳ | — | — |
| GritQL | ✅ | ✅ | — | — |
凡例: ✅ サポート / — 未計画 / ⏳ 開発中 / 🟡 実験的
言語別詳細
- JavaScript: ES2024 対応。公式構文のみ。テンプレートリテラル内 CSS/GraphQL 埋め込みは実験的
- TypeScript: v5.9 対応
- JSONC: コメント対応。
.jsoncやツール設定ファイルを自動識別 - HTML/Vue/Svelte/Astro: v2.3.0 以降で実験的サポート開始。完全サポートは進行中
開発哲学
プロジェクト管理
- 明確な期待値の設定と透明な意思決定
- GitHub Discussions・Discord での公開チャネル活用
- 重要な決定を事前に周知(サプライズを避ける)
技術的原則
- エラーメッセージの充実: 可能な限り修正のヒントを提示。具体的で一意なメッセージ
- API の最適化: オプション・フラグの必要性を常に問い直し、シンプルさを追求
- 可読性と包括性: 専門用語を避け、初心者から専門家まで理解できる表現
- 包容的な表現: ジェンダーニュートラルな代名詞、差別的でない用語を使用
- 汎用的な設計: ターミナルだけでなく IDE・ブラウザ等、様々な環境での表示を想定
internals
| Name | Description | Path |
|---|---|---|
| 言語サポート | サポート状況一覧 | language-support.md |
| 開発哲学 | プロジェクト管理と技術的原則 | philosophy.md |
CSS ルール
カテゴリ別ルール一覧
a11y(アクセシビリティ)
| ルール | 推奨 | 説明 |
|---|---|---|
| useGenericFontNames | ○ | font-family にジェネリックファミリーキーワードを必須 |
complexity
| ルール | 推奨 | 説明 |
|---|---|---|
| noImportantStyles | — | !important の使用禁止 |
correctness
| ルール | 推奨 | 説明 |
|---|---|---|
| noInvalidDirectionInLinearGradient | ○ | linear-gradient の無効な方向を検出 |
| noInvalidGridAreas | ○ | 無効な grid-template-areas を検出 |
| noInvalidPositionAtImportRule | ○ | @import の無効な位置を検出 |
| noMissingVarFunction | ○ | CSS カスタムプロパティに var() 関数の欠落を検出 |
| noUnknownFunction | ○ | 不明な CSS 関数を検出 |
| noUnknownMediaFeatureName | ○ | 不明なメディア機能名を検出 |
| noUnknownProperty | ○ | 不明な CSS プロパティを検出 |
| noUnknownPseudoClass | ○ | 不明な擬似クラスを検出 |
| noUnknownPseudoElement | ○ | 不明な擬似要素を検出 |
| noUnknownTypeSelector | ○ | 不明な型セレクタを検出 |
| noUnknownUnit | ○ | 不明な CSS 単位を検出 |
| noUnmatchableAnbSelector | ○ | マッチ不能な An+B セレクタを検出 |
nursery
| ルール | 推奨 | 説明 |
|---|---|---|
| noDeprecatedMediaType | — | 非推奨メディアタイプを検出 |
| noExcessiveLinesPerFile | — | ファイルの行数上限 |
| noHexColors | — | 16進数カラーの使用禁止 |
| useBaseline | — | ベースライン互換性チェック |
style
| ルール | 推奨 | 説明 |
|---|---|---|
| noDescendingSpecificity | ○ | 詳細度の降順を禁止 |
| noValueAtRule | — | @value ルールの使用禁止 |
suspicious
| ルール | 推奨 | 説明 |
|---|---|---|
| noDuplicateAtImportRules | ○ | 重複 @import を禁止 |
| noDuplicateCustomProperties | ○ | 重複カスタムプロパティを禁止 |
| noDuplicateFontNames | ○ | 重複フォント名を禁止 |
| noDuplicateProperties | ○ | 重複プロパティを禁止 |
| noDuplicateSelectorsKeyframeBlock | ○ | keyframe ブロックの重複セレクタを禁止 |
| noEmptyBlock | ○ | 空ブロックを禁止 |
| noEmptySource | — | 空ソースを禁止 |
| noImportantInKeyframe | ○ | keyframe 内の !important を禁止 |
| noIrregularWhitespace | ○ | 不規則な空白文字を検出 |
| noShorthandPropertyOverrides | ○ | ショートハンドプロパティの上書きを検出 |
| noUnknownAtRules | ○ | 不明な @ ルールを検出 |
| noUselessEscapeInString | — | 無用なエスケープを検出 |
CSS ルールのソース
Biome 独自ルール
- noExcessiveLinesPerFile
- noUselessEscapeInString
- noValueAtRule
Stylelint 対応
| Stylelint ルール | Biome ルール |
|---|---|
| at-rule-no-unknown | noUnknownAtRules |
| block-no-empty | noEmptyBlock |
| color-no-hex | noHexColors |
| declaration-block-no-duplicate-properties | noDuplicateProperties |
| declaration-block-no-shorthand-property-overrides | noShorthandPropertyOverrides |
| declaration-no-important | noImportantStyles |
| font-family-no-duplicate-names | noDuplicateFontNames |
| font-family-no-missing-generic-family-keyword | useGenericFontNames |
| function-linear-gradient-no-nonstandard-direction | noInvalidDirectionInLinearGradient |
| function-no-unknown | noUnknownFunction |
| keyframe-block-no-duplicate-selectors | noDuplicateSelectorsKeyframeBlock |
| keyframe-declaration-no-important | noImportantInKeyframe |
| media-feature-name-no-unknown | noUnknownMediaFeatureName |
| named-grid-areas-no-invalid | noInvalidGridAreas |
| no-descending-specificity | noDescendingSpecificity |
| no-duplicate-at-import-rules | noDuplicateAtImportRules |
| no-empty-source | noEmptySource |
| no-irregular-whitespace | noIrregularWhitespace |
| property-no-unknown | noUnknownProperty |
| selector-anb-no-unmatchable | noUnmatchableAnbSelector |
| selector-pseudo-class-no-unknown | noUnknownPseudoClass |
| selector-pseudo-element-no-unknown | noUnknownPseudoElement |
| selector-type-no-unknown | noUnknownTypeSelector |
| unit-no-unknown | noUnknownUnit |
@eslint/css 対応
| @eslint/css ルール | Biome ルール |
|---|---|
| use-baseline | useBaseline |
注意: 一部のルールは元のルールと比べてオプションを持たない場合がある。
ドメイン
概要
特定のフレームワーク・環境に対応したルール群を一括管理する機能。依存関係から自動検出。
設定方法
{
"linter": {
"domains": {
"react": "recommended" // 推奨ルールのみ
// "react": "all" // 全ルール
// "react": "none" // 無効
}
}
}利用可能なドメイン
フレームワーク・ライブラリ
| ドメイン | 対象 | 説明 |
|---|---|---|
| react | react >= 16.0.0 | React 固有の問題検出(フック、コンポーネント構造) |
| reactNative | react-native >= 0.60.0 | React Native 向け(<Text> 外テキストレンダリング等ランタイム問題検出) |
| next | next >= 14.0.0 | Next.js 向け(非同期クライアントコンポーネント、スクリプト最適化) |
| vue | vue >= 3.0.0 | Vue 3 テンプレート構文・コンポーネント検証 |
| svelte | svelte >= 3.0.0 | Svelte フレームワーク固有ルール |
| solid | solid >= 1.0.0 | Solid フレームワーク固有ルール(React ドメインと競合あり) |
| qwik | @builder.io/qwik >= 1.0.0 | Qwik 最適化パターン |
テスト・品質保証
| ドメイン | 対象 | 説明 |
|---|---|---|
| test | jest/mocha/ava/vitest | テスト汎用ルール(ライブラリ自動検出) |
| playwright | @playwright/test >= 1.0.0 | Playwright テスト向け |
インフラ・開発ツール
| ドメイン | 対象 | 説明 |
|---|---|---|
| project | — | モジュールグラフ分析(未宣言依存・循環参照検出) |
| types | — | 型推論エンジン(浮遊 Promise 検出・条件式冗長性) |
| turborepo | turbo >= 1.0.0 | モノレポ環境変数管理 |
| drizzle | drizzle-orm >= 0.9.0 | DB ORM 安全操作(WHERE 句検証) |
特徴
- 自動検出: 依存関係からドメインを自動判定
- グローバル認識: テスト用グローバル変数(test, expect 等)を自動認識
- パフォーマンス: Project ドメインはプロジェクト全体スキャンのため処理負荷増加
GraphQL ルール
correctness
| ルール | 推奨 | 説明 |
|---|---|---|
| useGraphqlNamedOperations | ○ (error) | GraphQL 操作に名前を必須 |
nursery
| ルール | 推奨 | 説明 |
|---|---|---|
| noDuplicateArgumentNames | — | 引数名の重複を禁止 |
| noDuplicateEnumValueNames | — | enum 値名の重複を禁止 |
| noDuplicateFieldDefinitionNames | — | フィールド定義名の重複を禁止 |
| noDuplicateGraphqlOperationName | — | 操作名の重複を禁止 |
| noDuplicateInputFieldNames | — | 入力フィールド名の重複を禁止 |
| noDuplicateVariableNames | — | 変数名の重複を禁止 |
| noExcessiveLinesPerFile | — | ファイルの行数上限 |
| noRootType | — | ルート型の使用禁止 |
| useConsistentGraphqlDescriptions | — | 説明の一貫性を強制 |
| useInputName | — | 入力型名の規則を強制 |
| useLoneAnonymousOperation | — | 単一の匿名操作を強制 |
| useLoneExecutableDefinition | — | 単一の実行可能定義を強制 |
style
| ルール | 推奨 | 説明 |
|---|---|---|
| useDeprecatedReason | ○ (warn) | @deprecated に理由を必須 |
| useGraphqlNamingConvention | — | enum 値の大文字化を検証 |
suspicious
| ルール | 推奨 | 説明 |
|---|---|---|
| noDuplicateFields | ○ (info) | 重複フィールドを禁止 |
| noEmptySource | — | 空ソースを禁止 |
| useDeprecatedDate | — | @deprecated に削除日を要求 |
GraphQL ルールのソース
Biome 独自ルール
多くの GraphQL ルールは Biome 独自に実装されている。
@graphql-eslint 対応
GraphQL ルールの一部は @graphql-eslint プラグインからインスパイアされている。
| @graphql-eslint ルール | Biome ルール |
|---|---|
| naming-convention | useGraphqlNamingConvention |
| require-deprecation-reason | useDeprecatedReason |
| no-duplicate-fields | noDuplicateFields |
| require-description | useConsistentGraphqlDescriptions |
注意: 一部のルールは元のルールと比べてオプションを持たない場合がある。
HTML ルール + ソース
a11y(アクセシビリティ)— 全 16 ルール(全て推奨)
| ルール | 説明 |
|---|---|
| noAccessKey | accesskey 属性の使用禁止 |
| noAutofocus | autofocus 属性の使用禁止 |
| noDistractingElements | 気を散らす要素(marquee, blink)の使用禁止 |
| noPositiveTabindex | 正のtabindex の使用禁止 |
| useAltText | 代替テキストを必須 |
| useAnchorContent | アンカー要素にコンテンツを必須 |
| useButtonType | button に type 属性必須 |
| useHeadingContent | 見出し要素にコンテンツを必須 |
| useHtmlLang | html 要素に lang 属性必須 |
| useIframeTitle | iframe に title 必須 |
| useKeyWithClickEvents | click イベントにキーボードイベントを併設 |
| useKeyWithMouseEvents | マウスイベントにキーボードイベントを併設 |
| useMediaCaption | メディア要素にキャプションを必須 |
| useValidAnchor | 有効なアンカーを強制 |
| useValidAriaProps | 有効な ARIA プロパティを強制 |
| useValidAriaRole | 有効な ARIA ロールを強制 |
nursery — 24 ルール
| ルール | 説明 |
|---|---|
| noConsole | console 使用禁止 |
| noDuplicateAttributes | 重複属性禁止 |
| noExcessiveLinesPerFile | 行数上限 |
| noMissingAttributeValues | 属性値の欠落検出 |
| noScriptUrl | javascript: URL 禁止 |
| noUnknownHtmlTag | 不明な HTML タグ検出 |
| useClosingTag | 閉じタグ必須 |
| useConsistentSelfClose | 自己閉じタグの一貫性 |
| useStrictDoctype | 正しい DOCTYPE 必須 |
(Vue テンプレート検証ルール等も含む)
ソース
eslint-plugin-jsx-a11y 対応
HTML a11y ルールの多くは eslint-plugin-jsx-a11y からインスパイアされている。
eslint-plugin-vue 対応
nursery の Vue 関連ルールは eslint-plugin-vue からインスパイアされている。
Linter
概要
Biome リンターは複数言語のコードを静的解析し、エラー検出とモダンなコーディングプラクティスを強制する。506 のルールを提供。
CLI での使い方
# リント実行
biome lint ./src ./public
# 安全な修正を適用
biome lint --write ./src
# 危険な修正も適用
biome lint --write --unsafe ./srcCLI オプション
--skip=<RULE>: 特定ルール/グループ除外--only=<RULE>: 特定ルールのみ実行(例:--only=correctness/noUnusedVariables)--write: 安全な修正を適用
セーフ修正とアンセーフ修正
- セーフ修正: コードの意味論を変更しないことが保証。
--writeで自動適用 - アンセーフ修正: プログラムの意味を変更する可能性。
--write --unsafeで適用
設定
{
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noDebugger": "off"
}
}
}
}重大度レベル
"error","warn","info","on","off"
コード修正制御
"none","safe","unsafe"をルールごとに設定
グループ管理
- グループ全体の有効/無効:
"a11y": "off"
ルールカテゴリ
| カテゴリ | 説明 |
|---|---|
| accessibility | アクセシビリティ問題を防止 |
| complexity | 複雑なコードを検出・単純化 |
| correctness | 確実に不正確または無用なコードを検出 |
| nursery | 開発中の実験的ルール |
| performance | パフォーマンス最適化の機会を検出 |
| security | セキュリティ脆弱性を検出 |
| style | 一貫したスタイルを強制 |
| suspicious | 不正確である可能性が高いコードを検出 |
エディタ統合
保存時のセーフ修正: source.fixAll.biome コードアクション
Scanner(v2+)
プロジェクトドメインルールが有効な場合、モジュールグラフ分析と型推論を実行する Scanner が起動。
- 約 2,000 ファイルで ~2s のオーバーヘッド
- TypeScript 型スキャン時は node_modules の依存関係も含むためメモリ使用量が増加
JavaScript/TypeScript ルール
Biome は JS/TS 向けに 300 以上のルールを 8 カテゴリで提供。
カテゴリ概要
| カテゴリ | ルール数 | 説明 |
|---|---|---|
| a11y (accessibility) | ~37 | アクセシビリティ問題防止 |
| complexity | ~45 | 複雑なコード検出・単純化 |
| correctness | ~79 | 不正確・無用なコード検出 |
| nursery | ~101 | 開発中の実験的ルール |
| performance | ~13 | パフォーマンス最適化 |
| security | ~5 | セキュリティリスク検出 |
| style | ~82 | コード一貫性の維持 |
| suspicious | ~107 | 疑わしいパターン検出 |
a11y(アクセシビリティ)— 代表的ルール
noAccessKey— accesskey 属性の使用禁止noAriaHiddenOnFocusable— フォーカス可能要素の aria-hidden 禁止noAutofocus— autofocus 属性の使用禁止useAltText— img 等に代替テキスト必須useButtonType— button に type 属性必須useHtmlLang— html 要素に lang 属性必須useValidAriaRole— 有効な ARIA ロールを強制
complexity — 代表的ルール
noBannedTypes— 禁止された型の使用検出noExcessiveCognitiveComplexity— 認知複雑性の制限noForEach— forEach の代わりに for...of を推奨noStaticOnlyClass— 静的メンバーのみのクラスを検出noUselessTypeConstraint— 無用な型制約を検出useFlatMap— map + flat の代わりに flatMap を推奨useSimplifiedLogicExpression— 論理式の単純化
correctness — 代表的ルール
noConstAssign— const への再代入を禁止noConstructorReturn— コンストラクタの return を禁止noGlobalObjectCalls— グローバルオブジェクトの呼び出し禁止noInvalidNewBuiltin— 無効な new 演算子の使用禁止noUndeclaredVariables— 未宣言変数の使用検出noUnusedImports— 未使用インポートの検出noUnusedVariables— 未使用変数の検出useExhaustiveDependencies— useEffect 依存配列の網羅性useIsNan— NaN 比較に isNaN() を強制
performance — 代表的ルール
noBarrelFile— バレルファイルの使用禁止noReExportAll—export * fromの禁止noDelete— delete 演算子の使用禁止useTopLevelRegex— 正規表現のトップレベル定義を推奨
security — 代表的ルール
noDangerouslySetInnerHtml— dangerouslySetInnerHTML の使用禁止noGlobalEval— eval() の使用禁止useAnchorContent— アンカー要素にコンテンツを必須
style — 代表的ルール
noCommaOperator— カンマ演算子の使用禁止noDefaultExport— デフォルトエクスポートの禁止noEnum— enum の使用禁止noNonNullAssertion— 非 null アサーション (!) の禁止useConst— 再代入のない変数に const を強制useExportType— 型のみのエクスポートに export type を強制useImportType— 型のみのインポートに import type を強制useNamingConvention— 命名規則の強制useTemplate— 文字列連結の代わりにテンプレートリテラルを推奨
suspicious — 代表的ルール
noArrayIndexKey— 配列インデックスを key に使用禁止noConsole— console の使用禁止noDebugger— debugger の使用禁止noDoubleEquals— == の代わりに === を強制noExplicitAny— any 型の使用禁止noMisleadingInstantiator— 誤解を招くコンストラクタを検出noShadowRestrictedNames— 組み込み名のシャドウイングを禁止useAwait— async 関数内で await を使用
nursery — 注意事項
- 開発中ルール。安定版では明示的オプトインが必要
- Playwright、Drizzle ORM 対応ルール等を含む
JavaScript/TypeScript ルールのソース
Biome ルールと外部ルールの対応関係。
Biome 独自ルール
約 35 個の独自ルール。例: noDelete, noEnum, useStrictMode
ESLint 対応
約 100 以上のルールが ESLint から対応:
| Biome ルール | ESLint ルール |
|---|---|
| noDoubleEquals | eqeqeq |
| noDebugger | no-debugger |
| noConsole | no-console |
| noUnusedVariables | no-unused-vars |
| useConst | prefer-const |
| useTemplate | prefer-template |
| noVar | no-var |
typescript-eslint 対応
| Biome ルール | typescript-eslint ルール |
|---|---|
| useExplicitType | explicit-function-return-type |
| noExplicitAny | no-explicit-any |
| useNamingConvention | naming-convention |
eslint-plugin-react 対応
| Biome ルール | plugin-react ルール |
|---|---|
| useButtonType | button-has-type |
| useJsxKeyInIterable | jsx-key |
eslint-plugin-jsx-a11y 対応
| Biome ルール | jsx-a11y ルール |
|---|---|
| useAltText | alt-text |
| useValidAriaRole | aria-role |
| noAccessKey | no-access-key |
eslint-plugin-unicorn 対応
| Biome ルール | unicorn ルール |
|---|---|
| useDateNow | prefer-date-now |
| useForOf | no-for-loop |
| useGlobalThis | prefer-global-this |
注意
一部の Biome ルールは元のルールと比べてオプションを持たない場合がある。
JSON ルール
nursery
| ルール | 推奨 | 説明 |
|---|---|---|
| noEmptyObjectKeys | — | JSON オブジェクトの空キーを禁止 |
| noTopLevelLiterals | — | トップレベル値にオブジェクト/配列を要求 |
| useRequiredScripts | — | package.json に必須スクリプトを強制 |
suspicious
| ルール | 推奨 | 説明 |
|---|---|---|
| noBiomeFirstException | ○ (error) | files.includes 内のグロブパターン誤用を防止 |
| noDuplicateDependencies | — | 依存関係の重複を禁止 |
| noDuplicateObjectKeys | ○ (error) | オブジェクト内の重複キーを禁止 |
| noQuickfixBiome | ○ (info) | エディタ設定での quickfix.biome 使用を禁止 |
| useBiomeIgnoreFolder | ○ (warn) | 設定ファイルでのフォルダ無視の正しい使い方を促進 |
JSON ルールのソース
Biome 独自ルール
- noBiomeFirstException
- noQuickfixBiome
- useBiomeIgnoreFolder
- useRequiredScripts
@eslint/json 対応
| @eslint/json ルール | Biome ルール |
|---|---|
| no-duplicate-keys | noDuplicateObjectKeys |
| no-empty-keys | noEmptyObjectKeys |
| no-top-level-literals | noTopLevelLiterals |
eslint-plugin-package-json / eslint-plugin-package-json-dependencies 対応
| プラグインルール | Biome ルール |
|---|---|
| valid-package-def (package-json) | noDuplicateDependencies |
| no-duplicate-dependencies (package-json-dependencies) | noDuplicateDependencies |
プラグイン
概要
Biome リンターは GritQL プラグインをサポート。特定のコードパターンをマッチさせてカスタム診断メッセージを登録できる。
プラグインの作成
.grit ファイル拡張子で GritQL スニペットを記述:
`$fn($args)` where {
$fn <: `Object.assign`,
register_diagnostic(
span = $fn,
message = "Prefer object spread instead of `Object.assign()`"
)
}設定方法
{
"plugins": ["./path-to-plugin.grit"]
}biome lint や biome check 実行時にプラグインが有効化。
対象言語の指定
デフォルトは JavaScript。他の言語を指定可能:
language css;
`$selector { $props }` where {
$props <: contains `color: $color` as $rule,
not $selector <: r"\.color-.*",
register_diagnostic(
span = $rule,
message = "Don't set explicit colors. Use `.color-*` classes instead."
)
}対応言語: JavaScript, CSS
register_diagnostic() API
| 引数 | 必須 | 説明 |
|---|---|---|
| span | ○ | 診断を添付する構文ノード |
| message | ○ | 表示メッセージ |
| severity | ✕ | 重大度(hint, info, warn, error)。デフォルト: error |
linter
| Name | Description | Path |
|---|---|---|
| CSS ルール | カテゴリ別ルール一覧(a11y、complexity、correctness、nursery、style、suspicious) | css-rules.md |
| CSS ルールのソース | Biome 独自ルール、Stylelint 対応、@eslint/css 対応 | css-sources.md |
| ドメイン | 特定のフレームワーク・環境に対応したルール群を一括管理する機能。依存関係から自動検出 | domains.md |
| GraphQL ルール | GraphQL 言語向けルール(correctness、nursery、style、suspicious) | graphql-rules.md |
| GraphQL ルールのソース | Biome 独自ルール、@graphql-eslint 対応 | graphql-sources.md |
| HTML ルール + ソース | HTML/Vue テンプレート向けルール(a11y、nursery)と対応元 | html-rules.md |
| Linter | Biome リンターの概要、CLI 使い方、セーフ修正、設定 | introduction.md |
| JavaScript/TypeScript ルール | Biome JS/TS 向けルール 300 以上(8 カテゴリ) | javascript-rules.md |
| JavaScript/TypeScript ルールのソース | ESLint、typescript-eslint、plugin-react 等との対応 | javascript-sources.md |
| JSON ルール | JSON ファイル向けルール(nursery、suspicious) | json-rules.md |
| JSON ルールのソース | Biome 独自ルール、@eslint/json、package-json プラグイン対応 | json-sources.md |
| プラグイン | GritQL プラグインによるカスタムルール定義、言語指定、register_diagnostic API | plugins.md |
バッジ
README.md に追加する Biome バッジ。
フォーマッタバッジ
[](https://biomejs.dev/)リンターバッジ
[](https://biomejs.dev)チェックバッジ
[](https://biomejs.dev)CI/CD
biome ci コマンド
CI 環境では biome ci を使用。--write/--fix オプションなし(読み取り専用)。
特徴:
- GitHub 等の環境に最適化されたアノテーション形式で診断出力
- スレッド数制御可能
- VCS 統合時に
--changedフラグ使用可能
GitHub Actions
公式 Action
name: Code quality
on:
push:
pull_request:
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: biomejs/setup-biome@v2
with:
version: latest
- run: biome ci .外部依存がある場合は事前に Node.js セットアップと依存インストールが必要。
GitLab CI
stages:
- quality
lint:
image:
name: ghcr.io/biomejs/biome:latest
entrypoint: [""]
stage: quality
script:
- biome ci --reporter=gitlab --colors=off > code-quality.json
artifacts:
reports:
codequality:
- code-quality.jsonGit Hooks
Lefthook
高速・クロスプラットフォーム・依存関係なし。
lefthook.yml:
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}pre-push:
commands:
check:
glob: "*.{js,ts,cjs,mjs,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files}セットアップ: lefthook install
Husky + lint-staged
package.json:
{
"scripts": {
"prepare": "husky"
}
}.husky/pre-commit:
lint-stagedpackage.json:
{
"lint-staged": {
"*.{js,ts,jsx,tsx,json,jsonc}": [
"biome check --files-ignore-unknown=true",
"biome check --write --no-errors-on-unmatched"
]
}
}Husky + git-format-staged
git stash を使わないため競合時に手動介入不要。
git-format-staged --formatter 'biome check --write --files-ignore-unknown=true --no-errors-on-unmatched "{}"' .pre-commit フレームワーク
.pre-commit-config.yaml:
repos:
- repo: https://github.com/biomejs/pre-commit
rev: "v2.0.6"
hooks:
- id: biome-check
additional_dependencies: ["@biomejs/biome@2.1.1"]利用可能 hook: biome-ci, biome-check, biome-format, biome-lint
シェルスクリプト
.git/hooks/pre-commit:
#!/bin/sh
set -eu
npx @biomejs/biome check --staged --files-ignore-unknown=true --no-errors-on-unmatched推奨
--no-errors-on-unmatched でファイル未処理時のエラーを抑制。
Recipes
| Name | Description | Path |
|---|---|---|
| バッジ | README.md に追加する Biome バッジ。 | badges.md |
| CI/CD | CI 環境では biome ci を使用。--write/--fix オプションなし(読み取… | continuous-integration.md |
| Git Hooks | 高速・クロスプラットフォーム・依存関係なし。 | git-hooks.md |
| Renovate | Renovate で biome.json の $schema バージョンを自動更新。 | renovate.md |
Renovate
概要
Renovate で biome.json の $schema バージョンを自動更新。
設定
renovate.json:
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["customManagers:biomeVersions"]
}customManagers:biomeVersions プリセットにより、Renovate が自動的に Biome のバージョンを検出し更新 PR を作成。
CLI
主要コマンド
biome check — 統合チェック
フォーマッタ、リンター、インポート整列を実行。
biome check --write # 安全な修正適用
biome check --write --unsafe # 危険な修正も含むオプション:
--formatter-enabled=<true|false>--linter-enabled=<true|false>--format-with-errors=<true|false>--staged: ステージ済みファイルのみ--changed: 変更ファイルのみ
biome lint — リンター
biome lint --write # 安全な修正
biome lint --write --unsafe # 危険な修正も含むオプション:
--suppress: コメント抑制で対応--reason=<STRING>: 抑制理由--only=<RULE>: 特定ルール実行(例:correctness/noUnusedVariables)--skip=<RULE>: 特定ルール除外
biome format — フォーマッター
biome format --writeオプション:
--stdin-file-path=<PATH>: stdin 入力時の拡張子指定--staged,--changed
biome ci — CI 環境用
読み取り専用。ファイル修正なし。--write/--fix オプションなし。
biome ci .biome init — 初期化
biome initデフォルト設定の biome.json を作成。
biome migrate — 設定移行
biome migrate --write # v2 設定移行
biome migrate eslint --write # ESLint 移行
biome migrate prettier --write # Prettier 移行biome search — パターン検索(実験的)
GritQL パターンでコード検索。
biome explain — ドキュメント表示
CLI 機能のドキュメントを表示。
biome clean — ログクリア
デーモンログをクリア。
biome rage — デバッグ情報
デバッグ情報を出力。
biome start / stop — デーモン制御
デーモンサーバーの起動/停止。
グローバルオプション
| オプション | 説明 |
|---|---|
--reporter=<形式> | 出力形式(default, json, json-pretty, github, junit, summary, gitlab, checkstyle, rdjson, sarif) |
--reporter-file=<PATH> | レポート出力先ファイル |
| `--diagnostic-level=<info\ | warn\ |
--max-diagnostics=<NUMBER> | 表示診断上限(デフォルト: 20) |
--config-path=<PATH> | 設定ファイルパス指定 |
--verbose | 詳細出力 |
| `--colors=<off\ | force>` |
--error-on-warnings | 警告でも終了コード 1 |
Configuration
biome.json / biome.jsonc の全オプション。
トップレベルプロパティ
| プロパティ | 説明 |
|---|---|
$schema | JSON スキーマパス。ローカル: ./node_modules/@biomejs/biome/configuration_schema.json、オンライン: https://biomejs.dev/schemas/2.3.11/schema.json |
extends | 他の設定ファイルのパス配列。モノレポ: "//" でルート設定を参照 |
root | ルート設定として扱うか(デフォルト: true)。ネスト設定では false |
files | ファイル処理の対象範囲 |
vcs | VCS 統合設定 |
formatter | フォーマッター設定 |
linter | リンター設定 |
assist | アシスト設定 |
javascript | JavaScript/TypeScript 設定 |
css | CSS 設定 |
json | JSON 設定 |
graphql | GraphQL 設定 |
html | HTML 設定 |
overrides | ファイルパターン別の上書き設定 |
grit | GritQL (.grit) ファイルの formatter / linter / assist 設定 |
plugins | GritQL プラグインパス配列 |
files セクション
| オプション | 説明 |
|---|---|
files.includes | グロブパターンでファイル指定。! で除外、!! で完全除外 |
files.ignoreUnknown | 不明ファイルを無視(デフォルト: false) |
files.maxSize | 最大ファイルサイズ(デフォルト: 1048576 = 1MB) |
vcs セクション
| オプション | デフォルト | 説明 |
|---|---|---|
vcs.enabled | false | VCS 統合有効化 |
vcs.clientKind | — | "git" を指定 |
vcs.useIgnoreFile | false | .gitignore/.ignore を尊重 |
vcs.root | — | VCS ファイル検索フォルダ |
vcs.defaultBranch | — | メインブランチ名 |
formatter セクション
| オプション | デフォルト | 説明 |
|---|---|---|
enabled | true | フォーマッター有効化 |
includes | — | 対象ファイル(グロブ) |
indentStyle | tab | インデント方式 |
indentWidth | 2 | インデント幅 |
lineEnding | lf | 改行コード |
lineWidth | 80 | 最大行幅 |
formatWithErrors | false | 構文エラー時も実行 |
attributePosition | auto | HTML 属性位置 |
bracketSpacing | true | 括弧内空白 |
expand | auto | 配列・オブジェクト展開 |
trailingNewline | true | ファイル末尾改行 |
useEditorconfig | false | .editorconfig 参照 |
javascript セクション
パーサ
| オプション | デフォルト | 説明 |
|---|---|---|
unsafeParameterDecoratorsEnabled | false | パラメータデコレータ |
jsxEverywhere | true | .js でも JSX 許可 |
フォーマッタ
| オプション | デフォルト |
|---|---|
quoteStyle | double |
jsxQuoteStyle | double |
quoteProperties | asNeeded |
trailingCommas | all |
semicolons | always |
arrowParentheses | always |
bracketSameLine | false |
operatorLinebreak | after |
その他
linter.enabled/assist.enabledglobals: グローバル変数配列jsxRuntime:"transparent"/"reactClassic"
css セクション
css.parser.cssModules: CSS Modules サポートcss.parser.tailwindDirectives: Tailwind CSS 構文css.formatter.*: CSS 固有フォーマッタ設定
html セクション
html.experimentalFullSupportEnabled: Vue/Svelte/Astro 対応html.parser.interpolation:{{ }}式サポートhtml.formatter.whitespaceSensitivity: 空白処理方式
grit セクション
GritQL (.grit) ファイルに対する設定:
| オプション | デフォルト | 説明 |
|---|---|---|
grit.formatter.enabled | false | GritQL ファイルのフォーマット有効化 |
grit.formatter.indentStyle | tab | インデント方式 |
grit.formatter.indentWidth | 2 | インデント幅 |
grit.formatter.lineWidth | 80 | 最大行幅 |
grit.formatter.quoteStyle | double | クォートスタイル(single / double) |
grit.formatter.trailingNewline | true | ファイル末尾改行 |
grit.linter.enabled | true | GritQL ファイルのリント有効化 |
grit.assist.enabled | true | GritQL ファイルのアシスト有効化 |
overrides セクション
特定ファイルに対する設定上書き:
{
"overrides": [
{
"includes": ["generated/**"],
"formatter": { "lineWidth": 160 }
},
{
"includes": ["**/*.config.js"],
"javascript": { "formatter": { "quoteStyle": "double" } }
}
]
}パターンの順序が重要。最初にマッチしたものが適用。
グロブパターン
| パターン | 説明 |
|---|---|
* | 1 フォルダ内の全ファイル |
** | 再帰的に全ファイル |
[...] | 文字クラス |
!パターン | 除外 |
!!パターン | 完全除外(スキャナが無視) |
Diagnostics
重大度レベル
| レベル | 色 | 説明 |
|---|---|---|
| Fatal | 赤 | 予期しないエラー。致命的タグ付き |
| Error | 赤 | 対処必要。CLI でエラーコード発行 |
| Warning | 黄 | 対処推奨だがブロックしない |
| Information | 緑 | 有用な情報提供 |
診断タグ
| タグ | 説明 |
|---|---|
| Verbose | --verbose で表示される非表示診断 |
| Internal | 内部エラー。バグ報告推奨 |
| Fixable | コード修正可能 |
| Deprecated | 廃止コード |
診断カテゴリ
- シンプル:
check - リンク付き:
lint/a11y/noAccessKey(ウェブページリンク付き)
ロケーション情報
- ファイルパス(左上)
- ソースコード(関連行の表示)
- 行・列番号(IDE クリックで該当位置へ)
アドバイス
診断に付与される追加メッセージ:
- エラー/警告/情報ログ
- コマンドフレーム
- グループ化メッセージ
- コード差分表示
- コードフレーム表示
環境変数
| 変数 | デフォルト | 説明 |
|---|---|---|
BIOME_LOG_PREFIX_NAME | server.log. | ログファイル名プレフィックス |
BIOME_LOG_PATH | — | ログファイル保存先ディレクトリ |
BIOME_CONFIG_PATH | — | 設定ファイルパスの明示的指定 |
BIOME_BINARY | — | Biome バイナリの上書き指定 |
使用例:
BIOME_BINARY=/path/to/biome npx @biomejs/biome format .GritQL
概要
GritQL はソースコード内の構造的検索を実行するクエリ言語。空白やクォートの違いは無視し、構文構造のマッチングに焦点を当てる。
サポート言語
- JavaScript/TypeScript:
language js(オプション:typescript,jsx) - CSS:
language css - JSON:
language json
パターンの基本
バッククォートでコードスニペットを囲む:
`console.log('Hello, world!')`フォーマット詳細は無視。クォートやスペースの違いもマッチ。
変数
$ で始まる識別子:
`console.log($message)`
`console.$method($message)`同じ変数名の複数使用で一貫性チェック:
`$fn && $fn()`条件文
where と <: マッチ演算子:
`console.$method($message)` where {
$method <: or { `log`, `info`, `warn`, `error` }
}構文ノードマッチング
Biome 内部ノード(PascalCase)を直接マッチ:
JsIfStatement() as $stmt where {
register_diagnostic(...)
}JSON パターン
language json
`"foo": $value`統合状況
GritQL サポートは開発中。多くの機能は動作するが、バグや未実装機能が存在する可能性あり。
Reference
| Name | Description | Path |
|---|---|---|
| CLI | フォーマッタ、リンター、インポート整列を実行するコマンド | cli.md |
| Configuration | biome.json / biome.jsonc の全オプション | configuration.md |
| Diagnostics | 重大度レベル・タグ・ロケーション情報・アドバイス | diagnostics.md |
| GritQL | ソースコード内の構造的検索を実行するクエリ言語 | gritql.md |
| Reporters | 診断とサマリーの出力形式を変更する --reporter… | reporters.md |
| VS Code | 公式拡張機能のインストール・設定・デフォルトフォーマッタ | vscode.md |
| Zed | Zed エディタ拡張機能のインストール・設定 | zed.md |
| 環境変数 | BIOME_LOG_PREFIX_NAME などの環境変数一覧 | environment-variables.md |
Reporters
--reporter 引数で診断とサマリーの出力形式を変更。
| レポーター | 説明 | コマンド例 |
|---|---|---|
| summary | ターミナル向け構造化出力 | biome check --reporter=summary |
| json | JSON 形式(実験的) | biome ci --reporter=json |
| json-pretty | 整形 JSON | biome ci --reporter=json-pretty |
| github | GitHub Actions 向け(PR 内メッセージ表示) | biome ci --reporter=github |
| junit | JUnit XML 形式(CI/CD 統合) | biome check --reporter=junit |
| gitlab | GitLab コードクオリティ形式 | biome check --reporter=gitlab |
| checkstyle | Checkstyle XML 形式 | biome check --reporter=checkstyle |
| rdjson | Reviewdog 形式 | biome check --reporter=rdjson |
| sarif | SARIF セキュリティ分析形式 | biome check --reporter=sarif |
VS Code
インストール
Visual Studio Marketplace から公式 Biome VS Code 拡張機能をインストール。
デフォルトフォーマッタ設定
1. サポート対象ファイルを開く 2. コマンドパレット(Ctrl/⌘+⇧+P)→「Format Document With…」 3.「Configure Default Formatter」→「Biome」
設定項目
| 設定 | デフォルト | 説明 |
|---|---|---|
biome.enabled | true | LSP セッション作成の制御 |
biome.requireConfiguration | false | biome.json 必須化 |
biome.configurationPath | null | カスタム設定ファイルパス |
biome.inlineConfig | — | インライン設定で上書き |
biome.lsp.bin | undefined | Biome バイナリパス上書き |
biome.runFromTemporaryLocation | OS依存 | 一時的な場所から実行 |
biome.suggestInstallingGlobally | true | グローバル導入提案 |
biome.lsp.trace.server | off | ログレベル(off/messages/verbose) |
biome.lsp.watcher.kind | null | ファイルウォッチャー動作 |
biome.lsp.watcher.pollingInterval | null | ポーリング間隔(ms) |
codeActionsOnSave
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}マルチルートワークスペース
フォルダごとに Biome インスタンスを自動作成。
v2.x からの移行
biome.lspBin→biome.lsp.bin(推奨)biome.requireConfigFile→biome.requireConfiguration(必須)
Zed
インストール
1. コマンドパレット(Ctrl/⌘+⇧+P)→「zed: extensions」 2.「Biome」を検索 → Install
設定
.zed/settings.json:
{
"lsp": {
"biome": {
"settings": {
"configuration_path": "./biome.json"
}
}
},
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
}
}デフォルトフォーマッタ設定
{
"formatter": {
"external": {
"command": "biome",
"arguments": ["format", "--write", "--stdin-file-path", "{buffer_path}"]
}
}
}CI with GitHub Actions
Run Biome in read-only CI mode using the official GitHub Action.
name: Code quality
on:
push:
pull_request:
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: biomejs/setup-biome@v2
with:
version: latest
- run: biome ci .For projects that require Node.js dependencies:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- uses: biomejs/setup-biome@v2
with:
version: latest
- run: biome ci .Notes
biome ciis read-only — it never writes fixes; exits non-zero on any finding- GitHub Actions annotations are emitted automatically when running in that environment
biomejs/setup-biome@v2installs the Biome CLI without requiring it inpackage.json- Specify
version: latestor a pinned version string (e.g.,2.1.1) to control the release used
Configuration
Configure formatter, linter, and per-language options in biome.json.
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noDebugger": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded",
"trailingCommas": "all"
}
},
"files": {
"includes": ["src/**", "!src/generated/**"]
},
"overrides": [
{
"includes": ["**/*.config.js"],
"javascript": {
"formatter": { "quoteStyle": "double" }
}
}
]
}Notes
- Default
indentStyleistab; switch tospacewhen the project requires it - Rule severity levels:
"error","warn","info","on","off" files.includeswith!prefix excludes paths;!!completely excludes (scanner ignores them too)overridespatterns are evaluated in order; the first match wins
Format and Lint
Run formatter and linter individually or together with biome check.
# Format only (check, no write)
biome format ./src
# Format and apply changes
biome format --write ./src
# Lint only (check, no write)
biome lint ./src
# Lint and apply safe fixes
biome lint --write ./src
# Lint and apply safe + unsafe fixes
biome lint --write --unsafe ./src
# Format + lint + import sorting in one command
biome check --write ./srcNotes
biome checkis the recommended all-in-one command for local development--writewithout--unsafeapplies only safe fixes that do not change semantics--only=<rule>and--skip=<rule>narrow which lint rules run (e.g.,--only=correctness/noUnusedVariables)- In CI use
biome ciinstead — it is read-only and exits non-zero on any finding
Getting Started
Install Biome and initialize configuration in a new project.
# Install as dev dependency (pinned version recommended)
npm install -D -E @biomejs/biome
# Generate biome.json
npx @biomejs/biome initGenerated biome.json:
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"formatter": { "enabled": true },
"linter": {
"enabled": true,
"rules": { "recommended": true }
}
}Notes
-Eflag pins the exact version to avoid unexpected upgradesbiome initcreatesbiome.jsonin the current directory"recommended": trueenables the recommended rule set out of the box- Run
biome check --write .to format, lint, and sort imports in one pass
Git Hooks
Run Biome automatically on commit using Lefthook or Husky + lint-staged.
Lefthook
lefthook.yml:
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}lefthook installHusky + lint-staged
npm install -D husky lint-staged
npx husky init.husky/pre-commit:
lint-stagedpackage.json:
{
"lint-staged": {
"*.{js,ts,jsx,tsx,json,jsonc}": [
"biome check --write --files-ignore-unknown=true --no-errors-on-unmatched"
]
}
}Notes
--no-errors-on-unmatchedsuppresses errors when no files match the glob--files-ignore-unknown=truesilently skips file types Biome does not support- Lefthook passes only staged files via
{staged_files}; no stash juggling needed - For staged-only checks without lint-staged, use
biome check --stageddirectly in the hook script
Migrate from ESLint and Prettier
Replace ESLint and Prettier with Biome using the built-in migration commands.
# Migrate ESLint config (reads .eslintrc.* or eslint.config.*)
biome migrate eslint --write
# Include rules "inspired by" ESLint (broader coverage)
biome migrate eslint --write --include-inspired
# Migrate Prettier config (.prettierrc, prettier.config.js, etc.)
biome migrate prettier --writeEnable VCS integration first so Biome respects .gitignore during migration:
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}After migration, remove the old tools:
npm uninstall eslint prettier eslint-config-* @typescript-eslint/*Notes
- Both legacy (
.eslintrc.*) and flat (eslint.config.*) ESLint formats are supported - Biome defaults differ from Prettier: tab indent vs. space, double quotes vs. configurable
- JSON5, TOML, and YAML Prettier config formats are not supported — convert to JSON first
- Full behavioral parity is not guaranteed; review and adjust
biome.jsonafter migration
Monorepo Setup
Share a root biome.json across packages using extends.
Root biome.json (project root):
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"formatter": { "enabled": true, "indentStyle": "space" },
"linter": { "enabled": true, "rules": { "recommended": true } }
}Package-level biome.json (inherits root, adds overrides):
{
"root": false,
"extends": "//",
"javascript": {
"formatter": { "quoteStyle": "single" }
}
}Shared config via npm package:
{
"extends": ["@org/shared-configs/biome"]
}@org/shared-configs/package.json:
{
"exports": {
"./biome": "./biome.json"
}
}Notes
"root": falsetells Biome the file is not the project root; prevents search from stopping here"extends": "//"is the shorthand for the workspace rootbiome.json- Omitting
extendsmakes a package fully independent from the root config - Relative file paths (e.g.,
"extends": ["../../common.json"]) also work for local shared configs
samples
| Name | Description | Path |
|---|---|---|
| CI with GitHub Actions | Run Biome in read-only CI mode using the official GitHub Action. | ci-github-actions.md |
| Configuration | Configure formatter, linter, and per-language options in biome.json. | configuration.md |
| Format and Lint | Run formatter and linter individually or together with biome check. | format-and-lint.md |
| Getting Started | Install Biome and initialize configuration in a new project. | getting-started.md |
| Git Hooks | Run Biome automatically on commit using Lefthook or Husky + lint-staged. | git-hooks.md |
| Migrate from ESLint and Prettier | Replace ESLint and Prettier with Biome using the built-in migration commands. | migrate-from-eslint-prettier.md |
| Monorepo Setup | Share a root biome.json across packages using extends. | monorepo-setup.md |
| Suppressions | Disable Biome diagnostics for a single line, a range, or an entire file. | suppressions.md |
| VCS Integration | Process only changed or staged files using Biome's built-in Git integration. | vcs-integration.md |
Suppressions
Disable Biome diagnostics for a single line, a range, or an entire file.
// Inline: suppress next line only
// biome-ignore lint/suspicious/noDebugger: temporary debugging
debugger;
// File-level: suppress throughout the file (must be at top of file)
// biome-ignore-all lint/suspicious/noDebugger: test file
// Range: suppress a block of lines
// biome-ignore-start lint/suspicious/noDoubleEquals: legacy code
a == b;
c == d;
// biome-ignore-end lint/suspicious/noDoubleEquals: legacy code
// Suppress formatter for a single statement
// biome-ignore format: hand-formatted table
const matrix = [[1,0,0],[0,1,0],[0,0,1]];
// Suppress an entire category
// biome-ignore lint: third-party code
eval(code);Notes
- Syntax:
// biome-ignore <category>[/<group>[/<rule>]]: <reason>— reason is required biome-ignore-allplaced outside the file top triggers asuppression/unuseddiagnostic- Range suppressions can be nested; each
biome-ignore-startmust have a matchingbiome-ignore-end - Categories:
lint,assist,format,syntax
VCS Integration
Process only changed or staged files using Biome's built-in Git integration.
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
}
}# Check only files changed from the default branch (main)
biome check --changed
# Check only files changed from a specific branch
biome check --since=develop
# Check only staged files (pre-commit use)
biome check --stagedNotes
vcs.useIgnoreFile: truemakes Biome respect.gitignoreand.ignore--changedrequiresvcs.defaultBranchto be set inbiome.json--stagedis designed for pre-commit hooks and cannot be used in CI- Combine
--changedwithbiome ciin CI pipelines to check only the PR diff
ci
CI 環境でのコード品質検証コマンド。biome ci はファイルへの書き込みを行わない読み取り専用モードで動作する。
CI 基本チェック
biome ci .フォーマット・リント・インポート整理をまとめて実行し、問題があればエラーで終了する。
GitHub Actions 向け
biome ci --reporter=github .GitHub Actions のアノテーション形式で診断を出力する。
GitLab CI 向け
biome ci --reporter=gitlab --colors=off > /tmp/code-quality.json警告をエラーとして扱う
biome ci --error-on-warnings .変更ファイルのみ CI チェック
biome ci --changedデフォルトブランチとの差分ファイルのみを対象とする。
スレッド数を指定して実行
biome ci --threads=4 .特定ルールのみ実行
biome ci --only=lint/suspicious .特定ルールをスキップ
biome ci --skip=lint/style .JSON 形式で出力
biome ci --reporter=json .JUnit 形式で出力
biome ci --reporter=junit .SARIF 形式で出力
biome ci --reporter=sarif .git hook(pre-commit)でステージング済みファイルをチェック
npx @biomejs/biome check --staged --files-ignore-unknown=true --no-errors-on-unmatchedpre-commit hook スクリプト内での使用例。
git hook(pre-commit)でフォーマット + 修正後に再ステージング
npx @biomejs/biome check --write --staged --files-ignore-unknown=true --no-errors-on-unmatched
git update-index --againcli
Biome CLI のコアコマンド一覧。フォーマット・リント・チェックの実行に使用する。
バージョン確認
biome --versionフォーマットの実行(ドライラン)
biome format .変更はファイルに書き込まれない。
フォーマットの実行(書き込み)
biome format --write .警告: ファイルを上書きする。VCS(git 等)で管理されていない変更は復元できない。
フォーマットの実行(特定ファイル)
biome format --write src/index.ts src/app.tsリントの実行
biome lint .リントの実行(安全な自動修正)
biome lint --write .リントの実行(unsafe 修正を含む)
biome lint --write --unsafe .警告: unsafe 修正はコードの挙動を変える可能性がある。
リント違反をコメントで抑制
biome lint --suppress .違反箇所に抑制コメントを挿入する。
リント違反の抑制(理由付き)
biome lint --suppress --reason "legacy code" .チェックの実行(フォーマット + リント + インポート整理)
biome check .チェックの実行(安全な自動修正)
biome check --write .チェックの実行(unsafe 修正を含む)
biome check --write --unsafe .警告: unsafe 修正はコードの挙動を変える可能性がある。
特定ルール・ドメインのみ実行
biome check --only=lint/suspicious .特定ルール・ドメインをスキップ
biome check --skip=lint/style .ステージング済みファイルのみチェック
biome check --staged変更ファイルのみチェック
biome check --changedデフォルトブランチ比較で変更されたファイルのみを対象とする。VCS 統合が有効である必要がある。
特定ブランチとの差分でチェック
biome check --changed --since=nextGrit パターン検索(実験的機能)
biome search '<pattern>' .ログのクリーンアップ
biome cleanデーモンが出力したログを削除する。
docker
Docker を使った Biome の実行コマンド集。ローカルインストールなしで利用できる。
フォーマットの実行(ドライラン)
docker run -v $(pwd):/code ghcr.io/biomejs/biome formatフォーマットの実行(書き込み)
docker run -v $(pwd):/code ghcr.io/biomejs/biome format --write警告: カレントディレクトリのファイルをコンテナ内から上書きする。
リントの実行
docker run -v $(pwd):/code ghcr.io/biomejs/biome lintリントの実行(安全な自動修正)
docker run -v $(pwd):/code ghcr.io/biomejs/biome lint --write警告: カレントディレクトリのファイルをコンテナ内から上書きする。
install
Biome をプロジェクトまたはシステムにインストールするコマンド集。
npm でのインストール
npm install -D -E @biomejs/biome-E フラグでバージョンを固定することを推奨。
pnpm でのインストール
pnpm add -D -E @biomejs/biomeyarn でのインストール
yarn add -D -E @biomejs/biomebun でのインストール
bun add -D -E @biomejs/biomedeno でのインストール
deno add -D npm:@biomejs/biomeHomebrew でのインストール(macOS / Linux)
brew install biomewinget でのインストール(Windows)
winget install biomejs.biomeArch Linux でのインストール
pacman -S biomeバイナリを直接ダウンロード(macOS ARM64)
curl -L https://github.com/biomejs/biome/releases/download/@biomejs/biome@2.4.16/biome-darwin-arm64 -o biome
chmod +x biomeバイナリを直接ダウンロード(Linux x86_64)
curl -L https://github.com/biomejs/biome/releases/download/@biomejs/biome@2.4.16/biome-linux-x64 -o biome
chmod +x biomeバイナリを直接ダウンロード(Windows x86_64、PowerShell)
Invoke-WebRequest -Uri "https://github.com/biomejs/biome/releases/download/@biomejs/biome@2.4.16/biome-win32-x64.exe" -OutFile "biome.exe"migrate
既存の ESLint・Prettier 設定を Biome 設定へ移行するコマンド集。
ESLint から移行
biome migrate eslint --write警告: biome.json を上書きする。実行前にバックアップまたは VCS でコミットしておくこと。ESLint の設定を読み取り、対応する Biome ルールへ変換する。
ESLint から移行(ESLint に着想を得たルールも含める)
biome migrate eslint --write --include-inspiredPrettier から移行
biome migrate prettier --write警告: biome.json を上書きする。実行前にバックアップまたは VCS でコミットしておくこと。Prettier の設定を読み取り、Biome のフォーマッター設定へ変換する。
ESLint + Prettier を一括移行
biome migrate eslint --write
biome migrate prettier --writenpm 経由で ESLint から移行
npx @biomejs/biome migrate eslint --writenpm 経由で Prettier から移行
npx @biomejs/biome migrate prettier --writepnpm 経由で ESLint から移行
pnpx @biomejs/biome migrate eslint --writepnpm 経由で Prettier から移行
pnpx @biomejs/biome migrate prettier --writebun 経由で ESLint から移行
bunx --bun @biomejs/biome migrate eslint --writedeno 経由で ESLint から移行
deno run -A npm:@biomejs/biome migrate eslint --writescripts
| Name | Description | Path |
|---|---|---|
| cli | Biome CLI のコアコマンド一覧。フォーマット・リント・チェックの実行に使用する。 | cli.md |
| ci | CI 環境でのコード品質検証コマンド。biome ci はファイルへの書き込みを行わない読み取り専用モードで動作する。 | ci.md |
| docker | Docker を使った Biome の実行コマンド集。ローカルインストールなしで利用できる。 | docker.md |
| install | Biome をプロジェクトまたはシステムにインストールするコマンド集。 | install.md |
| migrate | 既存の ESLint・Prettier 設定を Biome 設定へ移行するコマンド集。 | migrate.md |
| setup | プロジェクトの初期設定と設定ファイル生成のコマンド集。 | setup.md |
setup
プロジェクトの初期設定と設定ファイル生成のコマンド集。
設定ファイルの初期化(npm)
npx @biomejs/biome initbiome.json を生成する。
設定ファイルの初期化(JSONC 形式)
npx @biomejs/biome init --jsoncbiome.jsonc を生成する。
設定ファイルの初期化(pnpm)
pnpx @biomejs/biome init設定ファイルの初期化(yarn)
yarn exec biome -- init設定ファイルの初期化(bun)
bunx --bun @biomejs/biome init設定ファイルの初期化(deno)
deno run -A npm:@biomejs/biome initデーモンサーバーの起動
biome startLSP やエディター統合のためのデーモンを起動する。
デーモンサーバーの停止
biome stopデバッグ情報の表示
biome rage診断用の情報を表示する。デーモンログ・フォーマッター設定・リンター設定を確認できる。
ルール・概念の説明表示
biome explain <name>CLI の各種側面についてのドキュメントを表示する。