build: add ESLint to script/lint and containerize linting (closes #152)
This commit was merged in pull request #286.
This commit is contained in:
@@ -88,7 +88,7 @@ class Driver {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(text);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
throw new Error(
|
||||
method + " " + path + ": non-JSON response: " + text,
|
||||
);
|
||||
@@ -229,7 +229,9 @@ class Driver {
|
||||
// condition it was waiting on rather than "timed out".
|
||||
async waitFor(what, script, args = [], timeout = DEFAULT_WAIT_MS) {
|
||||
const deadline = Date.now() + timeout;
|
||||
let last = null;
|
||||
// Assigned on every path through the loop body before it is read, so
|
||||
// there is no initializer to give it.
|
||||
let last;
|
||||
for (;;) {
|
||||
try {
|
||||
const v = await this.execute(script, args);
|
||||
@@ -512,7 +514,7 @@ async function waitForDriverReady(base, timeoutMs) {
|
||||
const body = await res.json();
|
||||
if (body && body.value && body.value.ready !== false) return;
|
||||
}
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// not listening yet
|
||||
}
|
||||
if (Date.now() >= deadline) {
|
||||
|
||||
@@ -287,7 +287,7 @@ async function pageCompilesWasm(page) {
|
||||
try {
|
||||
await WebAssembly.compile(new Uint8Array(bytes));
|
||||
return true;
|
||||
} catch (_) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}, EMPTY_WASM_MODULE);
|
||||
|
||||
@@ -68,7 +68,11 @@ function withTimeout(promise, name) {
|
||||
const timeout = new Promise((_, reject) => {
|
||||
timer = setTimeout(
|
||||
() =>
|
||||
reject(new Error("timed out after " + TEST_TIMEOUT_MS + "ms")),
|
||||
reject(
|
||||
new Error(
|
||||
name + ": timed out after " + TEST_TIMEOUT_MS + "ms",
|
||||
),
|
||||
),
|
||||
TEST_TIMEOUT_MS,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { AbiCoder, Interface, solidityPacked, getBytes } = require("ethers");
|
||||
const { AbiCoder, Interface, solidityPacked } = require("ethers");
|
||||
const uniswap = require("../src/shared/uniswap");
|
||||
|
||||
const ROUTER_ADDR = "0x66a9893cc07d91d95644aedd05d03f95e1dba8af";
|
||||
|
||||
Reference in New Issue
Block a user