noUnknownFunction (CSS)
Language CSS
Summary
Section titled “Summary”- Rule available since:
v1.8.0 - Diagnostic Category:
lint/correctness/noUnknownFunction - This rule is recommended, meaning it is enabled by default.
- This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
- Same as
function-no-unknown
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "correctness": { "noUnknownFunction": "error" } } }}Description
Section titled “Description”Disallow unrecognized CSS value functions.
CSS value functions use a name followed by parentheses, such as scale() or calc().
Custom functions whose names begin with --, such as --custom-function(), are allowed.
Known functions come from the
MDN CSS reference and
browser compatibility data.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”a { 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.
a { transform: scale(1); }Options
Section titled “Options”ignore
Section titled “ignore”Lists additional function names to allow, without regard to letter case. Defaults to an empty list.
{ "linter": { "rules": { "correctness": { "noUnknownFunction": { "level": "on", "options": { "ignore": [ "custom-function" ] } } } } }}a { transform: custom-function(1); }Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.