feat: add --hide-branding flag for clean HTML reports#112
Open
Ticass wants to merge 9 commits intomillionco:mainfrom
Open
feat: add --hide-branding flag for clean HTML reports#112Ticass wants to merge 9 commits intomillionco:mainfrom
Ticass wants to merge 9 commits intomillionco:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the Million Team on Vercel. A member of the Team first needs to authorize it. |
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
When using React Doctor in GitHub Actions to post PR comments, the ASCII branding (doctor face, score bar, framed boxes) doesn't render well in Markdown. Characters get mangled, the report looks cluttered, and the collapsible diagnostics list is buried in a temp directory instead of being inline.
This PR adds a
--hide-brandingflag that replaces the ASCII output with a clean HTML report designed for GitHub PR comments:<details>section — all issues visible in one placeExample output
🟢 Score: 89 / 100 — Great
🚨 5 errors ·⚠️ 14 warnings
📋 View details
react/jsx-keysrc/components/MissingKeys.jsx:27react-hooks/rules-of-hookssrc/components/ConditionalHooks.jsx:9react-doctor/no-array-index-as-keysrc/components/MissingKeys.jsx:36Changes
src/types.ts— AddednoBrandingtoScanOptionssrc/scan.ts— AddednoBrandingtoResolvedScanOptions, refactoredmergeScanOptionsto use a defaults + spread pattern,printSummaryearly-returns with HTML when flag is set, branding calls guarded in zero-diagnostics pathsrc/cli.ts— Wired--hide-brandingCLI flag through toScanOptions.noBrandingsrc/utils/no-branding-diagnostics.ts— New file: builds the HTML report from diagnostics and score, uses data-driven score tiers instead of if/else chainspackages/react-doctor/README.md— Documented the new flag in CLI options and API usagetests/no-branding-diagnostics.test.ts— 15 test cases covering score tiers, boundary values, counts, pluralization, HTML structure, and absence of markdown syntax in HTML outputUsage
CLI:
npx react-doctor@latest . --hide-branding