Skip to content

Commit 3da8723

Browse files
committed
chore: several tooling improvements and fixes
- remove several unused dependencies - lint all js and ts files - prettify all js, ts and json files - install husky hooks on yarn install - use lint-staged Signed-off-by: Tomás Migone <[email protected]>
1 parent bc90412 commit 3da8723

28 files changed

+59
-263
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint
4+
npx --no-install lint-staged

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
1+
build
2+
reports
3+
cache
4+
coverage.json

cli/mockData/account-metadata/compound.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Compound developer",
66
"website": "https://compound.finance",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/decentraland.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Decentraland developer",
66
"website": "https://decentraland.io",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/ens.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "ENS developer",
66
"website": "https://ens.domains/",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/livepeer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Adam",
66
"website": "https://adam.com/",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/maker.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Maker deve",
66
"website": "https://maker.io/",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/melon.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Melon developer",
66
"website": "https://melon.finance/",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/moloch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Moloch dev",
66
"website": "https://moloch.io/",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/origin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Origin dev",
66
"website": "https://origin-dev.io",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/thegraph.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Dave Kajpust",
66
"website": "https://kajpust.com/",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/account-metadata/uniswap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"name": "Ian",
66
"website": "https://ian.com",
77
"isOrganization": true
8-
}
8+
}

cli/mockData/subgraph-metadata/compound.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmeMR3qK7wfAuSns4PpdFVZZcsCoLa7wEPQbrZTBQNKGWq",
55
"codeRepository": "https://github.com/graphprotocol/compound-V2-subgraph",
66
"website": "https://compound.finance/"
7-
}
7+
}

cli/mockData/subgraph-metadata/decentraland.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmVMtgVvEJLqmH3PZzcYVp5t8ni1v61e2M1rDVkcRo9WCz",
55
"codeRepository": "https://github.com/graphprotocol/decentraland-subgraph",
66
"website": "https://decentraland.org/"
7-
}
7+
}

cli/mockData/subgraph-metadata/ens.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmUqD4MMAXQvbNX3FbWNP43gmDFFdQPmQrn8CT9kNEb7Rs",
55
"codeRepository": "https://github.com/ensdomains/ens-subgraph",
66
"website": "https://ens.domains/"
7-
}
7+
}

cli/mockData/subgraph-metadata/livepeer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmcTyMcTpkSrRs8Q7tUBPqA6ektwL7x5DEZCsEpoveXxe1",
55
"codeRepository": "https://github.com/livepeer/livepeerjs/tree/master/packages/subgraph",
66
"website": "https://livepeer.org/"
7-
}
7+
}

cli/mockData/subgraph-metadata/maker.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmdJ2g7fbk1XDh24NBCwWNSUZ8jY1XxpG9ukXhLAhanP6C",
55
"codeRepository": "https://github.com/makerdao",
66
"website": "https://makerdao.com/en/"
7-
}
7+
}

cli/mockData/subgraph-metadata/melon.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmQpuowYwm5c7XYXmEbSGsP6EqTU7vEWBJGN3NhJLQZ7wq",
55
"codeRepository": "https://github.com/melonproject/melon-subgraph",
66
"website": "https://melonport.com"
7-
}
7+
}

cli/mockData/subgraph-metadata/moloch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmSLfbgC7wrmufnr4ekLJtzYT1YfoQFPRsFpCRrHsxr8ED",
55
"codeRepository": "https://github.com/MolochVentures/moloch-monorepo/",
66
"website": "https://molochdao.com/"
7-
}
7+
}

cli/mockData/subgraph-metadata/origin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmdNkVFiDjStPhCgQfnLUg8agwCK5yQQfmfivyeJJHDeDf",
55
"codeRepository": "https://github.com/graphprotocol/origin-subgraph",
66
"website": "https://www.originprotocol.com/en"
7-
}
7+
}

cli/mockData/subgraph-metadata/thegraph.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmTFK5DZc58XrTqhuuDTYoaq29ndnwoHX5TAW1bZr5EMpq",
55
"codeRepository": "https://github.com/graphprotocol/graph-network-subgraph",
66
"website": "https://thegraph.com/"
7-
}
7+
}

cli/mockData/subgraph-metadata/uniswap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"image": "https://api.thegraph.com/ipfs/api/v0/cat?arg=QmSaK8PKxNWPv3QMMdjp8bYvQxnpU277DowPMwCUr7dAxS",
55
"codeRepository": "https://github.com/graphprotocol/uniswap-subgraph",
66
"website": "https://uniswap.info/"
7-
}
7+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "v0.0.1",
33
"description": "First subgraph version"
4-
}
4+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "v0.2.0",
33
"description": "Second Version"
4-
}
4+
}

package.json

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
"devDependencies": {
1818
"@commitlint/cli": "^13.2.1",
1919
"@commitlint/config-conventional": "^13.2.0",
20-
"@ethersproject/contracts": "^5.4.1",
2120
"@ethersproject/experimental": "^5.4.0",
22-
"@ethersproject/transactions": "^5.4.0",
2321
"@graphprotocol/common-ts": "^1.6.0",
2422
"@nomiclabs/hardhat-ethers": "^2.0.2",
2523
"@nomiclabs/hardhat-etherscan": "^2.1.1",
@@ -40,23 +38,15 @@
4038
"@types/yargs": "^16.0.0",
4139
"@typescript-eslint/eslint-plugin": "^4.0.0",
4240
"@typescript-eslint/parser": "^4.0.0",
43-
"@typescript-eslint/typescript-estree": "^4.0.0",
4441
"@urql/core": "^2.1.3",
45-
"axios": "^0.21.1",
4642
"bignumber.js": "^9.0.0",
4743
"chai": "^4.3.4",
4844
"cli-table": "^0.3.6",
4945
"dotenv": "^9.0.0",
5046
"eslint": "^7.24.0",
5147
"eslint-config-prettier": "^8.3.0",
52-
"eslint-config-standard": "^16.0.0",
53-
"eslint-plugin-import": "^2.22.0",
54-
"eslint-plugin-mocha-no-only": "^1.1.1",
5548
"eslint-plugin-no-only-tests": "^2.4.0",
56-
"eslint-plugin-node": "^11.1.0",
5749
"eslint-plugin-prettier": "^3.4.0",
58-
"eslint-plugin-promise": "^5.0.0",
59-
"eslint-plugin-standard": "^4.1.0",
6050
"ethereum-waffle": "^3.3.0",
6151
"graphql-tag": "^2.12.4",
6252
"hardhat": "^2.2.0",
@@ -70,23 +60,21 @@
7060
"ipfs-http-client": "47.0.1",
7161
"isomorphic-fetch": "^3.0.0",
7262
"lint-staged": "^10.5.4",
73-
"minimist": "^1.2.5",
7463
"p-queue": "^6.6.1",
7564
"prettier": "^2.2.1",
7665
"prettier-plugin-solidity": "^1.0.0-beta.9",
7766
"solhint": "^3.3.6",
7867
"solhint-plugin-prettier": "^0.0.5",
7968
"solidity-coverage": "^0.7.16",
80-
"ts-generator": "^0.1.1",
8169
"ts-node": "^9.1.1",
8270
"typechain": "^5.0.0",
8371
"typescript": "^4.2.4",
8472
"winston": "^3.3.3",
8573
"yaml": "^1.10.2",
86-
"yargs": "^17.0.0",
87-
"yargs-parser": "^13.1.2"
74+
"yargs": "^17.0.0"
8875
},
8976
"scripts": {
77+
"prepare": "husky install",
9078
"prepublishOnly": "scripts/prepublish",
9179
"build": "SKIP_LOAD=true scripts/build",
9280
"clean": "rm -rf build/ cache/ dist/",
@@ -102,12 +90,12 @@
10290
"test:coverage": "scripts/coverage",
10391
"lint": "yarn lint:ts && yarn lint:sol",
10492
"lint:fix": "yarn lint:ts:fix && yarn lint:sol:fix",
105-
"lint:ts": "eslint '*/**/*.{js,ts}'",
106-
"lint:ts:fix": "yarn prettier:ts && eslint '*/**/*.{js,ts}' --fix",
107-
"lint:sol": "solhint './contracts/**/*.sol'",
108-
"lint:sol:fix": "yarn prettier:sol && solhint --fix './contracts/**/*.sol'",
93+
"lint:ts": "eslint '**/*.{js,ts}'",
94+
"lint:ts:fix": "yarn prettier:ts && eslint '**/*.{js,ts}' --fix",
95+
"lint:sol": "solhint 'contracts/**/*.sol'",
96+
"lint:sol:fix": "yarn prettier:sol && solhint --fix 'contracts/**/*.sol'",
10997
"prettier": "yarn prettier:ts && yarn prettier:sol",
110-
"prettier:ts": "prettier --write 'test/**/*.ts'",
98+
"prettier:ts": "prettier --write '**/*.{js,ts,json}'",
11199
"prettier:sol": "prettier --write 'contracts/**/*.sol'",
112100
"analyze": "scripts/analyze",
113101
"myth": "scripts/myth",
@@ -117,19 +105,19 @@
117105
"size": "hardhat size-contracts"
118106
},
119107
"lint-staged": {
120-
"contracts/*.sol": [
121-
"prettier --write"
108+
"contracts/**/*.sol": [
109+
"yarn lint:sol:fix"
122110
],
123-
"test/**/*.ts": [
124-
"prettier --write"
111+
"**/*.ts": [
112+
"yarn lint:ts:fix"
113+
],
114+
"**/*.js": [
115+
"yarn lint:ts:fix"
116+
],
117+
"**/*.json": [
118+
"yarn lint:ts:fix"
125119
]
126120
},
127-
"husky": {
128-
"hooks": {
129-
"pre-commit": "lint-staged",
130-
"pre-push": "git diff HEAD --quiet && yarn lint && yarn test"
131-
}
132-
},
133121
"repository": {
134122
"type": "git",
135123
"url": "git+https://github.com/graphprotocol/contracts.git"

slither.config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"hardhat_artifacts_directory": "./build/contracts",
3-
"filter_paths": "contracts/bancor/.*|contracts/tests/.*|contracts/staking/libs/Cobbs.*|contracts/staking/libs/LibFixedMath.*|contracts/staking/libs/MathUtils.*",
4-
"detectors_to_exclude": "similar-names,naming-convention",
5-
"exclude_dependencies": true
6-
}
2+
"hardhat_artifacts_directory": "./build/contracts",
3+
"filter_paths": "contracts/bancor/.*|contracts/tests/.*|contracts/staking/libs/Cobbs.*|contracts/staking/libs/LibFixedMath.*|contracts/staking/libs/MathUtils.*",
4+
"detectors_to_exclude": "similar-names,naming-convention",
5+
"exclude_dependencies": true
6+
}

test/rewards/rewards.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ describe('Rewards', () => {
573573
}
574574

575575
it('should distribute rewards on closed allocation and stake', async function () {
576-
577576
// Align with the epoch boundary
578577
await advanceToNextEpoch(epochManager)
579578
// Setup

0 commit comments

Comments
 (0)