はじめる
Biomeはプロジェクトの開発依存としてインストールするのが最適ですが、Node.jsを必要としないスタンドアロン実行形式としても利用可能です。
npm i -D -E @biomejs/biomepnpm add -D -E @biomejs/biomebun add -D -E @biomejs/biomedeno add -D npm:@biomejs/biomeyarn add -D -E @biomejs/biomeBiomeは設定なしでも動作しますが、プロジェクトのニーズに合わせていくつかの設定を調整したい場合は、次のコマンドを実行して biome.json 設定ファイルを生成できます。
npx @biomejs/biome initpnpx @biomejs/biome initbunx --bun @biomejs/biome initdeno run -A npm:@biomejs/biome inityarn exec biome initプロジェクトでBiomeを使用する方法の概要を説明します。
コマンドラインインターフェース
Section titled “コマンドラインインターフェース”Biomeは、コードのフォーマット、リント、チェックを行うためのコマンドラインインターフェースを提供します。
# すべてのファイルをフォーマットnpx @biomejs/biome format --write
# 特定のファイルをフォーマットnpx @biomejs/biome format --write <files>
# すべてのファイルをリントし、安全な修正を適用npx @biomejs/biome lint --write
# 特定のファイルをリントし、安全な修正を適用npx @biomejs/biome lint --write <files>
# すべてのファイルをフォーマット、リント、インポート整理npx @biomejs/biome check --write
# 特定のファイルをフォーマット、リント、インポート整理npx @biomejs/biome check --write <files># すべてのファイルをフォーマットpnpm exec biome format --write
# 特定のファイルをフォーマットpnpm exec biome format --write <files>
# すべてのファイルをリントし、安全な修正を適用pnpm exec biome lint --write
# 特定のファイルをリントし、安全な修正を適用pnpm exec biome lint --write <files>
# すべてのファイルをフォーマット、リント、インポート整理pnpm exec biome check --write
# 特定のファイルをフォーマット、リント、インポート整理pnpm exec biome check --write <files># すべてのファイルをフォーマットbunx biome format --write
# 特定のファイルをフォーマットbunx biome format --write <files>
# すべてのファイルをリントし、安全な修正を適用bunx biome lint --write
# 特定のファイルをリントし、安全な修正を適用bunx biome lint --write <files>
# すべてのファイルをフォーマット、リント、インポート整理bunx biome check --write
# 特定のファイルをフォーマット、リント、インポート整理bunx biome check --write <files># 特定のファイルをフォーマットdeno run -A npm:@biomejs/biome format --write <files>
# すべてのファイルをフォーマットdeno run -A npm:@biomejs/biome format --write
# すべてのファイルをリントし、安全な修正を適用deno run -A npm:@biomejs/biome lint --write
# 特定のファイルをリントし、安全な修正を適用deno run -A npm:@biomejs/biome lint --write <files>
# すべてのファイルをフォーマット、リント、インポート整理deno run -A npm:@biomejs/biome check --write
# 特定のファイルをフォーマット、リント、インポート整理deno run -A npm:@biomejs/biome check --write <files># すべてのファイルをフォーマットyarn exec biome format --write
# 特定のファイルをフォーマットyarn exec biome format --write <files>
# すべてのファイルをリントし、安全な修正を適用yarn exec biome lint --write
# 特定のファイルをリントし、安全な修正を適用yarn exec biome lint --write <files>
# すべてのファイルをフォーマット、リント、インポート整理yarn exec biome check --write
# 特定のファイルをフォーマット、リント、インポート整理yarn exec biome check --write <files>エディタ統合
Section titled “エディタ統合”Biomeはお気に入りのエディタでファーストパーティの拡張機能として利用可能です。
Vim、Neovim、Sublime Textなどの他のエディタ向けのコミュニティ拡張機能もあります。
継続的インテグレーション
Section titled “継続的インテグレーション”チーム全体でコード品質と一貫性を保つために、CIパイプラインの一部として biome ci を実行します。これは biome check コマンドと同様に動作しますが、CI環境向けに最適化されています。
その他の例については、継続的インテグレーションのレシピをご覧ください。
次のステップ
Section titled “次のステップ”成功です!これでBiomeを使う準備が整いました。🥳
- ESLintとPrettierから移行する
- Biomeの設定方法について詳しく知る
- フォーマッタの使い方と設定方法について詳しく知る
- リンタの使い方と設定方法について詳しく知る
- CLIコマンドとオプションを使いこなす
- 設定オプションを使いこなす
- Discordのコミュニティに参加する
Copyright (c) 2023-present Biome Developers and Contributors.