aurelia / template-lint

Sanity check of Aurelia-flavor template HTML
Apache License 2.0
56 stars 17 forks source link

False positive "duplicated id" combined with if.bind #188

Open RomkeVdMeulen opened 6 years ago

RomkeVdMeulen commented 6 years ago

I have this construction in my template:

<input type="text" list="my-options">
<datalist if.bind="type === 'server' id="my-options">
  <option repeat.for="server of servers" value="${server.name}">
</datalist>
<datalist if.bind="type === 'domain' id="my-options">
  <option repeat.for="domain of domains" value="${domain.name}">
</datalist>

Only one datalist will ever be rendered, so there should not be a problem with multiple elements having the id "my-options". However, the template linter gives this warning:

WARNING: duplicated id: my-options Ln 5 Col 4 mytemplate.html

The linter should not give a duplicate id warning if all the elements with the same id all have an if.bind.