noUnknownPseudoElement
¥Summary
-
规则生效日期:
v1.8.0¥Rule available since:
v1.8.0 -
诊断类别:
lint/correctness/noUnknownPseudoElement¥Diagnostic Category:
lint/correctness/noUnknownPseudoElement -
此规则为推荐规则,默认启用。
¥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:
¥How to configure
{ "linter": { "rules": { "correctness": { "noUnknownPseudoElement": "error" } } }}¥Description
禁止未知的伪元素选择器。
¥Disallow unknown pseudo-element selectors.
有关已知 CSS 伪元素的详细信息,请参阅 MDN web 文档。
¥For details on known CSS pseudo-elements, see the MDN web docs.
此规则忽略供应商前缀的伪元素选择器。
¥This rule ignores vendor-prefixed pseudo-element selectors.
¥Examples
¥Invalid
a::pseudo {}code-block.css:1:4 lint/correctness/noUnknownPseudoElement ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown pseudo-elements: pseudo
> 1 │ a::pseudo {}
│ ^^^^^^
2 │
ℹ See MDN web docs for more details.
ℹ Use a known pseudo-elements instead, such as:
- after
- backdrop
- before
- etc.
a::PSEUDO {}code-block.css:1:4 lint/correctness/noUnknownPseudoElement ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown pseudo-elements: PSEUDO
> 1 │ a::PSEUDO {}
│ ^^^^^^
2 │
ℹ See MDN web docs for more details.
ℹ Use a known pseudo-elements instead, such as:
- after
- backdrop
- before
- etc.
a::element {}code-block.css:1:4 lint/correctness/noUnknownPseudoElement ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown pseudo-elements: element
> 1 │ a::element {}
│ ^^^^^^^
2 │
ℹ See MDN web docs for more details.
ℹ Use a known pseudo-elements instead, such as:
- after
- backdrop
- before
- etc.
¥Valid
a:before {}a::before {}::selection {}input::-moz-placeholder {}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号