From 58a84ee3b55446fb18e85f7062288cb7f528d880 Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Tue, 21 Feb 2023 16:53:47 +0100 Subject: [PATCH] add: (CI) Husky (#4) --- .husky/pre-push | 4 ++++ package-lock.json | 22 ++++++++++++++++++++++ package.json | 4 +++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 .husky/pre-push diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000..75fac8e1 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run lint diff --git a/package-lock.json b/package-lock.json index 8001b12d..a6903ab4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "eslint-config-prettier": "^8.6.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", + "husky": "^8.0.3", "polished": "^4.2.2", "react": "^18.1.0", "react-dom": "^18.1.0", @@ -16065,6 +16066,21 @@ "node": ">=10.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", @@ -36872,6 +36888,12 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, + "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 fac8ae05..27631bb6 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "rollup": "rollup -c", "start": "npm run storybook", "storybook": "start-storybook -p 6006", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "prepare": "husky install" }, "author": "", "license": "ISC", @@ -46,6 +47,7 @@ "eslint-config-prettier": "^8.6.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", + "husky": "^8.0.3", "polished": "^4.2.2", "react": "^18.1.0", "react-dom": "^18.1.0",