@canonical/biome-config
v0.17.1
Published
This is a [Biome](https://biomejs.dev/) configuration that provides a set of default configurations for Biome projects.
Maintainers
Keywords
Readme
@canonical/biome-config
This is a Biome configuration that provides a set of default configurations for Biome projects.
Install
- Install Biome:
bun add -d @biomejs/biome - Install configuration:
bun add -d @canonical/biome-config
Consume
Create biome.json in the root of your project and extend this configuration.
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"extends": [
"@canonical/biome-config"
],
"files": {
"include": [
"src",
"*.json"
]
}
}Run biome commands as usual. The base configuration will be applied.
Example package.json scripts are provided below.
{
"scripts": {
"check": "biome check",
"format": "biome format",
"lint": "biome lint"
}
}Configuration
This configuration enables the following behavior:
- Formatting Rules
- Two-space indentation
- Double-quote strings
- Organized imports
- Apply Biome's recommended linting rules by default
- Disable version control integration: no interaction with Git
- Ignores
.gitignore: Explicitly includes all files unless they are ignored manually or other files are included explicitly. - Ignores Git add status: No need to stage files before running
biome checkorbiome format.
- Ignores
- Ignores checking all files in
node_modulesanddistdirectories. Please note that if you specify your own ignored files usingfiles.ignoreinbiome.json, you will override this behavior.
Caveats
Monorepos
Biome does not yet fully support monorepos.
Biome and IDE plugins that use it may not work as expected if you are working in a monorepo.
As a work-around, Biome suggests including a biome.json at the
root of a monorepository, and using overrides to specify any exceptions for sub-packages.
Language support
Biome is still in development and may not support all languages or features. We recommend checking the Biome supported languages list to ensure that your project is supported.
Svelte
We include Svelte-specific overrides because Biome does not yet support "cross-language" lint behavior, which can produce false positives for noUnusedVariables, noUnusedImports, useImportType, and useConst.
These lint overrides are temporary and should be removed once biomejs/biome#8590 is resolved.
We keep these overrides directly in @canonical/biome-config (rather than in a separate Svelte-specific config package) because Biome config extension is not transitive. For additional context, see PR #449.
