From 975ec0370cdfd1dd8cc52960af023cadfbe20810 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 2 Aug 2023 14:39:04 +0100 Subject: [PATCH] add husky precommit and pretty-quick script in package.json --- .husky/pre-commit | 4 ++++ package.json | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..618c2bfbc7 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + + diff --git a/package.json b/package.json index 5abd4aec77..b95b547635 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,8 @@ "watch": "watchify apps/remix-ide/src/index.js -dv -p browserify-reload -o apps/remix-ide/build/app.js --exclude solc", "reinstall": "rm ./node-modules/ -rf && rm yarn.lock && rm ./build/ -rf && yarn install & yarn run build", "ganache-cli": "npx ganache-cli", - "build-contracts": "find ./node_modules/@openzeppelin/contracts | grep -i '.sol' > libs/remix-ui/editor/src/lib/providers/completion/contracts/contracts.txt && find ./node_modules/@uniswap/v3-core/contracts | grep -i '.sol' >> libs/remix-ui/editor/src/lib/providers/completion/contracts/contracts.txt" + "build-contracts": "find ./node_modules/@openzeppelin/contracts | grep -i '.sol' > libs/remix-ui/editor/src/lib/providers/completion/contracts/contracts.txt && find ./node_modules/@uniswap/v3-core/contracts | grep -i '.sol' >> libs/remix-ui/editor/src/lib/providers/completion/contracts/contracts.txt", + "prepare": "husky install" }, "dependencies": { "@babel/plugin-proposal-class-properties": "^7.16.0", @@ -313,7 +314,7 @@ "gulp": "^4.0.2", "hardhat": "^2.14.0", "https-browserify": "^1.0.0", - "husky": "^8.0.3", + "husky": "^8.0.0", "ipfs-http-client": "^47.0.1", "ipfs-mini": "^1.1.5", "is-electron": "^2.2.0", @@ -365,5 +366,10 @@ }, "resolutions": { "@types/react": "^17.0.24" + }, + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged --pattern \"**/*.{js,jsx,ts,tsx}\"" + } } }