useBiomeIgnoreFolder
¥Summary
-
规则生效日期:
v2.2.0¥Rule available since:
v2.2.0 -
诊断类别:
lint/suspicious/useBiomeIgnoreFolder¥Diagnostic Category:
lint/suspicious/useBiomeIgnoreFolder -
此规则为推荐规则,默认启用。
¥This rule is recommended, which means is enabled by default.
-
此规则包含 safe 修复程序。
¥This rule has a safe fix.
-
此规则的默认严重级别为 warning。
¥The default severity of this rule is warning.
¥How to configure
{ "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
Biome v2.1 中文网 - 粤ICP备13048890号