Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
regexyl opened this issue Jan 16, 2024 · 3 comments
Closed

Comments

@regexyl
Copy link

regexyl commented Jan 16, 2024

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
Copy link
Member

ljharb commented Jan 16, 2024

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.

@lb-
Copy link
Contributor

lb- commented Oct 23, 2024

A fix for part of the issue is up (the docs being a bit hard to read) #1024

lb- added a commit to lb-/eslint-plugin-jsx-a11y that referenced this issue Oct 23, 2024
…control`

Add ability for `labelComponents` within the `label-has-associated-control` to use the same glob checking mechanism as `controlComponents`.
Ensure existing tests pass and update unit tests for new behaviour.
Add extra tests for documented `???Foo` syntax for component glob matching.
Update documentation to have appropriate examples for label/control glob usage.
Fixes jsx-eslint#972
lb- added a commit to lb-/eslint-plugin-jsx-a11y that referenced this issue Oct 23, 2024
…control`

Add ability for `labelComponents` within the `label-has-associated-control` to use the same glob checking mechanism as `controlComponents`.

- Ensure existing tests pass and update unit tests for new behaviour
- Add extra tests for documented `???Foo` syntax for component glob matching
- Update documentation to have appropriate examples for label/control glob usage

Closes jsx-eslint#972
@lb-
Copy link
Contributor

lb- commented Oct 23, 2024

PR up for the rest of the fix for this, supporting glob matching in labelComponents & refining documentation examples. #1025

lb- added a commit to lb-/eslint-plugin-jsx-a11y that referenced this issue Oct 26, 2024
…control`

Add ability for `labelComponents` within the `label-has-associated-control` to use the same glob checking mechanism as `controlComponents`.

- Ensure existing tests pass and update unit tests for new behaviour
- Add extra tests for documented `???Foo` syntax for component glob matching
- Update documentation to have appropriate examples for label/control glob usage

Closes jsx-eslint#972
@ljharb ljharb closed this as completed in 743168b Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants