Skip to content

biomejs/biome-intellij

Repository files navigation

Biome - IntelliJ Plugin

IntelliJ IDEA Ultimate Version WebStorm Version AppCode Version PhpStorm Version RubyMine Version

Biome is a powerful tool designed to enhance your development experience. This plugin integrates seamlessly with many JetBrains IDE's to provide the following capabilities.

  • 💡 See lints while you type
  • 👨‍💻 Apply code fixes
  • 🚧 Reformat your code
  • 💾 Automatically applying code fixes on save

Installation

To install the Biome IntelliJ plugin, head over to the official plugin page or follow these steps:

From JetBrains IDEs

  1. Open IntelliJ IDEA.
  2. Go to Settings/Preferences.
  3. Select Plugins from the left-hand menu.
  4. Click on the Marketplace tab.
  5. Search for "Biome" and click Install.
  6. Restart the IDE to activate the plugin.

From disk

  1. Download the plugin .zip from the releases tab.
  2. Press ⌘Cmd + , to open the IDE settings and then select Plugins.
  3. On the Plugins page, click the Settings button and then click Install Plugin from Disk….

Getting Started

Biome Resolution

The plugin tries to use Biome from your project’s local dependencies (node_modules/.bin/biome). We recommend adding Biome as a project dependency to ensure that NPM scripts and the extension use the same Biome version.

You can also explicitly specify the biome binary the extension should use by configuring the Biome CLI Path in Settings->Language & Frameworks->Biome Settings.

Biome Config resolution

In Automatic Biome configuration mode, the plugin will look for a biome configuration file upwards from the current file. If it doesn't find one, it will stop LSP server. There are several reasons to behave like this:

  1. In IDEA with multiple projects in one code base it sound reasonable to disable LSP server if there is no biome configuration file in the project.
  2. In multi-root workspace, we should run biome from proper working directory, so that include and exclude paths are resolved correctly.
  3. As currently LSP server proxy doesn't provide option to work with multiple configs, we should provide path to the biome configuration file and restart LSP server once active file is changed.

Plugin settings

Biome CLI Path

This setting overrides the Biome binary used by the plugin.

Supported IDEs

This plugin is currently supported in the following IDEs:

  • IntelliJ IDEA Ultimate Version

  • WebStorm Version

  • AppCode Version

  • PhpStorm Version

  • RubyMine Version

Usage

Biome CLI comes with many commands and options, so you can use only what you need.

Apply code fixes by either hovering over the relevant section and selecting the suggested fix, pressing +(Option+Enter) or Alt+Enter.

To reformat your code, use the keyboard shortcut ⌥⇧++L or Ctrl+Alt+L. Alternatively, you can configure your IDE to format code automatically on save for a seamless coding experience.