From 314ca1ce5a9ba60b6886dcfd6e6f55e5b52f60c5 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sun, 7 Aug 2022 21:53:00 -0500 Subject: [PATCH] chore: set up husky --- .husky/pre-commit | 4 ++++ package-lock.json | 32 ++++++++++++++++++++++++++++++-- package.json | 6 +++++- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..f61f44f --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +CI=true npm test diff --git a/package-lock.json b/package-lock.json index 2034714..06cd537 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chitchatter", - "version": "0.1.0", + "version": "0.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "chitchatter", - "version": "0.1.0", + "version": "0.0.0", "dependencies": { "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.3.0", @@ -15,6 +15,13 @@ "react-dom": "^18.2.0", "react-scripts": "5.0.1", "web-vitals": "^2.1.4" + }, + "devDependencies": { + "husky": "^8.0.1" + }, + "engines": { + "node": "18.x", + "npm": "8.x" } }, "node_modules/@adobe/css-tools": { @@ -8628,6 +8635,21 @@ "node": ">=10.17.0" } }, + "node_modules/husky": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", + "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -22821,6 +22843,12 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, + "husky": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", + "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "dev": true + }, "iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", diff --git a/package.json b/package.json index 6be3181..ddc11b8 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "test": "react-scripts test" + "test": "react-scripts test", + "prepare": "husky install" }, "eslintConfig": { "extends": [ @@ -38,5 +39,8 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "husky": "^8.0.1" } }