Skip to content

noUnknownTypeSelector

¥Summary

¥How to configure

biome.json
{
"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