コンテンツにスキップ

Set up your editor

このコンテンツはまだ日本語訳がありません。

Biome comes with a language server, so editor extensions give you the same diagnostics, formatting, and assist actions as the CLI while you type or save your code.

The Biome team maintains the extensions for VS Code, Zed, and IntelliJ. Helix connects to Biome’s language server directly, and extensions for other editors are maintained by the community.

VS Code is a code editor built by Microsoft. Its engine also powers other editors such as VSCodium and Cursor.

Install the Biome extension from the Visual Studio Marketplace, or install it from your editor:

  1. Open the Extensions view (View or Ctrl/⌘+⇧+X).
  2. Search for Biome.
  3. Select Install.

VSCodium, Cursor, and other derivatives install the extension from the Open VSX registry instead.

To make Biome the default formatter, open a supported file and:

  1. Open the Command Palette (View or Ctrl/⌘+⇧+P).
  2. Select Format Document With…
  3. Select Configure Default Formatter.
  4. Select Biome.

Then run Format Document to format a whole file, or Format Selection to format the selected code.

To format files when you save them, set VS Code’s editor.formatOnSave setting to true:

.vscode/settings.json
{
"editor.formatOnSave": true
}

To apply fixes and sort imports when you save a file, add Biome’s code actions to VS Code’s editor.codeActionsOnSave setting:

.vscode/settings.json
{
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}

source.fixAll.biome applies safe fixes, and source.organizeImports.biome sorts imports. You can enable either one on its own.

To apply unsafe fixes on save, make the code fix of the rule safe. To apply a fix manually, select the diagnostic and click Quick Fix.

For every setting of the extension, see the VS Code extension reference.

Zed is a code editor built for speed and collaboration.

To install the Biome extension:

  1. Open the Command Palette (View or Ctrl/⌘+⇧+P).
  2. Select zed: extensions.
  3. Search for Biome.
  4. Select Install.

To format files with Biome, set it as the formatter for each language it supports:

.zed/settings.json
{
"languages": {
"Astro": { "formatter": { "language_server": { "name": "biome" } } },
"CSS": { "formatter": { "language_server": { "name": "biome" } } },
"GraphQL": { "formatter": { "language_server": { "name": "biome" } } },
"HTML": { "formatter": { "language_server": { "name": "biome" } } },
"JSON": { "formatter": { "language_server": { "name": "biome" } } },
"JSONC": { "formatter": { "language_server": { "name": "biome" } } },
"JSX": { "formatter": { "language_server": { "name": "biome" } } },
"JavaScript": { "formatter": { "language_server": { "name": "biome" } } },
"Svelte": { "formatter": { "language_server": { "name": "biome" } } },
"TSX": { "formatter": { "language_server": { "name": "biome" } } },
"TypeScript": { "formatter": { "language_server": { "name": "biome" } } },
"Vue.js": { "formatter": { "language_server": { "name": "biome" } } },
}
}

Then run editor: format from the Command Palette to format a file.

Zed formats on save only for some languages by default, such as Astro and GraphQL. To format every file when you save it, set Zed’s format_on_save setting to "on":

.zed/settings.json
{
"format_on_save": "on"
}

To apply fixes and sort imports when you save a file, add Biome’s code actions to code_actions_on_format. Zed runs them every time it formats a file, so they only run on save when format_on_save is on:

.zed/settings.json
{
"languages": {
"JavaScript": {
"formatter": { "language_server": { "name": "biome" } },
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
}
},
"TypeScript": {
"formatter": { "language_server": { "name": "biome" } },
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
}
},
"TSX": {
"formatter": { "language_server": { "name": "biome" } },
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
}
}
}
}

source.fixAll.biome applies safe fixes, and source.organizeImports.biome sorts imports. You can enable either one on its own.

To apply unsafe fixes on save, make the code fix of the rule safe.

For every setting of the extension, see the Zed extension reference.

IntelliJ IDEA is an IDE built by JetBrains. It shares its platform with other JetBrains IDEs such as WebStorm, and the Biome plugin works in all of them.

Install the Biome plugin from the JetBrains Marketplace, or install it from your IDE:

  1. Go to Settings.
  2. Select Plugins from the menu on the left.
  3. Select the Marketplace tab.
  4. Search for Biome and select Install.
  5. Restart the IDE to activate the plugin.

To install the plugin from disk instead:

  1. Download the plugin .zip from the Versions tab of the plugin page.
  2. Open the IDE settings, then select Plugins.
  3. Select the settings button, then Install Plugin from Disk…

The plugin’s options are on the Biome page of the IDE settings. To find it, search for Biome in the settings.

On the Biome settings page, select Enable LSP-based code formatting. The Reformat Code action (Ctrl+Alt+L, or ⌥+⇧+⌘+L on macOS) then formats files with Biome.

On the Biome settings page, select Run format on save.

On the Biome settings page, select Run safe fixes on save to apply safe fixes, and Sort import on save to sort imports. You can enable either one on its own.

You can also turn these options on from Tools > Actions on Save, where they appear as Run Biome format, Run Biome apply safe fixes, and Run Biome sort import.

To apply unsafe fixes on save, make the code fix of the rule safe. To apply a fix manually, place the cursor on the diagnostic and press Alt+Enter (⌥+⏎ on macOS).

Helix does not need an extension. It connects to Biome through the biome lsp-proxy command, which acts as a language server over standard input and output.

In your languages.toml file, define Biome as a language server, then add it to each language you want it to handle. Disable formatting in the other language servers of that language, so that only Biome formats it:

languages.toml
[language-server.biome]
command = "biome"
args = ["lsp-proxy"]
[[language]]
name = "javascript"
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "biome" ]
[[language]]
name = "typescript"
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "biome" ]

Then run :format to format a file.

To use Biome with another language, such as JSON or CSS, add a [[language]] block for it. See the languages supported by Biome and the language identifiers defined by the Language Server Protocol.

To format files when you save them, set auto-format to true for each language:

languages.toml
[[language]]
name = "typescript"
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "biome" ]
auto-format = true

Helix has no setting to run code actions on save. To apply a fix or sort imports, press Space a to open the code actions and select the Biome action.

To make Helix apply project-specific settings, add Biome’s configuration files to the roots field. Helix then detects the project root from the presence of those files:

languages.toml
[[language]]
name = "typescript"
roots = ["biome.json", "biome.jsonc", "package.json"]
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "biome" ]

You can also pass an inline configuration to Biome under [language-server.biome.config.biome.inlineConfig].

These extensions are maintained by the community: