-
-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
false positive "A form label must be associated with a control" #759
Comments
This isn't a false positive. The airbnb config requires that every input be BOTH for-id linked, and also the input nested inside the label. |
Thanks @ljharb I C this has come up in the past. |
The error message needs to be updated. The form label is associated with a control. Please be more specific that "A label must be the parent of the associated control". |
It’s not associated in every engine, though, unless it’s both nested and linked. A PR to improve the message would be welcome. |
@ljharb A false positive occurred when working with |
@liby did you configure the plugin so it knows that a Field is an input? |
Thank you for reminding me. I haven't configured it yet because it works elsewhere. As shown below, I did not make any additional configure, nor did eslint-disable. |
Then the warning is expected, because it’s not an input, it’s a Field. I’m not sure why it works elsewhere without that config. |
@liby at this point i think a new issue would be warranted; but first make sure you're using the latest version of the plugin, and you're also looking at the docs not on main, but on the version tag you're using. |
I'm using airbnb eslint configuration, and eslint complains when input's label is wrapped in another element:
I'm getting this error during compilation:
The text was updated successfully, but these errors were encountered: