no-abstract-roles

This rule disallows use of abstract roles.

How to use

.eslintrc.js
module.exports = {
  rules: {
    "@html-eslint/no-abstract-roles": "error",
  },
};

Rule Details

This rule disallows the use of abstract roles.

  1. Abstract roles
    1. command
    2. composite
    3. input
    4. landmark
    5. range
    6. roletype
    7. section
    8. sectionhead
    9. select
    10. structure
    11. widget
    12. window

Examples of incorrect code for this rule:

<div role="command"></div>
<div role="composite"></div>
<div role="input"></div>

Examples of correct code for this rule:

<div role="button"></div>

Further Reading

  1. HTML spec - Abstract Roles