From a058a583862fd9fc80286d2fe4f48509f56ba5f4 Mon Sep 17 00:00:00 2001 From: Amrit Timalsina Date: Sat, 15 Oct 2022 00:18:15 +0545 Subject: [PATCH] Add and setup husky --- .husky/pre-commit | 4 ++++ package-lock.json | 24 +++++++++++++++++++++++- package.json | 6 ++++-- 3 files changed, 31 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..852dca8 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run test:eslint diff --git a/package-lock.json b/package-lock.json index 2736316..0ae1ed4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "eslint": "^8.24.0", "eslint-plugin-vue": "^9.5.1", "esm": "^3.2.25", + "husky": "^7.0.0", "jest": "^29.1.2", "jest-environment-jsdom": "^29.1.2", "node-fetch": "^3.2.10", @@ -9301,6 +9302,21 @@ "node": ">=10.17.0" } }, + "node_modules/husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=12" + }, + "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", @@ -23502,7 +23518,7 @@ }, "do-bulma": { "version": "git+ssh://git@github.com/do-community/do-bulma.git#798588c92e40fb6368898e6523a6c461757caf45", - "from": "do-bulma@https://github.com/do-community/do-bulma", + "from": "do-bulma@github:do-community/do-bulma", "requires": { "bulma": "^0.9.4" } @@ -25374,6 +25390,12 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, + "husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "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 8b79a93..0c2e5df 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "test:eslint": "eslint 'src/**/*.{js,vue}'", "test:eslint:fix": "npm run test:eslint -- --fix", "test:stylelint": "stylelint 'src/**/*.scss' --config node_modules/do-bulma/.stylelintrc.json", - "test:i18n-packs": "node --es-module-specifier-resolution=node src/nginxconfig/i18n/verify.js" + "test:i18n-packs": "node --es-module-specifier-resolution=node src/nginxconfig/i18n/verify.js", + "prepare": "husky install" }, "jest": { "testRegex": "/test/.*.js?$" @@ -87,7 +88,8 @@ "stylelint-order": "^5.0.0", "vue-template-compiler": "^2.7.10", "webpack": "^5.74.0", - "webpack-bundle-analyzer": "^4.6.1" + "webpack-bundle-analyzer": "^4.6.1", + "husky": "^7.0.0" }, "overrides": { "@vue/cli-service": {