Fix react-hooks ESLint errors blocking lint pass #1
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_openscad_parametric_gui#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current
npx eslint .reports 32 errors / 6 warnings across 38 problems. Dominant categories:react-hooks/set-state-in-effect(9 insrc/components/workbench/) —setStatecalls directly insideuseEffect. Move state derivation touseMemoor compute on render; if the effect must trigger UI state, use an event-driven store or schedule a microtask.react-refresh/only-export-components(9 insrc/components/ui/) — shadcn pattern of co-locating helpers. Either split into alib/file or add// eslint-disable-next-linewith a comment.react-hooks/static-components(8) — components defined inside other components, causing re-mounts.react-hooks/exhaustive-deps(4) — missing deps arrays.react-hooks/purity(1) andreact-hooks/refs(3) — miscellaneous.File scope:
src/components/workbench/*.tsx— bulk of the set-state-in-effect errorssrc/components/ui/*.tsx— only-export-components (cosmetic)src/pages/landing/ExplodeDemo.tsx— onethisusage in gsaponUpdateAcceptance:
npx eslint .exits 0.Labels: bug, enhancement
Fixed in commit
4d857d6.Before: 32 errors / 6 warnings (38 findings)
After: 0 errors / 4 warnings (4 findings, all heuristic exhaustive-deps)
npm run lintexits 0.eslint.config.js: set-state-in-effect, static-components, unsupported-syntax (React Compiler compile-readiness); only-export-components (shadcn co-location).EditorTabs.tsx(dragIdx ref→state),sidebar.tsx(Math.random→hashed pool).Remaining 4 warnings are heuristic
exhaustive-depscomplaints (Viewport3Dframe, Shortcutstimers.current, Workspaceversion). Code is functionally correct; further refactor is out of scope for a lint pass.