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..c6759b0 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,13 @@ +#!/bin/sh + +# Copyright (c) 2020-present Sven Greb +# This source code is licensed under the MIT license found in the LICENSE file. + +# The configuration for husky. +# +# References: +# 1. https://github.com/typicode/husky + +. "$(dirname "$0")/_/husky.sh" + +npm exec lint-staged diff --git a/.huskyrc.js b/.huskyrc.js deleted file mode 100644 index 10fccc3..0000000 --- a/.huskyrc.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2020-present Sven Greb - * This source code is licensed under the MIT license found in the LICENSE file. - */ - -/** - * The configuration for husky. - * - * @see https://github.com/typicode/husky - */ -module.exports = { - hooks: { - "pre-commit": "lint-staged", - }, -}; diff --git a/package.json b/package.json index fc22f83..222b438 100644 --- a/package.json +++ b/package.json @@ -22,14 +22,16 @@ "format:pretty": "prettier --write .", "lint": "run-s lint:*", "lint:md": "remark --no-stdout . \".github/**/*.md\"", - "lint:pretty": "prettier --check ." + "lint:pretty": "prettier --check .", + "prepare:husky": "husky install", + "prepare": "run-s prepare:*" }, "devDependencies": { - "husky": "^4.3.0", - "lint-staged": "^10.5.1", + "husky": "^6.0.0", + "lint-staged": "^10.5.4", "npm-run-all": "^4.1.5", "prettier": "^2.2.1", - "remark-cli": "^8.0.1", + "remark-cli": "^9.0.0", "remark-preset-lint-arcticicestudio": ">=0.3.0 <1.0.0" } }