Conversation
…tion Fixes #1810 - server-cache-with-object-literal: Use resolveImportedApiReference and collectBindingAliases to properly track React.cache wrappers through immutable bindings, check all argument positions for fresh objects/arrays, and report once per call. Shadowed and non-React cache functions stay silent. - nextjs-no-redirect-in-try-catch: Extend findGuardingTryStatement and catchClauseRethrowsCaught with optional framework rethrow predicates. Recognize unstable_rethrow(error) from next/navigation as equivalent to throw, including renamed imports and namespace access. Deferred, wrong-error, and shadowed rethrows still report. - server-sequential-independent-await and async-parallel: Use findSideEffect to detect mutating HTTP requests (POST, PUT, PATCH, DELETE) and preserve their ordering. Independent GET requests continue to report. Add 37 regression test cases covering binding resolution, multi-argument detection, unstable_rethrow patterns, and HTTP mutation ordering. Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
5 tasks
commit: |
Contributor
Interactive terminal E2ETerminal Control verified the built CLI at
|
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.
Summary
Fixes #1810
This PR resolves false positives and false negatives in four rules by improving binding resolution and side-effect detection:
Changes
server-cache-with-object-literalresolveImportedApiReferenceandcollectBindingAliasesto properly track React.cache wrappers through immutable bindingsnextjs-no-redirect-in-try-catchfindGuardingTryStatementandcatchClauseRethrowsCaughtwith optional framework rethrow predicatesunstable_rethrow(error)from next/navigation as equivalent tothrownav.unstable_rethrow(error))server-sequential-independent-awaitandasync-parallelfindSideEffectto detect mutating HTTP requests (POST, PUT, PATCH, DELETE)Testing
unstable_rethrowpatterns (direct, renamed, namespace)Scope and Correctness
The changes follow the existing patterns in the codebase:
resolveImportedApiReferenceandcollectBindingAliasesare existing, well-tested utilitiesfindSideEffectalready correctly detects mutating fetch callsValidation Status
Before merge: Run
rde parityto validate that only the intended diagnostic changes appear across the corpus.Changeset
Included patch-level changeset documenting all four rule fixes.