ember/template-simple-unless
April 20, 2026 ยท View on GitHub
๐ผ This rule is enabled in the ๐ template-lint-migration config.
๐ง This rule is automatically fixable by the --fix CLI option.
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 (or (eq a 1) (gt b 2))}}
Complex condition
{{/unless}}
</template>
<template>
{{#unless (and isAdmin (not isBanned))}}
Not allowed
{{/unless}}
</template>
Examples of correct code for this rule:
<template>
{{#unless isHidden}}
Visible
{{/unless}}
</template>
<template>
{{#unless (eq value 1)}}
Not one
{{/unless}}
</template>
<template>
{{#if (not (or a b))}}
Neither
{{/if}}
</template>
Options
| Name | Type | Default | Description |
|---|---|---|---|
allowlist | string[] | [] | Helper names allowed inside {{unless}}. |
denylist | string[] | [] | Helper names explicitly denied inside {{unless}}. |
maxHelpers | integer | 1 | Maximum number of helpers allowed inside {{unless}} (-1 for unlimited). |