noUnknownTypeSelector
¥Summary
-
规则生效日期:
v1.9.4¥Rule available since:
v1.9.4 -
诊断类别:
lint/correctness/noUnknownTypeSelector¥Diagnostic Category:
lint/correctness/noUnknownTypeSelector -
此规则为推荐规则,默认启用。
¥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:
-
¥Same as
selector-type-no-unknown
-
¥How to configure
{ "linter": { "rules": { "correctness": { "noUnknownTypeSelector": "error" } } }}¥Description
禁止使用未知的类型选择器。
¥Disallow unknown type selectors.
此规则将 HTML、SVG 和 MathML 规范中定义的标签视为已知标签。有关已知 CSS 类型选择器的详细信息,请参阅以下链接
¥This rule considers tags defined in the HTML, SVG, and MathML specifications to be known. For details on known CSS type selectors, see the following links
此规则允许自定义元素。
¥This rule allows custom elements.
¥Examples
¥Invalid
unknown {}code-block.css:1:1 lint/correctness/noUnknownTypeSelector ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unknown type selector is not allowed.
> 1 │ unknown {}
│ ^^^^^^^
2 │
ℹ See MDN web docs for more details.
ℹ Consider replacing the unknown type selector with valid one.
unknown > ul {}code-block.css:1:1 lint/correctness/noUnknownTypeSelector ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unknown type selector is not allowed.
> 1 │ unknown > ul {}
│ ^^^^^^^
2 │
ℹ See MDN web docs for more details.
ℹ Consider replacing the unknown type selector with valid one.
x-Foo {}code-block.css:1:1 lint/correctness/noUnknownTypeSelector ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unknown type selector is not allowed.
> 1 │ x-Foo {}
│ ^^^^^
2 │
ℹ See MDN web docs for more details.
ℹ Consider replacing the unknown type selector with valid one.
¥Valid
input {}ul > li {}x-foo {}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号