-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: synchronise linting rules of repositories (#49)
* chore: command name changes * lint(calculate-hashes): fix * fix: lint:md command * chore: package.json commands alphabetical order * lint: using @matterlabs/eslint-config-typescript and "@matterlabs/prettier-config * style: prettier:fix * lint: lint:fix * Revert "lint: lint:fix" This reverts commit 15993b2d2ddfce0d876966d170e781645ff66cf9. * lint: eslint rules turned off * lint: lint:fix with new rules * chore: .eslintignore removed * chore: create githooks to check formatting and linting (#56) * chore: pre-commit and pre-push hooks added * docs: removed yarn lint from PR template * Revert "chore: package.json commands alphabetical order" This reverts commit e39a52c0b764a6ef40cfdc0fded9e068cceba1ce.
- Loading branch information
1 parent
68aaee1
commit 27d550a
Showing
34 changed files
with
5,149 additions
and
4,257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
{ | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"root": true | ||
} | ||
"extends": ["@matterlabs/eslint-config-typescript"], | ||
"rules": { | ||
"no-multiple-empty-lines": ["error", { "max": 1 }], | ||
"@typescript-eslint/no-namespace": "off", | ||
"import/no-named-as-default-member": "off", | ||
"import/namespace": "off", | ||
"import/no-unresolved": "off", | ||
"import/order": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
CYAN='\033[0;36m' | ||
NC='\033[0m' # No Color | ||
RED='\033[0;31m' | ||
|
||
# Check that the code is formatted in the given directory provided in the first argument | ||
function check_prettier { | ||
if ! yarn prettier:check; then | ||
echo "${RED}Commit error! Cannot commit unformatted code!${NC}" | ||
echo "Prettier errors found. Please format the code via ${CYAN}yarn prettier:fix${NC}!" | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_prettier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
CYAN='\033[0;36m' | ||
NC='\033[0m' # No Color | ||
RED='\033[0;31m' | ||
|
||
# Checking that the code is linted and formatted in the given directory provided in the first argument | ||
function check_lint { | ||
if ! yarn lint:check; then | ||
echo "${RED}Push error! Cannot push unlinted code!${NC}" | ||
echo "Lint errors found. Please lint the code via ${CYAN}yarn lint:fix${NC} and/or fix the errors manually!" | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
...require("@matterlabs/prettier-config"), | ||
plugins: ["prettier-plugin-solidity"], | ||
overrides: [ | ||
{ | ||
files: "*.sol", | ||
options: { | ||
bracketSpacing: false, | ||
printWidth: 120, | ||
singleQuote: false, | ||
tabWidth: 4, | ||
useTabs: false, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
import '@matterlabs/hardhat-zksync-chai-matchers'; | ||
import '@matterlabs/hardhat-zksync-solc'; | ||
import '@nomiclabs/hardhat-ethers'; | ||
import '@nomiclabs/hardhat-solpp'; | ||
import '@typechain/hardhat'; | ||
import "@matterlabs/hardhat-zksync-chai-matchers"; | ||
import "@matterlabs/hardhat-zksync-solc"; | ||
import "@nomiclabs/hardhat-ethers"; | ||
import "@nomiclabs/hardhat-solpp"; | ||
import "@typechain/hardhat"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const systemConfig = require('./SystemConfig.json'); | ||
const systemConfig = require("./SystemConfig.json"); | ||
|
||
export default { | ||
zksolc: { | ||
version: '1.3.14', | ||
compilerSource: 'binary', | ||
settings: { | ||
isSystem: true | ||
} | ||
zksolc: { | ||
version: "1.3.14", | ||
compilerSource: "binary", | ||
settings: { | ||
isSystem: true, | ||
}, | ||
zkSyncDeploy: { | ||
zkSyncNetwork: 'http://localhost:3050', | ||
ethNetwork: 'http://localhost:8545' | ||
}, | ||
zkSyncDeploy: { | ||
zkSyncNetwork: "http://localhost:3050", | ||
ethNetwork: "http://localhost:8545", | ||
}, | ||
solidity: { | ||
version: "0.8.17", | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 200, | ||
}, | ||
viaIR: true, | ||
}, | ||
solidity: { | ||
version: '0.8.17', | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 200 | ||
}, | ||
viaIR: true | ||
} | ||
}, | ||
solpp: { | ||
defs: (() => { | ||
return { | ||
ECRECOVER_COST_GAS: systemConfig.ECRECOVER_COST_GAS, | ||
KECCAK_ROUND_COST_GAS: systemConfig.KECCAK_ROUND_COST_GAS, | ||
SHA256_ROUND_COST_GAS: systemConfig.SHA256_ROUND_COST_GAS, | ||
}; | ||
})(), | ||
}, | ||
networks: { | ||
hardhat: { | ||
zksync: true, | ||
}, | ||
solpp: { | ||
defs: (() => { | ||
return { | ||
ECRECOVER_COST_GAS: systemConfig.ECRECOVER_COST_GAS, | ||
KECCAK_ROUND_COST_GAS: systemConfig.KECCAK_ROUND_COST_GAS, | ||
SHA256_ROUND_COST_GAS: systemConfig.SHA256_ROUND_COST_GAS | ||
}; | ||
})() | ||
zkSyncTestNode: { | ||
url: "http://127.0.0.1:8011", | ||
ethNetwork: "", | ||
zksync: true, | ||
}, | ||
networks: { | ||
hardhat: { | ||
zksync: true | ||
}, | ||
zkSyncTestNode: { | ||
url: 'http://127.0.0.1:8011', | ||
ethNetwork: '', | ||
zksync: true | ||
} | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.