Skip to content

feat(cli): add markdown reports, Windows-safe build script, and Next.js rule reliability fixes#88

Open
damian3rd wants to merge 1 commit intomillionco:mainfrom
damian3rd:feat/cli-report-md-windows-build-and-nextjs-rule-stability
Open

feat(cli): add markdown reports, Windows-safe build script, and Next.js rule reliability fixes#88
damian3rd wants to merge 1 commit intomillionco:mainfrom
damian3rd:feat/cli-report-md-windows-build-and-nextjs-rule-stability

Conversation

@damian3rd
Copy link

Summary

This PR adds a new CLI-only output option, --report-md <path>, to generate a persistent Markdown report after a React Doctor scan.

Motivation

React Doctor currently provides rich terminal output and temporary diagnostics files, but there is no first-class, persistent Markdown report for sharing, archiving, or attaching to review workflows.

What Changed

  • Added --report-md <path> CLI option.
  • Added a dedicated markdown report writer utility:
    • packages/react-doctor/src/utils/write-markdown-report.ts
  • Extended scan result payload with project metadata and elapsed timing so the CLI can generate structured report sections.
  • Wired per-project scan results into a single report generated at the end of a CLI run.
  • Updated documentation in packages/react-doctor/README.md.
  • Added unit tests for markdown report generation:
    • packages/react-doctor/tests/write-markdown-report.test.ts
  • Replaced Unix-only build cleanup command in packages/react-doctor/package.json:
    • from rm -rf dist && NODE_ENV=production tsdown
    • to node -e "require('node:fs').rmSync('dist',{recursive:true,force:true})" && tsdown
  • Hardened Next.js lint rules in packages/react-doctor/src/plugin/rules/nextjs.ts:
    • Added path normalization and filename-agnostic fallbacks
    • Ensured rule behavior remains reliable when filename metadata is unavailable in runtime contexts
    • Resolved the four failing run-oxlint Next.js rule assertions

Report Contents

Generated report includes:

  • run metadata (mode/options/timestamp/root directory)
  • overall totals (diagnostics/errors/warnings/affected files)
  • per-project summary (framework/react version/score/elapsed/skipped checks)
  • grouped findings by plugin/rule with file-line references

Example

npx -y react-doctor@latest . --report-md react-doctor-report.md

Backward Compatibility

  • Existing CLI behavior remains unchanged when --report-md is not provided.
  • --score behavior remains terminal-focused; report generation is optional and explicit.
  • nr test on Windows is now unblocked from failing at the rm -rf dist build step.

Validation

Code changes were implemented with tests and documentation updates. Validation in this environment:

  • nr test:
    • 13 test files passed
    • 136 tests passed
    • 0 failed
  • Targeted regression verification:
    • pnpm.cmd --filter react-doctor exec vitest run --pool=threads tests/run-oxlint.test.ts
    • pnpm.cmd --filter react-doctor exec vitest run --pool=threads tests/write-markdown-report.test.ts
  • pnpm.cmd --filter react-doctor run typecheck passed.
  • nr lint completed successfully (warnings only, no errors).
  • nr format:check fails due repository-wide existing formatting baseline (170 files), not introduced by this PR.

Recommended verification on a standard dev environment:

ni
nr test
nr lint
nr format:check

@vercel
Copy link

vercel bot commented Feb 25, 2026

@damian3rd is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant