Skip to content

JSON 规则

以下是 Biome 支持的规则列表,按组划分。以下是表情符号的图例:

¥Below the list of rules supported by Biome, divided by group. Here’s a legend of the emojis:

  • 图标 表示该规则是推荐规则的一部分。

    ¥The icon indicates that the rule is part of the recommended rules.

  • 图标 表示该规则提供了可以安全应用的代码操作(修复)。

    ¥The icon indicates that the rule provides a code action (fix) that is safe to apply.

  • 图标 表示该规则提供了不安全应用的代码操作(修复)。

    ¥The icon indicates that the rule provides a code action (fix) that is unsafe to apply.

  • 图标 表示该规则已实现并计划在下一个版本中发布。

    ¥The icon indicates that the rule has been implemented and scheduled for the next release.

规则名称描述属性
noDuplicateDependencies防止列出重复的依赖。
useRequiredScripts强制要求 package.json 中包含所需的脚本。
规则名称描述属性
noBiomeFirstException防止在 files.includes 字段中误用 glob 模式。
noDuplicateObjectKeys禁止在对象内部使用两个同名的键。
noQuickfixBiome禁止在编辑器设置文件中使用 if quickfix.biome
useBiomeIgnoreFolder推广在配置文件中忽略文件夹的正确用法。

¥Recommended rules

缺少规则?请通过 contributinganalyzer 或创建规则建议 此处 来帮助我们。

¥Missing a rule? Help us by contributing to the analyzer or create a rule suggestion here.