Adapter for Biome for use as a formatting plugin in dprint.
Then in your project's directory with a dprint.json file, run:
dprint add biomeNote: You do not need Biome installed globally as dprint will run Biome from the .wasm file in a sandboxed environment.
To add configuration, specify a "biome" key in your dprint.json:
For an overview of the config, see https://dprint.dev/plugins/biome/config/
Each language has a <language>.enabled option that decides if the plugin formats the files of that language:
{
"biome": {
"css.enabled": true,
"json.enabled": false,
"jsonc.enabled": false,
},
}| Option | Files | Default |
|---|---|---|
javascript.enabled |
.js, .jsx, .cjs, .mjs |
true |
typescript.enabled |
.ts, .tsx, .cts, .mts |
true |
json.enabled |
.json |
true |
jsonc.enabled |
.jsonc |
true |
css.enabled |
.css |
false |
graphql.enabled |
.graphql |
false |
A disabled language's files are no longer matched by this plugin, so dprint formats them with the next plugin that matches them, if any.
The other language options are not split the same way: the javascript.* options also apply to TypeScript and the json.* options also apply to JSONC.
Note: The plugin does not understand Biome's configuration file because it runs sandboxed in a Wasm runtime—it has no access to the file system in order to read Biome's config.
- JS Formatter - Browser/Deno and Node
- npm package
This repo automatically upgrades to the latest version of Biome once a day. You can check which version of Biome is being used by looking at the tag property in the biome_js_formatter entry in the Cargo.toml file in this repo:
https://github.com/dprint/dprint-plugin-biome/blob/main/Cargo.toml
At the moment, the version of this plugin does not reflect the version of Biome. This is just in case there are any small bug fixes that need to be made as this plugin is quite new. After a while I'll try to match the versions.
{ "biome": { "indentStyle": "space", "lineWidth": 100, "indentWidth": 4, }, "plugins": [ // ...etc... ], }