Skip to content

useBiomeIgnoreFolder

¥Summary

¥How to configure

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

¥Description

推广在配置文件中忽略文件夹的正确用法。

¥Promotes the correct usage for ignoring folders in the configuration file.

从 Biome v2.2 开始,忽略文件夹不再需要使用末尾的 /**。使用模式 /** 时,你告诉 Biome 忽略文件夹内的所有文件,但该文件夹仍然会被抓取。此模式可能导致性能下降,尤其是在文件夹包含大量文件时。

¥Starting Biome v2.2, ignoring folders doesn’t require the use of the trailing /**. When using the pattern /**, you tell Biome to ignore all files inside a folder, but the folder is still crawled. This pattern can lead to poor performance, especially if the folder contains many files.

如果目的是忽略文件夹内的特定文件,则不应使用尾随模式 /**

¥If the intention is to ignore specific files inside a folder, the trailing pattern /** shouldn’t be used.

¥Examples

¥Invalid

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

¥Valid

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

¥Related links