refactor(linter/prefer-template): simplify string expression checks#21505
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
Refactors the prefer-template linter rule’s internal “string expression” detection logic to use AST helper APIs and simplify recursive checks, reducing diff size ahead of the larger autofix work in #21502.
Changes:
- Replaced explicit
matches!(Expression::StringLiteral | Expression::TemplateLiteral)checks withExpression::is_string_literal(). - Refactored recursive helpers for traversing
+binary expression trees to a guard-styleif let ... && ...structure.
Merge activity
|
1a48040 to
a5cab18
Compare
Merging this PR will not alter performance
Comparing Footnotes
|

taken from #21502 to reduce the diff