diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 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-lock.json b/package-lock.json index c598884..d69bfcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-sort-destructure-keys": "1.5.0", "eslint-plugin-sort-keys-fix": "1.1.2", + "husky": "8.0.3", "lint-staged": "14.0.1", "postcss-html": "1.5.0", "prettier": "3.0.3", @@ -4859,6 +4860,21 @@ "node": ">=16.17.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/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/package.json b/package.json index 5850e69..ea1b210 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "lint:fix": "npm run lint -- --fix", "lint:style": "stylelint ./**/*.{css,astro,html}", "lint:style:fix": "npm run lint:style -- --fix", - "format": "prettier . --write" + "format": "prettier . --write", + "prepare": "husky install" }, "dependencies": { "@astrojs/react": "^3.0.3", @@ -37,6 +38,7 @@ "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-sort-destructure-keys": "1.5.0", "eslint-plugin-sort-keys-fix": "1.1.2", + "husky": "8.0.3", "lint-staged": "14.0.1", "postcss-html": "1.5.0", "prettier": "3.0.3",