Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1006 Bytes

File metadata and controls

51 lines (37 loc) · 1006 Bytes

ember/template-simple-unless

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

Require simple conditions in {{#unless}} blocks. Complex expressions should use {{#if}} with negation instead.

Rule Details

This rule enforces using simple property paths in {{#unless}} blocks rather than complex helper expressions.

Examples

Examples of incorrect code for this rule:

<template>
  {{#unless (eq value 1)}}
    Not one
  {{/unless}}
</template>

<template>
  {{#unless (or a b)}}
    Neither
  {{/unless}}
</template>

Examples of correct code for this rule:

<template>
  {{#unless isHidden}}
    Visible
  {{/unless}}
</template>

<template>
  {{#if (not (eq value 1))}}
    Not one
  {{/if}}
</template>
  • strictGjs: true
  • strictGts: true