From cace5b368b1f7cb607105231f658bb58dd8dd263 Mon Sep 17 00:00:00 2001 From: Justin Fagnani Date: Fri, 16 Apr 2021 15:07:25 -0700 Subject: [PATCH] [all] Fix Husky after upgrade to v6 (#1760) --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ package.json | 8 ++------ 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..4a31be57ce --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run ignore-sync && npm exec lint-staged diff --git a/package.json b/package.json index caac35fc39..5a5461393b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "ignore-sync": "ignore-sync .", "lint": "eslint \"**/*.{js,ts}\"", "nuke": "rm -rf node_modules packages/{*,labs/*}/node_modules && npm install && npm run bootstrap && npm run clean", - "test": "(cd packages/tests && npm test) && (cd packages/labs/ssr && npm test) && (cd packages/localize && npm test) && (cd packages/localize-tools && npm test) && (cd packages/lit-starter-ts && npm test) && (cd packages/lit-starter-js && npm test)" + "test": "(cd packages/tests && npm test) && (cd packages/labs/ssr && npm test) && (cd packages/localize && npm test) && (cd packages/localize-tools && npm test) && (cd packages/lit-starter-ts && npm test) && (cd packages/lit-starter-js && npm test)", + "prepare": "husky install" }, "devDependencies": { "@rollup/plugin-node-resolve": "^11.2.1", @@ -39,11 +40,6 @@ "rollup-plugin-terser": "^7.0.2", "typescript": "^4.0.3" }, - "husky": { - "hooks": { - "pre-commit": "npm run ignore-sync && lint-staged" - } - }, "lint-staged": { "**/*.{cjs,html,js,json,md,ts}": "prettier --write", "**/*.{js,ts}": "eslint --fix"