Commit Graph

7 Commits

Author SHA1 Message Date
Skosh afd60dbe69 fix(effect-needs-cleanup): prove effect-owned cleanup (#1559)
* fix(effect-needs-cleanup): handle returned identifiers for addEventListener/addListener

Fixes #1558 - Part 1

- Allow returning identifiers bound to addEventListener/addListener results as valid cleanup
- Recognize calling such identifiers (e.g., ) as cleanup
- This fixes false positives for React Native's NetInfo.addEventListener and similar APIs

Remaining work: helper function cleanup and array collection cleanup

Co-authored-by: Skosh <skoshx@users.noreply.github.com>

* docs: add changeset for addEventListener cleanup fix

Co-authored-by: Skosh <skoshx@users.noreply.github.com>

* fix(effect-needs-cleanup): prove resource ownership

* fix(effect-needs-cleanup): harden ownership proofs

* fix(effect-needs-cleanup): isolate deferred ownership

* fix(effect-needs-cleanup): prove deferred timer ownership

* fix(effect-needs-cleanup): narrow invocation owners

* fix(effect-needs-cleanup): track helper collection mutations

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Aiden Bai <aiden@million.dev>
2026-08-03 13:29:06 -07:00
Aiden Bai 95f99372c0 fix(rules): gate chain updates below React 18 (#1336)
* fix(rules): gate chain updates below React 18

* test(rules): pin chain parity to React 17
2026-07-17 01:54:13 -07:00
Aiden Bai 55dcb937fb fix(zod): recognize the official v4 export (#1201)
* chore: scaffold zod v4 subpath fix

* fix(zod): recognize the official v4 export

* test(zod): harden v4 subpath coverage
2026-07-13 05:55:12 -05:00
Aiden Bai f10f9ca8a6 fix(rules): three false-positive fixes from the adversarial FP hunt (#1106) 2026-07-09 05:20:49 -07:00
Aiden Bai e872767965 Revert "fix(rules): three false-positive fixes from the fuzz FP hunt"
This reverts commit 6ae8e46b10.
2026-07-09 04:37:10 -07:00
Aiden Bai 6ae8e46b10 fix(rules): three false-positive fixes from the fuzz FP hunt
Hunt: hunt-false-positives over the 73-seed regression corpus + the
pinned 47-repo OSS sample, plus strict per-rule fuzz (500 iterations)
over every rule changed in the RB-COMP-FIX batch and the two new rules
— all fire under fuzz and pass the crash/slow/verdict oracles.

Fixes:
- exhaustive-deps: the effect-event dep message no longer fires on a
  same-named useEffectEvent polyfill imported from a non-React package
  or defined locally. The origin resolution that already guarded
  rules-of-hooks and no-effect-event-in-deps is extracted into the
  shared isNonReactEffectEventCallee util and applied to the dep check.
- no-direct-state-mutation: null-initialized state is no longer plain
  React data when every observed setter call feeds it an opaque
  instance (new X(), receiver.createGain()) — field writes there are
  the instance's imperative API. Bare helper calls stay unclassified so
  the wangeditor-class lost-update detection keeps firing.
- only-export-components: a default-exported unknown factory fed only
  config objects/literals (defineFrontComponent({...})) is a library
  definition counted as a plain non-component export, not an "unnamed
  component"; known-HOC anonymous wrappers and curried HOCs keep their
  reports.

Corpus: seed headers extended so the polyfill and disposed-resource
seeds also pin exhaustive-deps / no-direct-state-mutation; new
config-factory seed; the two no-array-index-as-key seeds trimmed to
their still-ground-truth shapes (split-output rows and same-item
composite keys were reclassified as true positives by the fn-hunt
sweep, so those sections contradicted the corpus contract). Hunt now
reports 0 regressions.
2026-07-09 04:36:04 -07:00
devin-ai-integration[bot] 0748a4ba19 test: adversarial fuzzing harness for every rule (@react-doctor/fuzz) (#1022)
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
2026-07-02 15:09:02 -07:00