Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 1.28 KB

dollar-variable-pattern.md

File metadata and controls

77 lines (49 loc) · 1.28 KB

Pattern: Unexpected $-variable name

Issue: -

Description

Specify a pattern for Sass-like variables.

a { $foo: 1px; }
/** ↑
 * The pattern of this */

Examples

regex or string

A string will be translated into a RegExp like so new RegExp(yourString) — so be sure to escape properly.

E.g. /foo-.+/

The following patterns are considered warnings:

a { $boo-bar: 0; }

The following patterns are not considered warnings:

a { $foo-bar: 0; }

Configuration

ignore: "local"|"global"

"local"

Makes this rule ignore local variables (variables defined inside a rule/mixin/function, etc.).

For example, with /^foo-/:

The following patterns are not considered warnings:

$foo-name00: 10px;
a {
  $bar-name01: 10px;
}

"global"

Makes this rule ignore global variables (variables defined in the stylesheet root).

For example, with /^foo-/:

The following patterns are not considered warnings:

$bar-name01: 10px;
a {
  $foo-name02: 10px;
}

Further Reading