Skip to content

fix(linter): valid-title: fix diagnostic quoted in strings#17180

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-20-fix_linter_fix_diagnostic_quoted_in_strings
Dec 20, 2025
Merged

fix(linter): valid-title: fix diagnostic quoted in strings#17180
graphite-app[bot] merged 1 commit intomainfrom
12-20-fix_linter_fix_diagnostic_quoted_in_strings

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Dec 20, 2025

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.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Dec 20, 2025
Copy link
Member Author


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 hot fixes, skip the queue and merge this PR next

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.

@camchenry camchenry changed the title fix(linter): : fix diagnostic quoted in strings fix(linter): valid-title: fix diagnostic quoted in strings Dec 20, 2025
@camchenry camchenry marked this pull request as ready for review December 20, 2025 14:38
@camchenry camchenry requested a review from camc314 as a code owner December 20, 2025 14:38
Copilot AI review requested due to automatic review settings December 20, 2025 14:38
Copy link
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

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_diagnostic function and Message enum
  • 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-hq
Copy link

codspeed-hq bot commented Dec 20, 2025

CodSpeed Performance Report

Merging #17180 will not alter performance

Comparing 12-20-fix_linter_fix_diagnostic_quoted_in_strings (78ddd78) with main (8d70b59)

Summary

✅ 4 untouched
⏩ 41 skipped1

Footnotes

  1. 41 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.

@camchenry camchenry force-pushed the 12-20-fix_linter_fix_diagnostic_quoted_in_strings branch from 033f10d to 78ddd78 Compare December 20, 2025 15:10
@github-actions github-actions bot added the A-cli Area - CLI label Dec 20, 2025
@camchenry camchenry added 0-merge Merge with Graphite Merge Queue and removed A-cli Area - CLI labels Dec 20, 2025
Copy link
Member Author

camchenry commented Dec 20, 2025

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.
@graphite-app graphite-app bot force-pushed the 12-20-fix_linter_fix_diagnostic_quoted_in_strings branch from 78ddd78 to c95a0ec Compare December 20, 2025 15:17
@github-actions github-actions bot added the A-cli Area - CLI label Dec 20, 2025
@graphite-app graphite-app bot merged commit c95a0ec into main Dec 20, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 12-20-fix_linter_fix_diagnostic_quoted_in_strings branch December 20, 2025 15:22
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants