feat(rules): add Octane correctness diagnostics - #1659
Draft
aidenybai wants to merge 2 commits into
Draft
Conversation
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
commit: |
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
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.
Catches Octane hook-slot collisions in plain JavaScript loops and React-style text
onChangehandlers that only fire on native commit.Why
Octane tracks slot-keyed hooks by compiler-assigned call site. Repeating one call site in a plain JavaScript loop makes iterations share state, memo, or effect storage, so Octane rejects the pattern. Octane also uses native DOM events: text
onChangeruns on commit or blur, whileonInputruns for each edit.Use keyed TSRX iteration or a child component for repeated hooks, and use
onInputfor per-edit text updates:Intentional native commit behavior remains supported with
suppressNativeChangeWarning.What changed
octane-no-hook-in-loop, including aliases, namespace calls, custom hooks, IIFEs,.call()/.apply()IIFEs, and synchronous iterator callbacks.use(),useContext, deferred nested functions, conditions, early returns, and loop-free callbacks.octane-no-native-text-onchangeusing Octane's compiler decision boundaries for text input types, callable input handlers, readonly/disabled controls, dynamic props, spreads, capture handlers, explicit suppression, and non-DOM renderers.octane.Evidence
The contracts follow Octane's current
compile-errors.test.ts,native-change-compiler.test.ts,compile.js,native-change-diagnostics.js, and public differences-from-React documentation. The implementation intentionally stays within those compiler-proven boundaries.Validation
test,lint,typecheck,format:check, andsmoke:json-report: passed.DAYTONA_API_KEYis not available in this environment.Test plan
nr --filter oxlint-plugin-react-doctor testnr --filter oxlint-plugin-react-doctor typecheckFUZZ_RULE=octane-no-hook-in-loop FUZZ_STRICT=1 FUZZ_ITERATIONS=500 nr fuzzFUZZ_RULE=octane-no-native-text-onchange FUZZ_STRICT=1 FUZZ_ITERATIONS=500 nr fuzznr testnr lintnr typechecknr format:checknr smoke:json-report