selector-no-deprecated
Disallow deprecated selectors.
nobr {}/** ↑ * This selector */Use this rule to avoid selectors that browsers may remove at any time, e.g. ::shadow. Some already have, and a removed selector invalidates the whole rule.
This rule reports selectors that were removed or deprecated after being in the CSS specifications, including Editor Drafts, and were either:
- shipped in a release browser version
- shipped in a pre-release browser version
- shipped but behind feature flags
- polyfilled with some adoption before any browser shipped
- given an MDN page
The fix option can automatically fix some of the problems reported by this rule.
This rule supports up to 2 message arguments: the deprecated selector, or the selector and its replacement.
Options
Section titled “Options”{ "selector-no-deprecated": true}The following patterns are considered problems:
acronym {}a:focus-ring {}.foo::shadow a {}The following patterns are not considered problems:
abbr {}a:focus-visible {}Optional secondary options
Section titled “Optional secondary options”ignoreSelectors
Section titled “ignoreSelectors”{ "ignoreSelectors": ["array", "of", "selectors", "/regex/"] }Given:
{ "selector-no-deprecated": [true, { "ignoreSelectors": ["contains", "/ern/"] }]}The following patterns are not considered problems:
:contains(a) {}svg hkern, vkern {}