src/content/docs/linter/rules/no-biome-first-exception.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JSON (and super languages)" icon="seti:json"> ## Summary - Rule available since: `v2.2.0` - Diagnostic Category: [`lint/suspicious/noBiomeFirstException`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule has a [**safe**](/linter/#safe-fixes) fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). ## How to configure ```json title="biome.json" { "linter": { "rules": { "suspicious": { "noBiomeFirstException": "error" } } } }## Description
Prevents the misuse of glob patterns inside the `files.includes` field.
## Leading of negated patterns
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](https://biomejs.dev/guides/configure-biome/#exclude-files-via-configuration) for more examples.
### Examples
#### Invalid
```json
{
"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"]
}
}