Open
Description
Description and reproduction of the issue
The [label-has-associated-control] rule hard codes the default inputs to check for on label elements. It would be great to allow users to override the defaults. This would allow projects to lint labels that rely on custom directives to hook into custom controls.
Suggestion to have the ability to declare the rule like this:
{
"rules": {
"@angular-eslint/template/label-has-associated-control": [
"error",
{
"controlComponents": [
"my-custom-control"
],
"labelComponents": [
{
"inputs": [
"for",
"htmlFor",
"myCustomFor"
],
"selector": "label"
}
]
}
]
}
}
so that the following would be valid:
<label [myCustomFor]="customId">Label</label>
<my-custom-control [id]="customId"></my-custom-control>
Versions
package | version |
---|---|
@angular-eslint/eslint-plugin-template |
19.3.0 |