Skip to content

Commit 5b746ee

Browse files
committed
Introduction tslint
1 parent 54a0b97 commit 5b746ee

24 files changed

+289
-208
lines changed

package-lock.json

Lines changed: 81 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "ava-ts -v",
8+
"posttest": "npm run lint",
9+
"lint": "tslint -c tslint.json 'src/**/*.ts'",
810
"docs": "typedoc --module etherscan-api --out docs ./src",
911
"lint:api": "swagger-cli validate ./api/swagger/swagger.yaml"
1012
},
@@ -29,6 +31,7 @@
2931
"ava-ts": "^0.25.2",
3032
"swagger-cli": "^2.3.0",
3133
"ts-node": "^8.3.0",
34+
"tslint": "^5.18.0",
3235
"typedoc": "^0.15.0",
3336
"typescript": "^3.5.3"
3437
}

src/actions/account.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { mapFromArray } from '../util/mapFromArray'
1+
import { mapFromArray } from "../util/mapFromArray"
22
const actionNames = [
3-
'balance',
4-
'balancemulti',
5-
'txlist',
6-
'txlistinternal',
7-
'tokentx',
8-
'getminedblocks'
3+
"balance",
4+
"balancemulti",
5+
"txlist",
6+
"txlistinternal",
7+
"tokentx",
8+
"getminedblocks",
99
]
10-
export const account = mapFromArray(actionNames)
10+
export const account = mapFromArray(actionNames)

src/actions/block.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { mapFromArray } from '../util/mapFromArray'
1+
import { mapFromArray } from "../util/mapFromArray"
22
const actionNames = [
3-
'getblockreward'
3+
"getblockreward",
44
]
55
export const block = mapFromArray(actionNames)

src/actions/contract.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { mapFromArray } from '../util/mapFromArray'
1+
import { mapFromArray } from "../util/mapFromArray"
22
const actionNames = [
3-
'getabi',
4-
'getsourcecode'
3+
"getabi",
4+
"getsourcecode",
55
]
66
export const contract = mapFromArray(actionNames)

src/actions/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export { account } from './account'
2-
export { block } from './block'
3-
export { contract } from './contract'
4-
export { logs } from './logs'
5-
export { proxy } from './proxy'
6-
export { stats } from './stats'
7-
export { tokens } from './tokens'
8-
export { transaction } from './transaction'
1+
export { account } from "./account"
2+
export { block } from "./block"
3+
export { contract } from "./contract"
4+
export { logs } from "./logs"
5+
export { proxy } from "./proxy"
6+
export { stats } from "./stats"
7+
export { tokens } from "./tokens"
8+
export { transaction } from "./transaction"

src/actions/logs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { mapFromArray } from '../util/mapFromArray'
1+
import { mapFromArray } from "../util/mapFromArray"
22
const actionNames = [
3-
'getLogs'
3+
"getLogs",
44
]
55
export const logs = mapFromArray(actionNames)

src/actions/proxy.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { mapFromArray } from '../util/mapFromArray'
1+
import { mapFromArray } from "../util/mapFromArray"
22
const actionNames = [
3-
'eth_blockNumber',
4-
'eth_getBlockByNumber',
5-
'eth_getBlockByNumberAndIndex',
6-
'eth_getBlockTransactionCountByNumber',
7-
'eth_getTransactionByHash',
8-
'eth_getTransactionByBlockNumberAndIndex',
9-
'eth_getTransactionCount',
10-
'eth_sendRawTransaction',
11-
'eth_getTransactionReceipt',
12-
'eth_call',
13-
'eth_getCode',
14-
'eth_getStorageAt',
15-
'eth_gasPrice',
16-
'eth_estimateGas'
3+
"eth_blockNumber",
4+
"eth_getBlockByNumber",
5+
"eth_getBlockByNumberAndIndex",
6+
"eth_getBlockTransactionCountByNumber",
7+
"eth_getTransactionByHash",
8+
"eth_getTransactionByBlockNumberAndIndex",
9+
"eth_getTransactionCount",
10+
"eth_sendRawTransaction",
11+
"eth_getTransactionReceipt",
12+
"eth_call",
13+
"eth_getCode",
14+
"eth_getStorageAt",
15+
"eth_gasPrice",
16+
"eth_estimateGas",
1717
]
1818
export const proxy = mapFromArray(actionNames)

src/actions/stats.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { mapFromArray } from '../util/mapFromArray'
1+
import { mapFromArray } from "../util/mapFromArray"
22
const actionNames = [
3-
'ethsupply',
4-
'ethprice'
3+
"ethsupply",
4+
"ethprice",
55
]
66
export const stats = mapFromArray(actionNames)

src/actions/tokens.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { mapFromArray } from '../util/mapFromArray'
1+
import { mapFromArray } from "../util/mapFromArray"
22
const actionNames = [
3-
'tokenbalance',
4-
'tokensupply'
3+
"tokenbalance",
4+
"tokensupply",
55
]
66
export const tokens = mapFromArray(actionNames)

0 commit comments

Comments
 (0)