Skip to content

Commit

Permalink
refactor: upgrade to husky@7 & lint-staged@11 & commitlint@13
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyaoji committed Sep 14, 2021
1 parent 3025d83 commit 9ed6a23
Show file tree
Hide file tree
Showing 5 changed files with 1,509 additions and 1,252 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push-todo-open
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run test
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,12 @@
"path": "./node_modules/cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push-todo-open": "npm run test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.{js,ts,vue}": "eslint --fix"
"*.{vue,js,ts,jsx,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{scss,css,json,yaml,yml,md,html}": "prettier --write"
},
"workspaces": [
"packages/*"
Expand All @@ -81,8 +78,9 @@
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.4",
"@babel/preset-typescript": "^7.15.0",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@commitlint/cz-commitlint": "^13.1.0",
"@rollup/plugin-alias": "^3.1.5",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
Expand Down Expand Up @@ -131,13 +129,13 @@
"gulp-typescript": "^6.0.0-alpha.1",
"highlight.js": "^11.2.0",
"html-webpack-plugin": "4.3.0",
"husky": "^4.2.5",
"husky": "^7.0.2",
"import-from": "^3.0.0",
"jest": "^26.6.3",
"jest-electron": "^0.1.11",
"klaw-sync": "^6.0.0",
"lerna": "^3.22.1",
"lint-staged": "^10.2.13",
"lint-staged": "^11.1.2",
"markdown-it": "^11.0.0",
"markdown-it-anchor": "^5.3.0",
"markdown-it-chain": "^1.3.0",
Expand Down
Loading

0 comments on commit 9ed6a23

Please sign in to comment.