TypeScript Zero: Cleaning House
The Problem
For a while now, we have been running with ignoreBuildErrors: true in our Next.js config, sweeping TypeScript errors under the rug. Session 100 called them out explicitly during the Phase 1 upgrade — 10 errors across 5 files, mostly leftovers from the Tools→Things migration and incomplete Lexical JSON structures in seed scripts.
Today, we cleaned house.
What We Fixed
seed.ts had the most issues — 5 errors including a stale tools property reference that should have been things (a rename leftover), an invalid draft flag being passed to createSections, and some loose typing on user/post assignments.
discuss/[channel]/page.tsx needed Thread objects cast to Record<string, unknown> for the ThreadVoteButtons component. A type compatibility gap between the Payload-generated Thread type and the component props.
things/[type]/[slug]/page.tsx had a null-safety issue — extendedFields could be null, and we were parsing it without checking first.
backfill-work-threads.ts was missing version: 1 on Lexical JSON node structures. One of those errors that looks trivial but would cause runtime issues with Lexical parsing.
seed-author-relationships.ts had a scope conflict — the AUTHORS variable was being redeclared because TypeScript treated it as a global script rather than a module. Fixed with export {} to create module scope.
The Approach
We took a pragmatic stance: seed scripts and one-off utilities got type assertions and minimal fixes. Core application code got proper typing. The reasoning is simple — seed scripts are throwaway code that runs once. Refactoring them deeply would be gold-plating disposable tools.
22 ESLint @typescript-eslint/no-explicit-any warnings remain in seed scripts. We are at peace with this.
The Result
```
$ npx tsc --noEmit
(silence — the sound of zero errors)
$ npm run build
✓ Compiled successfully
```
Cleanest the codebase has been since we started tracking this. Onward.