noUnknownAtRules
¥Summary
-
规则生效日期:
v2.0.0¥Rule available since:
v2.0.0 -
诊断类别:
lint/suspicious/noUnknownAtRules¥Diagnostic Category:
lint/suspicious/noUnknownAtRules -
此规则为推荐规则,默认启用。
¥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:
-
与
at-rule-no-unknown相同¥Same as
at-rule-no-unknown
-
¥How to configure
{ "linter": { "rules": { "suspicious": { "noUnknownAtRules": "error" } } }}¥Description
禁止使用未知的 at 规则。
¥Disallow unknown at-rules.
有关已知 at 规则的详细信息,请参阅 MDN web 文档。
¥For details on known at-rules, see the MDN web docs.
¥Examples
¥Invalid
@uNkNoWn {}code-block.css:1:2 lint/suspicious/noUnknownAtRules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown at-rule: uNkNoWn
> 1 │ @uNkNoWn {}
│ ^^^^^^^
2 │
ℹ uNkNoWn is not a standard CSS at-rule, which may lead to unexpected styling results or failure to interpret the styles as intended.
ℹ See MDN web docs for a known list of at-rules.
ℹ To fix this issue, consider removing the unknown at-rule.
@unknown-at-rule { font-size: 14px;}code-block.css:1:2 lint/suspicious/noUnknownAtRules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown at-rule: unknown-at-rule
> 1 │ @unknown-at-rule {
│ ^^^^^^^^^^^^^^^
2 │ font-size: 14px;
3 │ }
ℹ unknown-at-rule is not a standard CSS at-rule, which may lead to unexpected styling results or failure to interpret the styles as intended.
ℹ See MDN web docs for a known list of at-rules.
ℹ To fix this issue, consider removing the unknown at-rule.
¥Valid
@charset 'UTF-8';@media (max-width: 960px) { body { font-size: 13px; }}¥Options
ignore
Section titled “ignore”待忽略的未知 at 规则名称列表(不区分大小写)。
¥A list of unknown at-rule names to ignore (case-insensitive).
{ "linter": { "rules": { "suspicious": { "noUnknownAtRules": { "options": { "ignore": [ "custom-at-rule", "my-custom-rule" ] } } } } }}¥Valid
@custom-at-rule {}@my-custom-rule { color: red;}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号