Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 1.56 KB

File metadata and controls

74 lines (57 loc) · 1.56 KB

ember/template-require-presentational-children

💼 This rule is enabled in the following configs: strict-gjs, strict-gts.

Requires presentational elements to only contain presentational children.

When an element is marked as presentational (with role="none" or role="presentation"), its semantic children should not be present as they would be confusing to assistive technology users.

Rule Details

This rule checks that elements with role="presentation" or role="none" don't contain semantic children that expect the parent's semantic structure.

Examples

Examples of incorrect code for this rule:

<template>
  <ul role="presentation">
    <li>Item</li>
  </ul>
</template>
<template>
  <table role="none">
    <tr><td>Data</td></tr>
  </table>
</template>
<template>
  <ol role="presentation">
    <li>Item</li>
  </ol>
</template>

Examples of correct code for this rule:

<template>
  <ul role="presentation">
    <div>Content</div>
  </ul>
</template>
<template>
  <ul>
    <li>Item</li>
  </ul>
</template>
<template>
  <table>
    <tbody>
      <tr><td>Data</td></tr>
    </tbody>
  </table>
</template>

References