noUnknownPseudoClass
Summary
Section titled “Summary”- Rule available since:
v1.8.0 - Diagnostic Category:
lint/correctness/noUnknownPseudoClass - This rule is recommended, meaning it is enabled by default.
- This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
- Same as
selector-pseudo-class-no-unknown
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "correctness": { "noUnknownPseudoClass": "error" } } }}Description
Section titled “Description”Disallow unknown pseudo-class selectors.
For details on known pseudo-class, see the MDN web docs
This rule ignores vendor-prefixed pseudo-class selectors.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”a:unknown {}code-block.css:1:3 lint/correctness/noUnknownPseudoClass ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown pseudo-class unknown
> 1 │ a:unknown {}
│ ^^^^^^^
2 │
ℹ See MDN web docs for more details.
a:UNKNOWN {}code-block.css:1:3 lint/correctness/noUnknownPseudoClass ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown pseudo-class UNKNOWN
> 1 │ a:UNKNOWN {}
│ ^^^^^^^
2 │
ℹ See MDN web docs for more details.
a:hoverr {}code-block.css:1:3 lint/correctness/noUnknownPseudoClass ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown pseudo-class hoverr
> 1 │ a:hoverr {}
│ ^^^^^^
2 │
ℹ See MDN web docs for more details.
a:hover {}a:focus {}:not(p) {}input:-moz-placeholder {}Options
Section titled “Options”ignore
Section titled “ignore”A list of unknown pseudo-class names to ignore (case-insensitive).
{ "linter": { "rules": { "correctness": { "noUnknownPseudoClass": { "options": { "ignore": [ "custom-pseudo-class" ] } } } } }}a:custom-pseudo-class {}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.