feat(cli): expose --why as documented public alias for --explain#198
Merged
Conversation
The MVP requested by #161 — a single-site suppression diagnosis at `react-doctor --why <file:line>` — was already implemented as a hidden alias for `--explain`. Promote it to a documented option so users can reach it without reading the source. Updates the README's CLI reference and suppressions section to make the discovery story explicit: - `--explain <file:line>` (and its `--why` alias) classify what the scanner sees at a single location, matching every status in the issue's classifier table (MISSING, WRONG_RULE, GAP_CODE, etc.). - `--verbose` mode already surfaces the same suppression hint inline next to every flagged site, and `--json` mode includes it on each diagnostic as `suppressionHint`. A single scan therefore doubles as a suppression audit without a separate flag, which covers the "Bonus" and most of the "Maximum" goals from the request. Removes the unused `Option` import that the previous `addOption(...).hideHelp()` wiring left behind. Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merging this PR does not change React health
Analysis detailsanalyzed in 0.7s · nextjs · React 19.2.5 · TypeScript · 210 source files · powered by react-doctor |
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.
Closes #161.
Status
The MVP requested by #161 — a single-site suppression diagnosis at
react-doctor --why <file:line>— has been implemented since #165 as a hidden alias for--explain. The reporter (writing at v0.0.47) wouldn't have seen it. Promoting it to a documented option closes the discovery gap.What's changed
--why <file:line>is now a normalcommanderoption instead ofhideHelp(), so it surfaces inreact-doctor --help.--explain/--whyclassify a single site (covers every status in the issue's classifier table —MISSING,WRONG_RULE,GAP_CODE,ADJACENT_BUT_FAILED, etc.).--verbosealready prints the samesuppressionHintnext to every flagged site.--jsonalready attachessuppressionHintto each diagnostic.--audit-suppressionsflag.Verification
Drive-by: removes the now-unused
Optionimport that the previousaddOption(...).hideHelp()wiring left behind.