Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 2.51 KB

File metadata and controls

68 lines (46 loc) · 2.51 KB

ember/template-no-redundant-role

💼 This rule is enabled in the 📋 template-lint-migration config.

🔧 This rule is automatically fixable by the --fix CLI option.

The rule checks for redundancy between any semantic HTML element with a default/implicit ARIA role and the role provided.

For example, if a landmark element is used, any role provided will either be redundant or incorrect. This rule ensures that no role attribute is placed on any of the landmark elements, with the following exceptions:

Examples

This rule forbids the following:

<header role='banner'></header>
<main role='main'></main>
<aside role='complementary'></aside>
<footer role='contentinfo'></footer>
<form role='form'></form>

This rule allows the following:

<form role='search'></form>
<nav role='navigation'></nav>
<input role='combobox' />

Configuration

  • boolean -- if true, default configuration is applied

  • object -- containing the following property:

    • boolean -- checkAllHTMLElements -- if true, the rule checks for redundancy between any semantic HTML element with a default/implicit ARIA role and the role provided, instead of just landmark roles (default: true)

References