Skip to content

fix(prettier): surface Prettier 3 failures instead of dropping them - #1

Merged
KCuppens merged 1 commit into
developfrom
fix/prettier-hide-failures-2878
Jul 8, 2026
Merged

KCuppens merged 1 commit into
developfrom
fix/prettier-hide-failures-2878

Conversation

@KCuppens

@KCuppens KCuppens commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Prettier 3.x writes failing files to stderr as [warn] path/to/file.ts and a [warn] Code style issues found ... summary. The current filter (1) only captured stdout via RunOptions::stdout_only() and (2) explicitly skipped any line containing [warn], so failures were silently invisible to the LLM.

Changes

  • Switch run_filtered to RunOptions::default() so stderr is included in the filter input.
  • 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 "All files formatted correctly" when it is present.
  • Expand recognized extensions (mjs, cjs, mdx, yml, yaml, html, vue, svelte, less).
  • Add tests for Prettier 3 output shapes and a >=60% token-savings assertion.

Fixes rtk-ai#2878

Test plan

  • cargo test cmds::js::prettier — 9/9 pass
  • cargo fmt && cargo clippy --all-targets — clean
  • Full suite cargo test --all — pre-existing SQLite lock flakes only (unrelated, pass single-threaded)
  • Manual: run rtk pnpm exec prettier --check . against a project with formatting issues under Prettier 3

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
@KCuppens
KCuppens merged commit 05e8cef into develop Jul 8, 2026
@KCuppens
KCuppens deleted the fix/prettier-hide-failures-2878 branch July 8, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: rtk prettier silently hides prettier 3 failures (stdout-only capture + [warn] filter)

1 participant