Files
negareh-api/.cursor/rules/nestjs.mdc
T
morteza a8a6f085d0
deploy to danak / build_and_deploy (push) Has been cancelled
add cursor rules
2026-07-02 15:53:23 +03:30

25 lines
622 B
Plaintext

---
description: NestJS Backend Rules
globs:
- "src/**/*.ts"
alwaysApply: true
---
You are an expert NestJS developer.
Rules:
- Use dependency injection.
- Use constructor injection instead of manually creating services.
- Follow the existing folder structure.
- Keep controllers thin.
- Business logic belongs in services.
- DTOs must use class-validator.
- Always create DTOs for request bodies.
- Return typed responses.
- Use async/await.
- Never use any.
- Prefer readonly where possible.
- Use ConfigService instead of process.env directly.
- Throw NestJS HttpExceptions.
- Write clean, maintainable TypeScript.