Skip to content

Frontend typing-debt cleanup (cavatelli) — accumulating preview, merge at end - #1007

Draft
snackman wants to merge 3 commits into
masterfrom
cavatelli-typing-debt
Draft

snackman wants to merge 3 commits into
masterfrom
cavatelli-typing-debt

Conversation

@snackman

Copy link
Copy Markdown
Contributor

One long-lived integration branch for the whole frontend lint/typing-debt cleanup (plans/cavatelli-typing-debt.md). All phases land here and merge once at the end — single Vercel preview, no incremental master merges.

Included so far

  • P0eslint --fix safe auto-fixables (2× prefer-const).
  • P1 — removed 156 no-unused-vars (667 → 511 total problems) + ratcheted the rule to error in eslint.hooks.config.js (the CI gate now blocks regressions). Added _-prefix / ignoreRestSiblings escape hatches in eslint.config.js.

Coming (same branch)

P2 long-tail errors (~39) · P2.5 stale eslint-disable directives · P3 no-explicit-any (342, foundation-first via generated Supabase types) · P4 exhaustive-deps (41) + final switch to full npm run lint.

Notes

🤖 Generated with Claude Code

snackman and others added 2 commits June 11, 2026 17:40
…CI gate

Phase 1 of cavatelli-typing-debt: eliminate all
@typescript-eslint/no-unused-vars violations in frontend (156 -> 0) and
flip the CI ratchet so the focused gate enforces the rule going forward.

- Removed unused imports, locals, dead helper functions, and unused
  destructured props/state across 78 frontend files (mechanical dead-code
  removal; no logic changes).
- Intentionally-unused symbols that must stay positionally are _-prefixed
  (pizzaAlgorithm shouldUseHalfAndHalf _style) or handled via
  ignoreRestSiblings (ReactMarkdown { node, ...props } overrides).
- Unused catch bindings converted to optional catch (} catch {).
- eslint.config.js: no-unused-vars now ['error'] with argsIgnorePattern,
  varsIgnorePattern, caughtErrorsIgnorePattern '^_' + ignoreRestSiblings.
- eslint.hooks.config.js (CI gate): registered @typescript-eslint plugin and
  added the same no-unused-vars rule so PRs are blocked on regressions.

Verified: npm run lint no-unused-vars count = 0; CI gate command exits 0.
(Pre-existing, out-of-scope: vite build fails on a missing heic2any dep that
also fails on origin/master; not touched here.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Phase 0 of the typing-debt cleanup (plans/cavatelli-typing-debt.md). Ran
`npm run lint -- --fix --report-unused-disable-directives-severity off`. On current
master the only safe auto-fixables are 2 prefer-const (let->const, neither reassigned).

NOTE: a plain `--fix` ALSO strips eslint-disable directives (ESLint 9 flat config
defaults reportUnusedDisableDirectives to "warn"), including deliberate
react-hooks/exhaustive-deps suppressions in payments files. That's deliberately
EXCLUDED here — stale-directive cleanup is a judgment call handled in a later phase,
not a blanket sweep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rsvpizza Ready Ready Preview, Comment Jun 12, 2026 12:05am

Request Review

…cl/useless-catch/constant-binary/etc) + ratchet

Cleared all 34 non-(no-explicit-any/no-unused-vars) ESLint errors and added
each cleared rule to eslint.hooks.config.js as 'error' so the CI gate enforces
them. The two `false &&` constant-binary-expression JSX guards were intentional
feature-hides ("Coming Soon" AI ordering); converted to named const flags
(SHOW_LEGACY_PIZZERIA_SELECTION / SHOW_AI_ORDER_BUTTON) preserving exact runtime
behavior. BOM-strip regexes switched from literal U+FEFF to  escape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant