fix: fix typo and remove linting bloat (#1)

This commit is contained in:
Matt Rice
2020-12-30 14:48:49 -05:00
committed by GitHub
parent c5619457bf
commit dc3a9108a9
6 changed files with 25 additions and 1098 deletions
-18
View File
@@ -1,18 +0,0 @@
module.exports = {
env: {
node: true,
mocha: true,
es2020: true
},
extends: ["plugin:prettier/recommended", "eslint:recommended"],
plugins: ["prettier"],
rules: {
"prettier/prettier": ["error"],
indent: ["error", 2, { SwitchCase: 1 }],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double", { avoidEscape: true }],
semi: ["error", "always"],
"spaced-comment": ["error", "always", { exceptions: ["-", "+"] }],
"no-console": 0
}
};
-8
View File
@@ -2,12 +2,4 @@
"printWidth": 120,
"bracketSpacing": true,
"tabWidth": 2,
"overrides": [
{
"files": "*.md",
"options": {
"semi": false
}
}
]
}
+1 -1
View File
@@ -5,7 +5,7 @@ repository in place or fork and customize it.
## System Dependencies
You will need to install nodejs v12 (we reccomend `nvm` to manage node versions) and yarn.
You will need to install nodejs v12 (we recommend `nvm` to manage node versions) and yarn.
Note: these additional dependencies are required -- you may or may not have them on your system already:
+6 -6
View File
@@ -6,7 +6,7 @@ const { getAbi, getAddress } = require("@uma/core");
// --url: node url, by default points at http://localhost:8545.
// --mnemonic: an account mnemonic you'd like to use. The script will default to using the node's unlocked accounts.
const argv = require("minimist")(process.argv.slice(), {
string: ["url", "mnemonic"]
string: ["url", "mnemonic"],
});
if (!argv.gasprice) throw "--gasprice required (in GWEI)";
if (typeof argv.gasprice !== "number") throw "--gasprice must be a number";
@@ -19,10 +19,10 @@ if (argv.gasprice < 1 || argv.gasprice > 1000) throw "--gasprice must be between
// See HDWalletProvider documentation: https://www.npmjs.com/package/@truffle/hdwallet-provider.
const hdwalletOptions = {
mnemonic: {
phrase: argv.mnemonic
phrase: argv.mnemonic,
},
providerOrUrl: url,
addressIndex: 0 // Change this to use the nth account.
addressIndex: 0, // Change this to use the nth account.
};
// Initialize web3 with an HDWalletProvider if a mnemonic was provided. Otherwise, just give it the url.
@@ -43,7 +43,7 @@ if (argv.gasprice < 1 || argv.gasprice > 1000) throw "--gasprice must be between
minSponsorTokens: { rawValue: toWei("100") }, // Min sponsor position size of 100 synthetic tokens.
liquidationLiveness: 7200, // 2 hour liquidation liveness.
withdrawalLiveness: 7200, // 2 hour withdrawal liveness.
excessTokenBeneficiary: "0x54f44eA3D2e7aA0ac089c4d8F7C93C27844057BF" // UMA Store contract.
excessTokenBeneficiary: "0x54f44eA3D2e7aA0ac089c4d8F7C93C27844057BF", // UMA Store contract.
};
const accounts = await web3.eth.getAccounts();
@@ -60,7 +60,7 @@ if (argv.gasprice < 1 || argv.gasprice > 1000) throw "--gasprice must be between
const transactionOptions = {
gas: 12000000, // 12MM is very high. Set this lower if you only have < 2 ETH or so in your wallet.
gasPrice: argv.gasprice, // gasprice arg
from: account
from: account,
};
// Simulate transaction to test before sending to the network.
@@ -71,7 +71,7 @@ if (argv.gasprice < 1 || argv.gasprice > 1000) throw "--gasprice must be between
// Since the simulated transaction succeeded, send the real one to the network.
const { transactionHash } = await empCreator.methods.createExpiringMultiParty(empParams).send(transactionOptions);
console.log("Deployed in transaction:", transactionHash);
})().catch(e => {
})().catch((e) => {
console.error(e);
process.exit(1); // Exit with a nonzero exit code to signal failure.
});
+4 -19
View File
@@ -4,10 +4,9 @@
"description": "Example stub repo to help launch an EMP",
"private": true,
"scripts": {
"lint": "npm run eslint && npm run prettier -- --list-different",
"lint-fix": "npm run eslint -- --fix && npm run prettier -- --write",
"eslint": "eslint './**/*.js'",
"prettier": "prettier './**/*.js' './**/*.sol' './**/*.md'",
"lint": "yarn run prettier --list-different",
"lint-fix": "yarn run prettier --write",
"prettier": "prettier './**/*.js' './**/*.md'",
"ganache-fork": "yarn ganache-cli -l 12000000 --fork"
},
"author": "UMA Team",
@@ -17,22 +16,8 @@
"url": "https://github.com/UMAprotocol/launch-emp.git"
},
"devDependencies": {
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"ganache-cli": "6.11.0",
"husky": "^4.2.3",
"lint-staged": "^10.5.3",
"prettier": "1.19.1",
"pretty-quick": "^2.0.1"
},
"husky": {
"hooks": {
"pre-commit": "echo '🕺 Running eslint on staged files' && lint-staged --allow-empty && echo '🏃‍♂️ Running pretty-quick on staged files' && pretty-quick --staged"
}
},
"lint-staged": {
"*.js": "eslint --cache --fix"
"prettier": "^2.2.1"
},
"dependencies": {
"@truffle/hdwallet-provider": "^1.2.1",
+14 -1046
View File
File diff suppressed because it is too large Load Diff