noDuplicateFontNames
¥Summary
-
规则生效日期:
v1.8.0¥Rule available since:
v1.8.0 -
诊断类别:
lint/suspicious/noDuplicateFontNames¥Diagnostic Category:
lint/suspicious/noDuplicateFontNames -
此规则为推荐规则,默认启用。
¥This rule is recommended, which means is enabled by default.
-
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 error。
¥The default severity of this rule is error.
-
来源:
¥Sources:
-
与
font-family-no-duplicate-names相同¥Same as
font-family-no-duplicate-names
-
¥How to configure
{ "linter": { "rules": { "suspicious": { "noDuplicateFontNames": "error" } } }}¥Description
禁止字体系列中的重复名称。
¥Disallow duplicate names within font families.
此规则检查 font 和 font-family 属性中是否存在重复的字体名称。
¥This rule checks the font and font-family properties for duplicate font names.
此规则现在忽略 var(—custom-property) 变量语法。
¥This rule ignores var(—custom-property) variable syntaxes now.
¥Examples
¥Invalid
a { font-family: "Lucida Grande", 'Arial', sans-serif, sans-serif; }code-block.css:1:56 lint/suspicious/noDuplicateFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Duplicate font names are redundant and unnecessary: sans-serif
> 1 │ a { font-family: “Lucida Grande”, ‘Arial’, sans-serif, sans-serif; }
│ ^^^^^^^^^^
2 │
ℹ This is where the duplicate font name is found:
> 1 │ a { font-family: “Lucida Grande”, ‘Arial’, sans-serif, sans-serif; }
│ ^^^^^^^^^^
2 │
ℹ Remove duplicate font names within the property.
a { font-family: 'Arial', "Lucida Grande", Arial, sans-serif; }code-block.css:1:44 lint/suspicious/noDuplicateFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Duplicate font names are redundant and unnecessary: Arial
> 1 │ a { font-family: ‘Arial’, “Lucida Grande”, Arial, sans-serif; }
│ ^^^^^
2 │
ℹ This is where the duplicate font name is found:
> 1 │ a { font-family: ‘Arial’, “Lucida Grande”, Arial, sans-serif; }
│ ^^^^^^^
2 │
ℹ Remove duplicate font names within the property.
a { FONT: italic 300 16px/30px Arial, " Arial", serif; }code-block.css:1:39 lint/suspicious/noDuplicateFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Duplicate font names are redundant and unnecessary: ” Arial”
> 1 │ a { FONT: italic 300 16px/30px Arial, ” Arial”, serif; }
│ ^^^^^^^^
2 │
ℹ This is where the duplicate font name is found:
> 1 │ a { FONT: italic 300 16px/30px Arial, ” Arial”, serif; }
│ ^^^^^
2 │
ℹ Remove duplicate font names within the property.
¥Valid
a { font-family: "Lucida Grande", "Arial", sans-serif; }b { font: normal 14px/32px -apple-system, BlinkMacSystemFont, sans-serif; }c { font-family: SF Mono, Liberation Mono, sans-serif; }d { font: 1em SF Mono, Liberation Mono, sans-serif; }¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号