diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..233b47e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run format && npm run lint \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 0000000..82e7560 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1 @@ +npm run build && npm test \ No newline at end of file diff --git a/package.json b/package.json index 36ad968..cbcd696 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "node": ">= 18" }, "scripts": { - "prepare": "husky", "build": "tsc", "pack-and-install": "npm run build && npm pack && rm -rf node_modules/zkverifyjs && npm install ./$(npm pack | tail -n 1) --no-save", "bump-version": "npm version $npm_config_level && git add . && git commit -S -m \"chore: bump version to $npm_package_version\" && git push && npm run build", @@ -32,13 +31,8 @@ "test:coverage": "jest --coverage", "test:file:coverage": "node -e 'const path = process.argv[1]; require(\"child_process\").execSync(`jest --coverage --collectCoverageFrom=\"${path}/index.ts\" ${path}/index.test.ts`, { stdio: \"inherit\" });' --", "lint": "eslint 'src/**/*.ts' --fix --ignore-pattern '**/*.test.ts'", - "format": "prettier --write 'src/**/*.ts'" - }, - "husky": { - "hooks": { - "pre-commit": "npm run format && npm run lint", - "pre-push": "npm run build && npm test" - } + "format": "prettier --write 'src/**/*.ts'", + "prepare": "husky" }, "keywords": [ "blockchain",