How Biome works
Configuration
The configuration file is considered optional, Biome has good defaults. Use the configuration file to change those defaults.
The Biome configuration file is named biome.json
and should be placed in the root directory of your project. The root
directory is usually the directory containing your project’s package.json
.
This configuration file enables the formatter and sets the preferred indent style and width. The linter is disabled:
{ "formatter": { "enabled": true, "indentStyle": "tab", "lineWidth": 120 }, "linter": { "enabled": false }}
Default configuration
When you run biome init
, the default configuration emitted is the following:
{ "organizeImports": { "enabled": true }, "linter": { "enabled": true, "rules": { "recommended": true } }}
Configuration file resolution
Biome uses auto discovery to find the nearest biome.json
file. It starts looking for biome.json
in the current
working directory, and then it starts looking in the parent directories until:
- it finds a
biome.json
file; - it applies Biome’s defaults if no
biome.json
is found;
Here’s an example:
└── app ├── backend │ ├── package.json │ └── biome.json └── frontend ├── legacy │ └── package.json ├── new │ └── package.json └── biome.json
- biome commands that run in
app/backend/package.json
will use the configuration fileapp/backend/biome.json
; - biome commands that run in
app/frontend/legacy/package.json
andapp/frontend/new/package.json
will use the configuration fileapp/frontend/biome.json
;
Known Files
The following files are currently ignored by Biome. This means that no diagnostics will be ever emitted by Biome for those files.
package.json
package-lock.json
npm-shrinkwrap.json
yarn.lock
composer.json
composer.lock
typescript.json
tsconfig.json
jsconfig.json
deno.json
deno.jsonc
The following files are parsed as JSON
files with the options json.parser.allowComments
and json.parser.allowTrailingCommas
set to true
. This is because editor tools like VSCode treat them like this.
tslint.json
babel.config.json
.babelrc.json
.ember-cli
typedoc.json
.eslintrc
.eslintrc.json
.jsfmtrc
.jshintrc
.swcrc
.hintrc
.babelrc