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

fix(linter/jsx_a11y): Refactor jsx-a11y related utils and its usage #2389

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

leaysgur
Copy link
Collaborator

@leaysgur leaysgur commented Feb 11, 2024

Fixes #2360

To make jsx-a11y/anchor-has-content test pass,

  • Use utils::get_element_type(ctx, el) in utils::is_hidden_from_screen_reader and utils::object_has_accessible_child
  • utils::object_has_accessible_child should handle both null and undefined

and on the way...,

  • utils::get_element_type should be used only in jsx_a11y/* rules
  • Use those utils everywhere(remove manual implementation)

@github-actions github-actions bot added the A-linter Area - Linter label Feb 11, 2024
Copy link

codspeed-hq bot commented Feb 11, 2024

CodSpeed Performance Report

Merging #2389 will not alter performance

Comparing fix-jsx_a11y-utils (cec7cf5) with main (9ff7986)

Summary

✅ 27 untouched benchmarks

@leaysgur leaysgur changed the title fix(linter/jsx_a11y): Refactor get_element_type utils fix(linter/jsx_a11y): Refactor jsx-a11y related utils and its usage Feb 13, 2024
@leaysgur leaysgur marked this pull request as ready for review February 13, 2024 00:48
@Boshen Boshen merged commit 6a25864 into main Feb 13, 2024
20 checks passed
@Boshen Boshen deleted the fix-jsx_a11y-utils branch February 13, 2024 15:13
IWANABETHATGUY pushed a commit to IWANABETHATGUY/oxc that referenced this pull request May 29, 2024
…xc-project#2389)

Fixes oxc-project#2360 

To make `jsx-a11y/anchor-has-content` test pass,

- [x] Use `utils::get_element_type(ctx, el)` in
`utils::is_hidden_from_screen_reader` and
`utils::object_has_accessible_child`
- [x] `utils::object_has_accessible_child` should handle both `null` and
`undefined`

and on the way...,

- [x] `utils::get_element_type` should be used only in `jsx_a11y/*`
rules
- [x] Use those utils everywhere(remove manual implementation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linter: Fix jsx_a11y utils to make all heading-has-content test pass
2 participants