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

feat(eslint/jsx_a11y): implement anchor_ambiguous_text #5729

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

jelly
Copy link
Contributor

@jelly jelly commented Sep 12, 2024

There is a remaining clippy issue with passing COW<_, str> which I simply can't resolve, but maybe there is more to fix first in my approach.

Currently this PR might do a bit too much allocations:

  • trim() - this sadly has no cowutils replacement but might not be needed. I kept the trim() in there as a "maybe optimisation" to skip the whole string modification shenanigans
  • replace() can't be used so I used retain (which also is a bit faster iirc?), but that converts COW => String. So maybe this should chain cow_replace?
  • I'm also not sure if if normalized_str.contains(char::is_whitespace) { is worth it? But my gut feeling is that it is, as it deconstructs and constructs a whole String<>

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

codspeed-hq bot commented Sep 12, 2024

CodSpeed Performance Report

Merging #5729 will not alter performance

Comparing jelly:anchor_ambiguous_text (7b3c919) with main (e26916c)

Summary

✅ 30 untouched benchmarks

@Boshen Boshen requested a review from camc314 November 25, 2024 08:43
@Boshen
Copy link
Member

Boshen commented Nov 25, 2024

@camc314 can you help and get this PR merged.

@camc314 camc314 force-pushed the anchor_ambiguous_text branch from 383fd70 to 9a0054e Compare November 25, 2024 09:19
@github-actions github-actions bot added the C-enhancement Category - New feature or request label Nov 25, 2024
@camc314 camc314 force-pushed the anchor_ambiguous_text branch from 4675d94 to 01a9acd Compare November 25, 2024 09:25
@camc314 camc314 marked this pull request as ready for review November 25, 2024 09:26
@camc314 camc314 force-pushed the anchor_ambiguous_text branch from 01a9acd to f014a82 Compare November 25, 2024 10:00
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@camc314 camc314 force-pushed the anchor_ambiguous_text branch from 98648aa to 7b3c919 Compare November 25, 2024 10:46
@camc314 camc314 merged commit 7236d14 into oxc-project:main Nov 25, 2024
27 checks passed
Dunqing pushed a commit that referenced this pull request Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants