From 01840c92fd9234645b06abc83f86b973dc514a06 Mon Sep 17 00:00:00 2001 From: kennylam <909118+kennylam@users.noreply.github.com> Date: Thu, 12 Sep 2024 20:53:23 -0400 Subject: [PATCH] chore(husky): fix pre-commit hook (#4260) * chore(husky): fix pre-commit hook --- .husky/pre-commit | 1 + package.json | 8 ++------ yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000000..041c660c92b --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx --no-install lint-staged diff --git a/package.json b/package.json index 8997d2e30d1..bd108d65284 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "lint:js": "NODE_ENV=test eslint . --fix", "format": "prettier --write 'src/**/*.{css,scss,json,html,yaml,md,mdx,js}'", "format:check": "prettier --check 'src/**/*.{css,scss,json,html,yaml,md,mdx,js}'", - "update-browserslist": "npx browserslist-ga" + "update-browserslist": "npx browserslist-ga", + "prepare": "husky" }, "engines": { "node": ">=18.x" @@ -69,11 +70,6 @@ "prettier": "^2.0.2", "typescript": "^4.8.4" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, "lint-staged": { "*.js": [ "eslint --fix" diff --git a/yarn.lock b/yarn.lock index 58d71b8cb50..f587d88f47f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13488,11 +13488,11 @@ __metadata: linkType: hard "husky@npm:^9.0.11": - version: 9.0.11 - resolution: "husky@npm:9.0.11" + version: 9.1.6 + resolution: "husky@npm:9.1.6" bin: - husky: bin.mjs - checksum: 2c787dcf74a837fc9a4fea7da907509d4bd9a289f4ea10ecc9d86279e4d4542b0f5f6443a619bccae19e265f2677172cc2b86aae5c932a35a330cc227d914605 + husky: bin.js + checksum: 705673db4a247c1febd9c5df5f6a3519106cf0335845027bb50a15fba9b1f542cb2610932ede96fd08008f6d9f49db0f15560509861808b0031cdc0e7c798bac languageName: node linkType: hard