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 | 禁止在字体系列中缺少通用系列关键字。 |
complexity
Section titled “complexity”| 规则名称 | 描述 | 属性 |
|---|---|---|
| noImportantStyles | 禁止使用 !important 样式。 |
correctness
Section titled “correctness”| 规则名称 | 描述 | 属性 |
|---|---|---|
| noInvalidDirectionInLinearGradient | 禁止线性梯度函数使用非标准方向值。 | |
| noInvalidGridAreas | 禁止在 CSS 网格布局中无效命名的网格区域。 | |
| noInvalidPositionAtImportRule | 禁止在无效位置使用 @import at-rules。 | |
| noMissingVarFunction | 禁止 CSS 变量缺少 var 函数。 | |
| noUnknownFunction | 禁止未知的 CSS 值函数。 | |
| noUnknownMediaFeatureName | 禁止未知的媒体功能名称。 | |
| noUnknownProperty | 禁止未知的属性。 | |
| noUnknownPseudoClass | 禁止未知的伪类选择器。 | |
| noUnknownPseudoElement | 禁止未知的伪元素选择器。 | |
| noUnknownTypeSelector | 禁止使用未知的类型选择器。 | |
| noUnknownUnit | 禁止未知的 CSS 单位。 | |
| noUnmatchableAnbSelector | 禁止不匹配的 An+B 选择器。 |
nursery
Section titled “nursery”| 规则名称 | 描述 | 属性 |
|---|---|---|
| noEmptySource | 禁止使用空源。 |
| 规则名称 | 描述 | 属性 |
|---|---|---|
| noDescendingSpecificity | 禁止低优先级选择器出现在高优先级选择器之后。 | |
| noValueAtRule | 禁止在 css 模块中使用 @value 规则。 |
suspicious
Section titled “suspicious”| 规则名称 | 描述 | 属性 |
|---|---|---|
| noDuplicateAtImportRules | 禁止重复的 @import 规则。 | |
| noDuplicateCustomProperties | 禁止在声明块中重复自定义属性。 | |
| noDuplicateFontNames | 禁止字体系列中的重复名称。 | |
| noDuplicateProperties | 禁止在声明块中使用重复的属性。 | |
| noDuplicateSelectorsKeyframeBlock | 禁止关键帧块中的重复选择器。 | |
| noEmptyBlock | 禁止 CSS 空块。 | |
| noImportantInKeyframe | 禁止在关键帧声明中允许无效的 !important | |
| noIrregularWhitespace | 禁止使用不规则的空格字符。 | |
| noShorthandPropertyOverrides | 禁止覆盖相关长写属性的简写属性。 | |
| noUnknownAtRules | 禁止使用未知的 at 规则。 | |
| noUselessEscapeInString | 禁止在字符串字面量中使用不必要的转义。 |
¥Recommended rules
-
useGenericFontNames(严重性:error)
¥useGenericFontNames (Severity: error)
-
noImportantStyles(严重性:warning)
¥noImportantStyles (Severity: warning)
-
noInvalidDirectionInLinearGradient(严重性:error)
¥noInvalidDirectionInLinearGradient (Severity: error)
-
noInvalidGridAreas(严重性:error)
¥noInvalidGridAreas (Severity: error)
-
noInvalidPositionAtImportRule(严重性:error)
¥noInvalidPositionAtImportRule (Severity: error)
-
noMissingVarFunction(严重性:error)
¥noMissingVarFunction (Severity: error)
-
noUnknownFunction(严重性:error)
¥noUnknownFunction (Severity: error)
-
noUnknownMediaFeatureName(严重性:error)
¥noUnknownMediaFeatureName (Severity: error)
-
noUnknownProperty(严重性:error)
¥noUnknownProperty (Severity: error)
-
noUnknownPseudoClass(严重性:error)
¥noUnknownPseudoClass (Severity: error)
-
noUnknownPseudoElement(严重性:error)
¥noUnknownPseudoElement (Severity: error)
-
noUnknownTypeSelector(严重性:error)
¥noUnknownTypeSelector (Severity: error)
-
noUnknownUnit(严重性:error)
¥noUnknownUnit (Severity: error)
-
noUnmatchableAnbSelector(严重性:error)
¥noUnmatchableAnbSelector (Severity: error)
-
noDescendingSpecificity(严重性:warning)
¥noDescendingSpecificity (Severity: warning)
-
noDuplicateAtImportRules(严重性:error)
¥noDuplicateAtImportRules (Severity: error)
-
noDuplicateCustomProperties(严重性:error)
¥noDuplicateCustomProperties (Severity: error)
-
noDuplicateFontNames(严重性:error)
¥noDuplicateFontNames (Severity: error)
-
noDuplicateProperties(严重性:error)
¥noDuplicateProperties (Severity: error)
-
noDuplicateSelectorsKeyframeBlock(严重性:error)
¥noDuplicateSelectorsKeyframeBlock (Severity: error)
-
noEmptyBlock(严重性:warning)
¥noEmptyBlock (Severity: warning)
-
noImportantInKeyframe(严重性:error)
¥noImportantInKeyframe (Severity: error)
-
noIrregularWhitespace(严重性:warning)
¥noIrregularWhitespace (Severity: warning)
-
noShorthandPropertyOverrides(严重性:error)
¥noShorthandPropertyOverrides (Severity: error)
-
noUnknownAtRules(严重性:error)
¥noUnknownAtRules (Severity: error)
-
noUselessEscapeInString(严重性:warning)
¥noUselessEscapeInString (Severity: warning)
缺少规则?请通过 contributing 至 analyzer 或创建规则建议 此处 来帮助我们。
¥Missing a rule? Help us by contributing to the analyzer or create a rule suggestion here.
Biome v2.1 中文网 - 粤ICP备13048890号