diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 00000000..d1316cda --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname $0)/_/husky.sh" + +yarn commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..de26dc12 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +lint-staged diff --git a/package.json b/package.json index ee8a72d2..411b905a 100644 --- a/package.json +++ b/package.json @@ -14,18 +14,13 @@ "lint:js": "eslint --ext .ts,.js,.vue .", "lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore", "lint": "yarn lint:js && yarn lint:style", - "test": "jest" + "test": "jest", + "postinstall": "husky install" }, "lint-staged": { "*.{ts,js,vue}": "eslint", "*.{css,vue}": "stylelint" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, "dependencies": { "@fontsource/noto-sans": "^4.2.0", "@fontsource/noto-sans-hk": "^4.2.0",