fix(linter/escape-case): false positive for String.raw#20496
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
There was a problem hiding this comment.
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.rawtagged template expressions. - Updated
unicorn/escape-caseto skip template literal checking when the template is tagged byString.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.
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
9911ab2 to
d3cdc82
Compare

No description provided.