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
I expect this to fail, as no HtmlFor, which it fails.
<><FormLabel>Foo</FormLabel><Inputname="foo"/></>
I expect this to fail, as the htmlFor doesn't link to anything, but it doesn't fail. This is the scenario i see in our code base a lot that i want to protect against.
This rule checks that any label tag (or an indicated custom component that will output a label tag) either (1) wraps an input element (or an indicated custom component that will output an input tag) or (2) has an htmlFor attribute and that the label tag has text content.
I feel like my expected behaviour is not the reality, but I wasn't quite sure.
Should my expectation work, or am I just misunderstanding the library/rule? Thanks.
The text was updated successfully, but these errors were encountered:
Apologies if I've misunderstood the rule or configured this wrong.
I'm noticing in our code base that labels are often misconfigured, using
name
as the matcher, notid
, which isn't a valid pairing.I want to ensure that every (custom) input element has an associated label, and it's configured correctly. So the following works out the box:
Given the following configuration:
I expect this to fail, as no HtmlFor, which it fails.
I expect this to fail, as the htmlFor doesn't link to anything, but it doesn't fail. This is the scenario i see in our code base a lot that i want to protect against.
Then expect this to pass
Given that:
I feel like my expected behaviour is not the reality, but I wasn't quite sure.
Should my expectation work, or am I just misunderstanding the library/rule? Thanks.
The text was updated successfully, but these errors were encountered: