From 92d5fbf3efda5826ad0d9b86125e67d2ee5eab22 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:24:46 -0600 Subject: [PATCH] chore: Initialize husky --- .husky/.gitignore | 1 + .husky/pre-commit | 2 ++ package.json | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .husky/.gitignore create mode 100644 .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 100644 index 0000000..f841cf2 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +npx lint-staged diff --git a/package.json b/package.json index ae850a4..c45119e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "lint:fix": "eslint --fix {src,test}/**/*.ts", "package": "ncc build --source-map --license LICENSE", "test": "c8 --reporter=lcov ava", - "all": "npm run build && npm run format && npm run lint && npm run package && npm test" + "all": "npm run build && npm run format && npm run lint && npm run package && npm test", + "prepare": "husky && husky install" }, "repository": { "type": "git", @@ -76,5 +77,9 @@ "prettier": "^2.7.1", "ts-node": "^10.9.1", "typescript": "^4.7.3" + }, + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{ts,js,yml,md,json}": "prettier --write" } }