at-function-pattern
What it does
Section titled “What it does”Reports a @function whose name does not match the pattern option (a regex). An empty pattern allows everything.
Why it matters
Section titled “Why it matters”A naming convention for Sass functions keeps them predictable, so one can be guessed and searched for. The rule is a policy: with no pattern it reports nothing.
Example
Section titled “Example”With this configuration:
no-global-function-names: warnat-mixin-argumentless-call-parentheses: warnat-rule-conditional-no-parentheses: warnat-extend-no-missing-placeholder: warnat-if-no-null: warnload-no-partial-leading-underscore: warndollar-variable-pattern: { level: warn, options: { pattern: "^[a-z-]+$" } }at-mixin-pattern: { level: warn, options: { pattern: "^[a-z-]+$" } }at-function-pattern: { level: warn, options: { pattern: "^[a-z-]+$" } }...@use "c.css";...@function myFn($x) { @return mix($x, red); }a {... @include foo() using ($x) { top: 0; }...Configuration
Section titled “Configuration”css: lint: rules: at-function-pattern: level: warn # off (default), warn, error options: pattern: ""less: lint: rules: at-function-pattern: level: warn # off (default), warn, error options: pattern: ""scss: lint: rules: at-function-pattern: level: warn # off (default), warn, error options: pattern: ""| Option | Type | Default | Description |
|---|---|---|---|
pattern |
string | "" |
The regex a function name must match. |
Enabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line at-function-pattern in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint-scss | scss/at-function-pattern |
full |