From 1b8af749ffe5ead751bcacde8396506d461ffa0b Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Wed, 18 Dec 2024 17:35:16 +0100 Subject: [PATCH] fix: linting issues --- apps/web/next.config.mjs | 2 +- apps/web/package.json | 4 +- .../safe-apps/AppFrame/useAppCommunicator.ts | 5 +- .../safe-apps/PermissionsPrompt.tsx | 2 +- .../services/__tests__/recovery-state.test.ts | 2 +- .../recovery/services/recovery-sender.ts | 2 +- .../recovery/services/recovery-state.ts | 2 +- apps/web/src/features/swap/helpers/utils.ts | 2 +- .../permissions/useSafePermissions.ts | 2 +- .../firebase-messaging-sw.ts | 1 - apps/web/src/store/batchSlice.ts | 1 - apps/web/tsconfig.json | 9 ++ package.json | 3 +- yarn.lock | 115 +++++++++++++----- 14 files changed, 107 insertions(+), 45 deletions(-) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 617e195bf6..31142d01a7 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -86,7 +86,7 @@ const nextConfig = { cacheGroups: { ...config.optimization.splitChunks.cacheGroups, customModule: { - test: /[\\/]node_modules[\\/](@safe-global|ethers)[\\/]/, + test: /[\\/]..[\\/]..[\\/]node_modules[\\/](@safe-global|ethers)[\\/]/, name: 'protocol-kit-ethers', chunks: 'all', }, diff --git a/apps/web/package.json b/apps/web/package.json index b968be46df..3949bc041e 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -62,10 +62,10 @@ "@walletconnect/core": "^2.17.2", "@walletconnect/utils": "^2.17.3", "@web3-onboard/coinbase": "^2.4.1", - "@web3-onboard/core": "^2.21.4", + "@web3-onboard/core": "2.21.4", "@web3-onboard/injected-wallets": "^2.11.2", "@web3-onboard/ledger": "2.3.2", - "@web3-onboard/trezor": "^2.4.2", + "@web3-onboard/trezor": "2.4.3", "@web3-onboard/walletconnect": "^2.6.1", "blo": "^1.1.1", "classnames": "^2.5.1", diff --git a/apps/web/src/components/safe-apps/AppFrame/useAppCommunicator.ts b/apps/web/src/components/safe-apps/AppFrame/useAppCommunicator.ts index d553488d83..3da1ed16b6 100644 --- a/apps/web/src/components/safe-apps/AppFrame/useAppCommunicator.ts +++ b/apps/web/src/components/safe-apps/AppFrame/useAppCommunicator.ts @@ -24,10 +24,7 @@ import type { SafeInfoExtended, } from '@safe-global/safe-apps-sdk' import { Methods, RPC_CALLS } from '@safe-global/safe-apps-sdk' -import type { - Permission, - PermissionRequest, -} from 'node_modules/@safe-global/safe-apps-sdk/dist/types/types/permissions' +import type { Permission, PermissionRequest } from '@safe-global/safe-apps-sdk/dist/types/types/permissions' import type { SafeSettings } from '@safe-global/safe-apps-sdk' import AppCommunicator from '@/services/safe-apps/AppCommunicator' import { Errors, logError } from '@/services/exceptions' diff --git a/apps/web/src/components/safe-apps/PermissionsPrompt.tsx b/apps/web/src/components/safe-apps/PermissionsPrompt.tsx index 8daf9b2849..117476d8de 100644 --- a/apps/web/src/components/safe-apps/PermissionsPrompt.tsx +++ b/apps/web/src/components/safe-apps/PermissionsPrompt.tsx @@ -1,5 +1,5 @@ import type { ReactElement } from 'react' -import type { PermissionRequest } from 'node_modules/@safe-global/safe-apps-sdk/dist/types/types/permissions' +import type { PermissionRequest } from '@safe-global/safe-apps-sdk/dist/types/types/permissions' import { Button, Dialog, DialogActions, DialogContent, Divider, Typography } from '@mui/material' import { ModalDialogTitle } from '@/components/common/ModalDialog' diff --git a/apps/web/src/features/recovery/services/__tests__/recovery-state.test.ts b/apps/web/src/features/recovery/services/__tests__/recovery-state.test.ts index 869a90d09f..b9826bd0f0 100644 --- a/apps/web/src/features/recovery/services/__tests__/recovery-state.test.ts +++ b/apps/web/src/features/recovery/services/__tests__/recovery-state.test.ts @@ -2,7 +2,7 @@ import { faker } from '@faker-js/faker' import { id, zeroPadValue } from 'ethers' import { JsonRpcProvider } from 'ethers' import cloneDeep from 'lodash/cloneDeep' -import type { Delay, TransactionAddedEvent } from 'node_modules/@gnosis.pm/zodiac/dist/cjs/types/Delay' +import type { Delay, TransactionAddedEvent } from '@gnosis.pm/zodiac/dist/cjs/types/Delay' import type { TransactionReceipt } from 'ethers' import { diff --git a/apps/web/src/features/recovery/services/recovery-sender.ts b/apps/web/src/features/recovery/services/recovery-sender.ts index 65f5e24f2c..8ca388f479 100644 --- a/apps/web/src/features/recovery/services/recovery-sender.ts +++ b/apps/web/src/features/recovery/services/recovery-sender.ts @@ -1,7 +1,7 @@ import { getModuleInstance, KnownContracts } from '@gnosis.pm/zodiac' import type { SafeInfo } from '@safe-global/safe-gateway-typescript-sdk' import type { SafeTransaction } from '@safe-global/safe-core-sdk-types' -import type { TransactionAddedEvent } from 'node_modules/@gnosis.pm/zodiac/dist/cjs/types/Delay' +import type { TransactionAddedEvent } from '@gnosis.pm/zodiac/dist/cjs/types/Delay' import type { Eip1193Provider, TransactionResponse } from 'ethers' import { didReprice, didRevert } from '@/utils/ethers-utils' diff --git a/apps/web/src/features/recovery/services/recovery-state.ts b/apps/web/src/features/recovery/services/recovery-state.ts index 227533df2b..70941f90dc 100644 --- a/apps/web/src/features/recovery/services/recovery-state.ts +++ b/apps/web/src/features/recovery/services/recovery-state.ts @@ -3,7 +3,7 @@ import memoize from 'lodash/memoize' import { getMultiSendCallOnlyDeployment } from '@safe-global/safe-deployments' import type { SafeInfo } from '@safe-global/safe-gateway-typescript-sdk' import type { Delay } from '@gnosis.pm/zodiac' -import type { TransactionAddedEvent } from 'node_modules/@gnosis.pm/zodiac/dist/cjs/types/Delay' +import type { TransactionAddedEvent } from '@gnosis.pm/zodiac/dist/cjs/types/Delay' import { toBeHex, type JsonRpcProvider, type TransactionReceipt } from 'ethers' import { trimTrailingSlash } from '@/utils/url' import { sameAddress } from '@/utils/addresses' diff --git a/apps/web/src/features/swap/helpers/utils.ts b/apps/web/src/features/swap/helpers/utils.ts index 053618cccc..846bdb29d0 100644 --- a/apps/web/src/features/swap/helpers/utils.ts +++ b/apps/web/src/features/swap/helpers/utils.ts @@ -1,6 +1,6 @@ import type { DataDecoded, Order as SwapOrder } from '@safe-global/safe-gateway-typescript-sdk' import { formatUnits } from 'ethers' -import type { AnyAppDataDocVersion, latest, LatestAppDataDocVersion } from 'node_modules/@cowprotocol/app-data' +import type { AnyAppDataDocVersion, latest, LatestAppDataDocVersion } from '@cowprotocol/app-data' import { TradeType, UiOrderType } from '@/features/swap/types' diff --git a/apps/web/src/hooks/safe-apps/permissions/useSafePermissions.ts b/apps/web/src/hooks/safe-apps/permissions/useSafePermissions.ts index 83a36c3a13..51343ec69a 100644 --- a/apps/web/src/hooks/safe-apps/permissions/useSafePermissions.ts +++ b/apps/web/src/hooks/safe-apps/permissions/useSafePermissions.ts @@ -4,7 +4,7 @@ import type { Permission, PermissionCaveat, PermissionRequest, -} from 'node_modules/@safe-global/safe-apps-sdk/dist/types/types/permissions' +} from '@safe-global/safe-apps-sdk/dist/types/types/permissions' import { PermissionStatus } from '@/components/safe-apps/types' import useLocalStorage from '@/services/local-storage/useLocalStorage' diff --git a/apps/web/src/service-workers/firebase-messaging/firebase-messaging-sw.ts b/apps/web/src/service-workers/firebase-messaging/firebase-messaging-sw.ts index e7c59aa109..7e7aaf53c4 100644 --- a/apps/web/src/service-workers/firebase-messaging/firebase-messaging-sw.ts +++ b/apps/web/src/service-workers/firebase-messaging/firebase-messaging-sw.ts @@ -67,7 +67,6 @@ export function firebaseMessagingSw() { self.registration.showNotification(notification.title || '', { icon: ICON_PATH, body: notification.body, - image: notification.image, data, }) }) diff --git a/apps/web/src/store/batchSlice.ts b/apps/web/src/store/batchSlice.ts index b272d90f8e..1ab3d1a294 100644 --- a/apps/web/src/store/batchSlice.ts +++ b/apps/web/src/store/batchSlice.ts @@ -37,7 +37,6 @@ export const batchSlice = createSlice({ state[chainId][safeAddress].push({ id: Math.random().toString(36).slice(2), timestamp: Date.now(), - // @ts-expect-error txDetails, }) }, diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index a62d5ebc10..c01f42c73f 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -23,6 +23,15 @@ "@/*": [ "./src/*" ], + "@safe-global/safe-apps-sdk/*": [ + "../../node_modules/@safe-global/safe-apps-sdk/*" + ], + "@gnosis.pm/zodiac/*": [ + "../../node_modules/@gnosis.pm/zodiac/*" + ], + "@cowprotocol/app-data": [ + "../../node_modules/@cowprotocol/app-data" + ], "@/public/*": [ "./public/*" ] diff --git a/package.json b/package.json index 149545ec6b..b7097877b7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "@safe-global/safe-core-sdk-types/ethers": "6.13.4", "@safe-global/protocol-kit/ethers": "6.13.4", "@safe-global/api-kit/ethers": "6.13.4", - "@gnosis.pm/zodiac/ethers": "6.13.4" + "@gnosis.pm/zodiac/ethers": "6.13.4", + "@cowprotocol/events": "1.3.0" }, "devDependencies": { "husky": "^9.1.6", diff --git a/yarn.lock b/yarn.lock index aeb6e0712f..17bdaa4426 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1516,19 +1516,10 @@ __metadata: languageName: node linkType: hard -"@cowprotocol/events@npm:^1.3.0": - version: 1.5.0 - resolution: "@cowprotocol/events@npm:1.5.0" - dependencies: - "@cowprotocol/types": "npm:^1.2.0" - checksum: 10/01a29e411e260a04fb1abc5eb756c2db7c25687ab03c4007fb0413fbc86cb2af8128dcc9a0302d5136b446ff73834138d84648a48b487be7eafc119fa526928a - languageName: node - linkType: hard - -"@cowprotocol/types@npm:^1.2.0": - version: 1.2.0 - resolution: "@cowprotocol/types@npm:1.2.0" - checksum: 10/0a5c19c625c194037f49661b260a1e82700b4888111398424341bb66624b4ca5a317ce19cd3b021c1b9e389bc357cbd1f82987918f7f92e3f9ba9c99b024ee35 +"@cowprotocol/events@npm:1.3.0": + version: 1.3.0 + resolution: "@cowprotocol/events@npm:1.3.0" + checksum: 10/c91a8dfbb1d0dba753e4080efbe044c42f20a3564550fe72ddc14c31432fd5b8da1ef40a0e62396016bc59785b57d9cdbf86c814e3cd1fe381389ee22ea6ded2 languageName: node linkType: hard @@ -2726,6 +2717,33 @@ __metadata: languageName: node linkType: hard +"@ethersproject/providers@npm:5.5.2": + version: 5.5.2 + resolution: "@ethersproject/providers@npm:5.5.2" + dependencies: + "@ethersproject/abstract-provider": "npm:^5.5.0" + "@ethersproject/abstract-signer": "npm:^5.5.0" + "@ethersproject/address": "npm:^5.5.0" + "@ethersproject/basex": "npm:^5.5.0" + "@ethersproject/bignumber": "npm:^5.5.0" + "@ethersproject/bytes": "npm:^5.5.0" + "@ethersproject/constants": "npm:^5.5.0" + "@ethersproject/hash": "npm:^5.5.0" + "@ethersproject/logger": "npm:^5.5.0" + "@ethersproject/networks": "npm:^5.5.0" + "@ethersproject/properties": "npm:^5.5.0" + "@ethersproject/random": "npm:^5.5.0" + "@ethersproject/rlp": "npm:^5.5.0" + "@ethersproject/sha2": "npm:^5.5.0" + "@ethersproject/strings": "npm:^5.5.0" + "@ethersproject/transactions": "npm:^5.5.0" + "@ethersproject/web": "npm:^5.5.0" + bech32: "npm:1.1.4" + ws: "npm:7.4.6" + checksum: 10/25d7f15b0a9eb72410f90ce06cffd887c11c8abfa9699895defdb52424836af52b689c31ff13bd413c932f1ddf4bb21143739fdbf753360fe60c3c018ba3a83b + languageName: node + linkType: hard + "@ethersproject/providers@npm:5.5.3": version: 5.5.3 resolution: "@ethersproject/providers@npm:5.5.3" @@ -5885,10 +5903,10 @@ __metadata: "@walletconnect/core": "npm:^2.17.2" "@walletconnect/utils": "npm:^2.17.3" "@web3-onboard/coinbase": "npm:^2.4.1" - "@web3-onboard/core": "npm:^2.21.4" + "@web3-onboard/core": "npm:2.21.4" "@web3-onboard/injected-wallets": "npm:^2.11.2" "@web3-onboard/ledger": "npm:2.3.2" - "@web3-onboard/trezor": "npm:^2.4.2" + "@web3-onboard/trezor": "npm:2.4.3" "@web3-onboard/walletconnect": "npm:^2.6.1" blo: "npm:^1.1.1" classnames: "npm:^2.5.1" @@ -9213,7 +9231,7 @@ __metadata: languageName: node linkType: hard -"@web3-onboard/common@npm:^2.2.3, @web3-onboard/common@npm:^2.4.1": +"@web3-onboard/common@npm:^2.2.3, @web3-onboard/common@npm:^2.3.3, @web3-onboard/common@npm:^2.3.4, @web3-onboard/common@npm:^2.4.1": version: 2.4.2 resolution: "@web3-onboard/common@npm:2.4.2" dependencies: @@ -9223,13 +9241,15 @@ __metadata: languageName: node linkType: hard -"@web3-onboard/core@npm:^2.21.4": - version: 2.23.0 - resolution: "@web3-onboard/core@npm:2.23.0" +"@web3-onboard/core@npm:2.21.4": + version: 2.21.4 + resolution: "@web3-onboard/core@npm:2.21.4" dependencies: - "@web3-onboard/common": "npm:^2.4.1" + "@web3-onboard/common": "npm:^2.3.4" + bignumber.js: "npm:^9.0.0" bnc-sdk: "npm:^4.6.7" bowser: "npm:^2.11.0" + ethers: "npm:5.5.3" eventemitter3: "npm:^4.0.7" joi: "npm:17.9.1" lodash.merge: "npm:^4.6.2" @@ -9238,12 +9258,11 @@ __metadata: rxjs: "npm:^7.5.5" svelte: "npm:^3.49.0" svelte-i18n: "npm:^3.3.13" - viem: "npm:2.12.0" - checksum: 10/4b3c1fdb186c8523d6aa59895be204886ea38ae995f946132b17c6f0509e075e508437548b61b374f09746dba95e0d9fda85c4c9bb4f309263a2e5e29c5b6397 + checksum: 10/77011b7b7b365f2c743b537b42359d66d24776e62238348c795b2c84512fda8f525dcfa0d8802a131e5071d6d99bab4adc330edb0834affa32d3c15c6bcc8805 languageName: node linkType: hard -"@web3-onboard/hw-common@npm:^2.0.4, @web3-onboard/hw-common@npm:^2.3.2": +"@web3-onboard/hw-common@npm:^2.0.4, @web3-onboard/hw-common@npm:^2.3.0": version: 2.3.3 resolution: "@web3-onboard/hw-common@npm:2.3.3" dependencies: @@ -9286,20 +9305,20 @@ __metadata: languageName: node linkType: hard -"@web3-onboard/trezor@npm:^2.4.2": - version: 2.4.6 - resolution: "@web3-onboard/trezor@npm:2.4.6" +"@web3-onboard/trezor@npm:2.4.3": + version: 2.4.3 + resolution: "@web3-onboard/trezor@npm:2.4.3" dependencies: "@ethereumjs/tx": "npm:^3.4.0" "@ethersproject/providers": "npm:^5.5.0" "@trezor/connect-web": "npm:^9.0.11" - "@web3-onboard/common": "npm:^2.4.1" - "@web3-onboard/hw-common": "npm:^2.3.2" + "@web3-onboard/common": "npm:^2.3.3" + "@web3-onboard/hw-common": "npm:^2.3.0" buffer: "npm:^6.0.3" eth-crypto: "npm:^2.1.0" ethereumjs-util: "npm:^7.1.3" hdkey: "npm:^2.0.1" - checksum: 10/aa8c7100c84742633a3d02807b4f1574400b1608b55736afa6b35233c1fce7988f6c6b0bb468c6527390d108232141fa9dbe15a64dcc42ea58f64b4189a6912e + checksum: 10/48b5cd480683ad606236a7c50a0a9bf52ac4de8e65cc6b83d7d8c2f4c916d5b189a4aca21d22552166284aed3a8378fef9cc7d0f9718383abecc81bc1446b542 languageName: node linkType: hard @@ -13831,6 +13850,44 @@ __metadata: languageName: node linkType: hard +"ethers@npm:5.5.3": + version: 5.5.3 + resolution: "ethers@npm:5.5.3" + dependencies: + "@ethersproject/abi": "npm:5.5.0" + "@ethersproject/abstract-provider": "npm:5.5.1" + "@ethersproject/abstract-signer": "npm:5.5.0" + "@ethersproject/address": "npm:5.5.0" + "@ethersproject/base64": "npm:5.5.0" + "@ethersproject/basex": "npm:5.5.0" + "@ethersproject/bignumber": "npm:5.5.0" + "@ethersproject/bytes": "npm:5.5.0" + "@ethersproject/constants": "npm:5.5.0" + "@ethersproject/contracts": "npm:5.5.0" + "@ethersproject/hash": "npm:5.5.0" + "@ethersproject/hdnode": "npm:5.5.0" + "@ethersproject/json-wallets": "npm:5.5.0" + "@ethersproject/keccak256": "npm:5.5.0" + "@ethersproject/logger": "npm:5.5.0" + "@ethersproject/networks": "npm:5.5.2" + "@ethersproject/pbkdf2": "npm:5.5.0" + "@ethersproject/properties": "npm:5.5.0" + "@ethersproject/providers": "npm:5.5.2" + "@ethersproject/random": "npm:5.5.1" + "@ethersproject/rlp": "npm:5.5.0" + "@ethersproject/sha2": "npm:5.5.0" + "@ethersproject/signing-key": "npm:5.5.0" + "@ethersproject/solidity": "npm:5.5.0" + "@ethersproject/strings": "npm:5.5.0" + "@ethersproject/transactions": "npm:5.5.0" + "@ethersproject/units": "npm:5.5.0" + "@ethersproject/wallet": "npm:5.5.0" + "@ethersproject/web": "npm:5.5.1" + "@ethersproject/wordlists": "npm:5.5.0" + checksum: 10/75412f0dd60f0a21c2e8ade37781b6f67a84377d0b5452cf4c4d73596e6c2626966f666d491e53c55e124621ce3b72edf0001c683f2ef9ef08da79b5a3a02ace + languageName: node + linkType: hard + "ethers@npm:5.5.4": version: 5.5.4 resolution: "ethers@npm:5.5.4"