diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..1a43aa1 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm exec run-s style:write test build +git add dist/ diff --git a/package.json b/package.json index 069e553..488cec8 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,8 @@ "lint": "eslint src __test__", "style:check": "run-p --continue-on-error --aggregate-output format:check lint", "style:write": "run-p --continue-on-error --aggregate-output format:write lint", - "pre-commit": "run-s style:write test build", - "test": "jest" - }, - "husky": { - "hooks": { - "pre-commit": "npm run pre-commit && git add dist/" - } + "test": "jest", + "prepare": "husky install" }, "jest": { "preset": "ts-jest", @@ -50,11 +45,11 @@ "@vercel/ncc": "^0.23.0", "eslint": "^7.7.0", "eslint-config-prettier": "^6.11.0", - "husky": "^4.2.5", + "husky": "^6.0.0", "jest": "^26.4.1", "npm-run-all": "^4.1.5", "prettier": "^2.0.5", "ts-jest": "^26.2.0", "typescript": "^4.0.2" } -} +} \ No newline at end of file