Disallow unknown units.
禁止使用未知单位。
a { width: 100pixels; }
/** ↑
* These units */
This rule considers units defined in the CSS Specifications, up to and including Editor's Drafts, to be known.
该规则只考虑 CSS 规范包括草案中定义的单位。
true
The following patterns are considered warnings:
以下模式被认为是个警告:
a {
width: 10pixels;
}
a {
width: calc(10px + 10pixels);
}
The following patterns are not considered warnings:
以下模式正常:
a {
width: 10px;
}
a {
width: 10Px;
}
a {
width: 10pX;
}
a {
width: calc(10px + 10px);
}
ignoreUnits: ["/regex/", "string"]
Given:
给出:
["/^my-/", "custom"]
The following patterns are not considered warnings:
以下模式正常:
a {
width: 10custom;
}
a {
width: 10my-unit;
}
a {
width: 10my-other-unit;
}