noUnknownProperty
¥Summary
-
规则生效日期:
v1.8.0¥Rule available since:
v1.8.0 -
诊断类别:
lint/correctness/noUnknownProperty¥Diagnostic Category:
lint/correctness/noUnknownProperty -
此规则为推荐规则,默认启用。
¥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:
-
与
property-no-unknown相同¥Same as
property-no-unknown
-
¥How to configure
{ "linter": { "rules": { "correctness": { "noUnknownProperty": "error" } } }}¥Description
禁止未知的属性。
¥Disallow unknown properties.
此规则认为 CSS 规范中定义的属性和浏览器特定属性是已知的。https://github.com/known-css/known-css-properties#source
¥This rule considers properties defined in the CSS Specifications and browser specific properties to be known. https://github.com/known-css/known-css-properties#source
此规则忽略:
¥This rule ignores:
-
自定义变量,例如
--custom-property¥custom variables e.g.
--custom-property -
供应商前缀属性(例如,
-moz-align-self,-webkit-align-self)¥vendor-prefixed properties (e.g.,
-moz-align-self,-webkit-align-self)
¥Examples
¥Invalid
a { colr: blue;}code-block.css:2:3 lint/correctness/noUnknownProperty ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unknown property is not allowed.
1 │ a {
> 2 │ colr: blue;
│ ^^^^
3 │ }
4 │
ℹ See CSS Specifications and browser specific properties for more details.
ℹ To resolve this issue, replace the unknown property with a valid CSS property.
a { my-property: 1;}code-block.css:2:3 lint/correctness/noUnknownProperty ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unknown property is not allowed.
1 │ a {
> 2 │ my-property: 1;
│ ^^^^^^^^^^^
3 │ }
4 │
ℹ See CSS Specifications and browser specific properties for more details.
ℹ To resolve this issue, replace the unknown property with a valid CSS property.
¥Valid
a { color: green;}a { fill: black;}a { -moz-align-self: center;}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号