Skip to content

noBiomeFirstException

biome.json
{
"linter": {
"rules": {
"suspicious": {
"noBiomeFirstException": "error"
}
}
}
}

Prevents the misuse of glob patterns inside the files.includes field.

If the first pattern of files.includes starts with the leading !, Biome won’t have any file to crawl. Generally, it is a good practice to declare the files/folders to include first, and then the files/folder to ignore.

Check the official documentation for more examples.

{
"files": {
"includes": ["!dist"]
}
}
{
"files": {
"includes": ["src/**", "!dist"]
}
}

If the user configuration file extends from other sources (other configuration files or libraries), and those files contain the catch-all glob ** in files.includes, the rule will trigger a violation if also the user configuration file has a **.

biome.json
{
"extends": ["./base.json"],
"files": {
"includes": ["**", "!**/test"]
}
}
base.json
{
"files": {
"includes": ["**", "!**/dist"]
}
}