Files
lcbp3/.agent/rules/03-typescript.md
T
admin c95e0f537e
CI / CD Pipeline / build (push) Successful in 4m34s
CI / CD Pipeline / deploy (push) Successful in 7m33s
690404:1139 Modify ADR
2026-04-04 11:39:56 +07:00

870 B

trigger
trigger
always_on

TypeScript Rules

Strict Requirements

  • Strict Mode — all strict checks enforced
  • ZERO any types — use proper types or unknown + narrowing
  • ZERO console.log — NestJS Logger (backend); remove before commit (frontend)

Comment Language Policy

  • Comments: Thai (เข้าใจง่ายสำหรับทีมไทย)
  • Code Identifiers: English (variables, functions, classes)

Error Handling Pattern

// Backend (NestJS)
import { Logger } from '@nestjs/common';
const logger = new Logger('ServiceName');

// Use logger instead of console.log
logger.error('Error message', error.stack);
throw new HttpException('Message', HttpStatus.BAD_REQUEST);

// Frontend (Next.js)
// Remove all console.log before commit
// Use proper error boundaries and toast notifications