From eb83cf891cfc16fe4be3e43feb95997fb9525ca8 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Mon, 4 Dec 2023 13:02:27 -0500 Subject: [PATCH] Enable for-in lint rule (#3013) ### Description https://eslint.org/docs/latest/rules/guard-for-in ### Drive-by changes Fix lint error in SDK Sealevel adapter ### Backward compatibility Yes --- .eslintrc | 1 + typescript/sdk/src/ism/HyperlaneIsmFactory.ts | 2 +- typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index c1ce429fd..0855bdf61 100644 --- a/.eslintrc +++ b/.eslintrc @@ -23,6 +23,7 @@ "no-extra-boolean-cast": ["error"], "no-ex-assign": ["error"], "no-constant-condition": ["off"], + "guard-for-in": ["error"], "@typescript-eslint/ban-ts-comment": ["off"], "@typescript-eslint/explicit-module-boundary-types": ["off"], "@typescript-eslint/no-explicit-any": ["off"], diff --git a/typescript/sdk/src/ism/HyperlaneIsmFactory.ts b/typescript/sdk/src/ism/HyperlaneIsmFactory.ts index 3d36e8fde..0f1dbba52 100644 --- a/typescript/sdk/src/ism/HyperlaneIsmFactory.ts +++ b/typescript/sdk/src/ism/HyperlaneIsmFactory.ts @@ -165,7 +165,7 @@ export class HyperlaneIsmFactory extends HyperlaneApp { // ? this.getContracts(chain).defaultFallbackRoutingIsmFactory // : this.getContracts(chain).routingIsmFactory; const isms: ChainMap
= {}; - for (const origin in config.domains) { + for (const origin of Object.keys(config.domains)) { const ism = await this.deploy(chain, config.domains[origin], origin); isms[origin] = ism.address; } diff --git a/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts b/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts index b6d3b0024..2d93c4d2f 100644 --- a/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts +++ b/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts @@ -302,7 +302,7 @@ export abstract class SealevelHypTokenAdapter return tx; } - async getIgpKeys() { + async getIgpKeys(): Promise { const tokenData = await this.getTokenAccountData(); if (!tokenData.interchain_gas_paymaster) return undefined; const igpConfig = tokenData.interchain_gas_paymaster;