Repository navigation
fix(prettier): surface Prettier 3 failures instead of dropping them - #1
Merged
Merged
Conversation
Prettier 3.x writes failing files to stderr as `[warn] path/to/file.ts` and a `[warn] Code style issues found ...` summary. The previous filter (1) only captured stdout via `RunOptions::stdout_only()` and (2) explicitly skipped any line containing `[warn]`, so failures were silently invisible. - Switch to `RunOptions::default()` so stderr is included. - Strip `[warn]` / `[error]` prefixes and treat the remainder as a file path when it has a recognized extension. - Detect the Prettier 3 issues-summary line and refuse to report success when it is present. - Expand recognized extensions (mjs, cjs, mdx, yml, yaml, html, vue, svelte, less) so Prettier 3 users don't lose valid file matches. - Add tests for Prettier 3 shapes and a >=60% token-savings assertion. Fixes rtk-ai#2878
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prettier 3.x writes failing files to stderr as
[warn] path/to/file.tsand a[warn] Code style issues found ...summary. The current filter (1) only captured stdout viaRunOptions::stdout_only()and (2) explicitly skipped any line containing[warn], so failures were silently invisible to the LLM.Changes
run_filteredtoRunOptions::default()so stderr is included in the filter input.[warn]/[error]prefixes and treat the remainder as a file path when it has a recognized extension.>=60%token-savings assertion.Fixes rtk-ai#2878
Test plan
cargo test cmds::js::prettier— 9/9 passcargo fmt && cargo clippy --all-targets— cleancargo test --all— pre-existing SQLite lock flakes only (unrelated, pass single-threaded)rtk pnpm exec prettier --check .against a project with formatting issues under Prettier 3