template-lint
template-lint copied to clipboard
Ensure matching if - else attributes
<div if.bind="user.signedIn">
Hello ${user.name}.
<a>Logout</a>
</div>
<div else>
Please log in.
</div>
- for element with else attribute:
- ensure immediate preceding sibling node (same parent), ignoring text-nodes, has an
if.bind
- ensure immediate preceding sibling node (same parent), ignoring text-nodes, has an
example
<div>
<div else>
Please log in.
</div>
</div>
- issue: missing a matching if.bind in predecessor sibling
ref: https://github.com/jods4/if-else cc: @jods4
predecessor-sibling
Should be not any predecessor, but the previous element.