Conversation
…ee.js The rule was firing on any recursive requestAnimationFrame loop in projects with three as a dependency, even for 2D canvas animations that never use Three.js. Now the rule checks for file-level Three.js imports (three, @react-three/*) before reporting. This prevents false positives on 2D canvas/DOM animation loops while still catching real Three.js animation frame usage. Closes #1795 Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
commit: |
Contributor
Parity Check StatusThe full corpus scan is in progress (373/8423 repos processed so far). Given the narrow scope of this change, here's the expected parity outcome: Expected Changes
Risk AssessmentThis fix is low risk because:
Manual Validation
Will update with full parity results when the corpus scan completes. |
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.
Fixes #1795
Root Cause
three-prefer-set-animation-loopwas firing on any recursiverequestAnimationFrameloop in projects withthreeas a dependency, even for 2D canvas animations that never use Three.js. The rule was gated at the project level but had no file-level check.Fix Scope
Added file-level gate: the rule now only fires when the file imports from Three.js ecosystem packages (
three,@react-three/*). This is narrow and safe because:Changes
hasThreeImporthelper to detect Three.js imports (ESM, CJS, TS import-equals)fileImportsThreebefore reportingValidation