disallow invalid element names (element-name)

HTML defines what content is considered a valid (custom) element name, essentially:

Elements with xml namespaces is ignored by this rule.

Rule details

Examples of incorrect code for this rule:

<foobar></foobar>
1:1 - <foobar> is not a valid element name

Examples of correct code for this rule:

<div></div>
<foo-bar></foo-bar>

Options

This rule takes and optional object:

{
    "pattern": "[a-z][a-z0-9\\-._]*-[a-z0-9\\-._]*$",
    "whitelist": [],
    "blacklist": []
}

Pattern

A regular expression for matching valid names. If changed you should ensure it still fulfills the original HTML specification, in particular requiring a -.

Whitelist

Elements in the whitelist will never trigger this rule even if it would not match the pattern.

Blacklist

Elements in the blacklist will always trigger this rule.