Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"fix:errors": "eslint --fix --quiet .",
"fix:all": "eslint --fix .",
"fix": "npm run fix:errors",
"precommit": "lerna run --concurrency 1 --stream precommit --since master",
"precommit": "./precommit.sh",
"test:ci:local": "npm run test:ci:build:local && npm run test:ci:all",
"test:ci:build:local": "./ci.sh build local",
"test:ci": "echo 'This command has been removed. Try running `npm run test:ci:local` to run tests locally using the test_runner docker container as before. The CI pipeline logic is now in .circleci/config.yml.'",
Expand Down
3 changes: 1 addition & 2 deletions packages/bitcore-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"lint": "eslint .",
"fix:errors": "eslint --fix --quiet .",
"fix:all": "eslint --fix .",
"fix": "npm run fix:errors",
"precommit": "npm run lint"
"fix": "npm run fix:errors"
},
"dependencies": {
"@bitpay-labs/bitcore-mnemonic": "^11.8.1",
Expand Down
1 change: 0 additions & 1 deletion packages/bitcore-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"compile": "npm run clean && npm run build",
"test": "npm run compile && mocha -r tsx --exit 'test/**/*.test.ts'",
"coverage": "npm run compile && nyc mocha -r tsx --exit 'test/**/*.test.ts'",
"precommit": "npm run lint",
"lint": "eslint .",
"fix:errors": "eslint --fix --quiet .",
"fix:all": "eslint --fix .",
Expand Down
3 changes: 1 addition & 2 deletions packages/bitcore-logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"lint": "eslint .",
"fix:errors": "eslint --fix --quiet .",
"fix:all": "eslint --fix .",
"fix": "npm run fix:errors",
"precommit": "npm run lint"
"fix": "npm run fix:errors"
},
"dependencies": {
"winston": "3.3.3"
Expand Down
1 change: 0 additions & 1 deletion packages/bitcore-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"fix:errors": "eslint --fix --quiet .",
"fix:all": "eslint --fix .",
"fix": "npm run fix:errors",
"precommit": "npm run lint",
"test:scripts": "npx mocha scripts/test"
},
"nyc": {
Expand Down
3 changes: 1 addition & 2 deletions packages/bitcore-wallet-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
"fix:errors": "eslint --fix --quiet .",
"fix:all": "eslint --fix .",
"fix": "npm run fix:errors",
"pub": "npm run build && npm publish",
"precommit": "npm run lint"
"pub": "npm run build && npm publish"
},
"nyc": {
"include": [
Expand Down
1 change: 0 additions & 1 deletion packages/crypto-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"hardhat:clean": "rm -rf blockchain/EVM/artifacts blockchain/EVM/cache",
"hardhat:test": "npm run hardhat:clean && cd blockchain/EVM/ && npx hardhat test",
"lint": "eslint .",
"precommit": "npm run lint",
"test": "docker-compose down && docker-compose build && docker-compose run test_runner",
"test:local": "npm run docker:test:down && npm run docker:test:build && docker compose run test_runner"
},
Expand Down
1 change: 0 additions & 1 deletion packages/crypto-wallet-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"build": "tsc",
"clean": "rm -rf ts_build && tsc --version",
"compile": "npm run clean && npm run build",
"precommit": "npm run lint",
"lint": "eslint .",
"fix:errors": "eslint --fix --quiet .",
"fix:all": "eslint --fix .",
Expand Down
19 changes: 19 additions & 0 deletions precommit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

lintPackages="bitcore-cli bitcore-client bitcore-logging bitcore-node bitcore-wallet-client bitcore-wallet-service crypto-rpc crypto-wallet-core"

lintDirs=""
for package in $lintPackages; do
for dir in src test scripts lib; do
if [ -d "packages/$package/$dir" ]; then
lintDirs+="packages/$package/$dir "
fi
done
done

# staged JavaScript/TypeScript files that are either modified or new, not deleted files
modifiedFiles=`git diff --name-only --diff-filter=AM --cached $lintDirs | grep -E '\.(js|ts)'`

if [[ "" != $modifiedFiles ]]; then
npx eslint $modifiedFiles
fi