Skip to content

Commit

Permalink
add prettier for JS formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Jul 4, 2024
1 parent 1e17efc commit b89316d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 4,
"printWidth": 200,
"semi": true,
"trailingComma": "all",
"singleQuote": true
}
4 changes: 2 additions & 2 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require('solidity-coverage');

const { Networks, getNetwork } = require('@1inch/solidity-utils/hardhat-setup');

const { networks, etherscan } = (new Networks()).registerAll();
const { networks, etherscan } = new Networks().registerAll();

module.exports = {
solidity: {
Expand All @@ -22,7 +22,7 @@ module.exports = {
enabled: true,
runs: 1000000,
},
evmVersion: (networks[getNetwork()])?.hardfork || 'shanghai',
evmVersion: networks[getNetwork()]?.hardfork || 'shanghai',
viaIR: true,
},
},
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"hardhat-deploy": "0.12.4",
"hardhat-gas-reporter": "2.2.0",
"hardhat-tracer": "3.0.2",
"prettier": "3.3.2",
"rimraf": "5.0.7",
"solc": "0.8.26",
"solhint": "5.0.1",
Expand All @@ -40,10 +41,10 @@
"coverage": "hardhat coverage",
"deploy": "hardhat deploy --network",
"docify": "npx solidity-utils-docify",
"fmt": "yarn prettier --write .",
"fmt:check": "yarn prettier --check .",
"lint": "yarn run lint:js && yarn run lint:sol",
"lint:fix": "yarn run lint:js:fix && yarn run lint:sol:fix",
"fmt": "yarn prettier --write test deploy",
"fmt:check": "yarn prettier --check test deploy",
"lint": "yarn run fmt:check && yarn run lint:js && yarn run lint:sol",
"lint:fix": "yarn run fmt && yarn run lint:js:fix && yarn run lint:sol:fix",
"lint:js": "eslint .",
"lint:js:fix": "eslint . --fix",
"lint:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\"",
Expand Down
4 changes: 3 additions & 1 deletion test/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ describe('Example', async function () {
});

it('should be skipped in coverage', async function () {
if (hre.__SOLIDITY_COVERAGE_RUNNING) { this.skip(); }
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
this.skip();
}
// TODO: add test
});
});
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5328,6 +5328,11 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==

prettier@3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.2.tgz#03ff86dc7c835f2d2559ee76876a3914cec4a90a"
integrity sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==

prettier@^2.8.3:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
Expand Down

0 comments on commit b89316d

Please sign in to comment.