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
+13 -6
View File
@@ -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.
---
@@ -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.