- NodeJs v20.8.1
- VSCode
- Vue Volar extension Pack
- Vue Devtool
- Yarn
- Git
- Add setting visual code:
{
"eslint.alwaysShowStatus": true,
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.tslint": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
}
# install dependencies
$ yarn install
# serve with hot reload at localhost:3000
$ yarn dev
# build for production and launch server
$ yarn build
$ yarn preview
# generate static project
$ yarn generate
- Local: http://localhost:3000/
- Dev:
-
Styleguide
-
Use scss scoped
-
Mix scss when there are multiple css in common use
-
Create a file and import it for the screen. Name the file based on the screen name. Ex:
HomePage.scss
SettingPage.vue
-
The distance between two functions is 1 enter
-
Limit the use of const, let, var
-
File names must be multiple words
-
Git flow
-
Branch naming prefix:
Accepted prefix:
✔️feat/
for adding / developing a feature in here
✔️hotfix/
for adding / developing a hotfix that's not normal flow
✔️fix/
for adding / developing a bug fix in here
✔️cr/
for update customer change request after feature is merged in one sprint
ex:feat/issue-001
feat/issue-001-v2
feat/issue-001-dev
fix/issue-001-stg
hotfix/banner-style
-
Commit - Lint:
runyarn lint
before commit -> fix wrong format to till it clean Tip: can useyarn lintfix
to fix auto -
Merge - double check (mindset):
resolveconflict
checkmerge target
remove all debugger: ex:console.log
console.error
remove all variable created but not used double check code with previos revision (diff check
), controlinfulence level
-
Husky Hooks and Windows Compatibility with GitHub Desktop
If you're using a third-party GUI like GitHub Desktop for managing Git commits in Windows, you may get an error that
bash
is a command not found.This error commonly occurs when trying to run package manager based scripts, like the "npx lint-staged" command, as part of your husky pre-commit hooks.
To fix this error, you'll need to add the Git for Windows tools to your PATH by either:
- Choosing "Use Git and optional Unix tools from the command prompt" in the Git for Windows installer, or
- Adding "C:/Program Files/Git/bin" [or your appropriate installation location] to the PATH manually as an Environmental Variable in Windows. (Both: User variables, System variables)
Similar issues have been reported for the Node Version Manager program nvm on *nix systems, but those issues are addressed in the "command not found" section of the docs, which explains using a > ~/.huskyrc file.
-
Windows git "warning: LF will be replaced by CRLF"
run
git config --global core.autocrlf false