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/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..36af2198 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index 7985cb60..398180f8 100644 --- a/package.json +++ b/package.json @@ -46,13 +46,16 @@ "prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c", "prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"", "prettify:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write", - "test": "node test.js" + "test": "node test.js", + "prepare": "husky install" }, "devDependencies": { "cross-spawn": "*", "eslint": "^7.32.0", "git-list-updated": "^1.2.1", "github-release-from-cc-changelog": "^2.2.1", + "husky": "^8.0.1", + "lint-staged": "^13.0.3", "lodash": "^4.17.21", "prettier": "^2", "standard-version": "^9.3.2",