noUnknownUnit
Ce contenu n’est pas encore disponible dans votre langue.
Diagnostic Category: lint/correctness/noUnknownUnit
Since: v1.8.0
Sources:
- Same as:
stylelint/unit-no-unknown
Disallow unknown CSS units.
For details on known CSS units, see the MDN web docs.
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.css:2:12 lint/correctness/noUnknownUnit ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown unit: pixels
1 │ a {
> 2 │ width: 10pixels;
│ ^^^^^^
3 │ }
4 │
ℹ See MDN web docs for more details.
ℹ Use a known unit instead, such as:
- px
- em
- rem
- etc.
code-block.css:2:24 lint/correctness/noUnknownUnit ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown unit: pixels
1 │ a {
> 2 │ width: calc(10px + 10pixels);
│ ^^^^^^
3 │ }
4 │
ℹ See MDN web docs for more details.
ℹ Use a known unit instead, such as:
- px
- em
- rem
- etc.