diff --git a/.gitignore b/.gitignore index a8c5765..545b20a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,9 @@ /_playwright-results /lib /node_modules +/.husky/_ # exceptions !.gitkeep .vercel + diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..0997d63 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run prettier +npx lint-staged diff --git a/package.json b/package.json index 1701ca9..98eb972 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest", "lint:fix": "eslint . --fix", "lint": "prettier . --check && eslint .", - "postinstall": "opencollective-postinstall", + "postinstall": "opencollective-postinstall && npx husky install", "prepare": "npm run build", "prettier": "prettier . --write", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", @@ -57,11 +57,6 @@ "watch:css": "npm run build:css -- -w", "watch:js": "node build/build.js" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, "lint-staged": { "*.js": "eslint --fix" },