Element name case
- Rule ID:
- element-case
- Category:
- Style
- Standards:
- -
Requires a specific case for element names.
Rule details
Examples of incorrect code for this rule:
<DIV>...</DIV>
Examples of correct code for this rule:
<div>...</div>
Matching case
When using styles such as pascalcase the start and end tag must have matching case:
<FooBar>...</Foobar>
Options
This rule takes an optional object:
{
"style": "lowercase"
}
Style
camelcaserequires all element names to be camelCase.lowercaserequires all element names to be lowercase.pascalcaserequires all element names to be PascalCase.uppercaserequires all element names to be UPPERCASE.
Multiple styles can be set as an array of strings. With multiple styles the element name must match at least one pattern to be considered valid.
For instance, when configured with {"style": ["lowercase", "pascalcase"]} element names can be either lowercase or PascalCase:
<foo-bar></foo-bar>
<FooBar></FooBar>
<fooBar></fooBar>