From df3abe64a279ab89ecaaca206c3a8e44ce590759 Mon Sep 17 00:00:00 2001 From: lstoeferle <48953604+lstoeferle@users.noreply.github.com> Date: Sun, 7 Mar 2021 22:49:43 +0100 Subject: [PATCH] chore: added husky git hooks --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ package-lock.json | 6 ++++++ package.json | 2 ++ src/App.vue | 2 +- 5 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..20d0d06 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run lint diff --git a/package-lock.json b/package-lock.json index 01379b1..381980b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2369,6 +2369,12 @@ "integrity": "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos=", "dev": true }, + "husky": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-5.1.3.tgz", + "integrity": "sha512-fbNJ+Gz5wx2LIBtMweJNY1D7Uc8p1XERi5KNRMccwfQA+rXlxWNSdUxswo0gT8XqxywTIw7Ywm/F4v/O35RdMg==", + "dev": true + }, "icss-replace-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", diff --git a/package.json b/package.json index 41fc2cc..256f64e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "private": true, "scripts": { + "postinstall": "husky install", "dev": "vite", "build": "vite build", "lint": "eslint './src/**/*.{js,ts,tsx,vue,md}'", @@ -23,6 +24,7 @@ "eslint": "^7.21.0", "eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^7.7.0", + "husky": "^5.1.3", "prettier": "^2.2.1", "typescript": "^4.2.3", "vite": "^2.0.5", diff --git a/src/App.vue b/src/App.vue index fc73322..82cd572 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@