noBiomeFirstException
Summary
Section titled “Summary”- Rule available since:
v2.2.0 - Diagnostic Category:
lint/suspicious/noBiomeFirstException - This rule is recommended, which means is enabled by default.
- This rule has a safe fix.
- The default severity of this rule is error.
How to configure
Section titled “How to configure”{ "linter": { "rules": { "suspicious": { "noBiomeFirstException": "error" } } }}Description
Section titled “Description”Prevents the misuse of glob patterns inside the files.includes field.
Leading of negated patterns
Section titled “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 for more examples.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”{ "files": { "includes": ["!dist"] }}{ "files": { "includes": ["src/**", "!dist"] }}Leading with catch-all **
Section titled “Leading with catch-all **”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 **.
Invalid
Section titled “Invalid”{ "extends": ["./base.json"], "files": { "includes": ["**", "!**/test"] }}{ "files": { "includes": ["**", "!**/dist"] }}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.