jsx-eslint / eslint-plugin-jsx-a11y

Static AST checker for a11y rules on JSX elements.
MIT License
3.39k stars 637 forks source link

[label-has-associated-control] Glob format not supporting labelComponents #972

Open regexyl opened 9 months ago

regexyl commented 9 months ago

The docs mention that:

Glob format is also supported for specifying names (e.g., Label* matches LabelComponent but not CustomLabel, ????Label matches LinkLabel but not CustomLabel).

It seems like glob matching only occurs for controlComponents, not labelComponents in jsx-a11y/label-has-associated-control, though it seems like (and makes sense) to have it applied to both of them.

ljharb commented 9 months ago

I can definitely see both readings (that it applies only to control, and that it applies to both. I think that paragraph needs some splitting up for clarity regardless.

If we can enable glob support on label components in a non-breaking way, then I'm happy to add it.