Skip to content

Commit

Permalink
Add prettier plugin. (#56)
Browse files Browse the repository at this point in the history
* Initial prettier setup.

* Lint file.

* More linter fixes.
  • Loading branch information
jnaviask authored Apr 22, 2021
1 parent 3c66ff5 commit e4fb68c
Show file tree
Hide file tree
Showing 56 changed files with 5,406 additions and 3,125 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ jobs:
command: yarn test
- store_artifacts:
path: coverage
- run:
name: lint
command: yarn lint
41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"extends": [
"airbnb-base",
"plugin:prettier/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"settings": {
"import/extensions": [".js", ".ts"],
"import/resolver": {
"node": {},
"webpack": {
"config": "webpack/webpack.common.js"
}
}
},
"ignorePatterns": ["contractTypes/"],
"rules": {
"@typescript-eslint/interface-name-prefix": "off",
"import/prefer-default-export": 0,
"import/extensions": 0,
"import/no-cycle": 0,
"import/order": ["error", {
"newlines-between": "always"
}],
"max-classes-per-file": "off",
"no-await-in-loop": "off",
"no-import-cycles": "off",
"no-nested-ternary": "off",
"no-param-reassign": "off",
"no-plusplus": "off",
"no-restricted-syntax": "off",
"no-underscore-dangle": "off",
"no-useless-constructor": "off"
}
}
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"arrowParens": "always",
"singleQuote": true
}
20 changes: 17 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"marlin-test": "nyc ts-mocha --config ./.mocharc.json ./test/integration/marlin.spec.ts",
"integration-test": "nyc ts-mocha --config ./.mocharc.json ./test/integration/*.spec.ts",
"test": "nyc ts-mocha --config ./.mocharc.json ./test/integration/*.spec.ts ./test/unit/**/*.spec.ts",
"lint": "eslint src/ test/",
"listen": "ts-node -T ./scripts/listener.ts",
"listen-archival": "ts-node -T ./scripts/listener.ts -n edgeware-local -a true",
"scrape": "ts-node -T ./scripts/scraper.ts",
Expand All @@ -35,14 +36,19 @@
"@clover-network/node-tpye": "^1.0.1",
"@edgeware/node-types": "^3.3.3",
"@polkadot/api": "3.6.4",
"@polkadot/api-derive": "3.6.4",
"@polkadot/types": "3.6.4",
"@polkadot/util": "5.4.4",
"bn.js": "^5.1.3",
"ethereum-block-by-date": "^1.2.2",
"ethers": "^4.0.39",
"lodash": "^4.17.21",
"sleep-promise": "^8.0.1",
"typescript-logging": "^0.6.4",
"underscore": "^1.10.2",
"web3": "^1.2.9",
"web3-utils": "^1.2.9"
"web3": "1.3.1",
"web3-core": "1.3.1",
"web3-utils": "1.3.1"
},
"devDependencies": {
"@babel/core": "^7.10.3",
Expand All @@ -58,13 +64,21 @@
"@types/underscore": "^1.10.1",
"@types/web3": "^1.2.2",
"@types/yargs": "^15.0.9",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"chai": "^4.2.0",
"eslint": "^7.14.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-prettier": "^3.1.2",
"ganache-cli": "^6.9.1",
"jsdom": "^16.2.2",
"jsdom-global": "^3.0.2",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
"ts-mocha": "^7.0.0",
"prettier": "2.0.2",
"ts-mocha": "^8.0.0",
"ts-node": "^8.10.2",
"typechain": "^2.0.0",
"typescript": "^3.8.2",
Expand Down
54 changes: 26 additions & 28 deletions scripts/specs/hydraDX.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
/* eslint-disable @typescript-eslint/camelcase */
export const HydraDXSpec = {
types: {
"Amount": "i128",
"AmountOf": "Amount",
"Address": "AccountId",
"BalanceInfo": {
"amount": "Balance",
"assetId": "AssetId"
},
"CurrencyId": "AssetId",
"CurrencyIdOf": "AssetId",
"Intention": {
"who": "AccountId",
"asset_sell": "AssetId",
"asset_buy": "AssetId",
"amount": "Balance",
"discount": "bool",
"sell_or_buy": "IntentionType"
},
"IntentionId": "u128",
"IntentionType": {
"_enum": [
"SELL",
"BUY"
]
},
"LookupSource": "AccountId",
"Price": "Balance"
}
}
Amount: 'i128',
AmountOf: 'Amount',
Address: 'AccountId',
BalanceInfo: {
amount: 'Balance',
assetId: 'AssetId',
},
CurrencyId: 'AssetId',
CurrencyIdOf: 'AssetId',
Intention: {
who: 'AccountId',
asset_sell: 'AssetId',
asset_buy: 'AssetId',
amount: 'Balance',
discount: 'bool',
sell_or_buy: 'IntentionType',
},
IntentionId: 'u128',
IntentionType: {
_enum: ['SELL', 'BUY'],
},
LookupSource: 'AccountId',
Price: 'Balance',
},
};
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export * as MolochTypes from './moloch/types';
export * as MarlinEvents from './marlin/index';
export * as MarlinTypes from './marlin/types';
export * as SubstrateEvents from './substrate/index';
export * as SubstrateTypes from './substrate/types';
export * as SubstrateTypes from './substrate/types';
Loading

0 comments on commit e4fb68c

Please sign in to comment.