Skip to content

Configuration

Allows to pass a path to a JSON schema file.

We publish a JSON schema file for the biome.json.

You can specify a relative path to the schema of the @biomejs/biome npm package if @biomejs/biome is installed in the node_modules folder:

biome.json
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json"
}

If you have problems with resolving the physical file, you can use the one published in this site:

biome.json
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json"
}

A list of paths to other JSON files. Biome resolves and applies the options of the files contained in the extends list, and eventually applies the options contained in the biome.json file.

The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons.

Default: 1048576 (1024*1024, 1MB)

A list of Unix shell style patterns. Biome ignores files and folders that match these patterns.

biome.json
{
"files": {
"ignore": ["scripts/*.js"]
}
}

A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.

biome.json
{
"files": {
"include": ["scripts/*.js"]
}
}

Given the following example:

biome.json
{
"files": {
"include": ["scripts/**/*.js", "src/**/*.js"],
"ignore": ["scripts/**/*.js"]
}
}

Only the files that match the pattern src/**/*.js will be handled, while the files that match the pattern scripts/**/*.js will be ignored.

Biome won’t emit diagnostics if it encounters files that can’t handle.

biome.json
{
"files": {
"ignoreUnknown": true
}
}

Default: false

Set of properties to integrate Biome with a VCS (Version Control Software).

Whether Biome should integrate itself with the VCS client

Default: false

The kind of client.

Values:

  • "git"

Whether Biome should use the VCS ignore file. When true, Biome will ignore the files specified in the ignore file.

The folder where Biome should check for VCS files. By default, Biome will use the same folder where biome.json was found.

If Biome can’t find the configuration, it will attempt to use the current working directory. If no current working directory can’t be found, Biome won’t use the VCS integration, and a diagnostic will be emitted

The main branch of the project. Biome will use this branch when evaluating the changed files.

Enables Biome’s linter

Default: true

An array of Unix shell style patterns.

biome.json
{
"linter": {
"ignore": ["scripts/*.js"]
}
}

A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.

biome.json
{
"linter": {
"include": ["scripts/*.js"]
}
}

Given the following example:

biome.json
{
"linter": {
"include": ["scripts/**/*.js", "src/**/*.js"],
"ignore": ["scripts/**/*.js"]
}
}

Only the files that match the patter src/**/*.js will be linted, while the files that match the pattern scripts/**/*.js will be ignored.

Enables the recommended rules for all groups.

Default: true

Options that influence the rules of a single group. Biome supports the following groups:

  • accessibility: Rules focused on preventing accessibility problems.
  • complexity: Rules that focus on inspecting complex code that could be simplified.
  • correctness: Rules that detect code that is guaranteed to be incorrect or useless.
  • nursery: New rules that are still under development. Nursery rules require explicit opt-in via configuration on stable versions because they may still have bugs or performance problems. They are enabled by default on nightly builds, but as they are unstable their diagnostic severity may be set to either error or warning, depending on whether we intend for the rule to be recommended or not when it eventually gets stabilized. Nursery rules get promoted to other groups once they become stable or may be removed. Rules that belong to this group are not subject to semantic version.
  • performance: Rules catching ways your code could be written to run faster, or generally be more efficient.
  • security: Rules that detect potential security flaws.
  • style: Rules enforcing a consistent and idiomatic way of writing your code.
  • suspicious: Rules that detect code that is likely to be incorrect or useless.

Each group can accept, as a value, a string that represents the severity or an object where each rule can be configured.

When passing the severity, you can control the severity emitted by all the rules that belong to a group. For example, you can configure the a11y group to emit information diagnostics:

biome.json
{
"linter": {
"rules": {
"a11y": "info"
}
}
}

Here’s the accepted values:

  • "on": each rule that belongs to the group will emit a diagnostic with the default severity of the rule. Refer to the documentation of the rule, or use the explain command:
    Terminal window
    biome explain noDebugger
  • "off": none of the rules that belong to the group will emit any diagnostics.
  • "info": all rules that belong to the group will emit a diagnostic with information severity.
  • "warn": all rules that belong to the group will emit a diagnostic with warning severity.
  • "error": all rules that belong to the group will emit a diagnostic with error severity.

linter.rules.[group].recommended

Section titled linter.rules.[group].recommended

Enables the recommended rules for a single group.

Example:

biome.json
{
"linter": {
"enabled": true,
"rules": {
"nursery": {
"recommended": true
}
}
}
}

These options apply to all languages. There are additional language-specific formatting options below.

Enables Biome’s formatter

Default: true

An array of Unix shell style patterns.

biome.json
{
"formatter": {
"ignore": ["scripts/*.js"]
}
}

A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.

biome.json
{
"formatter": {
"include": ["scripts/*.js"]
}
}

Given the following example:

biome.json
{
"formatter": {
"include": ["scripts/**/*.js", "src/**/*.js"],
"ignore": ["scripts/**/*.js"]
}
}

Only the files that match the patter src/**/*.js will be formatted, while the files that match the pattern scripts/**/*.js will be ignored.

Allows to format a document that has syntax errors.

biome.json
{
"formatter": {
"formatWithErrors": true
}
}

Default: false

The style of the indentation. It can be "tab" or "space".

Default: "tab"

How big the indentation should be.

Default: 2

The type of line ending.

  • "lf", Line Feed only (\n), common on Linux and macOS as well as inside git repos;
  • "crlf", Carriage Return + Line Feed characters (\r\n), common on Windows;
  • "cr", Carriage Return character only (\r), used very rarely.

Default: "lf"

The amount of characters that can be written on a single line..

Default: 80

The attribute position style in HTMLish languages.

  • "auto", the attributes are automatically formatted, and they will collapse in multiple lines only when they hit certain criteria;
  • "multiline", the attributes will collapse in multiple lines if more then 1 attribute is used.

Default: "auto"

Choose whether spaces should be added between brackets and inner values.

Default: true

Whether to enforce collapsing object literals when possible.

  • "preserve", object literals are expanded if the first property has a leading newline.
  • "collapse", enforce object literals to collapse if possible (shorter than the max line width).

Default: "preserve"

Whether Biome should use the .editorconfig file to determine the formatting options. If true, the applicable options in the .editorconfig file will be used, but any configuration in the biome.json file will still take precedence.

When migrating from Prettier with biome migrate, this option is set to true to match the behavior of Prettier.

Default: false

Enables Biome’s sort imports.

Default: true

A list of Unix shell style patterns. Biome ignores files and folders that match these patterns.

biome.json
{
"organizeImports": {
"ignore": ["scripts/*.js"]
}
}

A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.

biome.json
{
"organizeImports": {
"include": ["scripts/*.js"]
}
}

Given the following example:

biome.json
{
"organizeImports": {
"include": ["scripts/**/*.js", "src/**/*.js"],
"ignore": ["scripts/**/*.js"]
}
}

Only the files that match the patter src/**/*.js will have their imports sorted, while the files that match the pattern scripts/**/*.js will be ignored.

These options apply only to JavaScript (and TypeScript) files.

javascript.parser.unsafeParameterDecoratorsEnabled

Section titled javascript.parser.unsafeParameterDecoratorsEnabled

Allows to support the unsafe/experimental parameter decorators.

biome.json
{
"javascript": {
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
}
}

Default: false

javascript.parser.jsxEverywhere

Section titled javascript.parser.jsxEverywhere

When set to true, allows to parse JSX syntax inside .js files. When set to false, Biome will raise diagnostics when it encounters JSX syntax inside .js files.

Default: true

biome.json
{
"javascript": {
"parser": {
"jsxEverywhere": false
}
}
}

javascript.formatter.quoteStyle

Section titled javascript.formatter.quoteStyle

The type of quote used when representing string literals. It can be "single" or "double".

Default: "double"

javascript.formatter.jsxQuoteStyle

Section titled javascript.formatter.jsxQuoteStyle

The type of quote used when representing jsx string literals. It can be "single" or "double".

Default: "double"

biome.json
{
"javascript": {
"formatter": {
"jsxQuoteStyle": "single"
}
}
}

javascript.formatter.quoteProperties

Section titled javascript.formatter.quoteProperties

When properties inside objects should be quoted. It can be "asNeeded" or "preserve".

Default: "asNeeded"

biome.json
{
"javascript": {
"formatter": {
"quoteProperties": "preserve"
}
}
}

javascript.formatter.trailingCommas

Section titled javascript.formatter.trailingCommas

Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Possible values:

  • "all", the trailing comma is always added;
  • "es5", the trailing comma is added only in places where it’s supported by older version of JavaScript;
  • "none", trailing commas are never added.

Default: "all"

javascript.formatter.semicolons

Section titled javascript.formatter.semicolons

It configures where the formatter prints semicolons:

  • "always", the semicolons is always added at the end of each statement;
  • "asNeeded", the semicolons are added only in places where it’s needed, to protect from ASI.

Default: "always"

Example:

biome.json
{
"javascript": {
"formatter": {
"semicolons": "asNeeded"
}
}
}

javascript.formatter.arrowParentheses

Section titled javascript.formatter.arrowParentheses

Whether to add non-necessary parentheses to arrow functions:

  • "always", the parentheses are always added;
  • "asNeeded", the parentheses are added only when they are needed.

Default: "always"

Enables Biome’s formatter for JavaScript (and its super languages) files.

Default: true

javascript.formatter.indentStyle

Section titled javascript.formatter.indentStyle

The style of the indentation for JavaScript (and its super languages) files. It can be "tab" or "space".

Default: "tab"

javascript.formatter.indentWidth

Section titled javascript.formatter.indentWidth

How big the indentation should be for JavaScript (and its super languages) files.

Default: 2

javascript.formatter.lineEnding

Section titled javascript.formatter.lineEnding

The type of line ending for JavaScript (and its super languages) files.

  • "lf", Line Feed only (\n), common on Linux and macOS as well as inside git repos;
  • "crlf", Carriage Return + Line Feed characters (\r\n), common on Windows;
  • "cr", Carriage Return character only (\r), used very rarely.

Default: "lf"

javascript.formatter.lineWidth

Section titled javascript.formatter.lineWidth

The amount of characters that can be written on a single line in JavaScript (and its super languages) files.

Default: 80

javascript.formatter.bracketSameLine

Section titled javascript.formatter.bracketSameLine

Choose whether the ending > of a multi-line JSX element should be on the last attribute line or not

Default: false

javascript.formatter.bracketSpacing

Section titled javascript.formatter.bracketSpacing

Choose whether spaces should be added between brackets and inner values.

Default: true

javascript.formatter.attributePosition

Section titled javascript.formatter.attributePosition

The attribute position style in jsx elements.

  • "auto", do not enforce single attribute per line.
  • "multiline", enforce single attribute per line.

Default: "auto"

javascript.formatter.objectWrap

Section titled javascript.formatter.objectWrap

Whether to enforce collapsing object literals when possible.

  • "preserve", object literals are expanded if the first property has a leading newline.
  • "collapse", enforce object literals to collapse if possible (shorter than the max line width).

Default: "preserve"

A list of global names that Biome should ignore (analyzer, linter, etc.)

biome.json
{
"javascript": {
"globals": ["$", "_", "externalVariable"]
}
}

Indicates the type of runtime or transformation used for interpreting JSX.

  • "transparent" — Indicates a modern or native JSX environment, that doesn’t require special handling by Biome.
  • "reactClassic" — Indicates a classic React environment that requires the React import. Corresponds to the react value for the jsx option in TypeScript’s tsconfig.json.
biome.json
{
"javascript": {
"jsxRuntime": "reactClassic"
}
}

For more information about the old vs. new JSX runtime, please see: https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html

Default: "transparent"

Enables Biome’s linter for JavaScript (and its super languages) files.

Default: true

biome.json
{
"javascript": {
"linter": {
"enabled": false
}
}
}

Enables Biome’s assist for JavaScript (and its super languages) files.

Default: true

biome.json
{
"javascript": {
"assist": {
"enabled": false
}
}
}

Options applied to the JSON files.

Enables the parsing of comments in JSON files.

biome.json
{
"json": {
"parser": {
"allowComments": true
}
}
}

json.parser.allowTrailingCommas

Section titled json.parser.allowTrailingCommas

Enables the parsing of trailing commas in JSON files.

biome.json
{
"json": {
"parser": {
"allowTrailingCommas": true
}
}
}

Enables Biome’s formatter for JSON (and its super languages) files.

Default: true

biome.json
{
"json": {
"formatter": {
"enabled": false
}
}
}

The style of the indentation for JSON (and its super languages) files. It can be "tab" or "space".

Default: "tab"

How big the indentation should be for JSON (and its super languages) files.

Default: 2

The type of line ending for JSON (and its super languages) files.

  • "lf", Line Feed only (\n), common on Linux and macOS as well as inside git repos;
  • "crlf", Carriage Return + Line Feed characters (\r\n), common on Windows;
  • "cr", Carriage Return character only (\r), used very rarely.

Default: "lf"

The amount of characters that can be written on a single line in JSON (and its super languages) files.

Default: 80

Print trailing commas wherever possible in multi-line comma-separated syntactic structures.

Allowed values:

  • "none": the trailing comma is removed;
  • "all": the trailing comma is kept and preferred.

Default: "none"

Choose whether spaces should be added between brackets and inner values.

Default: true

Whether to enforce collapsing object literals when possible.

  • "preserve", object literals are expanded if the first property has a leading newline.
  • "collapse", enforce object literals to collapse if possible (shorter than the max line width).

Default: "preserve"

Whether to expand arrays and objects literals on multiple lines.

  • "followSource": arrays and objects literals are formatted on multiple lines if they already were on multiple lines, or if they don’t fit on a single line.
  • "always": arrays and objects literals are formatted on multiple lines, regardless of length of the list.

When formatting package.json, Biome will use always unless configured otherwise.

Default: "followSource"

Enables Biome’s formatter for JSON (and its super languages) files.

Default: true

biome.json
{
"json": {
"linter": {
"enabled": false
}
}
}

Enables Biome’s assist for JSON (and its super languages) files.

Default: true

biome.json
{
"json": {
"assist": {
"enabled": false
}
}
}

Options applied to the CSS files.

Enables parsing of CSS modules

Default: false

Enables Biome’s formatter for CSS files.

Default: false

biome.json
{
"css": {
"formatter": {
"enabled": false
}
}
}

The style of the indentation for CSS files. It can be "tab" or "space".

Default: "tab"

How big the indentation should be for CSS files.

Default: 2

biome.json
{
"css": {
"formatter": {
"indentWidth": 2
}
}
}

The type of line ending for CSS files.

  • "lf", Line Feed only (\n), common on Linux and macOS as well as inside git repos;
  • "crlf", Carriage Return + Line Feed characters (\r\n), common on Windows;
  • "cr", Carriage Return character only (\r), used very rarely.

Default: "lf"

The amount of characters that can be written on a single line in CSS files.

Default: 80

The type of quote used when representing string literals. It can be "single" or "double".

Default: "double"

Enables Biome’s linter for CSS files.

Default: true

biome.json
{
"css": {
"linter": {
"enabled": false
}
}
}

Enables Biome’s assist for CSS files.

Default: true

biome.json
{
"css": {
"assist": {
"enabled": false
}
}
}

Options applied to the GraphQL files.

Enables Biome’s formatter for GraphQL files.

Default: false

The style of the indentation for GraphQL files. It can be "tab" or "space".

Default: "tab"

How big the indentation should be for GraphQL files.

Default: 2

The type of line ending for GraphQL files.

  • "lf", Line Feed only (\n), common on Linux and macOS as well as inside git repos;
  • "crlf", Carriage Return + Line Feed characters (\r\n), common on Windows;
  • "cr", Carriage Return character only (\r), used very rarely.

Default: "lf"

The amount of characters that can be written on a single line in GraphQL files.

Default: 80

The type of quote used when representing string literals. It can be "single" or "double".

Default: "double"

Enables Biome’s linter for GraphQL files.

Default: true

Enables Biome’s assist for GraphQL files.

Default: true

Options applied to the Grit files.

Enables Biome’s formatter for Grit files.

Default: false

The style of the indentation for Grit files. It can be "tab" or "space".

Default: "tab"

How big the indentation should be for Grit files.

Default: 2

The type of line ending for Grit files.

  • "lf", Line Feed only (\n), common on Linux and macOS as well as inside git repos;
  • "crlf", Carriage Return + Line Feed characters (\r\n), common on Windows;
  • "cr", Carriage Return character only (\r), used very rarely.

Default: "lf"

The amount of characters that can be written on a single line in Grit files.

Default: 80

The type of quote used when representing string literals. It can be "single" or "double".

Default: "double"

Enables Biome’s linter for Grit files.

Default: true

biome.json
{
"grit": {
"linter": {
"enabled": false
}
}
}

Enables Biome’s assist for Grit files.

Default: true

biome.json
{
"grit": {
"assist": {
"enabled": false
}
}
}

A list of patterns.

Use this configuration to change the behaviour of the tools for certain files.

When a file is matched against an override pattern, the configuration specified in that pattern will be override the top-level configuration.

The order of the patterns matter. If a file can match three patterns, only the first one is used.

A list of Unix shell style patterns. Biome will not apply the override to files that match the pattern.

biome.json
{
"overrides": [{
"ignore": ["scripts/*.js"]
}]
}

A list of Unix shell style patterns. Biome will apply the override only to files that match the pattern.

biome.json
{
"overrides": [{
"include": ["scripts/*.js"]
}]
}

It will include the options of top level formatter configuration, minus ignore and include.

For example, it’s possible to modify the formatter lineWidth, indentStyle for certain files that are included in the glob path generated/**:

biome.json
{
"formatter": {
"lineWidth": 100
},
"overrides": [
{
"include": ["generated/**"],
"formatter": {
"lineWidth": 160,
"indentStyle": "space"
}
}
]
}

It will include the options of top level linter configuration, minus ignore and include.

You can disable certain rules for certain glob paths, and disable the linter for other glob paths:

biome.json
{
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"overrides": [
{
"include": ["lib/**"],
"linter": {
"rules": {
"suspicious": {
"noDebugger": "off"
}
}
}
},
{
"include": ["shims/**"],
"linter": {
"enabled": false
}
}
]
}

It will include the options of top level organize imports, minus ignore and include.

It will include the options of top level javascript configuration.

You can change the formatting behaviour of JavaScript files in certain folders:

biome.json
{
"formatter": {
"lineWidth": 120
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"overrides": [
{
"include": ["lib/**"],
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
]
}

It will include the options of top level json configuration.

You can enable parsing features for certain JSON files:

biome.json
{
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"overrides": [
{
"include": [".vscode/**"],
"json": {
"parser": {
"allowComments": true,
"allowTrailingCommas": true
}
}
}
]
}