Skip to content

Commit 19c025f

Browse files
committed
Fix linting problems
Fixed the problems reported by the format task. Added `"no-await-in-loop": "off"` to the main elisntrc as this rules is often disabled by us. We still need to solve quotes problems with thesis/eslint-config#4
1 parent 27eab38 commit 19c025f

10 files changed

+11
-21
lines changed

solidity/random-beacon/.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"groups": ["builtin", "external", "parent", "sibling", "index", "type"],
1717
"newlines-between": "always"
1818
}
19-
]
19+
],
20+
"no-await-in-loop": "off"
2021
}
2122
}

solidity/random-beacon/tasks/ensure-eth-balance.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { task, types } from "hardhat/config"
22

33
import { parseValue, TASK_SEND_ETH } from "./send-eth"
44

5-
export const TASK_ENSURE_ETH_BALANCE = "ensure-eth-balance"
5+
const TASK_ENSURE_ETH_BALANCE = "ensure-eth-balance"
66

77
task(
88
TASK_ENSURE_ETH_BALANCE,
@@ -35,7 +35,8 @@ task(
3535
Array.from(args.addresses).map(hre.helpers.address.validate)
3636
)
3737

38-
for (let address of addresses) {
38+
// eslint-disable-next-line no-restricted-syntax
39+
for (const address of addresses) {
3940
const expectedBalance = parseValue(args.balance, hre)
4041
const currentBalance = await ethers.provider.getBalance(address)
4142

solidity/random-beacon/tasks/send-eth.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { BigNumber, Signer } from "ethers"
21
import { task, types } from "hardhat/config"
3-
import { HardhatRuntimeEnvironment } from "hardhat/types"
42

3+
import type { BigNumber, Signer } from "ethers"
4+
import type { HardhatRuntimeEnvironment } from "hardhat/types"
55
import type { TransactionResponse } from "@ethersproject/abstract-provider"
66

7+
// eslint-disable-next-line import/prefer-default-export
78
export const TASK_SEND_ETH = "send-eth"
89

910
task(TASK_SEND_ETH, "Send ether to an address")
@@ -32,8 +33,8 @@ task(TASK_SEND_ETH, "Send ether to an address")
3233
const to = hre.helpers.address.validate(args.to)
3334

3435
const tx: TransactionResponse = await from.sendTransaction({
35-
to: to,
36-
value: value,
36+
to,
37+
value,
3738
})
3839

3940
console.log(
@@ -51,7 +52,7 @@ export function parseValue(
5152
): BigNumber {
5253
const parsed = String(value).trim().split(" ")
5354

54-
if (parsed.length == 0 || parsed.length > 2) {
55+
if (parsed.length === 0 || parsed.length > 2) {
5556
throw new Error(`invalid value: ${value}`)
5657
}
5758

solidity/random-beacon/tasks/unlock-eth-accounts.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-await-in-loop */
21
import { task } from "hardhat/config"
32

43
import type { HttpNetworkConfig } from "hardhat/types"

solidity/random-beacon/test/Groups.Expiration.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-await-in-loop */
2-
31
import { ethers, waffle, helpers } from "hardhat"
42
import { expect } from "chai"
53

solidity/random-beacon/test/Groups.Termination.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-await-in-loop */
2-
31
import { ethers, waffle, helpers } from "hardhat"
42
import { expect } from "chai"
53

solidity/random-beacon/test/Groups.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-await-in-loop */
2-
31
import { ethers, waffle } from "hardhat"
42
import { expect } from "chai"
53

solidity/random-beacon/test/system/e2e.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-await-in-loop */
2-
31
import { ethers, waffle, helpers } from "hardhat"
42
import { expect } from "chai"
53

solidity/random-beacon/test/utils/dkg.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-await-in-loop */
2-
31
import { ethers, waffle } from "hardhat"
42
import { expect } from "chai"
53
import { BigNumber } from "ethers"

solidity/random-beacon/test/utils/operators.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-await-in-loop */
2-
31
import { ethers, helpers } from "hardhat"
42

53
import { params } from "../fixtures"

0 commit comments

Comments
 (0)