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 100755 index 0000000..d24fdfc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index b2e54cb..788a52a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ ], "main": "MMM-OnThisDay.js", "scripts": { + "prepare": "husky install", "prettier:fix": "prettier --write .", "test": "nyc mocha test/unit --recursive && prettier --check .", "test-functional": "mocha test/functional --recursive" @@ -24,12 +25,17 @@ "jsdom": "^22.1.0" }, "devDependencies": { + "husky": "^8.0.3", + "lint-staged": "^15.1.0", "mocha": "^10.2.0", "nyc": "^15.1.0", "prettier": "^3.1.0", "proxyquire": "^2.1.3", "sinon": "^17.0.1" }, + "lint-staged": { + "**/*": "prettier --write --ignore-unknown" + }, "nyc": { "reporter": [ "text",