💼 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.
This rule enforces using simple property paths in {{#unless}} blocks rather than complex helper expressions.
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>| 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). |