Skip to content

๐Ÿ‘ฉโ€๐Ÿ’ป Coding Convention

Jongeun Kim edited this page Nov 18, 2020 · 4 revisions

์ฝ”๋”ฉ ์ปจ๋ฒค์…˜

import ๊ทœ์น™

  • ์™ธ๋ถ€ ๋ชจ๋“ˆ๊ณผ ๋‚ด๋ถ€๋ชจ๋“ˆ์„ ๊ตฌ๋ถ„ํ•˜์—ฌ ์‚ฌ์šฉํ•œ๋‹ค. ์™ธ๋ถ€๋ชจ๋“ˆ๊ณผ ๋‚ด๋ถ€๋ชจ๋“ˆ ์„ ์–ธ์‹œ ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„ํ•œ๋‹ค. ๋‚ด๋ถ€๋ชจ๋“ˆ์˜ ๊ฒฝ์šฐ ์ ˆ๋Œ€ ๊ฒฝ๋กœ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ชจ๋“ˆ๊ณผ ์ƒ๋Œ€ ๊ฒฝ๋กœ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ชจ๋“ˆ์„ ์ถ”๊ฐ€๋กœ ๊ตฌ๋ถ„ํ•œ๋‹ค.
import axios from 'axios'; 

import router from '@service/router'

import util from './util'

๋ณ€์ˆ˜, ํ•จ์ˆ˜, ํด๋ž˜์Šค ๋ช…๋ช… ๊ทœ์น™

  • ํŒŒ์ผ๋„ค์ด๋ฐ

    • ์ปดํฌ๋„ŒํŠธ โ†’ PascalCase
    • ์™ธ โ†’ cammelCase
  • ์ƒ์ˆ˜ โ†’ SNAKE_CASE

  • ํ•จ์ˆ˜ ๋ฐ ๋ณ€์ˆ˜ โ†’ cammelCase

  • ์ปดํฌ๋„ŒํŠธ โ†’ PascalCase

  • ์ฐฝ์˜์ ์ธ ๋‹จ์–ด ์“ฐ์ง€ ์•Š๊ธฐ ๐Ÿ˜ (์ œ์ผ ๋– ์˜ค๋ฅด๊ธฐ ์‰ฝ๊ณ  ๊ธฐ๋ณธ์ ์ธ ๋‹จ์–ด)

  • ๋ณ€์ˆ˜๋Š” ๋ช…์‚ฌํ˜•์œผ๋กœ ์ž‘์„ฑ

  • ํ•จ์ˆ˜๋Š” ์„œ์ˆ ํ˜•์œผ๋กœ ์ž‘์„ฑ

๊ธฐํƒ€ ์ฝ”๋”ฉ ๊ทœ์น™

  • htmlํƒœ๊ทธ ์„ ์–ธ ์‹œ ์ตœ๋Œ€ํ•œ ์‹œ๋ฉ˜ํ‹ฑํ•œ ํƒœ๊ทธ ์‚ฌ์šฉ
  • ๋ชจ๋‘๊ฐ€ approve ํ•œ ํ›„์— merge ํ•  ์ˆ˜ ์žˆ๋‹ค
  • ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋Š” ํ•„์ˆ˜! ๊ผญ ํ™•์ธํ•˜๊ธฐ! ๐Ÿ˜ 
  • html id + className์€ snake_case๋กœ ํ•œ๋‹ค.

eslint & prettier

  • ๊ธฐ๋ณธ์ ์œผ๋กœ eslint airbnb๋ฅผ ๋”ฐ๋ฅธ๋‹ค
  • ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ์€ ๋ฃฐ์ด ์žˆ์„ ๊ฒฝ์šฐ ์˜๊ฒฌ์„ ์ œ์‹œํ•ด์„œ ๋…ผ์˜ ํ›„์— ๋ฐ˜์˜ ํ•  ์ˆ˜ ์žˆ๋‹ค

eslint

module.exports = {
  parser: '@typescript-eslint/parser',
  plugins: ['@typescript-eslint'],
  extends: [
    'airbnb-base',
    'plugin:import/errors',
    'plugin:import/warnings',
    'plugin:prettier/recommended',
    'plugin:@typescript-eslint/recommended',
  ],
  rules: {
    'linebreak-style': 0,
    'import/prefer-default-export': 0,
    'prettier/prettier': 0,
  },
  settings: {
    'import/resolver': {
      node: {
        extensions: ['.js', '.jsx', '.ts', '.tsx'],
      },
      alias: {
        map: [
          ['@api', './src/api'],
          ['@auth', './src/auth'],
          ['@config', './src/config'],
          ['@models', './src/models'],
          ['@util', './src/util/*'],
          ['@', './src'],
        ],
      },
    },
  },
};

prettier

{
  "singleQuote": true,
  "parser": "typescript",
  "semi": true,
  "useTabs": false,
  "tabWidth": 2,
  "trailingComma": "all",
  "printWidth": 100,
  "arrowParens": "always"
}

tsconfig

{
  "compilerOptions": {
    "target": "es6",
    "lib": ["es2015", "es2016", "es2017", "es2018", "es2019", "es2020"],

    // sourceMap
    "sourceMap": true,

    // module
    "module": "commonjs",
    "moduleResolution": "node",
    "esModuleInterop": true,

    // lint
    "strict": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "noFallthroughCasesInSwitch": true,

    // more spec
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "baseUrl": ".",
    "paths": {
      "@api/*": ["src/api/*"],
      "@auth/*": ["src/auth/*"],
      "@config/*": ["src/config/*"],
      "@models/*": ["src/models/*"],
      "@util/*": ["src/util/*"],
      "@/*": ["src/*"]
    }
  }
}

๐Ÿ“† Planning

๐Ÿ‘จโ€๐Ÿ’ป Agile Process

Daily Scrum
์ฃผ์ฐจ๋ณ„ ํšŒ๊ณ 
์ฃผ์ฐจ๋ณ„ ํ”ผ์–ด์„ธ์…˜
๊ธฐ์ˆ ๊ด€๋ จ ๋‚ด์šฉ ๋…ผ์˜
๋ฉ˜ํ† ๋‹˜๊ณผ์˜ ๋‘๊ทผ๋‘๊ทผ ๋ฏธํŒ…

๐Ÿ“š Ground Rule

Clone this wiki locally