Commit Graph

1865 Commits

Author SHA1 Message Date
Ray Arayilakath 3cc997108b fix(cli): exit cleanly on terminal hangup (read EIO) during interactive prompts (#650)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:40:14 -04:00
Rayhan Noufal Arayilakath 0a36216c12 style(readme): apply formatter to CI Action SHA-pin snippet
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 12:27:44 -07:00
Rayhan Noufal Arayilakath caf46a775a docs(agents): document GitHub Action versioning scheme
The composite Action is versioned independently from the npm packages via
v-prefixed semver tags (vX.Y.Z) plus a floating major (vN), distinct from
the Changesets `<pkg>@X.Y.Z` tags. Documents the bump rules, the signed-tag
gotcha, and the release/floating-major commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 12:20:38 -07:00
Rayhan Noufal Arayilakath 5c49fa2b8e docs(readme): pin CI Action example to @v1 + SHA-pin guidance (issue #299)
Replace the mutable `millionco/react-doctor@main` reference in the GitHub
Actions example with the `@v1` floating release tag, and add a note on
pinning to a full commit SHA for hardened CI (the example grants
`pull-requests: write`). Avoids running whatever `main` points at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 12:20:37 -07:00
github-actions[bot] 8d13ba3f84 chore: version packages (#641) 2026-06-01 23:19:09 -07:00
Aiden Bai 4aadaabfd4 fix(react-native): stop false-positives on Expo Universal UI (@expo/ui) (#645) 2026-06-01 23:18:56 -07:00
Ray Arayilakath 0c8b797d18 fix(cli): degrade git current-branch read when git is unavailable (#643)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 20:32:01 -04:00
Ray Arayilakath 2aa96f39b5 fix(cli): treat expected user/CLI errors as clean errors, not Sentry crashes (#642)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 20:09:07 -04:00
github-actions[bot] 5614b3220b chore: version packages (#639) 2026-06-01 15:21:39 -07:00
Aiden Bai b336f54d66 feat(cli): reveal category breakdown one issue at a time (#640) 2026-06-01 15:21:26 -07:00
Aiden Bai ec5d58cf83 fix(cli): never animate the score header / onboarding inside git hooks
`canAnimateOnboarding` only excluded CI, so a git hook invoked by an
interactive `git commit` (real inherited TTY, `GIT_DIR` set) would play
the score-bar count-up and onboarding pacing, emitting cursor escapes
into hook output (issue #293). Add `isGitHookEnvironment()` and gate it
out, while keeping the deliberate coding-agent real-TTY animation.
2026-06-01 14:25:50 -07:00
Aiden Bai 114893e07d New onboarding 2 ray backup (#638)
Co-authored-by: Rayhan Noufal Arayilakath <me@rayhanadev.com>
2026-06-01 14:20:43 -07:00
github-actions[bot] 2d1ab245f0 chore: version packages (#632) eslint-plugin-react-doctor@0.2.16 oxlint-plugin-react-doctor@0.2.16 react-doctor@0.2.16 2026-06-01 10:44:31 -07:00
Aiden Bai 8162bfb7ca feat(cli): redesign scan summary, footer, and verbose warnings (#637) 2026-06-01 10:26:17 -07:00
Aiden Bai bf4c21e45d Update README.md 2026-06-01 09:31:36 -07:00
Ray Arayilakath bd8298d6cf feat(cli): lint in parallel by default, with serial fallback (#635)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 11:50:59 -04:00
Ray Arayilakath 520b0a9235 fix(cli): accept commit ranges in --diff; render bad values as clean errors (#633)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 09:23:44 -04:00
Ray Arayilakath 17e722ee07 feat(cli): add anonymized Sentry usage metrics (counters + distributions) (#634)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 09:23:12 -04:00
Rayhan Noufal Arayilakath 3fae9ddd88 Revert "fix(cli): accept commit ranges in --diff; render bad values as clean errors"
This reverts commit 01ec05c06e.
2026-06-01 05:45:02 -07:00
Rayhan Noufal Arayilakath 01ec05c06e fix(cli): accept commit ranges in --diff; render bad values as clean errors
`--diff` now accepts git's own range syntax: two-dot `A..B` (diff A
directly against B) and three-dot `A...B` (diff from the merge-base of A
and B to B). Each endpoint is individually validated against the
anti-injection guard, so a range can't smuggle a `--upload-pack=`-style
option past it, and an empty endpoint defaults to HEAD (`main..` means
`main..HEAD`).

An invalid `--diff` value (a malformed ref/range, or a base branch that
hasn't been fetched) is now rendered as a clean, single-line message and
exits non-zero. It no longer prints the generic "Something went wrong,
open a prefilled issue" block or reports the expected user error to
Sentry: getDiffInfo now propagates the tagged ReactDoctorError so the CLI
dispatches on reason._tag via the new isUserInputError classifier.

Fixes REACT-DOCTOR-9

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 05:42:22 -07:00
github-actions[bot] 66f9d649e7 chore: version packages (#603)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
react-doctor@0.2.15 oxlint-plugin-react-doctor@0.2.15 eslint-plugin-react-doctor@0.2.15
2026-06-01 04:44:15 -07:00
Ray Arayilakath 05d7bba5c4 docs(readme): update readme (#631)
* docs(readme): update readme

* use "taste"
2026-06-01 07:33:01 -04:00
Rayhan Noufal Arayilakath 89215753d3 fix: remove unnecessary docs 2026-06-01 04:24:39 -07:00
Ray Arayilakath bdb9e36b0e feat: add 10 React Native & Expo diagnostic rules (#625)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 07:23:41 -04:00
Ray Arayilakath 75c1f99e06 fix(oxlint-plugin-react-doctor): declare oxc-parser as a runtime dependency (#630)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 07:02:17 -04:00
Ray Arayilakath e9e71bbc2f feat(cli): deepen sentry observability -- source maps, tracing, anonymization, crash refs (#628)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 06:19:25 -04:00
Rayhan Noufal Arayilakath cfeea7f7e9 chore(changeset): mark pending changesets as patch
Downgrade the four `minor` changesets (CLI color/version/help,
experimental parallel lint workers, Sentry crash reporting, and
warnings-shown-by-default) to `patch` so the next release is a single
patch bump.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 03:09:13 -07:00
Ray Arayilakath 59762666d8 fix: its a patch its okay we can breathe 2026-06-01 06:04:29 -04:00
Ray Arayilakath 9777f1ac45 feat(cli): add rules management commands and doctor-explain skill (#617)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 05:55:47 -04:00
Nisarg Patel 0938376e9c feat(cli): show warnings by default again (--no-warnings to hide) (#622)
Show "warning"-severity diagnostics by default again — a scan that reports only errors is too low a bar for a health check. Warnings reach every surface (CLI, PR comment, score, --fail-on); opt out with --no-warnings or "warnings": false. Per-rule / per-category severity overrides still win.

CLI output rework:
- Inline code frames are reserved for errors; warnings list their file:line sites compactly so a long tail of low-severity findings stays scannable.
- Non-verbose warnings roll up into a capped rule×count list (+N more rules → --verbose); errors get the same overflow line past the top 3.
- Audience-aware fix links in --verbose: coding agents get a cache-busting fetch directive, humans get a "Learn more" docs link under the rule name.
- Closing Docs note pointing to CI/CD setup, config-based rule suppression, and diff/PR scanning.

Internal: a single buildSortedRuleGroups primitive backs every rule-list surface (category breakdown, top errors, warnings roll-up, verbose detail, agent handoff, on-disk dump); shared warning-header and site-badge helpers remove the duplicated rendering.
2026-06-01 02:23:30 -07:00
Ray Arayilakath b9e9bcbc08 feat(cli): align CLI with clig.dev and 12-factor guidelines (#623)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 04:46:26 -04:00
Nisarg Patel 24425b113a feat(cli): add Sentry crash reporting (#621)
* feat(cli): add Sentry crash reporting

Capture uncaught CLI errors via @sentry/node, flushed before the process
exits and enriched with a run-context snapshot (version, node/platform/
arch, invocation command/argv, cwd, CI provider, coding agent,
interactivity, JSON mode). Initialized as the first statement of the CLI
entry and scoped to the CLI only — the @react-doctor/api library never
initializes Sentry. Opt out via --no-score (also skipped under tests).

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(cli): consolidate CI/agent detection into is-ci-environment

build-run-context re-declared CI provider and coding-agent env-var maps
that mirrored is-ci-environment. Move the label maps and the
detectCiProvider/detectCodingAgent resolvers into is-ci-environment as the
single source of truth, derive the flat agent env-var list from the brand
map, and have isCodingAgentEnvironment derive from detectCodingAgent.
Behavior is unchanged (env-detection tests still green).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 21:51:18 -07:00
Aiden Bai 5fc6a9faa7 Add Discord link to CLI error help (#620) 2026-05-31 20:32:43 -07:00
Aiden Bai b3c3aa9401 chore: codebase audit cleanup (dead code, dedup, CI/config fixes) (#619) 2026-05-31 19:36:40 -07:00
Ray Arayilakath f1913f27f5 chore(skills): add truffler symbol-search tooling and deslop skill (#618)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 21:45:11 -04:00
Ray Arayilakath bb15252940 feat(cli): add --experimental-parallel flag for multi-worker oxlint scans (#616)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 20:49:56 -04:00
Aiden Bai 4bc8a73d24 feat(core): port expo-doctor checks (Expo detection + project-level diagnostics) (#583) 2026-05-31 17:30:15 -07:00
Aiden Bai daef23ceff fix: cut false positives and gate rules by library + React Compiler (#614) 2026-05-31 17:25:18 -07:00
Aiden Bai 09fe1ff55f fix(#591): CLI multi-project wrapper scans (#592)
* Fix CLI multi-project wrapper scans

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>

* Tighten ambiguous scan target handling

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>

* Refactor resolveDiagnoseTarget to accept options for ambiguous handling

- Introduced ResolveDiagnoseTargetOptions interface to manage ambiguous project resolution.
- Updated resolveDiagnoseTarget function to utilize the new options parameter.
- Adjusted resolveScanTarget to pass options to resolveDiagnoseTarget, enhancing flexibility in target resolution.

* Remove unnecessary blank line in resolve-scan-target.ts for cleaner code.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
Co-authored-by: Nisarg Patel <awesomenisarg@gmail.com>
2026-05-31 16:45:13 -07:00
Ray Arayilakath 8b313badda fix: dead-code false positives on symlinked roots and 404 fix-recipe links (#615)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 18:32:56 -04:00
Nisarg Patel 6448d5bfe1 perf(oxlint-plugin): memoize getDownstreamRefs to fix superlinear effect-rule blowup (#613)
ascend() re-descended the same definition subtrees on every recursion step,
so the seven State & Effects rules (led by no-pass-data-to-parent) blew up
superlinearly on large effect-heavy components — re-walking and re-scoping
identical bodies across recursion, across effects, and across rules.

Cache the downstream-reference lookup per Program node in a WeakMap keyed on
the per-Program analysis singleton (GC-bound with the file, no cross-file
bleed). Callers only ever read the returned array, so sharing it is safe.

On an 866-file Next.js app this cut ~9s (~24%) off a full scan — the worst
rule on a 1,159-line / 10-effect component dropped from ~9.5s to ~0.18s, and
the hot lint batch from ~13.5s to ~2.5s — with byte-identical diagnostics
(verified by a SHA-256 fingerprint over every diagnostic before/after).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 03:20:00 -07:00
Aiden Bai 9fc6f62940 feat: handoff prompt verifies fixes and educates the user
Tell the handed-off agent to verify each fix against the canonical recipe
and re-run the scan (don't assume), and add a section instructing it to
explain in plain language what each issue is, why it matters, and how
severe it is in human terms.
2026-05-31 02:25:39 -07:00
Aiden Bai 6e59f10ef8 feat: new onboarding (#596) 2026-05-31 02:24:23 -07:00
Ray Arayilakath b612664043 fix(action): degrade to full-project scan when PR files are unreadable (#611)
Co-authored-by: Cursor <cursoragent@cursor.com>
v1 v1.1.1
2026-05-31 03:04:46 -04:00
Ray Arayilakath 3ceb7480c1 fix(oxlint-plugin): allowlist public client keys in no-secrets-in-client-code (#612)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 03:03:36 -04:00
Nisarg Patel c2198ed675 feat: order the diagnostics dump by rule priority (#590)
* feat: order the diagnostics dump by rule priority

Users report that `npx react-doctor` prints a large, undifferentiated dump and
they don't know what to tackle first. The score API now returns an intrinsic
priority/tier per rule; surface it so the dump leads with what's most worth
fixing instead of ordering purely by severity.

- core: `ScoreResult` carries the API's `rules: {ruleKey: {priority, tier}}`
  payload (new `RulePriority`/`RuleTier` types); `parseScoreResult` captures it.
- CLI: rule-groups and categories sort by `effectivePriority` (API priority
  desc). Unranked rules get a severity-based midpoint; with no score at all
  (`--no-score` / API unreachable) ordering degrades to the previous
  error-before-warning + count order, so there is no regression offline.

No priority table is duplicated here — the engine remains the single source of
truth and the values arrive over the score API.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(cli): improve error handling for command execution failures

* refactor(core): validate the score API response with effect/Schema

Replace the hand-rolled type guards in `parseScoreResult`/`parseRulePriorities`
with `effect/Schema` (the schema lib already used across @react-doctor/core, see
schemas.ts) — `Schema.Struct` + `Schema.Literals` + `Schema.Record` decoded via
`decodeUnknownOption`. A malformed payload decodes to null and falls back to the
severity ordering, same as before. Result types are now `readonly` to match the
decoded shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 22:49:53 -07:00
Aiden Bai ac3ca1ab12 Add enterprise hint for missing scores (#608) 2026-05-30 19:37:47 -07:00
Ray Arayilakath fe01e573a9 fix(core): redact secrets and PII from diagnostic output (#606)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 22:26:55 -04:00
Ray Arayilakath 5dff3b5a5d fix(core): always clear oxlint batch progress interval to prevent CLI hang (#599) (#607)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 20:02:05 -04:00
Ray Arayilakath 52ecf12d64 feat(action): add non-blocking input for advisory CI runs (#604)
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.1.0
2026-05-30 19:36:54 -04:00