Fix: react hook hidden mutation noise - #73
Merged
Conversation
alxxjohn
added a commit
that referenced
this pull request
Jul 28, 2026
🤖 I have created a release *beep* *boop* --- ## [1.3.1](v1.3.0...v1.3.1) (2026-07-28) ### Bug Fixes * harden hidden mutation precision ([8f77a74](8f77a74)) * harden UI false positive precision ([b46dfe7](b46dfe7)) * react hook hidden mutation noise ([#73](#73)) ([3fa1b1c](3fa1b1c)) * reduce hidden mutation noise for React hooks ([c4f61c9](c4f61c9)) * satisfy lint for false positive hardening ([62643da](62643da)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
PR Summary
This PR hardens CodeGuard’s precision around high-volume false positives seen while dogfooding against TypeScript/JavaScript React/Next codebases.
Key changes:
Reduces function.hidden-mutation noise for React hooks, local builders, collectors, accumulators, script entrypoints, and Next route handlers.
Keeps real hidden side effects detectable, including collaborator mutations like repo.save(...), parameter mutation, and external resource
mutation.
Recognizes common command/event-style names such as submit, upload, download, notify, fetch, list, read, exists, seed, apply, sync, approve, and
related verbs.
Hardens quality.ambiguous-name for conventional UI/render-prop names like value, values, item, items, and data in React/UI callback contexts.
Prevents function.command-query-mix from flagging React components/hooks and framework-required Next GET / POST handlers.
Improves quality.duplicated-knowledge by including the duplicated literal in the finding message and skipping obvious UI display/class strings.
Tightens naming.cardinality-mismatch to require stronger type evidence and ignore common framework names like args, props, searchParams, next,
out, ids, and rows.
Prevents quality.mutable-global-state from misclassifying local React/component bindings as module-level mutable state.
Allows common UI boolean prop names like open, loading, active, and pending in React/UI contexts for naming.boolean-not-predicate.
Refines design.persistence-model-leak so generated Prisma enum imports and TypeScript Record<...> utility types are not treated as ORM model
leaks.
Tests added/updated:
Prisma enum imports.
Validation:
go test ./...
make codeguard-ci
Both pass.