【问题标题】:linking pre-commit hook to VSC source control将预提交挂钩链接到 VSC 源代码控制
【发布时间】:2021-11-09 11:06:40
【问题描述】:
【问题讨论】:
标签:
typescript
visual-studio-code
version-control
eslint
githooks
【解决方案1】:
用recommended steps 安装哈士奇似乎对我有用:
From github.com:rachOS/BonApp-FRONT
* branch feature/create-user-account -> FETCH_HEAD
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track) refs/heads/feature/create-user-account refs/remotes/feature/create-user-account
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git ls-files --stage -- /home/rach/Documents/Code/BonApp/front-bon_app.ts/src/entities/Recipe.ts
> git cat-file -s 96fa250abd168e2175cffe887b14db1f5787e7dc
> git show --textconv :src/entities/Recipe.ts
> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
> git ls-files --stage -- /home/rach/Documents/Code/BonApp/front-bon_app.ts/src/entities/Recipe.ts
> git cat-file -s 96fa250abd168e2175cffe887b14db1f5787e7dc
> git show --textconv :src/entities/Recipe.ts
> front-bon_app.ts@0.1.0 validate
> npm-run-all --parallel check-format lint build
> front-bon_app.ts@0.1.0 lint
> eslint --ignore-path .gitignore -c .eslintrc --ext .ts --fix .
> front-bon_app.ts@0.1.0 build
> react-scripts build
> front-bon_app.ts@0.1.0 check-format
> npm run format -- --list-different
> front-bon_app.ts@0.1.0 format
> npm run prettier -- --write "--list-different"
> front-bon_app.ts@0.1.0 prettier
> prettier --ignore-path .gitignore "**/*.+(js|ts|json|jsx|tsx|css|html)" "--write" "--list-different"
Creating an optimized production build...
Compiled with warnings.
src/adapters/primary/components/Form/Form.jsx
Line 103:3: 'readOnly' is defined but never used no-unused-vars
Line 137:45: 'type' is defined but never used no-unused-vars
src/adapters/primary/components/Signup/manager/SignupManager.jsx
Line 4:10: 'signup' is defined but never used no-unused-vars
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
59.19 KB build/static/js/2.58d43881.chunk.js
1.63 KB build/static/js/3.90fad592.chunk.js
1.55 KB build/static/js/main.5cbbd48f.chunk.js
1.17 KB build/static/js/runtime-main.63262bbd.js
1.14 KB build/static/css/main.8636b64b.chunk.css
The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
https://cra.link/deployment
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track) refs/heads/feature/create-user-account refs/remotes/feature/create-user-account
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git config --get commit.template
> git ls-files --stage -- /home/rach/Documents/Code/BonApp/front-bon_app.ts/src/entities/Recipe.ts
> git cat-file -s 96fa250abd168e2175cffe887b14db1f5787e7dc
> git show --textconv :src/entities/Recipe.ts