From fa6c32ef0a186821ef07ebade71830e477cd4189 Mon Sep 17 00:00:00 2001 From: Kari Lintulaakso Date: Thu, 20 Nov 2025 15:27:20 +0200 Subject: [PATCH] Improve lint and tsc contributor guidance --- documentation/codex_planning_prompt.md | 19 +++++++++++++------ .../coding_prompt_template_fullstack.md | 11 +++++++++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/documentation/codex_planning_prompt.md b/documentation/codex_planning_prompt.md index 56ab9c63..6712a451 100644 --- a/documentation/codex_planning_prompt.md +++ b/documentation/codex_planning_prompt.md @@ -78,12 +78,19 @@ This section summarizes the overall architecture, structure, and technologies of ## Development Workflow & Tooling -- TypeScript strict-mode throughout -- Code style enforced with **ESLint** and **Prettier** -- Backend and frontend run via Docker or parallel dev servers -- Database migrations managed with Prisma -- CI/CD pipelines ensure linting, testing, and build integrity -- All new features require code review, test coverage, and documentation updates +- TypeScript strict-mode throughout +- Code style enforced with **ESLint** and **Prettier** +- Backend and frontend run via Docker or parallel dev servers +- Database migrations managed with Prisma +- CI/CD pipelines ensure linting, testing, and build integrity +- All new features require code review, test coverage, and documentation updates + +### Linting and Type-Checking Expectations +- Run `npm run lint` and `npm run tsc` from the repo root before requesting review; use `npm run lint:backend` / `npm run lint:frontend` and `npm run tsc:backend` / `npm run tsc:frontend` when iterating in a single scope. +- If Cypress specs are touched, run `npm run lint:cypress` to satisfy the dedicated ESLint rules in `eslint.config.mjs`. +- Keep Prisma clients generated (`npm run prisma`) so TypeScript sees the emitted types referenced by backend utilities. +- Typical CI failures to avoid: unchecked Prettier drift, unused imports/variables (especially in tests), missing async return types or implicit `any`, and stale `eslint-disable` directives. +- Large fixtures or JSON assets (e.g., geodata) should remain excluded via `tsconfig.json`/`eslint.config.mjs` ignores; avoid importing them in type-checked code paths. --- diff --git a/documentation/coding_prompt_template_fullstack.md b/documentation/coding_prompt_template_fullstack.md index dd9e96ed..dcd776df 100644 --- a/documentation/coding_prompt_template_fullstack.md +++ b/documentation/coding_prompt_template_fullstack.md @@ -53,8 +53,15 @@ Implement **exactly one task** from an approved feature plan. ✅ **Coding Requirements** ### Scope -- Implement **only** the task above. No bonus features. -- Respect `files_touched`, `migrations`, `settings_changes`, `permissions`. +- Implement **only** the task above. No bonus features. +- Respect `files_touched`, `migrations`, `settings_changes`, `permissions`. + +### Local lint/type-check checklist (run before returning output) +- From repo root, run `npm run lint` and `npm run tsc`; for focused work use `npm run lint:backend` / `npm run lint:frontend` and `npm run tsc:backend` / `npm run tsc:frontend`. +- If Cypress specs changed, run `npm run lint:cypress` to cover `cypress/e2e/**/*.cy.js` rules from `eslint.config.mjs`. +- Ensure Prisma clients are generated (`npm run prisma`) so `tsc --noEmit` sees emitted types in backend utilities. +- Common failure patterns to avoid: missing Prettier formatting, unused imports/variables in tests, missing async return types or implicit `any`, and stale `eslint-disable` directives. +- Keep large fixtures/geojson assets out of type-checked paths; rely on `tsconfig`/ESLint ignores already defined (see `frontend/tsconfig.json`, `backend/tsconfig.json`, and `eslint.config.mjs`). ### Quality / Style - Follow ESLint + Prettier + TypeScript strict.