This rule template can be used to create rules which will be triggered when a property matches a given regular expression.

For example, one can create a rule with the regular expression .*animation.* to match all the animation properties (to warn developers not to use them for some reasons for instance).

Note that, in order to match "animation" regardless of the case, the (?i) modifier can be prepended to the expression, as in (?i).*animation.*.

See Java documentation for detailed regular expression syntax.

[begin-less]

Exceptions

Less interpolated properties are not checked against this rule. For instance, the following piece of code does not raise an issue when the regular expression is set to (?i).*animation.*:

.mybox {
  foo-@{animation}-bar: green;
}
[end-less] [begin-scss]

Exceptions

SCSS interpolated properties are not checked against this rule. For instance, the following piece of code does not raise an issue when the regular expression is set to (?i).*animation.*:

.mybox {
  foo-#{$animation}-bar: green;
}
[end-scss]

stylelint Related Rules