noUnknownFunction
Summary
Section titled Summary- Rule available since:
v1.8.0
- Diagnostic Category:
lint/correctness/noUnknownFunction
- This rule is recommended, which means is enabled by default.
- This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
- Same as
stylelint/function-no-unknown
- Same as
Description
Section titled DescriptionDisallow unknown CSS value functions.
This rule ignores double-dashed custom functions, e.g. --custom-function()
.
Data sources of known CSS value functions are:
- MDN reference on CSS value functions
- MDN reference on CSS reference
- MDN browser compatibility data for CSS value functions
Examples
Section titled ExamplesInvalid
Section titled Invalida { transform: unknown(1); }
code-block.css:1:16 lint/correctness/noUnknownFunction ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected unknown function: unknown
> 1 │ a { transform: unknown(1); }
│ ^^^^^^^
2 │
ℹ Use a known function instead.
ℹ See MDN web docs for more details.
Valid
Section titled Valida { transform: scale(1); }
How to configure
Section titled How to configure{ "linter": { "rules": { "correctness": { "noUnknownFunction": "error" } } }}