perf(linter): no-multi-str: skip searching strings when in jsx attribute#17327
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. |
CodSpeed Performance ReportMerging #17327 will not alter performanceComparing Summary
Footnotes
|
a6ba999 to
120c867
Compare
There was a problem hiding this comment.
Pull request overview
This PR optimizes the no-multi-str linter rule for JSX files by performing an early check for JSX attributes before searching string contents for multiline patterns. This avoids unnecessary string scanning operations when the string is inside a JSX attribute (where multiline strings are allowed).
Key Changes:
- Early return when string literal is within a JSX attribute, avoiding expensive string search
- Refactored string search logic to use idiomatic Option handling instead of
unwrap_or(0)pattern - Inlined and removed the
is_within_jsx_attributehelper function
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
…ute (#17327) Optimization for JSX files: we can skip looking at string literals right away if it's inside of a JSX attribute, instead of searching the whole value first.
120c867 to
d2abc78
Compare

Optimization for JSX files: we can skip looking at string literals right away if it's inside of a JSX attribute, instead of searching the whole value first.