Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 999 Bytes

File metadata and controls

45 lines (31 loc) · 999 Bytes

ember/template-no-positional-data-test-selectors

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

Disallows positional data-test selectors.

Rule Details

Data-test selectors should use descriptive names rather than positional indices for better maintainability and clarity.

Examples

Examples of incorrect code for this rule:

<template>
  <div data-test-item="0"></div>
</template>
<template>
  <div data-test-card="1"></div>
</template>

Examples of correct code for this rule:

<template>
  <div data-test-user-card></div>
</template>
<template>
  <div data-test-item="my-item"></div>
</template>

References