The recommended and strict configurations for the control-has-associated-label rule include an includeRoles option:
'jsx-a11y/control-has-associated-label': [
'off',
{
// ... other options
includeRoles: ['alert', 'dialog'],
},
]
However, this option is not implemented in the actual rule. The rule only supports the following options:
labelAttributes
controlComponents
ignoreElements
ignoreRoles
depth
The includeRoles option does not appear in:
Expected behavior:
Either:
- Remove
includeRoles from the recommended/strict configurations since it has no effect, or
- Implement the
includeRoles option in the rule to explicitly include certain roles that should require labels (opposite of ignoreRoles)
Location:
The
recommendedandstrictconfigurations for thecontrol-has-associated-labelrule include anincludeRolesoption:However, this option is not implemented in the actual rule. The rule only supports the following options:
labelAttributescontrolComponentsignoreElementsignoreRolesdepthThe
includeRolesoption does not appear in:Expected behavior:
Either:
includeRolesfrom the recommended/strict configurations since it has no effect, orincludeRolesoption in the rule to explicitly include certain roles that should require labels (opposite ofignoreRoles)Location:
index.js (recommended config)
eslint-plugin-jsx-a11y/src/index.js
Line 84 in 8f75961
index.js (strict config)
eslint-plugin-jsx-a11y/src/index.js
Line 238 in 8f75961