Skip to content

noBiomeFirstException (JSON)

Language JSON (and super languages)
biome.json
{
"linter": {
"rules": {
"suspicious": {
"noBiomeFirstException": "error"
}
}
}
}

Disallow ineffective ordering in files.includes patterns.

A pattern beginning with ! excludes matching paths. If an exclusion is first, no earlier pattern has included files for it to remove, so Biome matches no files. Start with an inclusion pattern, then add exclusions.

See the file exclusion guide for more examples.

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

The catch-all pattern ** includes every path. When an extended configuration already starts with **, repeating that pattern at the start of the local configuration is redundant. Keep the inherited catch-all and add only the local exclusions.

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