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/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..7cd8dd9 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..a6d839a --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run lint && npm run test diff --git a/.huskyrc b/.huskyrc deleted file mode 100644 index 71b3d44..0000000 --- a/.huskyrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hooks": { - "pre-commit": "npm run lint && npm run test", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } -} diff --git a/package.json b/package.json index c921c6c..bbf147d 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "test": "mocha", "test:travis": "npm install && npm install nodemailer@$NODEMAILER_VERSION && npm test", "coverage": "nyc --reporter=html --reporter=text mocha", - "coveralls": "nyc report --reporter=text-lcov | coveralls" + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "prepare": "husky install" }, "nyc": { "all": true, @@ -71,7 +72,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", "eslint-plugin-standard": "^4.1.0", - "husky": "^4.3.8", + "husky": "^6.0.0", "mocha": "^8.4.0", "nodemailer": "^6.6.0", "npm-check-updates": "^11.5.13",