Skip to content

includeRoles option in control-has-associated-label config is not implemented #1072

@nelsonlaidev

Description

@nelsonlaidev

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:

  1. Remove includeRoles from the recommended/strict configurations since it has no effect, or
  2. Implement the includeRoles option in the rule to explicitly include certain roles that should require labels (opposite of ignoreRoles)

Location:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions