348 Commits

Author SHA1 Message Date
Aiden Bai 53e2544870 feat(action): expose --annotations through action.yml (#281)
* feat(action): expose --annotations through action.yml

Adds an opt-in 'annotations' input to the composite action so users
can surface findings as inline GitHub Actions annotations on the PR's
Files changed view. The flag is forwarded to the CLI as --annotations.

When 'github-token' is also set, the captured PR-comment body now
filters out '::error' / '::warning' workflow-command lines so the
sticky summary stays human-readable while the runner still parses
annotations from the live step log.

README documents the three resulting modes: sticky-comment-only
(default), annotations-only, and both.

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

* docs: tighten action annotations docs, remove em dashes

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

* test(action): update contract test for split tee/sed and annotations

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
v0.4.0
2026-05-16 20:43:13 -07:00
Aiden Bai d15cfa761b fix 2026-05-16 20:30:16 -07:00
Aiden Bai afe086a449 fix 2026-05-16 20:27:41 -07:00
Aiden Bai 679e2b01c0 docs: document PR blocking and fail-on semantics (#282) v0.3.2 2026-05-16 20:23:37 -07:00
Aiden Bai 28db33f320 Simplify npx usage (#280) v0.3.1 2026-05-16 20:18:03 -07:00
Aiden Bai 08063c0a62 docs: remove stale dead-code claims after Knip removal (#246) (#283)
* docs: remove stale dead-code claims after Knip removal (#246)

PR #246 removed the bundled knip integration, but several user-facing
docs still advertised dead-code coverage and exposed the removed
`--dead-code` / `--no-dead-code` CLI flags:

- packages/react-doctor/README.md ("and dead code" in the categories list)
- skills/react-doctor/SKILL.md (skill description)
- packages/website/public/llms.txt (CLI options block)

Strips those claims and adds a short migration note pointing users to
`npx knip` directly for dead-code analysis.

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

* chore(todos): mark stale dead-code doc cleanup as resolved

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-16 20:16:40 -07:00
Aiden Bai 118741e260 Simplify rule set exports (#277) 2026-05-16 19:58:10 -07:00
Cursor Agent 3bb230f752 Revert "feat(oxlint): add effect/ analyzer primitives for upstream rule port"
This reverts commit 891088c1b0.
2026-05-17 02:08:42 +00:00
Cursor Agent d7efa43fb8 Revert "feat(oxlint): port 8 rules from eslint-plugin-react-you-might-not-need-an-effect"
This reverts commit 86a2a98e7c.
2026-05-17 02:08:42 +00:00
Cursor Agent 86a2a98e7c feat(oxlint): port 8 rules from eslint-plugin-react-you-might-not-need-an-effect
1:1 ports of:
- no-derived-state (avoidDerivedState + avoidSingleSetter branches)
- no-chain-state-updates
- no-event-handler (per-test-identifier reporting, state vs prop variants)
- no-adjust-state-on-prop-change
- no-reset-all-state-on-prop-change (custom-hook skip, full-reset detection)
- no-pass-live-state-to-parent (hook vs component message variants)
- no-pass-data-to-parent (leaf classification, ref/refCurrent exclusions)
- no-initialize-state (mount-only deps detection)

Diagnostic messages match upstream verbatim with template-variable
substitution done in JS. Rules coexist with our existing thematically
related rules (no-derived-state-effect, no-effect-chain,
no-event-trigger-state, no-prop-callback-in-effect); the IDs are
distinct.

Total rule count rises from 179 → 187.

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:58:54 +00:00
Cursor Agent 891088c1b0 feat(oxlint): add effect/ analyzer primitives for upstream rule port
Builds the AST-only foundation needed to port the 8 rules from
eslint-plugin-react-you-might-not-need-an-effect (NickvanDyke,
v0.10.1, upstream SHA 4c71faaa7623d2d5feb33983dc2ebcc08206bcc5).

Upstream is ESLint-native and uses context.sourceCode.getScope()
references / resolved.defs[].node.init recursively to chase the
ultimate source of every value. Oxlint plugins have no scope
manager. This commit ports the impedance-bridging analyzer:

- get-effect-deps-array.ts: typed accessor for useEffect(..., deps)
- has-effect-cleanup.ts: matches upstream's loose hasCleanup shape
- is-custom-hook-name.ts: `use[A-Z]` predicate
- is-synchronous.ts: parent-pointer walk bailing on await / void /
  nested function-likes
- get-containing-component-or-hook.ts: classifies the surrounding
  function as component / HOC-wrapped component / custom hook
  (mirrors upstream's pure-HOC short-circuit for memo/forwardRef)
- collect-use-ref-bindings.ts: top-level useRef binding collector
- collect-local-function-bindings.ts: FunctionDeclaration / arrow /
  useCallback bindings with param names + body for indirect-call
  reasoning
- analyze-component-bindings.ts: the cornerstone — classifies every
  component-scope name as state / setter / ref / prop / constant /
  local-function and precomputes localFunctionCalls{StateSetter,
  PropFunction,RefMethod} flags so callees like setX(...) inside an
  intermediateSetter() still register as state-setter calls
- classify-effect-callee-argument.ts: leaf / transitive upstream
  classification used by every rule for argument and deps analysis
- stringify-expression-snippet.ts: bounded AST → text formatter for
  the no-initialize-state "set to ..." message
- create-effect-analyzer-tracker.ts: function-entry / -exit visitor
  pair that maintains the ComponentBindingTable stack

Plus rules/state-and-effects/effect/SOURCE.md with upstream commit
SHA, license attribution, and known divergences.

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:54:09 +00:00
Cursor Agent 013d8b060b docs(changelog): replace em-dashes with hyphens across all changelog content
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:52:54 +00:00
Cursor Agent 1ece85187e docs(changelog): rewrite react-doctor 0.0.1..0.0.47 from version diffs
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:49:25 +00:00
Cursor Agent 2f4e722074 docs(changelog): rewrite react-doctor 0.1.0..0.1.6 from version diffs
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:44:45 +00:00
Cursor Agent 9add2d4771 docs(changelog): drop @aidenybai attribution per user request
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:41:00 +00:00
Cursor Agent fad39ccd8a docs(changeset): refresh placeholder changeset bodies with real descriptions
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:08:43 +00:00
Cursor Agent 687b52d9af docs(changelog): rewrite react-doctor 0.2.0-beta.2..beta.5 from version diffs
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:07:52 +00:00
Cursor Agent 65553614fc docs(changelog): rewrite @react-doctor/types 0.2.0-beta.2..beta.3
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:06:09 +00:00
Cursor Agent 60ae4f8b3d docs(changelog): rewrite @react-doctor/project-info 0.2.0-beta.2..beta.3
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:05:42 +00:00
Cursor Agent cbe1dacb64 docs(changelog): rewrite @react-doctor/core 0.2.0-beta.2..beta.5
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:04:56 +00:00
Cursor Agent ede38a3864 docs(changelog): rewrite eslint-plugin-react-doctor 0.2.0-beta.2..beta.5
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:03:47 +00:00
Cursor Agent 56a916c8bb docs(changelog): rewrite oxlint-plugin-react-doctor 0.2.0-beta.2..beta.5 from version diffs
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-17 01:03:06 +00:00
Aiden Bai 99f6a6ad1c chore: align all package versions to 0.2.0-beta.5
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 04:51:57 -07:00
Aiden Bai 4cbf436848 fix(async-parallel): suppress in tests, browser fixtures, and ordered UI flows (#270) 2026-05-16 04:48:23 -07:00
Nisarg Patel b53d873045 fix(nextjs): stop flagging response.headers and local Map/Set/Headers in GET handlers (#206) (#260)
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
2026-05-16 04:42:49 -07:00
Aiden Bai 838c7f4174 fix(js-length-check-first): detect length guards in larger && chains (#269) 2026-05-16 04:37:17 -07:00
Aiden Bai 3b7cc7c373 fix(no-prevent-default): make rule framework-aware (#274) 2026-05-16 04:29:51 -07:00
Aiden Bai 7a7ec84fad feat: demote design/Tailwind cleanup from default PR comments via per-surface controls (#271) v0.3.0 2026-05-16 04:23:30 -07:00
Aiden Bai d821ca2a82 fix(oxlint): skip js-combine-iterations on lazy Iterator helper chains (#205) (#272) 2026-05-16 04:23:18 -07:00
Aiden Bai 529015d1d8 Scope React Native rules to RN/Expo packages (#266) 2026-05-16 00:30:39 -07:00
Aiden Bai 18b7033e9e fix: avoid async defer await destructuring false positives (#265) 2026-05-15 21:45:34 -07:00
Aiden Bai 8a3a1bee7e update todos 2026-05-15 17:26:49 -07:00
Aiden Bai 2d90c1c5ae fix: scope client secret diagnostics (#252)
* fix: scope client secret diagnostics

Avoid reporting weak secret-name heuristics in config and tooling files, and render framework-specific public env guidance so non-Next.js projects get actionable output.

* fix: broaden secret false-positive guards

Extend the weak client-secret heuristic boundary to common server and tooling paths while keeping exact secret-shape detection active, and move recommendation helpers into focused utilities.

* fix: tighten rc file secret heuristic

Require rc config filenames to be explicit so normal source files like src.ts still use the weak secret-name heuristic.

* test: cover explicit rc secret heuristic

Add regression coverage that explicit rc config files remain outside the weak client-secret name heuristic while regular src.ts files still report.

* fix: refine secret heuristic boundaries

Keep client API helpers covered while making the server-only heuristic exclusions easier to audit.

* chore: format TODO tracker

Format the inherited TODO tracker so PR merge-commit checks can pass.

* fix: classify client secret exposure

Gate the weak secret-name heuristic on explicit client exposure while keeping high-confidence secret values active everywhere.

* test: cover secret exposure boundaries

Lock down client, server, ambiguous-source, and App Router cases for the client-secret heuristic.

* fix: pass framework to secret classifier

Use detected framework settings to avoid path-only client exposure guesses for app directories and server-owned source roots.

* fix: respect use server in secret classifier

Classify use-server modules as server code so client-path heuristics do not report server action constants.

* fix: harden secret exposure edges

Cover mixed server-only scopes, server-owned source roots, and additional client entry shapes so the weak secret heuristic stays scoped to bundled client code.

* fix: refine secret classifier precedence

Classify secret exposure from project-relative paths and gate Next-only route heuristics so explicit client signals win over broad server path names.

* fix: suppress secret label false positives

Avoid weak secret-name diagnostics for UI copy and storage-key prefixes found during evals while preserving client secret fallback coverage.

* fix: preserve api key secret detection

Keep camel-case apiKey variables eligible for the weak secret heuristic while retaining UI text and storage prefix suppressions.

* chore: format changeset prerelease metadata

Keep the new prerelease metadata from main aligned with the repository formatter so CI can pass on the PR merge commit.
2026-05-16 00:32:54 +03:00
Aiden Bai 29b7229ea1 0.2.0-beta.4 2026-05-15 07:13:11 -07:00
Aiden Bai 10d5de804f 0.2.0-beta.3 2026-05-15 07:11:24 -07:00
Aiden Bai 9783acf525 Fix no-barrel-import index false positives (#253) 2026-05-15 07:07:52 -07:00
Aiden Bai 809e38ceba pub 2026-05-15 07:01:35 -07:00
Aiden Bai 0cd93551a4 fix: narrow effect event handler detection (#256) 2026-05-15 06:47:09 -07:00
Aiden Bai bca5d30fc5 fix(oxlint): collapse duplicate diagnostics + recover diagnostics from large monorepo projects (eval-driven) (#262) 2026-05-15 06:46:36 -07:00
Aiden Bai ffbd20f3d0 fix: suppress local use hook false positives (#257) 2026-05-15 06:22:35 -07:00
Aiden Bai bfaf9c9530 fix: avoid React 19 rule false positives on React 18 (#254) 2026-05-15 05:40:34 -07:00
Aiden Bai 6bc33c8aab fix: treat return guards as render state reads (#255) 2026-05-15 05:40:07 -07:00
Aiden Bai d23137e177 test: add fixed issue regression coverage (#258) 2026-05-15 02:23:03 -07:00
Aiden Bai 92829c7123 chore: format TODOS.md to fix format:check on main 2026-05-15 02:15:22 -07:00
Aiden Bai 0a52ca3d05 fix 2026-05-15 01:47:20 -07:00
Aiden Bai 9902ea671d TODOS.md 2026-05-15 01:45:59 -07:00
Aiden Bai 6e2ee9d474 refactor(cli): reorganize cli/ into commands/utils + port from react-grab (#250) 2026-05-15 00:50:42 -07:00
Aiden Bai f0198e2f2d refactor: extract @react-doctor/{types,project-info,core} internal packages + cleanup (#249) 2026-05-14 22:22:19 -07:00
Aiden Bai 4d622970b5 Revert "pub"
This reverts commit 4d9d1a5fcf.
2026-05-14 22:05:22 -07:00
Aiden Bai 4d9d1a5fcf pub 2026-05-14 22:03:02 -07:00