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:

error: <foobar> is not a valid element name (element-name) at inline:1:2:
> 1 | <foobar></foobar>
    |  ^^^^^^

1 error found.

Examples of correct code for this rule:



This rule takes and optional object:

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


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


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


Elements in the blacklist will always trigger this rule.