From c973f3b3435a98b18520d88ef46c111d83215b26 Mon Sep 17 00:00:00 2001 From: Ashwin Phatak Date: Mon, 20 Sep 2021 16:25:54 +0530 Subject: [PATCH] Add husky for setting lint in commit hook. (#248) Co-authored-by: nabarun --- .husky/pre-commit | 4 ++++ package.json | 4 +++- yarn.lock | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..9dcd433f --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn lint diff --git a/package.json b/package.json index 68a4ea5d..32fa82f0 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ ], "devDependencies": { "depcheck": "^1.4.2", + "husky": "^7.0.2", "lerna": "^4.0.0" }, "scripts": { @@ -15,6 +16,7 @@ "build": "lerna run build --stream", "build:watch": "lerna run build --stream --parallel -- -w", "build:contracts": "lerna run build:contracts", - "db:reset": "sudo ./scripts/reset-dbs.sh" + "db:reset": "sudo ./scripts/reset-dbs.sh", + "prepare": "husky install" } } diff --git a/yarn.lock b/yarn.lock index 49666acf..5a9fbfe8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8120,6 +8120,11 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" +husky@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.2.tgz#21900da0f30199acca43a46c043c4ad84ae88dff" + integrity sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg== + iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"