Skip to content

Commit cd877d4

Browse files
Fix lint issues and prune stale ESLint suppressions
1 parent 649a57c commit cd877d4

4 files changed

Lines changed: 8 additions & 17 deletions

File tree

eslint-suppressions.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,9 +1419,6 @@
14191419
"@typescript-eslint/explicit-function-return-type": {
14201420
"count": 4
14211421
},
1422-
"@typescript-eslint/prefer-nullish-coalescing": {
1423-
"count": 4
1424-
},
14251422
"id-length": {
14261423
"count": 2
14271424
},

packages/multichain-account-service/src/providers/BaseBip44AccountProvider.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ export abstract class BaseBip44AccountProvider<
130130
'AccountsController:getAccounts',
131131
accountsIds,
132132
);
133-
// we cast here because we know that the accounts are BIP-44 compatible
134-
return internalAccounts as unknown as Account[];
133+
return internalAccounts;
135134
}
136135

137136
/**
@@ -148,12 +147,7 @@ export abstract class BaseBip44AccountProvider<
148147
throw new Error(`Unable to find account: ${id}`);
149148
}
150149

151-
// We need to upcast here since InternalAccounts are not always BIP-44 compatible
152-
// but we know that the account is BIP-44 compatible here so it is safe to do so
153-
return this.messenger.call(
154-
'AccountsController:getAccount',
155-
id,
156-
) as unknown as Account;
150+
return this.messenger.call('AccountsController:getAccount', id);
157151
}
158152

159153
protected async withKeyring<SelectedKeyring, CallbackResult = void>(

packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/controller-integration.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function syncContactsWithUserStorage(
8181
.filter((contact) => !isContactBridgedFromAccounts(contact))
8282
.filter(
8383
(contact) => contact.address && contact.chainId && contact.name?.trim(),
84-
) || [];
84+
) ?? [];
8585

8686
// Get remote contacts from user storage API
8787
const remoteContacts = await getRemoteContacts(options);
@@ -90,7 +90,7 @@ export async function syncContactsWithUserStorage(
9090
const validRemoteContacts =
9191
remoteContacts?.filter(
9292
(contact) => contact.address && contact.chainId && contact.name?.trim(),
93-
) || [];
93+
) ?? [];
9494

9595
const performSync = async () => {
9696
try {
@@ -140,8 +140,8 @@ export async function syncContactsWithUserStorage(
140140

141141
if (hasContentDifference) {
142142
// Check timestamps to determine which version to keep
143-
const localTimestamp = localContact.lastUpdatedAt || 0;
144-
const remoteTimestamp = remoteContact.lastUpdatedAt || 0;
143+
const localTimestamp = localContact.lastUpdatedAt ?? 0;
144+
const remoteTimestamp = remoteContact.lastUpdatedAt ?? 0;
145145

146146
if (localTimestamp >= remoteTimestamp) {
147147
// Local is newer (or same age) - use local version
@@ -383,7 +383,7 @@ export async function updateContactInRemoteStorage(
383383
// Create an updated entry with timestamp
384384
const updatedEntry = {
385385
...contact,
386-
lastUpdatedAt: contact.lastUpdatedAt || Date.now(),
386+
lastUpdatedAt: contact.lastUpdatedAt ?? Date.now(),
387387
} as SyncAddressBookEntry;
388388

389389
const key = createContactKey(contact);

packages/react-data-query/src/createUIQueryClient.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ describe('createUIQueryClient', () => {
336336
const promise = new Promise<Error>((_resolve, reject) => {
337337
observer.subscribe((event) => {
338338
if (event.status === 'error') {
339-
reject(event.error as Error);
339+
reject(event.error);
340340
}
341341
});
342342
});

0 commit comments

Comments
 (0)