Improve lint and tsc contributor guidance

This commit is contained in:
Kari Lintulaakso
2025-11-20 15:27:20 +02:00
parent 69a093e7e1
commit fa6c32ef0a
2 changed files with 22 additions and 8 deletions
+7
View File
@@ -85,6 +85,13 @@ This section summarizes the overall architecture, structure, and technologies of
- 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.
---
# Codex Prompt for NOW Database Full-Stack Development
@@ -56,6 +56,13 @@ Implement **exactly one task** from an approved feature plan.
- 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.
- Typed interfaces / DTOs for all API payloads.