BE 코딩 컨벤션 - boostcampwm2023/and03_movemove GitHub Wiki
- 네이밍
- 함수명, 변수명 : cammelCase
- 클래스 : PascalCase
- 상수 : UPPERCASE_SNAKE_CASE
- 파일명 : lower-case.lower.ts
- 스타일
-
eslint
module.exports = { parser: '@typescript-eslint/parser', parserOptions: { project: 'tsconfig.json', tsconfigRootDir: __dirname, sourceType: 'module', }, plugins: ['@typescript-eslint/eslint-plugin', 'import'], extends: [ 'airbnb-base', 'airbnb-typescript/base', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', ], root: true, env: { node: true, jest: true, }, ignorePatterns: ['.eslintrc.js'], rules: { '@typescript-eslint/no-use-before-define': 'off', 'class-methods-use-this': 'off', 'import/prefer-default-export': 'off', '@typescript-eslint/interface-name-prefix': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', 'prettier/prettier': [ 'error', { endOfLine: 'auto', }, ], }, }; -
.prettierrc
{ "printWidth": 100, "singleQuote": true, "trailingComma": "none", "endOfLine": "auto", "prettier.tabWidth": 2 }
-
- Mongoose를 사용할 때 custom provider를 작성하지 않고 MongooseModule과 InjectModel을 사용합니다.
- Swagger 스펙 명시 시 데코레이터 대신 NestJS CLI를 최대한 활용하여 작성합니다.
@ApiProperty({ description: '유저 닉네임', example: '페이커' }) nickname: string;/** * 유저 닉네임 * @example '페이커' */ nickname: string;