mcpField
B
biome-tooling

biome-tooling

github.com/laurigates開発5941 回インストール1 日前に更新
リポジトリ

biome-tooling について

biome-toolingは、JavaScriptやTypeScriptなどのWeb言語プロジェクトでBiomeを使うためのスキルです。設定、フォーマット、Lint、インポート整理、ESLintやPrettierからの移行を扱います。

主な機能

  1. 01フォーマット、Lint、インポート整理
  2. 02JavaScript、TypeScript、JSX、TSX、JSON、CSSに対応
  3. 03ゼロコンフィグでの利用とプロジェクト設定
  4. 04CIと診断出力のコマンド
  5. 05ESLintとPrettierからの移行ガイド

活用シーン

  1. 01新しいJS/TSプロジェクトのチェック設定
  2. 02CIでのフォーマットとLint実行
  3. 03ESLintとPrettierの設定から移行

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/laurigates/claude-plugins --skill biome-tooling

インストール後、Claude Code で/biome-toolingを入力して読み込まれたか確認します。

同梱ファイルREFERENCE.md

詳細

Biome ツールチェーン

Biome は、JavaScript、TypeScript、および関連する Web 言語向けの、モダンで高性能なツールチェーンです。フォーマット、リンティング、インポートの整理を単一のツールに統合し、ESLint/Prettier より15〜20 倍高速です。

このスキルを使うタイミング

このスキルを使う場合...別の方法を使う場合...
新しい JS/TS プロジェクトを始める特定の ESLint プラグイン(React hooks、a11y)が必要
設定不要のフォーマット/リンティングを求めている複雑なカスタム ESLint ルールがある
高速な CI/CD パイプラインが必要フレームワーク固有のルール(Next.js、Nuxt)が必要
ESLint+Prettier から移行するESLint の大規模なカスタマイズが施されたレガシーコードベース

ハイブリッド方式:フォーマットには Biome を、専門的なリンティングには ESLint を使います。

主な機能

Biome とは?

  • オールインワンのツールチェーン:リンター+フォーマッター+インポートソーター
  • 設定不要:適切なデフォルト設定ですぐに使えます
  • 高速:Rust で記述され、ファイルを並列処理します
  • 互換性:Prettier のフォーマットと 97% 以上一致します
  • 対応言語:JavaScript、TypeScript、JSX、TSX、JSON、CSS

インストール

# Project-local (recommended)
bun add --dev @biomejs/biome

# Verify installation
bunx biome --version

# Initialize configuration
bunx biome init

基本的なコマンド

# Format files
bunx biome format --write src/

# Lint with fixes
bunx biome lint --write src/

# Check everything (format + lint + organize imports)
bunx biome check --write src/

# Check without changes (CI mode)
bunx biome check src/

# CI mode (exits with error on issues)
bunx biome ci src/

# Migrate from ESLint/Prettier
bunx biome migrate eslint --write
bunx biome migrate prettier --write

# Explain a rule
bunx biome explain noUnusedVariables

設定(biome.json)

最小限の設定(設定不要)

Biome は設定なしで動作します。基本的なカスタマイズを行う場合:

{
  "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true
  },
  "files": {
    "ignoreUnknown": false,
    "ignore": ["dist", "build", "node_modules", ".next", "coverage"]
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  },
  "organizeImports": {
    "enabled": true
  }
}

ルールのカテゴリー

カテゴリー目的ルールの例
recommended誰もが有効にすべき基本的なルール「recommended」とマークされたほとんどのルール
correctnessバグやロジックエラーを防ぐnoUnusedVariables、noUnreachable
suspicious誤りの可能性があるコードを検出するnoExplicitAny、noDoubleEquals
style一貫したスタイルを適用するuseConst、noVar
complexityコードの複雑さを軽減するnoForEach、useFlatMap
performanceパフォーマンスを最適化するnoAccumulatingSpread
a11yアクセシビリティのベストプラクティスnoSvgWithoutTitle、useAltText
securityセキュリティの脆弱性noDangerouslySetInnerHtml

よくあるパターン

ファイルとディレクトリを無視する

biome.json で指定:

{
  "files": {
    "ignore": [
      "dist",
      "build",
      "node_modules",
      "**/*.config.js",
      "scripts/legacy/**"
    ]
  }
}

.gitignore で指定(自動):

{
  "vcs": {
    "enabled": true,
    "useIgnoreFile": true
  }
}

パフォーマンスの比較

ツール所要時間(1000 ファイル)備考
Biome0.5sRust、並列処理
ESLint8-10sNode.js、シングルスレッド
Prettier3-5sNode.js、フォーマットのみ
ESLint + Prettier11-15s順次実行

エージェント向けの最適化

コンテキストコマンド
クイックチェックbunx biome check src/
すべて修正bunx biome check --write src/
フォーマットのみbunx biome format --write src/
リンティングのみbunx biome lint --write src/
CI モードbunx biome ci src/
エラーのみbunx biome check --diagnostic-level=error src/
出力を制限bunx biome check --max-diagnostics=10 src/
GitHub レポーターbunx biome check --reporter=github src/
JSON 出力bunx biome check --reporter=json src/
ESLint から移行bunx biome migrate eslint --write
Prettier から移行bunx biome migrate prettier --write

クイックリファレンス

フラグ説明
--write修正/フォーマットを適用
--reporter=githubGitHub アノテーション形式
--reporter=jsonJSON 出力
--diagnostic-level=errorエラーのみ
--max-diagnostics=N出力数を制限
--verbose詳細な診断を表示
--no-errors-on-unmatched一致しないファイルを無視
ciCI モード(チェック+終了コード)

詳しい例、高度なパターン、ベストプラクティスについては、REFERENCE.md をご覧ください。

参考資料

コメント