Skip to content

CSS 规则

以下是 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.

规则名称描述属性
useGenericFontNames禁止在字体系列中缺少通用系列关键字。
规则名称描述属性
noImportantStyles禁止使用 !important 样式。
规则名称描述属性
noInvalidDirectionInLinearGradient禁止线性梯度函数使用非标准方向值。
noInvalidGridAreas禁止在 CSS 网格布局中无效命名的网格区域。
noInvalidPositionAtImportRule禁止在无效位置使用 @import at-rules。
noMissingVarFunction禁止 CSS 变量缺少 var 函数。
noUnknownFunction禁止未知的 CSS 值函数。
noUnknownMediaFeatureName禁止未知的媒体功能名称。
noUnknownProperty禁止未知的属性。
noUnknownPseudoClass禁止未知的伪类选择器。
noUnknownPseudoElement禁止未知的伪元素选择器。
noUnknownTypeSelector禁止使用未知的类型选择器。
noUnknownUnit禁止未知的 CSS 单位。
noUnmatchableAnbSelector禁止不匹配的 An+B 选择器。
规则名称描述属性
noEmptySource禁止使用空源。
规则名称描述属性
noDescendingSpecificity禁止低优先级选择器出现在高优先级选择器之后。
noValueAtRule禁止在 css 模块中使用 @value 规则。
规则名称描述属性
noDuplicateAtImportRules禁止重复的 @import 规则。
noDuplicateCustomProperties禁止在声明块中重复自定义属性。
noDuplicateFontNames禁止字体系列中的重复名称。
noDuplicateProperties禁止在声明块中使用重复的属性。
noDuplicateSelectorsKeyframeBlock禁止关键帧块中的重复选择器。
noEmptyBlock禁止 CSS 空块。
noImportantInKeyframe禁止在关键帧声明中允许无效的 !important
noIrregularWhitespace禁止使用不规则的空格字符。
noShorthandPropertyOverrides禁止覆盖相关长写属性的简写属性。
noUnknownAtRules禁止使用未知的 at 规则。
noUselessEscapeInString禁止在字符串字面量中使用不必要的转义。

¥Recommended rules

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

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