Skip to content

noUnknownPseudoElement (CSS)

Language CSS
biome.json
{
"linter": {
"rules": {
"correctness": {
"noUnknownPseudoElement": "error"
}
}
}
}

Disallow unrecognized pseudo-element selectors.

A pseudo-element selects a specific part of an element, such as ::before or ::selection. Vendor-prefixed pseudo-elements are allowed. See MDN’s pseudo-element reference.

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.

a:before {}
a::before {}
::selection {}
input::-moz-placeholder {}

Lists additional pseudo-element names to allow, without regard to letter case. Defaults to an empty list.

biome.json
{
"linter": {
"rules": {
"correctness": {
"noUnknownPseudoElement": {
"level": "on",
"options": {
"ignore": [
"custom-pseudo-element"
]
}
}
}
}
}
}
::custom-pseudo-element {}