I am trying to add the informed
package to my project, but I am getting the eslint an error when I add the components like this:
<Form id="intro-form">
<label htmlFor="intro-name">
First name:
<Text field="name" id="intro-name" />
</label>
<button type="submit">Submit</button>
</Form>
I have added Text
to my .eslintrc
as a controlComponent
and I am still getting the error:
eslint] Form label must have ALL of the following types of associated control: nesting, id (jsx-a11y/label-has-for)
I'm guessing this is not the correct way to add this to my .eslintrc
file?
{
"rules": {
"jsx-a11y/label-has-associated-control": [ 2, {
"labelComponents": ["label"],
"labelAttributes": ["htmlFor"],
"controlComponents": ["Text"]
}]
},
"parser": "babel-eslint",
"extends": [
"airbnb"
]
}
When I change Text
to input
the error goes away, so it feels like I'm misunderstanding how this works. Any suggestions for how to allow Text
as an acceptable input
?