Skip to content

Commit 8e4ea6b

Browse files
authored
Fix lint warnings (#131)
* getSubscriptionStatus tests * permission.spender * fix: remove debug console.log statements from tests * style: apply formatting fixes * Fix lint warnings in SDK * Apply formatting fixes * Fix chainId type issue * remove 'as any' from new version
1 parent 82be6e3 commit 8e4ea6b

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

packages/account-sdk/src/browser-entry.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ import type {
2121
SubscriptionResult,
2222
} from './interface/payment/types.js';
2323

24+
// Extend Window interface for global exports
25+
declare global {
26+
interface Window {
27+
base: typeof base;
28+
createBaseAccountSDK: typeof createBaseAccountSDK;
29+
BaseAccountSDK: {
30+
VERSION: string;
31+
};
32+
}
33+
}
34+
2435
// Expose to global window object
2536
if (typeof window !== 'undefined') {
26-
(window as any).base = base;
27-
(window as any).createBaseAccountSDK = createBaseAccountSDK;
28-
(window as any).BaseAccountSDK = {
37+
window.base = base;
38+
window.createBaseAccountSDK = createBaseAccountSDK;
39+
window.BaseAccountSDK = {
2940
VERSION: PACKAGE_VERSION,
3041
};
3142
}

packages/account-sdk/src/interface/payment/charge.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ export async function charge(options: ChargeOptions): Promise<ChargeResult> {
139139

140140
// Step 4: Get the network-scoped smart wallet
141141
const network = testnet ? 'base-sepolia' : 'base';
142-
// biome-ignore lint/correctness/useHookAtTopLevel: useNetwork is not a React hook, it's a CDP SDK method
143142
const networkSmartWallet = await smartWallet.useNetwork(network);
144143

145144
// Step 5: Execute the charge transaction(s) using the smart wallet

packages/account-sdk/src/sign/base-account/Signer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CB_WALLET_RPC_URL } from ':core/constants.js';
2-
import { Hex, hexToNumber, isAddressEqual, numberToHex } from 'viem';
2+
import { Hex, WalletSendCallsParameters, hexToNumber, isAddressEqual, numberToHex } from 'viem';
33

44
import { Communicator } from ':core/communicator/Communicator.js';
55
import { isActionableHttpRequestError, isViemError, standardErrors } from ':core/error/errors.js';
@@ -703,10 +703,10 @@ export class Signer {
703703
});
704704

705705
// Determine effective chainId - use request chainId for wallet_sendCalls, default otherwise
706-
const chainId =
707-
request.method === 'wallet_sendCalls' && (request.params as any[])?.[0]?.chainId
708-
? hexToNumber((request.params as any[])[0].chainId)
709-
: this.chain.id;
706+
const walletSendCallsChainId =
707+
request.method === 'wallet_sendCalls' &&
708+
(request.params as WalletSendCallsParameters)?.[0]?.chainId;
709+
const chainId = walletSendCallsChainId ? hexToNumber(walletSendCallsChainId) : this.chain.id;
710710

711711
const client = getClient(chainId);
712712
assertPresence(

packages/account-sdk/src/sign/base-account/utils/routeThroughGlobalAccount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export async function routeThroughGlobalAccount({
4646
/** Optional calls to prepend to the request. */
4747
prependCalls?: { to: Address; data: Hex; value: Hex }[] | undefined;
4848
/** The function to use to send the request to the global account. */
49-
globalAccountRequest: (request: RequestArguments) => Promise<any>;
49+
globalAccountRequest: (request: RequestArguments) => Promise<unknown>;
5050
}) {
5151
// Construct call to execute the original calls using executeBatch
5252
let originalSendCallsParams: WalletSendCallsParameters[0];

packages/account-sdk/src/ui/Dialog/Dialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2018-2025 Coinbase, Inc. <https://www.coinbase.com/>
22

33
import { clsx } from 'clsx';
4-
import { FunctionComponent, render } from 'preact';
4+
import { FunctionComponent, JSX, render } from 'preact';
55

66
import { getDisplayableUsername } from ':core/username/getDisplayableUsername.js';
77
import { store } from ':store/store.js';
@@ -122,7 +122,7 @@ export const DialogContainer: FunctionComponent = (props) => {
122122
const [startY, setStartY] = useState(0);
123123

124124
// Touch event handlers for drag-to-dismiss (entire dialog area)
125-
const handleTouchStart = (e: any) => {
125+
const handleTouchStart = (e: JSX.TargetedTouchEvent<HTMLDivElement>) => {
126126
// Only enable drag on mobile portrait mode
127127
if (!isPhonePortrait()) return;
128128

@@ -131,7 +131,7 @@ export const DialogContainer: FunctionComponent = (props) => {
131131
setIsDragging(true);
132132
};
133133

134-
const handleTouchMove = (e: any) => {
134+
const handleTouchMove = (e: JSX.TargetedTouchEvent<HTMLDivElement>) => {
135135
if (!isDragging) return;
136136

137137
const touch = e.touches[0];

0 commit comments

Comments
 (0)