fix(linter): valid-title: fix diagnostic quoted in strings#17180
fix(linter): valid-title: fix diagnostic quoted in strings#17180graphite-app[bot] merged 1 commit intomainfrom
valid-title: fix diagnostic quoted in strings#17180Conversation
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. |
valid-title: fix diagnostic quoted in strings
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where diagnostic messages in the valid_title Jest linter rule were incorrectly wrapped in string quotes (using format!("{error_message:?}") and format!("{help_text:?}")). The changes refactor the code to use individual diagnostic functions for each error type, making the code more maintainable and conventional.
Key changes:
- Removed the generic
valid_title_diagnosticfunction andMessageenum - Added six specific diagnostic functions for different error types
- Updated all call sites to use the new diagnostic functions
- Snapshot file updated to show correctly unquoted diagnostic messages
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/oxc_linter/src/rules/jest/valid_title.rs | Refactored diagnostic creation by replacing a generic function and enum with specific diagnostic functions for each error type; updated all usage sites |
| crates/oxc_linter/src/snapshots/jest_valid_title.snap | Updated snapshot to reflect properly formatted diagnostic messages without extra quotes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17180 will not alter performanceComparing Summary
Footnotes
|
033f10d to
78ddd78
Compare
Merge activity
|
The diagnostic messages here were quoted in strings. I also simplified the diagnostic setup to be more conventional like other lint rules where each message has its own function.
78ddd78 to
c95a0ec
Compare

The diagnostic messages here were quoted in strings. I also simplified the diagnostic setup to be more conventional like other lint rules where each message has its own function.