selector-pseudo-class-allowed-list
Specify a list of allowed pseudo-class selectors.
a:hover {}/** ↑ * This pseudo-class selector */Use this rule to enforce a subset of pseudo-classes as a convention. For example, allow only hover, focus-visible and not.
This rule ignores selectors that use variable interpolation e.g. :#{$variable} {}.
This rule supports 1 message argument: the disallowed pseudo-class.
Options
Section titled “Options”Array<string>
Section titled “Array<string>”["array", "of", "pseudo-classes", "/regex/"]Given:
{ "selector-pseudo-class-allowed-list": ["hover", "/^nth-/"]}The following patterns are considered problems:
a:focus {}a:first-of-type {}The following patterns are not considered problems:
a:hover {}a:nth-of-type(5) {}a:nth-child(2) {}