require a specific class format (class-pattern)

Requires all classes to match a given pattern.

Rule details

Examples of incorrect code for this rule:

<div class="fooBar"></foobar>
1:6 - Class "fooBar" does not match required pattern "/^[a-z0-9-]+$/"

Examples of correct code for this rule:

<div class="foo-bar"></div>


This rule takes and optional object:

    "pattern": "kebabcase"


Either one of the presets or a custom regular expression.