From e5370145af0bd6f495993470245201b5041bf7b3 Mon Sep 17 00:00:00 2001 From: Dejan Vasic Date: Thu, 1 Feb 2024 23:45:08 +1100 Subject: [PATCH] adding the husky test --- .husky/pre-commit | 1 + package-lock.json | 16 ++++++++++++++++ package.json | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..72c4429 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm test diff --git a/package-lock.json b/package-lock.json index a48d053..b3cbda7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "eslint": "^8.53.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-svelte": "^2.34.1", + "husky": "^9.0.7", "postcss": "^8.4.28", "prettier": "^3.0.2", "prettier-plugin-svelte": "^3.0.3", @@ -2169,6 +2170,21 @@ "node": ">=8" } }, + "node_modules/husky": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.7.tgz", + "integrity": "sha512-vWdusw+y12DUEeoZqW1kplOFqk3tedGV8qlga8/SF6a3lOiWLqGZZQvfWvY0fQYdfiRi/u1DFNpudTSV9l1aCg==", + "dev": true, + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", diff --git a/package.json b/package.json index 0833861..0969804 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,12 @@ "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "test": "vitest run && npm run check", "test:unit": "vitest", "test:playwright": "playwright test", "lint": "prettier --plugin-search-dir . --check . && eslint .", - "format": "prettier --plugin-search-dir . --write ." + "format": "prettier --plugin-search-dir . --write .", + "prepare": "husky" }, "devDependencies": { "@fontsource/fira-mono": "^5.0.8", @@ -28,6 +30,7 @@ "eslint": "^8.53.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-svelte": "^2.34.1", + "husky": "^9.0.7", "postcss": "^8.4.28", "prettier": "^3.0.2", "prettier-plugin-svelte": "^3.0.3",