๐ข ํ๋ก์ ํธ Vue.js ์ปจ๋ฒค์
01. Commit ์ปจ๋ฒค์
// ๊ตฌ๋ถ [์ข
๋ฅ] ๋ด์ฉ
F [ADD] **ํ์ผ์ ์๋ก์ด ๊ธฐ๋ฅ ์ถ๊ฐ
EF [MOD] ์ผ๋ ํธ๋ก main.js์ **๊ธฐ๋ฅ ์์
- ๊ตฌ๋ถ
- F : FrontEnd
- B: BackEnd
- E: Electron
- A: All
- ์ข
๋ฅ
- [ADD] : ์๋ก์ด ๊ธฐ๋ฅ ์ถ๊ฐ, ํจ์ ์ถ๊ฐ ๋ฑ
- [MOD] : ๊ธฐ์กด ๋ด์ฉ์์ ์์
- [FIX] : ๋ฒ๊ทธ ํฝ์ค
- [DEL] : ๊ธฐ์กด ๋ด์ฉ ์ญ์ , ๊ธฐ๋ฅ ์ญ์ ๋ฑ
- [DOC] : md ์ถ๊ฐ, doc ์ถ๊ฐ ๋ฑ
- ๋ด์ฉ
- ํ์ค๋ก ํํํ ์ ์๋ ๊ฐ๋จํ ๋ด์ฉ
02. Branch ์ปจ๋ฒค์
// /๋ธ๋์น์ข
๋ฅ/๊ตฌ๋ถ-๋ด์ฉ
/feat/ef-electron-test
/feat/f-ui-develop
/fix/a-debug
/issue/ef-electron-error
- ๋ธ๋์น ์ข
๋ฅ
- /feat : ๊ธฐ๋ฅ ๊ฐ๋ฐ
- /fix : ์์ , ๋ฒ๊ทธ fix
- /issue : Issue์ ์ฌ๋ฆด ๋ธ๋์น
- ๊ตฌ๋ถ
- f : FrontEnd
- b : BackEnd
- e : Electron
- a : All
- ๋ด์ฉ
- ํ๋ฒ์ ์์๋ณผ ์ ์๋ ์ง๊ด์ ์ธ ๋ด์ฉ
03. ISSUE ์ปจ๋ฒค์
// MR OPEN
// ๊ตฌ๋ถ [์ข
๋ฅ] ๋ด์ฉ
// ๊ตฌ๋ถ์ ํด๊ฒฐํ ์ฌ๋์ ๊ตฌ๋ถ์๋ฅผ ๋ฃ์ด๋
// ex) F๊ฐ B์๊ฒ ์์ฒญํด์ ํด๊ฒฐํด์ผํจ -> B [REQ] ***์์ฒญ -> B์์ ํด๊ฒฐ ํ MR
B [MOD] /analyzer/launch API ๋ณ๊ฒฝ ์์ฒญ
A [ISSUE] Ready์ CPU ์ฌ์ฉ๋ 100%๋๋ ๋ฌธ์
// Tag๋ ์ข
๋ฅ์ ๋ฐ๋ผ ์์ฑ
// MR ํ
ํ๋ฆฟ http://gitlab.mkon/drivingex/drivingex-lm/-/issues/2 ์ฐธ๊ณ
๊ธฐ์กด
[ ๋ด์ฉ ]
์์
[ ๋ด์ฉ ]
// ์ผ๋ก MR์ ๋ณด๋
// MR Close
// Openํ MR์ Comment๋ฅผ ๋จ๊ธด ํ Close
04. Google Style Guide(js) ์ฌ์ฉ
> npx eslint --init
? How would you like to use ESLint? ...
To check syntax only
To check syntax and find problems
> To check syntax, find problems, and enforce code style
? What type of modules does your project use? ...
> JavaScript modules (import/export)
CommonJS (require/exports)
None of these
? Which framework does your project use? ...
React
> Vue.js
None of these
? Does your project use TypeScript? ยป No
? Where does your code run? ... (Press <space> to select, <a> to toggle all, <i> to invert selection)
โ Browser
โ Node
? How would you like to define a style for your project? ...
> Use a popular style guide
Answer questions about your style
? Which style guide do you want to follow? ...
Airbnb: https://github.com/airbnb/javascript
Standard: https://github.com/standard/standard
> Google: https://github.com/google/eslint-config-google
XO: https://github.com/xojs/eslint-config-xo
1. .eslintrc.js
์์
// eslintrc.js
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: ["plugin:vue/vue3-essential", "google"],
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["vue"],
rules: {
requireJsdoc: false,
},
};
// prettier ๋ ์ถฉ๋ ์ ์ฐ์ ์์ ์ค์
// npm install eslint-plugin-prettier eslint-config-prettier --save-dev
//{
// plugins: ["prettier"],
// extends: ["plugin:prettier/recommended"],
// rules: {
// "prettier/prettier": "error"
// }
//}
2. Prettier ์ค์น
npm install --save-dev --save-exact prettier
์ดํ .prettierrc.js ํ์ผ ์ต์์์ ์์ฑ
// .prettierrc.js
module.exports = {
arrowParens: "always", // ํ์ดํ ํจ์ ๊ดํธ ์ฌ์ฉ ๋ฐฉ์
bracketSpacing: false, // ๊ฐ์ฒด ๋ฆฌํฐ๋ด์์ ๊ดํธ์ ๊ณต๋ฐฑ ์ฝ์
์ฌ๋ถ
endOfLine: "if", // EoF ๋ฐฉ์, OS๋ณ๋ก ์ฒ๋ฆฌ ๋ฐฉ์์ด ๋ค๋ฆ
htmlWhitespaceSensitivity: "css", // HTML ๊ณต๋ฐฑ ๊ฐ๋ ์ค์
jsxBracketSameLine: false, // JSX์ ๋ง์ง๋ง `>`๋ฅผ ๋ค์ ์ค๋ก ๋ด๋ฆด์ง ์ฌ๋ถ
jsxSingleQuote: true, // JSX์ singe ์ฟผํ
์ด์
์ฌ์ฉ ์ฌ๋ถ
printWidth: 80, // ์ค ๋ฐ๊ฟ ํ ํญ ๊ธธ์ด
proseWrap: "never", // markdown ํ
์คํธ์ ์ค๋ฐ๊ฟ ๋ฐฉ์ (v1.8.2)
quoteProps: "as-needed", // ๊ฐ์ฒด ์์ฑ์ ์ฟผํ
์ด์
์ ์ฉ ๋ฐฉ์
semi: true, // ์ธ๋ฏธ์ฝ๋ก ์ฌ์ฉ ์ฌ๋ถ
singleQuote: true, // single ์ฟผํ
์ด์
์ฌ์ฉ ์ฌ๋ถ
tabWidth: 2, // ํญ ๋๋น
trailingComma: "all", // ์ฌ๋ฌ ์ค์ ์ฌ์ฉํ ๋, ํํ ์ฝค๋ง ์ฌ์ฉ ๋ฐฉ์
useTabs: false, // ํญ ์ฌ์ฉ ์ฌ๋ถ
vueIndentScriptAndStyle: false, // Vue ํ์ผ์ script์ style ํ๊ทธ์ ๋ค์ฌ์ฐ๊ธฐ ์ฌ๋ถ (v1.19.0)
requirePragma: false, // ํ์ผ ์๋จ์ ๋ฏธ๋ฆฌ ์ ์๋ ์ฃผ์์ ์์ฑํ๊ณ Pragma๋ก ํฌ๋งทํ
์ฌ์ฉ ์ฌ๋ถ ์ง์ (v1.8.0)
insertPragma: false, // ๋ฏธ๋ฆฌ ์ ์๋ @format marker์ ์ฌ์ฉ ์ฌ๋ถ (v1.8.0)
};
3. extentions
3.1 ์ถ์ฒํ์ฅ
05. Naming Convention
๋ชจ๋ ๊ท์น์ google js style guide์ vue.js style guide ๋ฅผ ์ฐธ์กฐํ๊ณ ๋ฐ๋ฆ
Naming
- Package names:
lowerCamelCase
ex)my.exampleCode.deepSpace
- Class names:
UpperCamelCase
ex)ImmutableList
- Method names:
lowerCamelCase
ex)setFoo(value)
- Constant names:
CANSTANT_CASE
- Non-constant field names:
lowerCamelCase
ex)computedValues
- Parameter names:
lowerCamelCase
- Local variable names:
lowerCamelCase
By Vue
https://v2.vuejs.org/v2/style-guide/?redirect=true#Priority-B-Rules-Strongly-Recommended-Improving-Readability ์ฐธ์กฐ, B ๊น์ง ๊ผญ ์ง์ผ์ผ
๋๊ธ๋จ๊ธฐ๊ธฐ