2.6 KiB
2.6 KiB
Shared Development Guidelines
These guidelines apply to all Next.js full-stack applications using this architecture.
Documentation Files
| File | Description | When to Read |
|---|---|---|
| code-quality.md | Code quality mandatory rules | Always |
| typescript.md | TypeScript best practices | Type-related decisions |
| dependencies.md | Dependency versions and constraints | Adding/updating deps |
Quick Navigation
| Task | File |
|---|---|
| Code quality rules | code-quality.md |
| Type annotations | typescript.md |
| Dependency management | dependencies.md |
Core Rules (MANDATORY)
| Rule | File |
|---|---|
No non-null assertions (!) |
code-quality.md |
No any type |
code-quality.md |
No @ts-expect-error / @ts-ignore |
code-quality.md |
No console.log (use structured logging) |
code-quality.md |
| Zod-first type definitions | typescript.md |
| Import types from backend, never redefine | typescript.md |
Standard response format (success + reason) |
typescript.md |
Before Every Commit
pnpm lint- 0 errorspnpm type-check- 0 errorspnpm build- production build succeeds- No
anytypes in new code - No non-null assertions (
!) - No
@ts-expect-erroror@ts-ignorecomments - No
console.logstatements (uselogger) - Tests pass (if applicable)
Code Review Checklist
- Types are explicit, not
any - API inputs/outputs have Zod schemas
- Error handling returns structured responses
- No duplicate type definitions (import from source of truth)
- Naming follows conventions (files: kebab-case, components: PascalCase)
- Unused imports and dead code removed
- No swallowed errors (silent
catchblocks)
Language: All documentation must be written in English.