Skip to content

fix(lint/useRegexLiterals): handle useless escapes #5716

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

Conaclos
Copy link
Member

Summary

Fix #5693 (comment)

I took the opportunity of reviewing the entire process of escape/unescape.
I fixed many edge cases including:

  • Don't unescape escaped characters in raw strings.
  • Handle String literals split on several lines.
  • Handle backspace escape (it is valid in strings and invalid in regexes)

Test Plan

I added new tests.

@Conaclos Conaclos requested review from a team April 20, 2025 12:16
@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Apr 20, 2025
@Conaclos Conaclos force-pushed the conaclos/useRegexLiterals-#5693 branch 2 times, most recently from 714cf99 to 632f08a Compare April 20, 2025 12:18
Copy link

codspeed-hq bot commented Apr 20, 2025

CodSpeed Performance Report

Merging #5716 will not alter performance

Comparing conaclos/useRegexLiterals-#5693 (f8b7cae) with main (ab2ae41)

Summary

✅ 95 untouched benchmarks

@Conaclos Conaclos force-pushed the conaclos/useRegexLiterals-#5693 branch from 632f08a to f8b7cae Compare April 22, 2025 19:01
@Conaclos Conaclos merged commit ab2ae41 into main Apr 22, 2025
12 checks passed
@Conaclos Conaclos deleted the conaclos/useRegexLiterals-#5693 branch April 22, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 useRegexLiterals incorrect autofix
4 participants