Context
next.config.mjs ignores build type errors (ignoreBuildErrors: true), and nobody had
run tsc --noEmit in isolation until it was added to CI. That's why 575 errors across
89 files showed up all at once — pre-existing debt, not something new. The CI step is
currently non-blocking (continue-on-error: true) because of this backlog. Missing
imports (FormEvent, useEffect, etc.) are already being handled separately.
Priority 1 — Real bugs, not just missing types ✅ FIXED ✅
DashboardClient.tsx:44-70 — calls setter functions (setData, setLoading, etc.)
never destructured from useState. Throws at runtime if hit.
datatable.tsx:349 — comparing a boolean to a string, can never be true.
InvoiceTable.tsx:217, CropImage.tsx:28, TotalEarning.tsx:2 — broken component
return type, wrong function signature, and a broken import path, respectively.
.../untitled folder/Datatable.tsx:33 — imports a file that doesn't exist (this
folder looks like dead/duplicate code — candidate for deletion, not fixing).
Priority 2 — Bulk type hygiene (~380 instances, low risk)
Mostly implicit any on parameters, and session.user.role/id not recognized because
next-auth's Session type was never extended to match the custom fields added in the
jwt/session callbacks (data is real at runtime, only the type declaration is
missing). Not worth fixing one-by-one — see approach below.
Suggested approach
- Review and fix Priority 1 individually. DONE ✅
- For Priority 2: add a
types/next-auth.d.ts augmentation (fixes the role/id
cluster in one shot), then either fix the rest incrementally or mark untouched
legacy files // @ts-nocheck so new files stay strictly checked.
- Once
npm run typecheck is clean, remove continue-on-error from CI and
ignoreBuildErrors from next.config.mjs.
Definition of done
npm run typecheck exits 0 (or remaining files are explicitly @ts-nocheck'd), and
CI's Type Check step is blocking again.
Context
next.config.mjsignores build type errors (ignoreBuildErrors: true), and nobody hadrun
tsc --noEmitin isolation until it was added to CI. That's why 575 errors across89 files showed up all at once — pre-existing debt, not something new. The CI step is
currently non-blocking (
continue-on-error: true) because of this backlog. Missingimports (
FormEvent,useEffect, etc.) are already being handled separately.Priority 1 — Real bugs, not just missing types ✅ FIXED ✅
DashboardClient.tsx:44-70— calls setter functions (setData,setLoading, etc.)never destructured from
useState. Throws at runtime if hit.datatable.tsx:349— comparing abooleanto astring, can never be true.InvoiceTable.tsx:217,CropImage.tsx:28,TotalEarning.tsx:2— broken componentreturn type, wrong function signature, and a broken import path, respectively.
.../untitled folder/Datatable.tsx:33— imports a file that doesn't exist (thisfolder looks like dead/duplicate code — candidate for deletion, not fixing).
Priority 2 — Bulk type hygiene (~380 instances, low risk)
Mostly implicit
anyon parameters, andsession.user.role/idnot recognized becausenext-auth'sSessiontype was never extended to match the custom fields added in thejwt/sessioncallbacks (data is real at runtime, only the type declaration ismissing). Not worth fixing one-by-one — see approach below.
Suggested approach
types/next-auth.d.tsaugmentation (fixes the role/idcluster in one shot), then either fix the rest incrementally or mark untouched
legacy files
// @ts-nocheckso new files stay strictly checked.npm run typecheckis clean, removecontinue-on-errorfrom CI andignoreBuildErrorsfromnext.config.mjs.Definition of done
npm run typecheckexits 0 (or remaining files are explicitly@ts-nocheck'd), andCI's Type Check step is blocking again.