template-lint icon indicating copy to clipboard operation
template-lint copied to clipboard

Ensure matching if - else attributes

Open MeirionHughes opened this issue 7 years ago • 1 comments

<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

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

MeirionHughes avatar Mar 15 '17 11:03 MeirionHughes

predecessor-sibling

Should be not any predecessor, but the previous element.

jods4 avatar Mar 15 '17 12:03 jods4