From 33e26e431f1b0289f7be603e2d6540deefcdb4b2 Mon Sep 17 00:00:00 2001 From: jacoblurie29 Date: Sun, 14 Jan 2024 13:10:00 -0600 Subject: [PATCH] Added husky --- .husky/pre-commit | 4 ++++ package-lock.json | 22 ++++++++++++++++++++++ package.json | 6 ++++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..eb04cb3 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run prettier:check && npm run lint:check && npm run typescript:check \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1e685de..fba718a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "eslint": "^8.53.0", "eslint-plugin-autofix": "^1.1.0", "eslint-plugin-import": "^2.29.0", + "husky": "^8.0.0", "mocha": "^10.2.0", "nyc": "^15.1.0", "prettier": "^3.1.0", @@ -3948,6 +3949,21 @@ "node": ">= 0.8" } }, + "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", @@ -10146,6 +10162,12 @@ "toidentifier": "1.0.1" } }, + "husky": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true + }, "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 c25e259..4c004a1 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "typescript:check": "tsc --esModuleInterop", "lint:check": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "prettier:format": "prettier --write '**/*.{js,jsx,ts,tsx,json,css,scss,md}'", - "prettier:check": "prettier --check '**/*.{js,jsx,ts,tsx,json,css,scss,md}'" + "prettier:check": "prettier --check '**/*.{js,jsx,ts,tsx,json,css,scss,md}'", + "prepare": "husky install" }, "author": "", "license": "ISC", @@ -43,6 +44,7 @@ "mocha": "^10.2.0", "nyc": "^15.1.0", "prettier": "^3.1.0", - "supertest": "^6.3.3" + "supertest": "^6.3.3", + "husky": "^8.0.0" } }