chore(repo): finalize week 1 - readme, governance, ci, lint, husky (AC 5)#6
Merged
Conversation
GitHub Actions workflow that runs on every pull request and push to development/main. Two jobs: - dashboard: prisma generate (required before tsc — generated client is gitignored), npm run lint, tsc --noEmit - extension: tsc --noEmit
Stricter eslint rules in dashboard to enforce CLAUDE.md type-safety
guarantees at PR time:
- @typescript-eslint/no-explicit-any: error
- @typescript-eslint/ban-ts-comment: error
- @typescript-eslint/consistent-type-assertions: forbid object-literal
casts ({ foo } as T)
- no-restricted-syntax: forbid casting to unknown (incl. as unknown as T)
Also ignore generated/** (output of prisma generate — autogenerated)
and remove the now-redundant eslint-disable-next-line in server/db.ts.
Pre-commit hook runs eslint --fix on staged dashboard files via lint-staged. Catches issues locally before CI; typecheck stays in CI because it needs the whole project and is too slow per-commit. - husky + lint-staged installed in a new root package.json (the repo is a monorepo without a workspace tool) - lint-staged.config.mjs uses npm --prefix dashboard to run eslint from the dashboard cwd so the flat config resolves naturally - .gitattributes normalizes line endings to LF — stops the "LF will be replaced by CRLF" warnings on every commit - .nvmrc pins Node 20 for nvm use / IDE auto-switch
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
prisma.config.ts uses prisma/config's strict env() helper, which throws PrismaConfigEnvError if DATABASE_URL is missing at load time. The CI runner has no .env file (gitignored), so prisma generate failed before reading the schema. prisma generate does not connect to the database — it only reads the schema and writes the generated client + zod schemas. A dummy URL satisfies the config loader without touching any real database. Set DATABASE_URL only on the prisma generate step, not on the whole job, so an accidental query elsewhere still fails loudly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes Week 1 AC 5 (full root README) and lands the supporting governance / CI / tooling infrastructure for ongoing work. Five commits, all repo-meta — no
dashboard/orextension/source changes beyond a lint-config tweak and one stale comment removal.Changes
Code
dashboard/eslint.config.mjs— stricter TS rules:no-explicit-any: error,ban-ts-comment: error,consistent-type-assertions(no object-literal casts),no-restricted-syntaxblockingas unknownchains; ignoregenerated/**dashboard/server/db.ts— drop redundanteslint-disable-next-line no-varTooling / config
package.json+package-lock.json(new root) —husky+lint-stagedfor the pre-commit hook.husky/pre-commit— runsnpx lint-stagedlint-staged.config.mjs— JS config; usesnpm --prefix dashboard run lint -- --fix <relative paths>so the dashboard ESLint flat config resolves with the correct cwd cross-platform.github/workflows/ci.yml— two jobs (dashboardlint + tsc,extensiontsc) on PR/push todevelopmentandmain.gitattributes—* text=auto eol=lf+ binary patterns.nvmrc—20Docs / plan
README.md— replaces 7-line placeholder with full setup guide (repo layout, tech stack, prerequisites, docker-compose, prisma migrate, dashboard dev, extension load)LICENSE— MITCONTRIBUTING.md— Plan→Review→Implement summary, branch naming, commit conventions, branch-protection setup notes, file map.github/PULL_REQUEST_TEMPLATE.md— enforces plan/AC references in every PRplans/reorganized underplans/week1/(4 renames + 3 new plans: AC5 readme, governance+CI, husky)Design decisions
package.jsonhosts hooks only. lint-staged's JS config does the path arithmetic sonpm --prefix dashboard run lintworks cross-platform without shell tricks.next build/vite buildonly when a build-only failure escapes.prisma generateis mandatory before tsc in CI, and needs a dummyDATABASE_URL. Dashboard imports from gitignored@/generated/prisma/client; without generation, tsc fails with "Cannot find module". Andprisma.config.tsusesprisma/config's strictenv()helper, which throws at load time ifDATABASE_URLis unset — so the CI step sets a dummy URL (the command never actually connects).lintexists in dashboard, not extension). Named jobs (CI / dashboard,CI / extension) plug into branch protection as required checks.eslint.config.mjsinextension/yet — captured in plans for Week 2 pickup.Verification
npm run lint(dashboard) — 0 errors, 0 warningsnpx tsc --noEmit(dashboard) — cleannpm run typecheck(extension) — cleannpx lint-staged --diff "HEAD~1 HEAD"— ESLint runs correctly with relative paths throughnpm --prefix dashboard run lintcore.hooksPath = .husky/_set by husky'spreparescript duringnpm installOut of scope (future PRs)
Captured in each plan's "Out of scope" section. Highlights:
tsc --noEmit— if devs start landing bad type-checksdevelopmentCloses
development/main(docs/Task.md#L97); branch-protection toggles remain a manual step