Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 903 Bytes

File metadata and controls

43 lines (30 loc) · 903 Bytes

ember/template-no-class-bindings

Disallows usage of class attribute bindings.

Rule Details

This rule discourages the use of class attribute bindings with colon syntax. Use the {{class}} helper or individual classes instead for better readability and maintainability.

Examples

Examples of incorrect code for this rule:

<template>
  <div class={{isActive:active:inactive}}></div>
</template>
<template>
  <div class={{foo:bar}}></div>
</template>

Examples of correct code for this rule:

<template>
  <div class={{if this.isActive "active" "inactive"}}></div>
</template>
<template>
  <div class={{this.myClass}}></div>
</template>

References