Skip to content

fix(linter/escape-case): false positive for String.raw#20496

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/03-18-fix_linter_escape-case_false_positive_for_string.raw_
Mar 18, 2026
Merged

fix(linter/escape-case): false positive for String.raw#20496
graphite-app[bot] merged 1 commit intomainfrom
c/03-18-fix_linter_escape-case_false_positive_for_string.raw_

Conversation

@camc314
Copy link
Copy Markdown
Contributor

@camc314 camc314 commented Mar 18, 2026

No description provided.

@github-actions github-actions bot added the A-linter Area - Linter label Mar 18, 2026
Copy link
Copy Markdown
Contributor Author

camc314 commented Mar 18, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-bug Category - Bug label Mar 18, 2026
@camc314 camc314 self-assigned this Mar 18, 2026
@camc314 camc314 marked this pull request as ready for review March 18, 2026 11:05
Copilot AI review requested due to automatic review settings March 18, 2026 11:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a false positive in the unicorn/escape-case linter rule when encountering String.raw tagged template literals, where escape sequences are treated as raw text and must not be auto-fixed.

Changes:

  • Added a utility helper to detect String.raw tagged template expressions.
  • Updated unicorn/escape-case to skip template literal checking when the template is tagged by String.raw.
  • Added a regression test case for String.raw`\uAaAa``.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
crates/oxc_linter/src/utils/unicorn.rs Adds is_string_raw_tagged_template_expression helper used by unicorn rules.
crates/oxc_linter/src/rules/unicorn/escape_case.rs Skips escape-case checks for template literals whose parent is a String.raw tagged template; adds a pass test.

You can also share your feedback on Copilot code review. Take the survey.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 18, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 52 skipped benchmarks1


Comparing c/03-18-fix_linter_escape-case_false_positive_for_string.raw_ (9911ab2) with main (50d59e9)

Open in CodSpeed

Footnotes

  1. 52 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 18, 2026
Copy link
Copy Markdown
Contributor Author

camc314 commented Mar 18, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the c/03-18-fix_linter_escape-case_false_positive_for_string.raw_ branch from 9911ab2 to d3cdc82 Compare March 18, 2026 11:13
@graphite-app graphite-app bot merged commit d3cdc82 into main Mar 18, 2026
21 checks passed
@graphite-app graphite-app bot deleted the c/03-18-fix_linter_escape-case_false_positive_for_string.raw_ branch March 18, 2026 11:19
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants