-
Notifications
You must be signed in to change notification settings - Fork 0
π©βπ» Coding Convention
Jongeun Kim edited this page Nov 18, 2020
·
4 revisions
- μΈλΆ λͺ¨λκ³Ό λ΄λΆλͺ¨λμ ꡬλΆνμ¬ μ¬μ©νλ€. μΈλΆλͺ¨λκ³Ό λ΄λΆλͺ¨λ μ μΈμ 곡백μΌλ‘ ꡬλΆνλ€. λ΄λΆλͺ¨λμ κ²½μ° μ λ κ²½λ‘λ₯Ό μ¬μ©νλ λͺ¨λκ³Ό μλ κ²½λ‘λ₯Ό μ¬μ©νλ λͺ¨λμ μΆκ°λ‘ ꡬλΆνλ€.
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 airbnbλ₯Ό λ°λ₯Έλ€
- μΆκ°νκ³ μΆμ λ£°μ΄ μμ κ²½μ° μ견μ μ μν΄μ λ Όμ νμ λ°μ ν μ μλ€
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'],
],
},
},
},
};
{
"singleQuote": true,
"parser": "typescript",
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 100,
"arrowParens": "always"
}
{
"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/*"]
}
}
}
μΈλΆμ 보λ μ¬μ΄λλ°λ₯Ό μ΄μ©ν΄μ£ΌμΈμπ β‘οΈβ‘οΈ