Skip to content
This repository was archived by the owner on Dec 10, 2020. It is now read-only.

Commit de80d90

Browse files
committed
Lint lib/rpc
1 parent 39fe168 commit de80d90

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/rpc/modules/eth.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class Eth {
4747
* as the second argument
4848
* @return {Promise}
4949
*/
50-
async blockNumber(params = [], cb: (err: Error | null, val?: string) => void) {
50+
async blockNumber(_params = [], cb: (err: Error | null, val?: string) => void) {
5151
try {
5252
const latestHeader = await this._chain.getLatestHeader()
5353
const latestBlockNumber = bufferToHex(latestHeader.number)
@@ -66,6 +66,7 @@ export class Eth {
6666
* @return {Promise}
6767
*/
6868
async getBlockByNumber(params: any[] | boolean[], cb: (err: Error | null, val?: any) => void) {
69+
// eslint-disable-next-line prefer-const
6970
let [blockNumber, includeTransactions] = params
7071

7172
blockNumber = Number.parseInt(blockNumber, 16)
@@ -135,7 +136,7 @@ export class Eth {
135136
* @param {Function} [cb] A function with an error object as the first argument and a
136137
* hex-encoded string of the current protocol version as the second argument
137138
*/
138-
protocolVersion(params = [], cb: (err: null, val: string) => void) {
139+
protocolVersion(_params = [], cb: (err: null, val: string) => void) {
139140
cb(null, `0x${this.ethVersion.toString(16)}`)
140141
}
141142
}

lib/rpc/modules/net.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class Net {
3232
* @param {Function} [cb] A function with an error object as the first argument and the network
3333
* id as the second argument
3434
*/
35-
version(params = [], cb: (err: Error | null, id: string) => void) {
35+
version(_params = [], cb: (err: Error | null, id: string) => void) {
3636
cb(null, `${this._node.common.chainId()}`)
3737
}
3838

@@ -42,7 +42,7 @@ export class Net {
4242
* @param {Function} [cb] A function with an error object as the first argument and a boolean
4343
* that's true when the client is listening and false when it's not as the second argument
4444
*/
45-
listening(params = [], cb: (err: Error | null, isListening: boolean) => void) {
45+
listening(_params = [], cb: (err: Error | null, isListening: boolean) => void) {
4646
cb(null, this._node.opened)
4747
}
4848

@@ -52,7 +52,7 @@ export class Net {
5252
* @param {Function} [cb] A function with an error object as the first argument and the
5353
* number of peers connected to the client as the second argument
5454
*/
55-
peerCount(params = [], cb: (err: Error | null, numberOfPeers: string) => void) {
55+
peerCount(_params = [], cb: (err: Error | null, numberOfPeers: string) => void) {
5656
cb(null, addHexPrefix(this._peerPool.peers.length.toString(16)))
5757
}
5858
}

lib/rpc/modules/web3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Web3 {
2828
* @param {Function} [cb] A function with an error object as the first argument and the
2929
* client version as the second argument
3030
*/
31-
clientVersion(params = [], cb: (err: null, version: string) => void) {
31+
clientVersion(_params = [], cb: (err: null, version: string) => void) {
3232
const packageVersion = require('../../../package.json').version
3333
const { version } = process
3434
const ethJsVersion = `EthereumJS/${packageVersion}/${platform()}/node${version.substring(1)}`

0 commit comments

Comments
 (0)