Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize codebase Part 2 #297

Closed
wants to merge 17 commits into from
Closed
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 .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "stage-2", "stage-3", "env"]
"presets": ["es2015", "stage-2", "stage-3", "env"]
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules/
coverage/
@types/generated/
55 changes: 55 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
root: true,
env: {
es2020: true,
node: true,
mocha: true,
},
globals: {
artifacts: "readonly",
contract: "readonly",
assert: "readonly",
web3: true,
},
overrides: [
{
files: ["**/*.ts"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/no-use-before-define": [
"error",
{ functions: false, classes: false },
],
"prettier/prettier": "warn",
},
},
{
files: ["**/*.js"],
extends: [
"eslint:recommended",
"standard",
"plugin:prettier/recommended",
],
rules: {
camelcase: [
"error",
{ properties: "never", allow: ["run_tests", "test_suite_name"] },
],
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"prettier/prettier": "warn",
"no-var": "error",
},
},
],
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@types/generated/**/* linguist-generated=true

7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
.DS_Store
build/
node_modules/
coverage/
coverage.json
package-lock.json
.idea/
#local codebuild results
artifacts/
.DS_Store
contracts/.DS_Store
token.json
credentials.json
echidna/
validate/apikey.infura
ganache-blockchain-log.txt
.coverage_artifacts
.coverage_contracts
yarn-error.log
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
node_modules/
coverage/
30 changes: 30 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"overrides": [
{
"files": "*.sol",
"options": {
"tabWidth": 4,
"explicitTypes": "always"
}
},
{
"files": "*.md",
"options": {
"proseWrap": "always"
}
}
]
}
12 changes: 7 additions & 5 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module.exports = {
providerOptions: {
port: 8555,
testrpcOptions: '-p 8555 -d --accounts 15',
skipFiles: [
'test/'
],
copyPackages: ['openzeppelin-solidity', 'zos-lib']
seed: "TestRPC is awesome!",
total_accounts: 15,
default_balance_ether: 1000000,
},
skipFiles: ["test/"],
copyPackages: ["openzeppelin-solidity", "zos-lib"],
};
7 changes: 7 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.6.0"],
"reason-string": ["warn", { "maxLength": 64 }]
}
}
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
language: node_js
node_js:
- 8
- 12

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.9.2
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"


install:
- npm install -g truffle@4.1.13
- yarn install --frozen-lockfile

script:
- yarn check --integrity && truffle compile && npm test
- yarn ganache & sleep 5 && yarn test

7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"juanblanco.solidity"
]
}
27 changes: 27 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"files.exclude": {
"**/.DS_Store": true,
"**/node_modules/": true
},
"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.packageDefaultDependenciesDirectory": "node_modules",
"files.trimTrailingWhitespace": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"[javascript]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"[markdown]": {
"editor.formatOnSave": true
},
"[solidity]": {
"editor.tabSize": 4,
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
}
}
Loading