diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 996860e..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -export NVM_DIR="$HOME/.nvm/nvm.sh" -. "$(dirname $NVM_DIR)/nvm.sh" - -export NVM_DIR="$HOME/.nvm" -a=$(nvm ls | grep 'node') -b=${a#*(-> } -v=${b%%[)| ]*} - -export PATH="$NVM_DIR/versions/node/$v/bin:$PATH" - -npx lint-staged diff --git a/package-lock.json b/package-lock.json index f94743e..8a688f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,18 +38,18 @@ "@types/node": "^18.15.11", "@types/table": "^6.3.2", "cross-env": "^7.0.3", - "husky": "^8.0.1", "jest": "^29.5.0", "lint-staged": "^15.2.7", "semantic-release": "^24.0.0", "semantic-release-npm-github": "^5.0.0", + "simple-git-hooks": "^2.11.1", "ts-jest": "^29.1.0", "typescript": "^5.0.3", "xo": "^0.54.0" }, "engines": { - "node": "^14.13.1 || >=16.0.0", - "npm": ">=6.0.0" + "node": ">=18.0.0", + "npm": ">=9.0.0" } }, "node_modules/@ampproject/remapping": { @@ -6814,21 +6814,6 @@ "node": ">=18.18.0" } }, - "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", - "dev": true, - "bin": { - "husky": "lib/bin.js" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -18898,6 +18883,16 @@ "node": ">=4" } }, + "node_modules/simple-git-hooks": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/simple-git-hooks/-/simple-git-hooks-2.11.1.tgz", + "integrity": "sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "simple-git-hooks": "cli.js" + } + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", diff --git a/package.json b/package.json index ba83188..b9703df 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "clean": "rm -rf lib *.tgz", "commit": "git-cz", "release:check": "semantic-release --dry-run", - "prepare": "husky install" + "prepare": "simple-git-hooks || echo 'simple-git-hooks install skipped'" }, "keywords": [ "cli", @@ -73,11 +73,11 @@ "@types/node": "^18.15.11", "@types/table": "^6.3.2", "cross-env": "^7.0.3", - "husky": "^8.0.1", "jest": "^29.5.0", "lint-staged": "^15.2.7", "semantic-release": "^24.0.0", "semantic-release-npm-github": "^5.0.0", + "simple-git-hooks": "^2.11.1", "ts-jest": "^29.1.0", "typescript": "^5.0.3", "xo": "^0.54.0" @@ -153,6 +153,9 @@ }, "verbose": true }, + "simple-git-hooks": { + "pre-commit": "npx lint-staged" + }, "lint-staged": { "*.js": [ "xo --fix",