Skip to content

feat: show errors with --show-errors regardless of increase#49

Merged
frankieyan merged 2 commits intomainfrom
frankieyan/show-errors-always
Jan 30, 2026
Merged

feat: show errors with --show-errors regardless of increase#49
frankieyan merged 2 commits intomainfrom
frankieyan/show-errors-always

Conversation

@frankieyan
Copy link
Copy Markdown
Member

@frankieyan frankieyan commented Jan 29, 2026

Previously, --check-files and --stage-record-file with --show-errors would only display detailed errors when errors had increased. This made it inconsistent with check-all, which always shows errors when the flag is set.

Now --show-errors displays errors for all checked files that have errors, regardless of whether there's an increase:

🔍 Checking 1 file for React Compiler errors…
Errors:
    - src/bad-hook.ts: Line 6: Cannot access refs during render (x3)
✅ No new React Compiler errors in checked files

Test plan

Test locally by running against the sample project fixtures:

npm run build
cd src/__fixtures__/sample-project
  • Create baseline records first

    node ../../../dist/index.mjs --overwrite
  • --check-files --show-errors shows errors even with no increase

    node ../../../dist/index.mjs --check-files --show-errors src/bad-hook.ts
    🔍 Checking 1 file for React Compiler errors…
    Errors:
        - src/bad-hook.ts: Line 6: Cannot access refs during render (x3)
    ✅ No new React Compiler errors in checked files
    
  • --stage-record-file --show-errors shows errors even with no increase

    node ../../../dist/index.mjs --stage-record-file --show-errors src/bad-hook.ts
    🔍 Checking 1 file for React Compiler errors and updating records…
    Errors:
        - src/bad-hook.ts: Line 6: Cannot access refs during render (x3)
    ✅ Records saved to .react-compiler.rec.json. No new React Compiler errors
    
  • Errors still shown when there IS an increase (without baseline records)

    rm .react-compiler.rec.json
    node ../../../dist/index.mjs --check-files --show-errors src/bad-hook.ts
    🔍 Checking 1 file for React Compiler errors…
    Errors:
        - src/bad-hook.ts: Line 6: Cannot access refs during render (x3)
    ❌ React Compiler errors have increased in:
      • src/bad-hook.ts: +3
    
    Please fix the errors and run the command again.
    

Previously, --check-files and --stage-record-file with --show-errors
would only display detailed errors when errors had increased. Now
errors are shown for all checked files that have errors, matching
the behavior of check-all.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@frankieyan frankieyan requested a review from a team as a code owner January 29, 2026 08:02
@frankieyan frankieyan requested review from Bloomca and removed request for a team January 29, 2026 08:02
Copy link
Copy Markdown

@doistbot-app doistbot-app bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change correctly updates the --show-errors flag to consistently display detailed error information for all checked files, regardless of whether there is an increase in errors. The implementation is sound and the accompanying integration tests thoroughly validate the new behavior, improving the tool's consistency and making its output more predictable for users.

- Clarify that --show-errors displays errors regardless of increase
- Add example showing errors when no increase
- Rename "Detailed errors:" heading to "Errors:" for brevity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@frankieyan frankieyan added the 👀 Show PR PR must be reviewed before or after merging label Jan 29, 2026
@frankieyan frankieyan merged commit fe692c2 into main Jan 30, 2026
3 checks passed
@frankieyan frankieyan deleted the frankieyan/show-errors-always branch January 30, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant