Open ViincentLim opened 1 month ago
Would be nice to define element tag as well
Yeah but you can't know what the render tag will render...it might render an input, a div or even nothing.
The only thing the compiler could do here is to silence all such warnings that might be false positives because of the {@render}
. I'm not too happy with that idea. I'd probably just say you should put a <!-- svelte-ignore -->
comment in if you're sure this isn't a problem.
Yeah the compiler should not make assumptions imho...you can have assumptions since you know your code. And you can even avoid the warning by using a for
attribute (this again if you are sure about your code)
Describe the bug
The warning
A form label must be associated with a control(a11y_label_has_associated_control)(svelte/valid-compile
shows up even when the label has a render children inside.Reproduction
https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAEz2O3WrDMAyFX0WIQVsI672b_uwNBrusd5ElSmdwZCOrhWH87sPOujvp45yPk3F2nhKaa0YeFkKDbzFih_oT65Me5JWwwxTuMlbSp1FcVPAD344WNVk8WbbqlhhEofYgwwe7GEmhwCxhgc3q2RwstywryTyMBO8SYoJcoVU_fJE3kFQc37qVjd_OT0J8Nk9n5WX1eFLI0GodPJNQzJ_2CC-xHtvdwXK_X4fXsdy3TtvdpzjwKTdQ-n37Ks8XIZ5I_r3n1-2uVM_axQ6XMLnZ0YRG5U7ls_wCoGD20E4BAAA=
Logs
No response
System Info
Severity
annoyance