-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Problem / Motivation
Micah pointed out that the codebase is 100 % JavaScript and lacks static type safety:
- We’re already modernizing dependencies (see PR Code Cleanup and Package Updates #146) and adding Docker dev DBs—this is a natural time to tighten type guarantees.
Proposal — Incremental TypeScript Adoption
- Tooling – add
typescript,@types/node,@types/react/**, etc. Commit a baselinetsconfig.json(strict-ish, but not blocking migration). - Transpile path – use
ts-node-devfor server scripts; on the client, migrate CRA → Vite (or keep CRA withreact-scripts’ TS template). - Gradual opt-in – rename high-value files to
.ts/.tsx(start withsrc/utils, shared hooks, & API route handlers). - Type linting – extend ESLint with
@typescript-eslint/*; CI fails on type errors (npm run typecheck). - Docs – update
CONTRIBUTING.mdand README with setup + “How to convert a JS file to TS”.
Acceptance Criteria
-
typescript& type deps inpackage.json - Root
tsconfig.jsoncommitted -
npm run typecheckscript and CI job added - ≥ 20 % of codebase (or
src/utils,src/hooks,src/components/common) converted with noanysuppressions - ESLint passes locally & in CI
- New doc:
docs/ts-migration.md(step-by-step guide)
Suggested Task Breakdown
| Step | Owner | Details | ETA |
|---|---|---|---|
| 1 | any | Add TS deps & tsconfig.json |
1 h |
| 2 | any | Add ESLint/Prettier TS rules | 1 h |
| 3 | any | Convert src/utils/* |
2–3 h |
| 4 | any | Convert src/hooks/* & one sample page |
3–4 h |
| 5 | any | Add npm run typecheck to CI |
1 h |
| 6 | any | Update docs & PR template | 1 h |
Risks / Mitigations
- Large diffs → keep PRs < 300 LOC and scoped to one folder.
- Legacy bugs → run unit tests after each migration slice.
- Contributor friction → document
npx tsc --noEmitin PR checklist.
References
- Hacknight Reimplement previous login #4 with @niamao & @micah.shute (2025-06-01) re: modernizing the stack
- PR Code Cleanup and Package Updates #146 – Package & cleanup upgrade (blocked until merged)
Reactions are currently unavailable