Skip to content

biomejs/biome-zed

Repository files navigation

Shows the banner of Biome, with its logo and the phrase 'Biome - Toolchain of the web'.

CI main

Biome extension for Zed

This extension adds support for Biome in Zed.

Languages currently supported:

  • JavaScript
  • TypeScript
  • JSX
  • TSX
  • JSON
  • JSONC
  • Vue.js
  • Astro
  • Svelte
  • CSS

Installation

Requires Zed >= v0.131.0.

This extension is available in the extensions view inside the Zed editor. Open zed: extensions and search for Biome.

Configuration

By default, the biome.json file is required to be in the root of the workspace.

Otherwise, it can be configured through the lsp settings:

// settings.json
{
  "lsp": {
    "biome": {
      "settings": {
        "config_path": "<path>/biome.json"
      }
    }
  }
}

Formatting

Formatting does not work through the extension yet.

Instead, you can configure biome as an external formatter:

// settings.json
{
  "formatter": {
    "external": {
      "command": "./node_modules/@biomejs/biome/bin/biome",
      "arguments": ["format", "--write", "--stdin-file-path", "{buffer_path}"]
    }
  }
}

Project based configuration

If you'd like to exclude biome from running in every project,

  1. Disable the biome language server in user settings:
// settings.json
{
  "language_servers": [ "!biome", "..." ]
}
  1. And enable it in the projects local settings:
// <workspace>/.zed/settings.json
{
  "language_servers": [ "biome", "..." ]
}

The same can be configured on a per-lanugage bassis with the languages key.

Run code actions on format:

// settings.json
{
  "code_actions_on_format": {
    "source.fixAll.biome": true,
    "source.organizeImports.biome": true
  }
}