Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.52 KB

File metadata and controls

66 lines (47 loc) · 1.52 KB

ember/template-no-scope-outside-table-headings

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

✅ The extends: 'plugin:ember/strict-gjs' or extends: 'plugin:ember/strict-gts' property in a configuration file enables this rule.

Disallow the scope attribute on elements other than <th> or <td> elements.

Rule Details

The scope attribute is only valid on <th> and <td> elements within tables. Using it on other elements is invalid HTML and should be avoided.

Examples

Examples of incorrect code for this rule:

<template>
  <div scope="col">Not a table cell</div>
</template>
<template>
  <span scope="row">Wrong element</span>
</template>
<template>
  <p scope="col">Paragraph</p>
</template>

Examples of correct code for this rule:

<template>
  <th scope="col">Header</th>
</template>
<template>
  <td scope="row">Cell</td>
</template>
<template>
  <div>Content without scope</div>
</template>

References

  • strictGjs: true
  • strictGts: true