diff --git a/.eslintrc.json b/.eslintrc.json index cefdd135d743..59096d0cb027 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,6 +11,7 @@ "constructor-super": "error", "dot-notation": "error", "eqeqeq": "error", + "object-shorthand": "warn", "no-var": "error", "no-bitwise": "error", "no-debugger": "error", diff --git a/package.json b/package.json index 36e1fd3c0709..971e1b443977 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build-ios": "build --preset iOS", "lint": "eslint -c packages/.eslintrc.json packages --ext .ts,.tsx,.js --cache --fix", "lint:ci": "eslint -c packages/.eslintrc.json packages --ext .ts,.tsx,.js --cache", - "lint:ci-report": "pnpm lint:ci -- --format=junit --output-file=reports/junit/eslint-results.xml", + "lint:ci-report": "pnpm lint:ci -- --format=junit --output-file=reports/junit/eslint-results.xml --max-warnings=0", "postinstall": "patch-package", "prepare": "husky install", "test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js", diff --git a/packages/backup-format/src/version-2/index.ts b/packages/backup-format/src/version-2/index.ts index af4ae9c52b8b..ec5400e4ef55 100644 --- a/packages/backup-format/src/version-2/index.ts +++ b/packages/backup-format/src/version-2/index.ts @@ -99,7 +99,7 @@ export function normalizeBackupVersion2(item: BackupJSONFileVersion2): Normalize foundAt: new Date(post.foundAt), postBy: postBy.unwrapOr(undefined), interestedMeta, - encryptBy: encryptBy, + encryptBy, summary: post.summary ? Some(post.summary) : None, url: post.url ? Some(post.url) : None, postCryptoKey: isAESJsonWebKey(post.postCryptoKey) ? Some(post.postCryptoKey) : None, @@ -137,7 +137,7 @@ export function normalizeBackupVersion2(item: BackupJSONFileVersion2): Normalize backup.relations.push({ profile: a.val, persona: b.val, - favor: favor, + favor, }) } } diff --git a/packages/dashboard/src/components/MaskAvatar/index.tsx b/packages/dashboard/src/components/MaskAvatar/index.tsx index 9c75f2a72506..68d4bfc623bc 100644 --- a/packages/dashboard/src/components/MaskAvatar/index.tsx +++ b/packages/dashboard/src/components/MaskAvatar/index.tsx @@ -27,7 +27,7 @@ export const MaskAvatar = memo(({ size = 36, onClick }) => { background: MaskColorVar.lightBackground, borderRadius: '50%', }, - onClick: onClick, + onClick, className: classes.author, } diff --git a/packages/dashboard/src/components/Restore/steps/EmailField.tsx b/packages/dashboard/src/components/Restore/steps/EmailField.tsx index 17f06ee5fdf4..d64a37ce4f34 100644 --- a/packages/dashboard/src/components/Restore/steps/EmailField.tsx +++ b/packages/dashboard/src/components/Restore/steps/EmailField.tsx @@ -37,9 +37,7 @@ export const EmailField = memo(({ toStep }: StepCommonProps) => { variant="rounded" color="primary" size="large" - onClick={() => - toStep(ValidationCodeStep.AccountValidation, { account: account, type: AccountType.email }) - } + onClick={() => toStep(ValidationCodeStep.AccountValidation, { account, type: AccountType.email })} disabled={!account || invalidEmail}> {t.next()} diff --git a/packages/dashboard/src/components/Restore/steps/ValidationAccount.tsx b/packages/dashboard/src/components/Restore/steps/ValidationAccount.tsx index 31e48cf0609a..fd804a4f495f 100644 --- a/packages/dashboard/src/components/Restore/steps/ValidationAccount.tsx +++ b/packages/dashboard/src/components/Restore/steps/ValidationAccount.tsx @@ -26,7 +26,7 @@ export const ValidationAccount = ({ account, toStep, type, onNext }: ValidationA const [{ error: sendCodeError }, handleSendCodeFn] = useAsyncFn(async () => { showSnackbar(t.sign_in_account_cloud_backup_send_email_success({ type }), { variant: 'success' }) await sendCode({ - account: account, + account, type, scenario: Scenario.backup, locale: language.includes('zh') ? Locale.zh : Locale.en, @@ -38,7 +38,7 @@ export const ValidationAccount = ({ account, toStep, type, onNext }: ValidationA if ((backupInfo as BackupFileInfo).downloadURL) { setError('') - toStep(ValidationCodeStep.ConfirmBackupInfo, { backupInfo: backupInfo, account: account, type: type }) + toStep(ValidationCodeStep.ConfirmBackupInfo, { backupInfo, account, type }) } else { setError((backupInfo as { message: string }).message) } diff --git a/packages/dashboard/src/pages/Personas/components/PostHistory/Placeholder.tsx b/packages/dashboard/src/pages/Personas/components/PostHistory/Placeholder.tsx index c532fe947d6d..55d2fc130ae1 100644 --- a/packages/dashboard/src/pages/Personas/components/PostHistory/Placeholder.tsx +++ b/packages/dashboard/src/pages/Personas/components/PostHistory/Placeholder.tsx @@ -12,7 +12,7 @@ interface PlaceholderProps { export const Placeholder = memo(({ network }) => { const t = useDashboardI18N() - const url = urlcat('https://www.:network', { network: network }) + const url = urlcat('https://www.:network', { network }) const handleClick = () => openWindow(url) diff --git a/packages/dashboard/src/pages/Personas/components/RenameDialog/index.tsx b/packages/dashboard/src/pages/Personas/components/RenameDialog/index.tsx index 53d74a5d1b56..919dc7c87758 100644 --- a/packages/dashboard/src/pages/Personas/components/RenameDialog/index.tsx +++ b/packages/dashboard/src/pages/Personas/components/RenameDialog/index.tsx @@ -35,7 +35,7 @@ export const RenameDialog = memo(({ open, nickname, onClose, } = useForm({ resolver: zodResolver(schema), defaultValues: { - nickname: nickname, + nickname, }, }) diff --git a/packages/dashboard/src/pages/Personas/hooks/useOperateBindingProof.ts b/packages/dashboard/src/pages/Personas/hooks/useOperateBindingProof.ts index 7815f6f1ee1e..033f2ff51bf3 100644 --- a/packages/dashboard/src/pages/Personas/hooks/useOperateBindingProof.ts +++ b/packages/dashboard/src/pages/Personas/hooks/useOperateBindingProof.ts @@ -26,7 +26,7 @@ export function useDeleteBound() { username, payload.createdAt, { - signature: signature, + signature, }, ) Services.Identity.detachProfile(profile) diff --git a/packages/dashboard/src/pages/Settings/api.ts b/packages/dashboard/src/pages/Settings/api.ts index eb5ec7c28d8b..894e2bfbd781 100644 --- a/packages/dashboard/src/pages/Settings/api.ts +++ b/packages/dashboard/src/pages/Settings/api.ts @@ -88,9 +88,9 @@ export const fetchDownloadLink = ({ account, code, type }: VerifyCodeRequest) => }).then(({ abstract, download_url, size, uploaded_at }) => { return { downloadURL: download_url, - size: size, + size, uploadedAt: uploaded_at, - abstract: abstract, + abstract, } }) } diff --git a/packages/dashboard/src/pages/Wallets/components/CollectibleList/index.tsx b/packages/dashboard/src/pages/Wallets/components/CollectibleList/index.tsx index d2550fbfce83..b215b72a4eec 100644 --- a/packages/dashboard/src/pages/Wallets/components/CollectibleList/index.tsx +++ b/packages/dashboard/src/pages/Wallets/components/CollectibleList/index.tsx @@ -60,8 +60,7 @@ export const CollectibleList = memo(({ selectedNetwork }) loading: isQuerying, retry, } = useAsyncRetry( - async () => - Asset?.getNonFungibleAssets?.(account, { page: page, size: 20 }, undefined, selectedNetwork || undefined), + async () => Asset?.getNonFungibleAssets?.(account, { page, size: 20 }, undefined, selectedNetwork || undefined), [account, Asset?.getNonFungibleAssets, network, selectedNetwork], ) useEffect(() => { diff --git a/packages/encryption/src/encryption/Decryption.ts b/packages/encryption/src/encryption/Decryption.ts index c67808eb761f..ca41d207507e 100644 --- a/packages/encryption/src/encryption/Decryption.ts +++ b/packages/encryption/src/encryption/Decryption.ts @@ -151,7 +151,7 @@ async function* v38To40StaticECDH( report: ((message: TypedMessage) => void) | undefined, ): AsyncIterableIterator { const postKey = { - '-40': async function* (iv: Uint8Array) { + async *'-40'(iv: Uint8Array) { const val = await io.queryPostKey_version40(iv) if (val) yield val }, diff --git a/packages/injected-script/sdk/bridgedSolana.ts b/packages/injected-script/sdk/bridgedSolana.ts index fef7ee5d9a2f..bfa57053a617 100644 --- a/packages/injected-script/sdk/bridgedSolana.ts +++ b/packages/injected-script/sdk/bridgedSolana.ts @@ -47,7 +47,7 @@ export const bridgedSolanaProvider: BridgedSolanaProvider = { getProperty(key) { return createPromise((id) => sendEvent('solanaBridgePrimitiveAccess', id, key)) }, - isConnected: isConnected, + isConnected, untilAvailable() { return createPromise((id) => sendEvent('untilSolanaBridgeOnline', id)) }, diff --git a/packages/mask/background/database/persona/helper.ts b/packages/mask/background/database/persona/helper.ts index b5bb177419a4..d681968619ab 100644 --- a/packages/mask/background/database/persona/helper.ts +++ b/packages/mask/background/database/persona/helper.ts @@ -159,7 +159,7 @@ export async function createPersonaByJsonWebKey(options: { const record: PersonaRecord = { createdAt: new Date(), updatedAt: new Date(), - identifier: identifier, + identifier, linkedProfiles: new Map(), publicKey: options.publicKey, privateKey: options.privateKey, diff --git a/packages/mask/background/database/post/web.ts b/packages/mask/background/database/post/web.ts index 08616669a656..77743bd31af1 100644 --- a/packages/mask/background/database/post/web.ts +++ b/packages/mask/background/database/post/web.ts @@ -14,12 +14,12 @@ import { CryptoKeyToJsonWebKey } from '../../../utils-pure' import type { PersonaIdentifierStoredInDB, ProfileIdentifierStoredInDB } from '../persona/type' import { createDBAccessWithAsyncUpgrade, createTransaction } from '../utils/openDB' import type { - RecipientReason, - PostRecord, PostDB, PostDBRecord, PostReadOnlyTransaction, PostReadWriteTransaction, + PostRecord, + RecipientReason, } from './type' type UpgradeKnowledge = { version: 4; data: Map } | undefined @@ -327,8 +327,8 @@ function postOutDB(db: PostDBRecord): PostRecord { identifier: PostIVIdentifier.from(identifier).unwrap(), postBy: ProfileIdentifier.of(postBy?.network, postBy?.userId).unwrapOr(undefined), recipients: recipients === true ? 'everyone' : convertRawMapToIdentifierMap(recipients, ProfileIdentifier), - foundAt: foundAt, - postCryptoKey: postCryptoKey, + foundAt, + postCryptoKey, encryptBy: ECKeyIdentifier.from(encryptBy).unwrapOr(undefined), interestedMeta, summary, diff --git a/packages/mask/background/services/crypto/decryption.ts b/packages/mask/background/services/crypto/decryption.ts index 0c47a94eb626..b2796b9e5022 100644 --- a/packages/mask/background/services/crypto/decryption.ts +++ b/packages/mask/background/services/crypto/decryption.ts @@ -139,8 +139,8 @@ async function* decryption(payload: string | Uint8Array, context: DecryptionCont url: postURL, }) }, - hasLocalKeyOf: hasLocalKeyOf, - decryptByLocalKey: decryptByLocalKey, + hasLocalKeyOf, + decryptByLocalKey, async deriveAESKey(pub) { return Array.from((await deriveAESByECDH(pub)).values()) }, diff --git a/packages/mask/background/services/identity/persona/utils.ts b/packages/mask/background/services/identity/persona/utils.ts index f19b95947fe4..2fde21125488 100644 --- a/packages/mask/background/services/identity/persona/utils.ts +++ b/packages/mask/background/services/identity/persona/utils.ts @@ -59,7 +59,7 @@ export async function generate_ECDH_256k1_KeyPair_ByMnemonicWord( key, password, mnemonicRecord: { - parameter: { path: path, withPassword: password.length > 0 }, + parameter: { path, withPassword: password.length > 0 }, words: mnemonicWord, }, } @@ -81,7 +81,7 @@ export async function recover_ECDH_256k1_KeyPair_ByMnemonicWord( key, password, mnemonicRecord: { - parameter: { path: path, withPassword: password.length > 0 }, + parameter: { path, withPassword: password.length > 0 }, words: mnemonicWord, }, } diff --git a/packages/mask/src/components/shared/AbstractTab.tsx b/packages/mask/src/components/shared/AbstractTab.tsx index 649d256897dc..6b6d5c8dbc73 100644 --- a/packages/mask/src/components/shared/AbstractTab.tsx +++ b/packages/mask/src/components/shared/AbstractTab.tsx @@ -85,7 +85,7 @@ export default function AbstractTab(props: AbstractTabProps) { role="tabpanel" {...tabs.find((_, index) => index === value)} sx={{ - height: height, + height, minHeight: height, }} /> diff --git a/packages/mask/src/extension/debug-page/DatabaseOps.tsx b/packages/mask/src/extension/debug-page/DatabaseOps.tsx index f557c1643cc5..cf02c1e05183 100644 --- a/packages/mask/src/extension/debug-page/DatabaseOps.tsx +++ b/packages/mask/src/extension/debug-page/DatabaseOps.tsx @@ -153,7 +153,7 @@ async function backupAll() { records, }) } - instances.push({ name: name, version: version, stores }) + instances.push({ name, version, stores }) } const payload: BackupFormat = { buildInfo: { diff --git a/packages/mask/src/extension/popups/pages/Personas/VerifyWallet/index.tsx b/packages/mask/src/extension/popups/pages/Personas/VerifyWallet/index.tsx index 5de5df2304a5..64fe9dce28ba 100644 --- a/packages/mask/src/extension/popups/pages/Personas/VerifyWallet/index.tsx +++ b/packages/mask/src/extension/popups/pages/Personas/VerifyWallet/index.tsx @@ -110,7 +110,7 @@ const VerifyWallet = memo(() => { payload.createdAt, { walletSignature: walletSig, - signature: signature, + signature, }, ) setSigned(true) diff --git a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/PurchaseDialog.tsx b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/PurchaseDialog.tsx index b2f6097b84fe..a1e16e6eca61 100644 --- a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/PurchaseDialog.tsx +++ b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/PurchaseDialog.tsx @@ -87,7 +87,7 @@ export function PurchaseDialog(props: ActionBarProps) { : 'plugin_artblocks_share_no_official_account', { name: project.name, - price: price, + price, symbol: token.value?.symbol, }, ), diff --git a/packages/mask/src/plugins/ArtBlocks/hooks/usePurchaseCallback.ts b/packages/mask/src/plugins/ArtBlocks/hooks/usePurchaseCallback.ts index 94eff5a8e2e6..524608b16f9e 100644 --- a/packages/mask/src/plugins/ArtBlocks/hooks/usePurchaseCallback.ts +++ b/packages/mask/src/plugins/ArtBlocks/hooks/usePurchaseCallback.ts @@ -39,7 +39,7 @@ export function usePurchaseCallback(projectId: string, amount: string, tokenType .purchase(projectId) .estimateGas({ from: account, - value: value, + value, }) .catch((error) => { setPurchaseState({ diff --git a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/CheckoutDialog.tsx b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/CheckoutDialog.tsx index 7a8d14bb20d2..c0e1941ff39e 100644 --- a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/CheckoutDialog.tsx +++ b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/CheckoutDialog.tsx @@ -108,7 +108,7 @@ export function CheckoutDialog(props: CheckoutDialogProps) { amount: asset?.value?.priceInEth, symbol: token?.value?.symbol, title: asset?.value?.title, - assetLink: assetLink, + assetLink, account: isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account'), }, ) diff --git a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx index 05d78c75ae9d..12718c75e0e1 100644 --- a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx +++ b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx @@ -224,7 +224,7 @@ export function Collectible(props: CollectibleProps) { resolveCollectibleLink(chainId as ChainId, NonFungibleAssetProvider.OPENSEA, { - contractDetailed: { address: address }, - tokenId: tokenId, + contractDetailed: { address }, + tokenId, } as unknown as any), } return state diff --git a/packages/mask/src/plugins/GoodGhosting/hooks/useGameInfo.ts b/packages/mask/src/plugins/GoodGhosting/hooks/useGameInfo.ts index 37a9031e976e..cc22a06884f4 100644 --- a/packages/mask/src/plugins/GoodGhosting/hooks/useGameInfo.ts +++ b/packages/mask/src/plugins/GoodGhosting/hooks/useGameInfo.ts @@ -132,7 +132,7 @@ export function useTimeline(info: GoodGhostingInfo) { } else if (index === numberOfRounds - 1) { return { eventOnDate: t('plugin_good_ghosting_deposit_deadline', { - index: index, + index, }), ongoingEvent: t('plugin_good_ghosting_waiting_round'), } @@ -144,7 +144,7 @@ export function useTimeline(info: GoodGhostingInfo) { } else { return { eventOnDate: t('plugin_good_ghosting_deposit_deadline', { - index: index, + index, }), ongoingEvent: t('plugin_good_ghosting_deposit', { index: index + 1, diff --git a/packages/mask/src/plugins/MaskBox/hooks/useContext.ts b/packages/mask/src/plugins/MaskBox/hooks/useContext.ts index 51579f1c95fa..b1eb10182c59 100644 --- a/packages/mask/src/plugins/MaskBox/hooks/useContext.ts +++ b/packages/mask/src/plugins/MaskBox/hooks/useContext.ts @@ -111,7 +111,7 @@ function useContext(initialState?: { boxId: string; hashRoot: string }) { creator: maskBoxInfo.creator, name: maskBoxInfo.name, sellAll: maskBoxCreationSuccessEvent?.returnValues.sell_all ?? false, - personalLimit: personalLimit, + personalLimit, personalRemaining, remaining, availableAmount: Math.min(personalRemaining, remaining), @@ -125,7 +125,7 @@ function useContext(initialState?: { boxId: string; hashRoot: string }) { tokenIdsPurchased: purchasedTokens, payments: paymentTokens.map((token, i) => { return { - token: token, + token, price: maskBoxStatus.payment[i][1], receivableAmount: maskBoxStatus.payment[i][2], } diff --git a/packages/mask/src/plugins/NextID/hooks/usePersonaSign.ts b/packages/mask/src/plugins/NextID/hooks/usePersonaSign.ts index af44ed44bd4d..766b4e23ec54 100644 --- a/packages/mask/src/plugins/NextID/hooks/usePersonaSign.ts +++ b/packages/mask/src/plugins/NextID/hooks/usePersonaSign.ts @@ -13,7 +13,7 @@ export function usePersonaSign( try { const result = await Services.Identity.signWithPersona({ method: 'eth', - message: message, + message, identifier: currentIdentifier.toText(), }) return result diff --git a/packages/mask/src/plugins/Pets/hooks/useUser.ts b/packages/mask/src/plugins/Pets/hooks/useUser.ts index 218d59b22782..d6baaca6c7cb 100644 --- a/packages/mask/src/plugins/Pets/hooks/useUser.ts +++ b/packages/mask/src/plugins/Pets/hooks/useUser.ts @@ -27,7 +27,7 @@ export function useCurrentVisitingUser(flag?: number) { } finally { setUser({ userId: identity.identifier?.userId ?? '', - address: address, + address, }) } }, [identity, flag]) diff --git a/packages/mask/src/plugins/PoolTogether/UI/DepositDialog.tsx b/packages/mask/src/plugins/PoolTogether/UI/DepositDialog.tsx index 1ebc32698a11..ced220768201 100644 --- a/packages/mask/src/plugins/PoolTogether/UI/DepositDialog.tsx +++ b/packages/mask/src/plugins/PoolTogether/UI/DepositDialog.tsx @@ -182,7 +182,7 @@ export function DepositDialog() { : 'plugin_pooltogether_share_no_official_account', { amount: rawAmount, - cashTag: cashTag, + cashTag, symbol: token.symbol, pool: pool?.name ?? `${pool?.tokens.underlyingToken.symbol} Pool`, account: isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account'), diff --git a/packages/mask/src/plugins/PoolTogether/UI/PoolView.tsx b/packages/mask/src/plugins/PoolTogether/UI/PoolView.tsx index 8c622fbb8a6d..54a94a62dd84 100644 --- a/packages/mask/src/plugins/PoolTogether/UI/PoolView.tsx +++ b/packages/mask/src/plugins/PoolTogether/UI/PoolView.tsx @@ -197,8 +197,8 @@ export function PoolView(props: PoolProps) { if (!pool || !token) return openDepositDialog({ open: true, - pool: pool, - token: token, + pool, + token, }) }, [pool, token, openDepositDialog]) // #endregion @@ -245,7 +245,7 @@ export function PoolView(props: PoolProps) { - {t('plugin_pooltogether_prize', { period: period })} + {t('plugin_pooltogether_prize', { period })} diff --git a/packages/mask/src/plugins/PoolTogether/apis/index.ts b/packages/mask/src/plugins/PoolTogether/apis/index.ts index 8bf8729c193b..8071e7237e49 100644 --- a/packages/mask/src/plugins/PoolTogether/apis/index.ts +++ b/packages/mask/src/plugins/PoolTogether/apis/index.ts @@ -59,14 +59,14 @@ export async function fetchPool(address?: string, subgraphUrl?: string) { : prizePool.prizeStrategy.multipleWinners return { - address: address, + address, config: { numberOfWinners: prizeStrategy.numberOfWinners ?? '1', prizePeriodSeconds: prizeStrategy.prizePeriodSeconds, }, prize: {}, prizePool: { - address: address, + address, }, tokens: { ticket: { diff --git a/packages/mask/src/plugins/PoolTogether/hooks/useAccountBalances.ts b/packages/mask/src/plugins/PoolTogether/hooks/useAccountBalances.ts index 7bcf81e62443..64e575ac9356 100644 --- a/packages/mask/src/plugins/PoolTogether/hooks/useAccountBalances.ts +++ b/packages/mask/src/plugins/PoolTogether/hooks/useAccountBalances.ts @@ -27,7 +27,7 @@ export function useAccountBalance(pools: Pool[]) { ? pools.map( (pool, i) => ({ - pool: pool, + pool, account: { ticketBalance: results[i].value, userAddress: account, diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx index ff8157f32d02..dab912ca098d 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx @@ -72,8 +72,8 @@ export function RedPacketPast({ onSelect, onClose }: Props) { attachMetadata(RedPacketNftMetaKey, { id: rpid, txid, - duration: duration, - message: message, + duration, + message, senderName, contractName: contractDetailed.name, contractAddress: contractDetailed.address, diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useNftAvailabilityComputed.ts b/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useNftAvailabilityComputed.ts index 35951019977e..8d7634a98f64 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useNftAvailabilityComputed.ts +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useNftAvailabilityComputed.ts @@ -43,7 +43,7 @@ export function useNftAvailabilityComputed(account: string, payload: NftRedPacke canFetch: isSameChain, canClaim: isClaimable && isPasswordValid, canSend: isSendable, - isPasswordValid: isPasswordValid, + isPasswordValid, listOfStatus: compact([ isClaimed ? RedPacketStatus.claimed : undefined, isEmpty ? RedPacketStatus.empty : undefined, diff --git a/packages/mask/src/plugins/RedPacket/Worker/apis/erc20Redpacket.ts b/packages/mask/src/plugins/RedPacket/Worker/apis/erc20Redpacket.ts index 65b01a9f4e3a..c3a96cc598f8 100644 --- a/packages/mask/src/plugins/RedPacket/Worker/apis/erc20Redpacket.ts +++ b/packages/mask/src/plugins/RedPacket/Worker/apis/erc20Redpacket.ts @@ -141,7 +141,7 @@ export async function getRedPacketHistory(address: string, chainId: ChainId) { }, contract_version: x.contract_version, network: resolveChainName(x.chain_id), - token: token, + token, claimers: x.claimers, total_remaining: x.total_remaining, block_number: x.block_number, diff --git a/packages/mask/src/plugins/Savings/protocols/AAVEProtocol.ts b/packages/mask/src/plugins/Savings/protocols/AAVEProtocol.ts index 0edbcb6131b7..9ce14d79921a 100644 --- a/packages/mask/src/plugins/Savings/protocols/AAVEProtocol.ts +++ b/packages/mask/src/plugins/Savings/protocols/AAVEProtocol.ts @@ -76,7 +76,7 @@ export class AAVEProtocol implements SavingsProtocol { const response = await fetch(subgraphUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: body, + body, }) const fullResponse: { data: { @@ -127,7 +127,7 @@ export class AAVEProtocol implements SavingsProtocol { const response = await fetch(subgraphUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: body, + body, }) const fullResponse: { @@ -201,7 +201,7 @@ export class AAVEProtocol implements SavingsProtocol { .on(TransactionEventType.ERROR, (error) => { onChange({ type: TransactionStateType.FAILED, - error: error, + error, }) }) .on(TransactionEventType.CONFIRMATION, (no, receipt) => { diff --git a/packages/mask/src/plugins/Tips/SNSAdaptor/bodyViews/AddWallet.tsx b/packages/mask/src/plugins/Tips/SNSAdaptor/bodyViews/AddWallet.tsx index 0faa80893765..0bf99e1ac291 100644 --- a/packages/mask/src/plugins/Tips/SNSAdaptor/bodyViews/AddWallet.tsx +++ b/packages/mask/src/plugins/Tips/SNSAdaptor/bodyViews/AddWallet.tsx @@ -117,7 +117,7 @@ const AddWalletView = memo(({ currentPersona, bindings, onCancel }: AddWalletVie payload.createdAt, { walletSignature: walletSig, - signature: signature, + signature, }, ) showSnackbar(t('plugin_tips_wallet_sign_success'), { variant: 'success', message: nowTime }) diff --git a/packages/mask/src/plugins/Trader/trader/bancor/useTradeCallback.ts b/packages/mask/src/plugins/Trader/trader/bancor/useTradeCallback.ts index fc65f7159721..a9fc077e6431 100644 --- a/packages/mask/src/plugins/Trader/trader/bancor/useTradeCallback.ts +++ b/packages/mask/src/plugins/Trader/trader/bancor/useTradeCallback.ts @@ -36,7 +36,7 @@ export function useTradeCallback(tradeComputed: TradeComputed const error = new Error(err.error.messages?.[0] || 'Unknown Error') setTradeState({ type: TransactionStateType.FAILED, - error: error, + error, }) throw error } diff --git a/packages/mask/src/plugins/Trader/trader/uniswap/useTradeCallback.ts b/packages/mask/src/plugins/Trader/trader/uniswap/useTradeCallback.ts index 6a8a82e07e7d..8d5a87c36c5e 100644 --- a/packages/mask/src/plugins/Trader/trader/uniswap/useTradeCallback.ts +++ b/packages/mask/src/plugins/Trader/trader/uniswap/useTradeCallback.ts @@ -166,7 +166,7 @@ export function useTradeCallback( } else { setTradeState({ type: TransactionStateType.HASH, - hash: hash, + hash, }) resolve(hash) } diff --git a/packages/mask/src/plugins/Trader/trending/useTrending.ts b/packages/mask/src/plugins/Trader/trending/useTrending.ts index 9cdc2accc89a..48ef378d33ae 100644 --- a/packages/mask/src/plugins/Trader/trending/useTrending.ts +++ b/packages/mask/src/plugins/Trader/trending/useTrending.ts @@ -24,7 +24,7 @@ export function useTrendingByKeyword(tagType: TagType, keyword: string, dataProv } as Coin return { value: { - currency: currency, + currency, trending: trending ? { ...trending, @@ -32,8 +32,8 @@ export function useTrendingByKeyword(tagType: TagType, keyword: string, dataProv } : null, }, - loading: loading, - error: error, + loading, + error, } } @@ -59,7 +59,7 @@ export function useTrendingById(id: string, dataProvider: DataProvider) { return { value: { - currency: currency, + currency, trending: trending ? { ...trending, @@ -67,7 +67,7 @@ export function useTrendingById(id: string, dataProvider: DataProvider) { } : null, }, - loading: loading, - error: error, + loading, + error, } } diff --git a/packages/mask/src/plugins/UnlockProtocol/SNSAdaptor/UnlockProtocolInPost.tsx b/packages/mask/src/plugins/UnlockProtocol/SNSAdaptor/UnlockProtocolInPost.tsx index 1b16d6f9a5b2..70ad5e11208e 100644 --- a/packages/mask/src/plugins/UnlockProtocol/SNSAdaptor/UnlockProtocolInPost.tsx +++ b/packages/mask/src/plugins/UnlockProtocol/SNSAdaptor/UnlockProtocolInPost.tsx @@ -31,7 +31,7 @@ export default function UnlockProtocolInPost(props: UnlockProtocolInPostProps) { if (!res) return const requestData = { lock: locks.unlocklock, - address: address, + address, chain: locks.chainid, identifier: metadata.val.iv, } diff --git a/packages/mask/src/plugins/Wallet/services/assets.ts b/packages/mask/src/plugins/Wallet/services/assets.ts index 1d1c8c2c3915..52fca9a4808c 100644 --- a/packages/mask/src/plugins/Wallet/services/assets.ts +++ b/packages/mask/src/plugins/Wallet/services/assets.ts @@ -89,7 +89,7 @@ export async function getAssetsListNFT( }) return { assets: data, - hasNextPage: hasNextPage, + hasNextPage, } } diff --git a/packages/mask/src/plugins/Wallet/services/rpc.ts b/packages/mask/src/plugins/Wallet/services/rpc.ts index 682a332d2aa8..9f382cbebab6 100644 --- a/packages/mask/src/plugins/Wallet/services/rpc.ts +++ b/packages/mask/src/plugins/Wallet/services/rpc.ts @@ -110,7 +110,7 @@ export async function deleteUnconfirmedRequest(payload: JsonRpcPayload) { const chunk = { ...chunk_, updatedAt: now, - requests: requests, + requests, } await t.objectStore('UnconfirmedRequestChunk').put(chunk) WalletMessages.events.requestsUpdated.sendToAll({ hasRequest: false }) diff --git a/packages/mask/src/plugins/Wallet/services/transaction/index.ts b/packages/mask/src/plugins/Wallet/services/transaction/index.ts index e00ea56746e7..eae7ec4b268f 100644 --- a/packages/mask/src/plugins/Wallet/services/transaction/index.ts +++ b/packages/mask/src/plugins/Wallet/services/transaction/index.ts @@ -89,7 +89,7 @@ export async function getRecentTransactions( payload, payloadReplacement, status: helpers.getReceiptStatus(receipt), - receipt: receipt, + receipt, } if (!options?.receipt) { diff --git a/packages/mask/src/plugins/dHEDGE/UI/PoolViewDeck.tsx b/packages/mask/src/plugins/dHEDGE/UI/PoolViewDeck.tsx index 94b2d5ffad3e..9e58bebd5911 100644 --- a/packages/mask/src/plugins/dHEDGE/UI/PoolViewDeck.tsx +++ b/packages/mask/src/plugins/dHEDGE/UI/PoolViewDeck.tsx @@ -79,7 +79,7 @@ export function PoolViewDeck(props: PoolDeckProps) { if (!pool || !inputTokens) return openInvestDialog({ open: true, - pool: pool, + pool, tokens: inputTokens, }) }, [pool, inputTokens, openInvestDialog]) @@ -127,7 +127,7 @@ export function PoolViewDeck(props: PoolDeckProps) { share: , }} values={{ - managerShare: managerShare, + managerShare, }} /> ) : ( diff --git a/packages/mask/src/plugins/dHEDGE/apis/index.ts b/packages/mask/src/plugins/dHEDGE/apis/index.ts index d12372dd2ac6..9b4ad1827168 100644 --- a/packages/mask/src/plugins/dHEDGE/apis/index.ts +++ b/packages/mask/src/plugins/dHEDGE/apis/index.ts @@ -44,7 +44,7 @@ export async function fetchPoolPerformance(address: string, period: Period, url: }`, variables: { fundAddress: address, - period: period, + period, }, } const response = await fetch(url, { diff --git a/packages/mask/src/social-network-adaptor/facebook.com/utils/getProfileIdentifier.ts b/packages/mask/src/social-network-adaptor/facebook.com/utils/getProfileIdentifier.ts index 5f90f6a09cd2..3618ded60463 100644 --- a/packages/mask/src/social-network-adaptor/facebook.com/utils/getProfileIdentifier.ts +++ b/packages/mask/src/social-network-adaptor/facebook.com/utils/getProfileIdentifier.ts @@ -64,7 +64,7 @@ export function getProfileIdentifierAtFacebook(links: link[] | link, allowCollec } } catch {} return { - identifier: identifier, + identifier, avatar: avatar ?? undefined, nickname: nickname ?? undefined, } diff --git a/packages/mask/src/utils/native-rpc/Web.ts b/packages/mask/src/utils/native-rpc/Web.ts index 04f576efa8f6..3b050ca08795 100644 --- a/packages/mask/src/utils/native-rpc/Web.ts +++ b/packages/mask/src/utils/native-rpc/Web.ts @@ -56,8 +56,8 @@ function profileRelationFormatter(p: Profile, personaIdentifier: string | undefi linkedPersona: !!p.linkedPersona, createdAt: p.createdAt.getTime(), updatedAt: p.updatedAt.getTime(), - personaIdentifier: personaIdentifier, - favor: favor, + personaIdentifier, + favor, } } diff --git a/packages/mask/src/web3/hooks/useTransactionDialog.ts b/packages/mask/src/web3/hooks/useTransactionDialog.ts index e7c1df87320b..0324e5a3eb0a 100644 --- a/packages/mask/src/web3/hooks/useTransactionDialog.ts +++ b/packages/mask/src/web3/hooks/useTransactionDialog.ts @@ -24,7 +24,7 @@ export function useTransactionDialog( if (state.type === TransactionStateType.UNKNOWN) return setDialog({ open: open || state.type === TransactionStateType.WAIT_FOR_CONFIRMING, - state: state, + state, ...event, }) }, [state /* update tx dialog only if state changed */]) diff --git a/packages/plugins/FileService/src/SNSAdaptor/components/Uploading.tsx b/packages/plugins/FileService/src/SNSAdaptor/components/Uploading.tsx index 62001d4a5fdc..efc2215012c0 100644 --- a/packages/plugins/FileService/src/SNSAdaptor/components/Uploading.tsx +++ b/packages/plugins/FileService/src/SNSAdaptor/components/Uploading.tsx @@ -92,8 +92,8 @@ export const Uploading: React.FC = () => { size: state.size, createdAt: new Date(startedAt), key: state.key, - payloadTxID: payloadTxID, - landingTxID: landingTxID, + payloadTxID, + landingTxID, } await PluginFileServiceRPC.setFileInfo(item) navigate(FileRouter.uploaded, { state: item }) diff --git a/packages/plugins/FileService/src/Worker/swarm.ts b/packages/plugins/FileService/src/Worker/swarm.ts index 034e48d3275f..ca2bf695ea14 100644 --- a/packages/plugins/FileService/src/Worker/swarm.ts +++ b/packages/plugins/FileService/src/Worker/swarm.ts @@ -29,7 +29,7 @@ class SwarmAgent implements ProviderAgent { if (isHTML) { const file: CollectionEntry = { path: name, - data: data, + data, } const { reference } = await this.bee.uploadCollection(POSTAGE_STAMP, [file], { encrypt: false, diff --git a/packages/plugins/Solana/src/apis/getNonFungibleAssets.ts b/packages/plugins/Solana/src/apis/getNonFungibleAssets.ts index 194c54c5c960..e263c47da597 100644 --- a/packages/plugins/Solana/src/apis/getNonFungibleAssets.ts +++ b/packages/plugins/Solana/src/apis/getNonFungibleAssets.ts @@ -57,7 +57,7 @@ async function getNftList(chainId: ChainId, account: string) { return { id: pubkey, tokenId: pubkey, - chainId: chainId, + chainId, type: TokenType.NonFungible, name: metadata.data.data.name, description: externalMeta?.description, diff --git a/packages/shared/src/UI/components/MiniNetworkSelector/index.tsx b/packages/shared/src/UI/components/MiniNetworkSelector/index.tsx index f5d34c83835b..c3498dc4b812 100644 --- a/packages/shared/src/UI/components/MiniNetworkSelector/index.tsx +++ b/packages/shared/src/UI/components/MiniNetworkSelector/index.tsx @@ -66,7 +66,7 @@ export const MiniNetworkSelector = memo( disabledNonCurrentNetwork = false, size = 30, }) => { - const { classes } = useStyles({ size: size }) + const { classes } = useStyles({ size }) return ( diff --git a/packages/shared/src/UI/components/NFTCardStyledAssetPlayer/index.tsx b/packages/shared/src/UI/components/NFTCardStyledAssetPlayer/index.tsx index ac2bea3ed059..a0d77b33f358 100644 --- a/packages/shared/src/UI/components/NFTCardStyledAssetPlayer/index.tsx +++ b/packages/shared/src/UI/components/NFTCardStyledAssetPlayer/index.tsx @@ -89,7 +89,7 @@ export function NFTCardStyledAssetPlayer(props: Props) { erc721Token={{ chainId, contractAddress, - tokenId: tokenId, + tokenId, }} url={url} options={{ diff --git a/packages/theme/src/Components/PhoneNumberField/index.tsx b/packages/theme/src/Components/PhoneNumberField/index.tsx index 3bb112be3f6e..f9c1bd41ac36 100644 --- a/packages/theme/src/Components/PhoneNumberField/index.tsx +++ b/packages/theme/src/Components/PhoneNumberField/index.tsx @@ -45,7 +45,7 @@ export const PhoneNumberField = ({ const prefix = inputValue.startsWith('+') ? '' : '+' setCountryCode(prefix + inputValue) - onChange?.({ country: inputValue, phone: phone }) + onChange?.({ country: inputValue, phone }) } const handlePhoneChange = (event: ChangeEvent) => { diff --git a/packages/theme/src/Components/SearchableList/MaskSearchableItemInList.tsx b/packages/theme/src/Components/SearchableList/MaskSearchableItemInList.tsx index 9439d792d923..8629559cd221 100644 --- a/packages/theme/src/Components/SearchableList/MaskSearchableItemInList.tsx +++ b/packages/theme/src/Components/SearchableList/MaskSearchableItemInList.tsx @@ -17,6 +17,6 @@ export interface MaskSearchableListItemProps extends React.PropsWithChildren< export const MaskSearchableItemInList = ({ children, data, index, style }: FixSizeListItemProps) => (
- {React.createElement(children as any, { data: data.dataSet[index], index: index, onSelect: data.onSelect })} + {React.createElement(children as any, { data: data.dataSet[index], index, onSelect: data.onSelect })}
) diff --git a/packages/theme/src/Components/SearchableList/SearchableList.tsx b/packages/theme/src/Components/SearchableList/SearchableList.tsx index a1776821e765..3896d5735adc 100644 --- a/packages/theme/src/Components/SearchableList/SearchableList.tsx +++ b/packages/theme/src/Components/SearchableList/SearchableList.tsx @@ -122,7 +122,7 @@ export function SearchableList({ itemSize={itemSize ?? 100} itemData={{ dataSet: readyToRenderData, - onSelect: onSelect, + onSelect, }} itemCount={readyToRenderData.length} {...rest}> diff --git a/packages/theme/src/Components/Snackbar/index.tsx b/packages/theme/src/Components/Snackbar/index.tsx index b3fb6ac24c6e..dbd017e1e3db 100644 --- a/packages/theme/src/Components/Snackbar/index.tsx +++ b/packages/theme/src/Components/Snackbar/index.tsx @@ -216,7 +216,7 @@ export const CustomSnackbarContent = forwardRef(({ offsetY, ...rest }) => { const ref = useRef(null) - const { classes } = useStyles({ offsetY: offsetY }) + const { classes } = useStyles({ offsetY }) const onDismiss = (key: string | number) => () => { ref.current?.closeSnackbar(key) } diff --git a/packages/web3-providers/src/NextID/proof.ts b/packages/web3-providers/src/NextID/proof.ts index cfd2aa15c67f..7e3e156d09ef 100644 --- a/packages/web3-providers/src/NextID/proof.ts +++ b/packages/web3-providers/src/NextID/proof.ts @@ -98,9 +98,7 @@ export class NextIDProofAPI implements NextIDBaseAPI.Proof { async queryExistedBindingByPlatform(platform: NextIDPlatform, identity: string, page?: number) { if (!platform && !identity) return [] - const response = await fetchJSON( - urlcat(BASE_URL, '/v1/proof', { platform: platform, identity: identity }), - ) + const response = await fetchJSON(urlcat(BASE_URL, '/v1/proof', { platform, identity })) // TODO: merge Pagination into this return response.unwrap().ids diff --git a/packages/web3-providers/src/debank/format.ts b/packages/web3-providers/src/debank/format.ts index 1beb4479a6e9..a834097eefa7 100644 --- a/packages/web3-providers/src/debank/format.ts +++ b/packages/web3-providers/src/debank/format.ts @@ -22,7 +22,7 @@ export function formatAssets(data: WalletTokenRecord[]): Asset[] { chainId: chainIdFromChain, token: { id: address, - address: address, + address, chainId: chainIdFromChain, type: TokenType.Fungible, decimals: y.decimals, diff --git a/packages/web3-providers/src/rarible/index.ts b/packages/web3-providers/src/rarible/index.ts index efeeb09258a5..4d660764186e 100644 --- a/packages/web3-providers/src/rarible/index.ts +++ b/packages/web3-providers/src/rarible/index.ts @@ -70,7 +70,7 @@ function createERC721TokenFromAsset( imageURL, owner: asset?.owners[0], }, - tokenId: tokenId, + tokenId, } } diff --git a/packages/web3-providers/src/token-list/index.ts b/packages/web3-providers/src/token-list/index.ts index fddc1dadd05e..76a1678b52b7 100644 --- a/packages/web3-providers/src/token-list/index.ts +++ b/packages/web3-providers/src/token-list/index.ts @@ -35,7 +35,7 @@ async function fetch1inchERC20TokensFromTokenList( .map((x) => ({ type: EthereumTokenType.ERC20, ...x, - chainId: chainId, + chainId, logoURI: x.logoURI ? [x.logoURI] : [], })) } diff --git a/packages/web3-providers/src/zerion/format.ts b/packages/web3-providers/src/zerion/format.ts index e0d2412e7761..4bbcde8e1391 100644 --- a/packages/web3-providers/src/zerion/format.ts +++ b/packages/web3-providers/src/zerion/format.ts @@ -62,14 +62,14 @@ export function formatAssets( return { id: address, - chainId: chainId, + chainId, token: { id: address, name: asset.name, symbol: asset.symbol, decimals: asset.decimals, - address: address, - chainId: chainId, + address, + chainId, type: TokenType.Fungible, logoURI: asset.icon_url, }, diff --git a/packages/web3-providers/src/zora/index.ts b/packages/web3-providers/src/zora/index.ts index 53f908fddbb0..30bf9055c6eb 100644 --- a/packages/web3-providers/src/zora/index.ts +++ b/packages/web3-providers/src/zora/index.ts @@ -89,7 +89,7 @@ function createERC721TokenFromAsset(tokenAddress: string, tokenId: string, asset mediaUrl: asset?.metadata.json.animation_url ?? asset?.metadata.json.image_url ?? '', owner: asset?.owner, }, - tokenId: tokenId, + tokenId, } } diff --git a/packages/web3-shared/base/src/proxy/index.ts b/packages/web3-shared/base/src/proxy/index.ts index 85ff04bdecf9..5ff86d4c5147 100644 --- a/packages/web3-shared/base/src/proxy/index.ts +++ b/packages/web3-shared/base/src/proxy/index.ts @@ -58,7 +58,7 @@ export class ProviderProxy { if (!itemInPoll) return if (error || !id) { - itemInPoll.notify({ id, done: true, error: error, from: 'remote' }) + itemInPoll.notify({ id, done: true, error, from: 'remote' }) } const updatedAt = new Date() diff --git a/packages/web3-shared/evm/hooks/useCollectibles.ts b/packages/web3-shared/evm/hooks/useCollectibles.ts index 1a7926555b3b..57f342812b1b 100644 --- a/packages/web3-shared/evm/hooks/useCollectibles.ts +++ b/packages/web3-shared/evm/hooks/useCollectibles.ts @@ -11,7 +11,7 @@ export function useCollections(address: string, chainId: ChainId | null, dependR id: dependReady === undefined ? id : dependReady ? id : '', method: 'mask.fetchNonFungibleCollectionAsset', params: { - address: address, + address, pageSize: 200, chainId, }, @@ -36,7 +36,7 @@ export function useCollectibles(address: string, chainId: ChainId | null, depend id: dependReady === undefined ? id : dependReady ? id : '', method: 'mask.fetchNonFungibleCollectibleAssetV2', params: { - address: address, + address, pageSize: 30, }, }