From 8038525ad0d9f156373d31d16a6966332b6f361f Mon Sep 17 00:00:00 2001 From: Xymorot Date: Sun, 6 Oct 2019 22:34:13 +0200 Subject: [PATCH] config: add pre-push hook (including linting and testing) --- package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f87dd8c..3e03d3d 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "watch": "gulp build --watch --dev", "build": "gulp build", "test": "mocha", + "lint": "npm run eslint && npm run tslint", "eslint-check": "eslint --print-config gulpfile.js | eslint-config-prettier-check", "eslint": "eslint .", "tslint-check": "tslint-config-prettier-check ./tslint.json", @@ -23,7 +24,8 @@ "forge:start": "electron-forge start", "forge:make": "electron-forge --platform win32 --arch x64 make", "forge": "npm run build && npm run forge:make", - "precommit": "npm run prettier:write && npm run eslint-check && npm run tslint-check" + "precommit": "npm run prettier:write && npm run eslint-check && npm run tslint-check", + "prepush": "npm run lint && npm run test" }, "dependencies": { "jsdom": "^15.1.1", @@ -72,7 +74,8 @@ }, "husky": { "hooks": { - "pre-commit": "npm run precommit" + "pre-commit": "npm run precommit", + "pre-push": "npm run prepush" } } }