From 3a6efc8fbf30b2856602140204b8616d5b2ecc25 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Thu, 27 Nov 2025 08:57:24 +0000 Subject: [PATCH 1/4] feat: document inline config --- .../guides/editors/create-an-extension.mdx | 76 +++++++++++++++++++ src/content/docs/reference/zed.mdx | 36 +++++---- 2 files changed, 93 insertions(+), 19 deletions(-) diff --git a/src/content/docs/guides/editors/create-an-extension.mdx b/src/content/docs/guides/editors/create-an-extension.mdx index 0fc29f4d8..100a29c94 100644 --- a/src/content/docs/guides/editors/create-an-extension.mdx +++ b/src/content/docs/guides/editors/create-an-extension.mdx @@ -39,6 +39,82 @@ It's the editor's responsibility to locate the resolve the path of the binary an The binary name is `biome` or `biome.exe`, and it can be found in the root directory of the library, e.g.: `@biomejs/cli-darwin-arm64/biome`, `@biomejs/cli-win32-x64/biome.exe`. +### Extension settings + +The Biome Language Server exposes the following settings, which the extension can expose to users. + +:::note +The following settings are meant for **extension developers**, not for users. +An extension might decide to expose the settings to users with different names, or different formats. + +For example, the Zed extension maps the [`require_configuration`](#require-configuration) from the setting is called `require_config_file`, which is defined in a JSONC file. +::: + +#### `require_configuration` + +> Type: `boolean` +> Default: `false` + +Whether the Biome Language Server requires a configuration file. When set to `true`, it won't analyze any file. + +```json +{ + "require_configuration": true +} +``` + +#### `configuration_path` + +> Type: `string` +> Default: `null` + +A path to a custom configuration file. The path can be the folder where the `biome.json`/`biome.jsonc` is, or a path to a file. + +The path *should* be an absolute. The Biome Language Server read this option only when provided. + +```json +{ + "configuration_path": "/Users/nick/.configs/biome.json" +} +``` + +#### `inline_config` + +> Type: `object` +> Default: `null` + +An inline version of the Biome configuration. The options of this configuration will override the options coming from any `biome.json` file read from disk (or the defaults). + +For example, let's say your project enables the rule `noConsole` with `error` severity: + +```json title="biome.json" +{ + "linter": { + "rules": { + "suspicious": { + "noConsole": "error" + } + } + } +} +``` + +However, during local development, you want to disable this rule because it's useful and you don't want to see red squiggles. In your `inline_config`, you would write something like the following: + +```json +{ + "inline_config": { + "linter": { + "rules": { + "suspicious": { + "noConsole": "off" + } + } + } + } +} +``` + ### Use the daemon with the binary Using the binary via CLI is very efficient, although you won't be able to provide [logs](#daemon-logs) to your users. The CLI allows you to bootstrap a daemon and then use the CLI commands through the daemon itself. diff --git a/src/content/docs/reference/zed.mdx b/src/content/docs/reference/zed.mdx index 584e385bd..502dee554 100644 --- a/src/content/docs/reference/zed.mdx +++ b/src/content/docs/reference/zed.mdx @@ -35,8 +35,7 @@ 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: -```jsonc -// settings.json +```json5 title=".zed/settings.json" { "lsp": { "biome": { @@ -52,17 +51,21 @@ Otherwise, it can be configured through the lsp settings: To use the language server as a formatter, specify biome as your formatter in the settings: -```jsonc -// settings.json +```json5 title=".zed/settings.json" { "languages": { - "JavaScript": { "formatter": { "language_server": { "name": "biome" } } }, - "TypeScript": { "formatter": { "language_server": { "name": "biome" } } }, - "TSX": { "formatter": { "language_server": { "name": "biome" } } }, - "JSON": { "formatter": { "language_server": { "name": "biome" } } }, - "JSONC": { "formatter": { "language_server": { "name": "biome" } } }, + "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" } } }, } } ``` @@ -71,8 +74,7 @@ See [Language Support](/internals/language-support) for more information. ### Enable biome only when biome.json is present -```jsonc -// settings.json +```json5 title=".zed/settings.json" { "lsp": { "biome": { @@ -86,8 +88,7 @@ See [Language Support](/internals/language-support) for more information. ### Run code actions on format: -```jsonc -// settings.json +```json5 title=".zed/settings.json" { "languages": { "JavaScript": { @@ -107,9 +108,7 @@ See [Language Support](/internals/language-support) for more information. "TSX": { "formatter": { "language_server": { "name": "biome" } }, "code_actions_on_format": { - "source.fixAll.biome": true, - - + "source.fixAll.biome": true, "source.organizeImports.biome": true } } @@ -119,7 +118,7 @@ See [Language Support](/internals/language-support) for more information. If you want to apply [unsafe fixes](/linter/#unsafe-fixes) on save, you must make the [code fix of the rule safe](/linter/#configure-the-code-fix). -### Project based configuration +### Project-based configuration You can include these settings in Zed Project Settings (`.zed/settings.json`) at the root of your project folder or as Zed User Settings (`~/.config/zed/settings.json`) which will apply to all projects by default. @@ -127,8 +126,7 @@ You can include these settings in Zed Project Settings (`.zed/settings.json`) at You can exclude biome for a given language (e.g. GraphQL) on project with: -```jsonc -// settings.json +```json5 title=".zed/settings.json" { "languages": { "GraphQL": { From 8e64103a34c17015d6fde30fd0532289eaad05b9 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 1 Dec 2025 15:47:38 +0000 Subject: [PATCH 2/4] Apply suggestions from code review --- src/content/docs/guides/editors/create-an-extension.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/guides/editors/create-an-extension.mdx b/src/content/docs/guides/editors/create-an-extension.mdx index 100a29c94..618674cc3 100644 --- a/src/content/docs/guides/editors/create-an-extension.mdx +++ b/src/content/docs/guides/editors/create-an-extension.mdx @@ -47,7 +47,7 @@ The Biome Language Server exposes the following settings, which the extension ca The following settings are meant for **extension developers**, not for users. An extension might decide to expose the settings to users with different names, or different formats. -For example, the Zed extension maps the [`require_configuration`](#require-configuration) from the setting is called `require_config_file`, which is defined in a JSONC file. +For example, the Zed extension maps the [`require_configuration`](#require-configuration) setting from the setting `require_config_file`, which is defined in a JSONC file. ::: #### `require_configuration` @@ -74,7 +74,7 @@ The path *should* be an absolute. The Biome Language Server read this option onl ```json { - "configuration_path": "/Users/nick/.configs/biome.json" + "configuration_path": "./frontend/biome.json" } ``` From 51291e8c2b1a41eb096136420947d389430d7b06 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 1 Dec 2025 15:58:06 +0000 Subject: [PATCH 3/4] Apply suggestions from code review --- src/content/docs/guides/editors/create-an-extension.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/guides/editors/create-an-extension.mdx b/src/content/docs/guides/editors/create-an-extension.mdx index 618674cc3..9a51cac5a 100644 --- a/src/content/docs/guides/editors/create-an-extension.mdx +++ b/src/content/docs/guides/editors/create-an-extension.mdx @@ -55,7 +55,7 @@ For example, the Zed extension maps the [`require_configuration`](#require-confi > Type: `boolean` > Default: `false` -Whether the Biome Language Server requires a configuration file. When set to `true`, it won't analyze any file. +Whether the Biome Language Server requires a configuration file. When set to `true`, it won't analyze any file (exception for parsing) until there's a `biome.json` file in the root of the project. ```json { @@ -70,7 +70,7 @@ Whether the Biome Language Server requires a configuration file. When set to `tr A path to a custom configuration file. The path can be the folder where the `biome.json`/`biome.jsonc` is, or a path to a file. -The path *should* be an absolute. The Biome Language Server read this option only when provided. +The path can be relative or absolute. The Biome Language Server reads this option only when provided. Use this option when the configuration is *in a subfolder of your project*. ```json { From f6ec5795f8b8f9314c6f9de15c58a6d249d08715 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 2 Dec 2025 08:04:26 +0000 Subject: [PATCH 4/4] Update src/content/docs/guides/editors/create-an-extension.mdx Co-authored-by: Carson McManus --- src/content/docs/guides/editors/create-an-extension.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/guides/editors/create-an-extension.mdx b/src/content/docs/guides/editors/create-an-extension.mdx index 9a51cac5a..761a7191b 100644 --- a/src/content/docs/guides/editors/create-an-extension.mdx +++ b/src/content/docs/guides/editors/create-an-extension.mdx @@ -55,7 +55,7 @@ For example, the Zed extension maps the [`require_configuration`](#require-confi > Type: `boolean` > Default: `false` -Whether the Biome Language Server requires a configuration file. When set to `true`, it won't analyze any file (exception for parsing) until there's a `biome.json` file in the root of the project. +Whether the Biome Language Server requires a configuration file. When set to `true`, it won't analyze any file (except for parsing) until there's a `biome.json` file in the root of the project. ```json {