Skip to content

Latest commit

 

History

History
67 lines (49 loc) · 1.51 KB

File metadata and controls

67 lines (49 loc) · 1.51 KB

ember/template-no-nested-splattributes

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

Disallow nested ...attributes usage.

Having ...attributes on multiple elements nested within each other in a component can cause unintended results. This rule prevents ...attributes on an element if any of its parent elements already has ...attributes.

Rule Details

This rule disallows ...attributes on an element when an ancestor element already has ...attributes.

Examples

Incorrect ❌

<template>
  <div ...attributes>
    <span ...attributes>Text</span>
  </div>
</template>
<template>
  <section ...attributes>
    <div>
      <button ...attributes>Click</button>
    </div>
  </section>
</template>

Correct ✅

<template>
  <div ...attributes>Content</div>
</template>
<template>
  <div ...attributes>
    <span>Text</span>
  </div>
</template>
<template>
  <div ...attributes>first</div>
  <div ...attributes>second</div>
</template>

Migration

  • Remove the inner ...attributes declaration

References