You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ember-template-lint's simple-unless fixes two of the four violation
types; the autofix was lost when the rule was extracted. Restores it
using text-based replacement (this rule does not have access to
ember-template-recast):
- withHelper: `{{unless cond}}` -> `{{if (not cond)}}`, with two De
Morgan special-cases:
- `{{unless (not x)}}` -> `{{if x}}` (unwrap the not)
- `{{unless (not x y)}}` -> `{{if (or x y)}}` (multi-arg `not` is
true only when all args are falsy)
- followingElseBlock: `{{#unless cond}}A{{else}}B{{/unless}}` ->
`{{#if cond}}B{{else}}A{{/if}}` (body/inverse swap)
The followingElseIfBlock (`{{#unless}}...{{else if}}`) and
asElseUnlessBlock (`{{#if}}...{{else unless}}`) cases remain
unfixable, also matching upstream.
The body-swap fixer slices sourceCode.text between node.program.range
and node.inverse.range and reassembles with a hardcoded `{{else}}`
separator, which normalizes whitespace around `{{else}}`.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,7 +283,7 @@ rules in templates can be disabled with eslint directives with mustache or html
283
283
|[template-require-valid-named-block-naming-format](docs/rules/template-require-valid-named-block-naming-format.md)| require valid named block naming format || 🔧 ||
284
284
|[template-self-closing-void-elements](docs/rules/template-self-closing-void-elements.md)| require self-closing on void elements || 🔧 ||
0 commit comments