Skip to content

Commit c326eb7

Browse files
committed
fix: lint
1 parent 0f61514 commit c326eb7

10 files changed

Lines changed: 39 additions & 42 deletions

File tree

‎oxlint-suppressions.json‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,11 @@
15091509
"count": 1
15101510
}
15111511
},
1512+
"packages/bridge-controller/src/utils/controllers/remote-feature-flags.ts": {
1513+
"typescript/explicit-function-return-type": {
1514+
"count": 1
1515+
}
1516+
},
15121517
"packages/bridge-controller/src/utils/feature-flags.ts": {
15131518
"id-length": {
15141519
"count": 1
@@ -2301,15 +2306,6 @@
23012306
"typescript/no-unsafe-argument": {
23022307
"count": 18
23032308
},
2304-
"typescript/no-unsafe-call": {
2305-
"count": 2
2306-
},
2307-
"typescript/no-unsafe-member-access": {
2308-
"count": 1
2309-
},
2310-
"typescript/no-unsafe-return": {
2311-
"count": 1
2312-
},
23132309
"typescript/prefer-nullish-coalescing": {
23142310
"count": 18
23152311
},
@@ -4447,6 +4443,11 @@
44474443
"count": 2
44484444
}
44494445
},
4446+
"packages/profile-sync-controller/src/sdk/__fixtures__/auth.ts": {
4447+
"typescript/no-misused-promises": {
4448+
"count": 1
4449+
}
4450+
},
44504451
"packages/profile-sync-controller/src/sdk/__fixtures__/test-utils.ts": {
44514452
"typescript/explicit-function-return-type": {
44524453
"count": 4

‎packages/bridge-controller/src/bridge-controller.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { InternalAccount } from '@metamask/keyring-internal-api';
77
import { abiERC20 } from '@metamask/metamask-eth-abis';
88
import { StaticIntervalPollingController } from '@metamask/polling-controller';
99
import type { TransactionController } from '@metamask/transaction-controller';
10-
import type { CaipAssetType, Hex } from '@metamask/utils';
10+
import type { CaipAssetType } from '@metamask/utils';
1111
import { v4 as uuid } from 'uuid';
1212

1313
import { toQuoteResponseV2 } from './coercers/quote-response-v1-to-v2.js';
@@ -40,7 +40,6 @@ import type {
4040
} from './types.js';
4141
import { getAssetIdsForToken, toExchangeRates } from './utils/assets.js';
4242
import { hasSufficientBalance } from './utils/balance.js';
43-
import { getAccountByAddress } from './utils/controllers/accounts.js';
4443
import {
4544
getDefaultBridgeControllerState,
4645
isCrossChain,
@@ -53,6 +52,8 @@ import {
5352
formatChainIdToCaip,
5453
formatChainIdToHex,
5554
} from './utils/caip-formatters.js';
55+
import { getAccountByAddress } from './utils/controllers/accounts.js';
56+
import { getNetworkClientByChainId } from './utils/controllers/network.js';
5657
import {
5758
getBridgeFeatureFlags,
5859
hasMinimumRequiredVersion,
@@ -103,7 +104,6 @@ import {
103104
} from './validators/quote-request.js';
104105
import type { QuoteResponseV1 } from './validators/quote-response-v1.js';
105106
import type { QuoteResponse } from './validators/quote-response.js';
106-
import { getNetworkClientByChainId } from './utils/controllers/network.js';
107107

108108
const metadata: StateMetadata<BridgeControllerState> = {
109109
quoteRequest: {

‎packages/bridge-controller/src/utils/controllers/accounts.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import type { AccountsControllerGetAccountByAddressAction } from '@metamask/accounts-controller';
33

44
export const getAccountByAddress = <
5-
T extends {
5+
MessengerType extends {
66
call(
77
action: AccountsControllerGetAccountByAddressAction['type'],
88
address: string,
99
): ReturnType<AccountsControllerGetAccountByAddressAction['handler']>;
1010
},
1111
>(
12-
messenger: T,
12+
messenger: MessengerType,
1313
address: string,
1414
) => {
1515
return messenger.call('AccountsController:getAccountByAddress', address);

‎packages/bridge-controller/src/utils/controllers/remote-feature-flags.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
12
import type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';
23

34
export const getFeatureFlags = <
4-
T extends {
5+
MessengerType extends {
56
call(
67
action: RemoteFeatureFlagControllerGetStateAction['type'],
78
): ReturnType<RemoteFeatureFlagControllerGetStateAction['handler']>;
89
},
910
>(
10-
messenger: T,
11+
messenger: MessengerType,
1112
) => {
1213
const remoteFeatureFlags = messenger.call(
1314
'RemoteFeatureFlagController:getState',

‎packages/bridge-status-controller/src/bridge-status-controller.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ import { normalizeQuoteResponses } from './utils/quotes.js';
108108
import {
109109
approvalUpdateHandler,
110110
tradeUpdateHandler,
111-
type SubscriptionHandlerInputs,
112-
type SubscriptionHandlerParams,
111+
} from './utils/subscriptions.js';
112+
import type {
113+
SubscriptionHandlerInputs,
114+
SubscriptionHandlerParams,
113115
} from './utils/subscriptions.js';
114116
import {
115117
getSwapOperationCompletedTraceParams,
@@ -452,8 +454,9 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
452454

453455
/**
454456
* Handles the confirmed status for EVM swap, bridge src, batch or deposit txs
455-
* @param txMeta - The transaction meta
456-
* @param historyKey - The history key
457+
* @param params - The parameters for the transaction confirmed handler
458+
* @param params.txMeta - The transaction meta
459+
* @param params.historyKey - The history key
457460
*/
458461
readonly #onTransactionConfirmed = ({
459462
txMeta,
@@ -1317,7 +1320,9 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
13171320
*******************************************************
13181321
*/
13191322

1323+
// oxlint-disable-next-line jsdoc/require-returns
13201324
readonly #executeSubmitStrategy = async (
1325+
// oxlint-disable-next-line jsdoc/require-param
13211326
params: SubmitStrategyParams<Trade>,
13221327
sharedHistoryItemProperties: {
13231328
startTime: number;

‎packages/bridge-status-controller/src/utils/history.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import {
33
isCrossChain,
44
isNonEvmChainId,
55
isTronChainId,
6-
type ChainId,
7-
type DeepPartial,
8-
type Trade,
96
} from '@metamask/bridge-controller';
7+
import type { ChainId, DeepPartial } from '@metamask/bridge-controller';
108
import type { TransactionMeta } from '@metamask/transaction-controller';
119
import { TransactionStatus } from '@metamask/transaction-controller';
1210

@@ -176,7 +174,7 @@ export const getMatchingHistoryEntryForApprovalTxMeta = (
176174
export const resolveHistoryKeyForTxMeta = (
177175
{ transactionMeta }: { transactionMeta: TransactionMeta },
178176
txHistory: BridgeStatusControllerState['txHistory'],
179-
) => ({
177+
): { historyKey?: string; txMeta: TransactionMeta } => ({
180178
historyKey:
181179
// Match swap/bridge/batch src tx
182180
(getMatchingHistoryEntryForTxMeta(txHistory, transactionMeta) ??
@@ -270,7 +268,7 @@ export const getHistoryOverridesFromTxMeta = (
270268
txMeta?: Partial<
271269
Pick<TransactionMeta, 'actionId' | 'id' | 'status' | 'hash' | 'batchId'>
272270
>,
273-
) => {
271+
): Pick<BridgeHistoryItem, 'txMetaId' | 'actionId' | 'batchId' | 'status'> => {
274272
return {
275273
txMetaId: txMeta?.id,
276274
actionId: txMeta?.actionId,

‎packages/bridge-status-controller/src/utils/quotes.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {
2+
BridgeAsset,
23
QuoteMetadata,
34
QuoteResponseV1,
45
TxData,
@@ -9,7 +10,7 @@ import { describe, expect, it } from 'vitest';
910

1011
import { normalizeQuoteResponses } from './quotes.js';
1112

12-
const nativeAsset = (chainId: number) => ({
13+
const nativeAsset = (chainId: number): BridgeAsset => ({
1314
address: '0x0000000000000000000000000000000000000000',
1415
assetId: `eip155:${chainId}/slip44:60` as CaipAssetType,
1516
chainId,

‎packages/bridge-status-controller/src/utils/quotes.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import {
33
QuoteResponseV1,
44
QuoteMetadata,
55
Trade,
6-
type QuoteMetadataMigrationPhase,
6+
isQuoteResponseV2,
7+
toQuoteMetadataV1,
8+
toQuoteResponseV1,
79
} from '@metamask/bridge-controller';
8-
import { isQuoteResponseV2 } from '@metamask/bridge-controller';
9-
import { toQuoteMetadataV1 } from '@metamask/bridge-controller';
10-
import { toQuoteResponseV1 } from '@metamask/bridge-controller';
10+
import type { QuoteMetadataMigrationPhase } from '@metamask/bridge-controller';
1111

1212
/**
1313
* Convert quote responses to V1 format and preserve metadata for consistency

‎packages/bridge-status-controller/src/utils/subscriptions.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const tradeUpdateHandler = ({
3131
onTransactionConfirmed,
3232
onTransactionFailed,
3333
onReportSubmittedOnce,
34-
}: SubscriptionHandlerParams) => {
34+
}: SubscriptionHandlerParams): void => {
3535
const { type, status } = txMeta;
3636

3737
// Allow event publishing if the txMeta is a swap/bridge OR if the
@@ -75,7 +75,7 @@ export const approvalUpdateHandler = ({
7575
txMeta,
7676
historyKey,
7777
onTransactionFailed,
78-
}: SubscriptionHandlerParams) => {
78+
}: SubscriptionHandlerParams): void => {
7979
if (!historyKey) {
8080
return;
8181
}

‎tsc-suppressions.json‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,6 @@
361361
"packages/bridge-status-controller/src/bridge-status-controller.intent.test.ts": {
362362
"TS2322": {
363363
"count": 2
364-
},
365-
"TS2345": {
366-
"count": 1
367-
},
368-
"TS2741": {
369-
"count": 2
370364
}
371365
},
372366
"packages/bridge-status-controller/src/bridge-status-controller.test.ts": {
@@ -456,9 +450,6 @@
456450
}
457451
},
458452
"packages/eth-sig-util/src/sign-typed-data.test.ts": {
459-
"TS2351": {
460-
"count": 1
461-
},
462453
"TS2593": {
463454
"count": 1
464455
},
@@ -1255,7 +1246,7 @@
12551246
},
12561247
"packages/wallet-framework-docs/content/data-services/writing-data-services/02-read-only-requests/orders-service.test.ts": {
12571248
"TS1479": {
1258-
"count": 3
1249+
"count": 2
12591250
},
12601251
"TS1541": {
12611252
"count": 1

0 commit comments

Comments
 (0)