Disallow unknown pseudo-element selectors.
禁止使用未知的伪元素。
a::before {}
/** ↑
* This pseudo-element selector */
This rule considers pseudo-element selectors defined in the CSS Specifications, up to and including Editor's Drafts, to be known.
该规则只考虑 CSS 规范包括草案中定义的伪元素选择器。
All vendor-prefixed pseudo-element selectors are ignored.
所有的带有浏览器引擎前缀的伪元素选择器都被忽略。
true
The following patterns are considered warnings:
以下模式被认为是个警告:
a::pseudo {}
a::PSEUDO {}
a::element {}
The following patterns are not considered warnings:
以下模式正常:
a:before {}
a::before {}
::selection {}
input::-moz-placeholder {}
ignorePseudoElements: ["/regex/", "string"]
Given:
给出:
["/^my-/", "pseudo-element"]
The following patterns are not considered warnings:
以下模式正常:
a::pseudo-element {}
a::my-pseudo {}
a::my-other-pseudo {}