Skip to content

Fix the pre-existing eslint errors and enable lint in CI - #54

Merged
portdeveloper merged 1 commit into
portdeveloper:masterfrom
ShadowOfTime1:lint/clean-and-gate
Oct 4, 2026
Merged

portdeveloper merged 1 commit into
portdeveloper:masterfrom
ShadowOfTime1:lint/clean-and-gate

Conversation

@ShadowOfTime1

Copy link
Copy Markdown
Contributor

Closes #17

pnpm lint now exits 0 on master's 18 errors across 12 files, without new warnings (11 left, down from 12), and CI runs pnpm lint before test and build. Behavior is kept; where it was already broken it now does what the code intended.

Both points from the #32 review are covered, with tests:

  • Mip3HeroSection reset. The counter is driven by one timer per frame from a small nextHeroTick timeline (src/components/mip3/heroTimeline.ts). On current master the effect scheduled the 3s restart and then called setRunning(false); that state change ran the effect cleanup, which cancelled the restart timer, so the counter played once and stopped. Now there is no stopped state for a cleanup to cancel: it holds the last frame for 3s and starts over, with the same 1s / 80ms / 0.5s timings. heroTimeline.test.ts steps through two full cycles.
  • Hydration. LanguageProvider, ExplainModeProvider and InfraContent read the saved locale, explain mode and URL-hash tab through useSyncExternalStore (a small storedPreference helper for the two localStorage values). The server and the hydrating client render the defaults, and the saved value applies right after hydration, so the first client render matches the server markup. src/lib/hydration.test.ts renders the providers with react-dom/server while window and localStorage hold a saved value, and checks the markup still has the defaults; reading the saved value during render (as a state initializer would) makes it fail. InfraContent keeps a hash-restored tab mounted after you switch away, as before.

The rest:

  • Auto-play in MemoryPoolSection, JumpdestSection and BundlerComparisonSection stops in the timer callback that reaches the last step instead of from the effect body. Final state and timing are the same; in the bundler's "with MIP-4" mode the message is still decided from the same statuses at the same moment.
  • ConstructionSection renders the reduced-motion final frame from the preference rather than writing it into state after hydration.
  • OraclePlayground resets when a different token is picked, in the click handler (re-picking the current token does nothing, as before).
  • AnalyzerPage guards the one-time ?q= auto-analyze with a ref, and lists setTab in handleQuickRepo's deps so the compiler can keep the memoization.
  • SpamHeroSection draws its first random block one task after hydration.
  • TransactionTimelineSection uses the useInView ref directly instead of writing to it from a ref callback; CollisionSection wraps its // labels in braces.

Verification: pnpm lint (0 errors), tsc --noEmit, vitest run (78 passed), next build, and every touched page returns 200 from the built app.

pnpm lint now exits 0 (18 errors across 12 files, no new warnings), and CI
runs it before test and build.

- Mip3HeroSection: one timer per frame from a small nextHeroTick timeline.
  The old effect scheduled the restart and then set running false, whose
  cleanup cancelled that same timer, so the counter played once and stopped.
  It now holds the last frame for 3s and starts over, with the same timings.
- LanguageProvider, ExplainModeProvider and InfraContent read the saved
  locale, explain mode and URL-hash tab through useSyncExternalStore. The
  server and the hydrating client render the defaults and the saved value
  applies right after hydration, so the first client render matches the
  server markup. InfraContent keeps a hash-restored tab mounted after
  switching away, as before.
- Auto-play in MemoryPoolSection, JumpdestSection and BundlerComparisonSection
  stops in the timer callback that reaches the last step instead of from the
  effect body; state and timing are unchanged.
- ConstructionSection renders the reduced-motion final frame from the
  preference instead of writing it into state after hydration.
- OraclePlayground resets when a different token is picked, in the click
  handler. AnalyzerPage guards its one-time ?q= auto-analyze with a ref and
  lists setTab so the compiler can keep the memoization. SpamHeroSection
  draws its first random block one task after hydration.
- TransactionTimelineSection uses the useInView ref directly instead of
  writing to it from a ref callback. CollisionSection wraps its // labels in
  braces.

Tests cover the hero timeline looping and the server render ignoring a
saved preference, with window and localStorage present.

Closes portdeveloper#17
@vercel

vercel Bot commented Oct 3, 2026

Copy link
Copy Markdown

@ShadowOfTime1 is attempting to deploy a commit to the MF Experimental Team on Vercel.

A member of the Team first needs to authorize it.

@portdeveloper portdeveloper left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks

@portdeveloper
portdeveloper merged commit 1d97962 into portdeveloper:master Oct 4, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the pre-existing eslint errors and enable lint in CI

2 participants