Skip to content

代码规范

概述

项目代码规范和最佳实践。

TypeScript 规范

  • 严格模式
  • 明确类型
  • 避免 any
  • 接口优于类型

NestJS 规范

  • 模块化设计
  • 依赖注入
  • 装饰器使用
  • 异常处理

代码风格

  • ESLint 配置
  • Prettier 格式化
  • 命名约定
  • 文件组织

Git 规范

  • Conventional Commits
  • 分支策略
  • PR 模板
  • Code Review

最佳实践

  1. SOLID 原则
  2. DRY 原则
  3. 清晰命名
  4. 及时重构

Released under the MIT License.