This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
---
|
||||
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.
|
||||
Reference in New Issue
Block a user