Skip to content
Merged
1 change: 1 addition & 0 deletions apps/cowswap-frontend/src/common/hooks/useContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@cowprotocol/common-const'
import { isEns, isProd, isStaging, COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS } from '@cowprotocol/common-utils'
import {
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS as COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS_PROD,
CowEnv,
SupportedChainId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import { ReactNode, useCallback, useMemo } from 'react'
import iconEtherscanSrc from '@cowprotocol/assets/cow-swap/etherscan-icon.svg'
import { TokenWithLogo } from '@cowprotocol/common-const'
import { useTheme } from '@cowprotocol/common-hooks'
import { getBlockExplorerUrl, getIsNativeToken, isFractionFalsy } from '@cowprotocol/common-utils'
import { COW_PROTOCOL_VAULT_RELAYER_ADDRESS, MAX_UINT256, getAddressKey } from '@cowprotocol/cow-sdk'
import {
getBlockExplorerUrl,
getIsNativeToken,
isFractionFalsy,
COW_PROTOCOL_VAULT_RELAYER_ADDRESS,
} from '@cowprotocol/common-utils'
import { MAX_UINT256, getAddressKey } from '@cowprotocol/cow-sdk'
import { CurrencyAmount, Token } from '@cowprotocol/currency'
import { useAreThereTokensWithSameSymbol } from '@cowprotocol/tokens'
import { Command } from '@cowprotocol/types'
Expand Down
8 changes: 4 additions & 4 deletions apps/cowswap-frontend/src/legacy/components/Version/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import svgCarretDownSrc from '@cowprotocol/assets/images/carret-down.svg'
import svgXSrc from '@cowprotocol/assets/images/x.svg'
import { CODE_LINK } from '@cowprotocol/common-const'
import { useOnClickOutside } from '@cowprotocol/common-hooks'
import { getEtherscanLink, isBarnBackendEnv } from '@cowprotocol/common-utils'
import {
CONTRACTS_PKG_VERSION,
getEtherscanLink,
isBarnBackendEnv,
COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS,
COW_PROTOCOL_VAULT_RELAYER_ADDRESS,
SupportedChainId as ChainId,
} from '@cowprotocol/cow-sdk'
} from '@cowprotocol/common-utils'
import { CONTRACTS_PKG_VERSION, SupportedChainId as ChainId } from '@cowprotocol/cow-sdk'
import { ExternalLink, Media, UI } from '@cowprotocol/ui'
import { useWalletInfo } from '@cowprotocol/wallet'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { COW_PROTOCOL_VAULT_RELAYER_ADDRESS, SupportedChainId } from '@cowprotocol/cow-sdk'
import { COW_PROTOCOL_VAULT_RELAYER_ADDRESS } from '@cowprotocol/common-utils'
import { SupportedChainId } from '@cowprotocol/cow-sdk'

import { cowSwapStore } from '../../../../legacy/state'
import { addTransaction, finalizeTransaction } from '../../../../legacy/state/enhancedTransactions/actions'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ContractsOrder,
OrderParameters,
SupportedChainId,
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS as COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS_PROD,
AddressPerChain,
} from '@cowprotocol/cow-sdk'
Expand Down
19 changes: 14 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ module.exports = [
message:
"Please import COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS and COW_PROTOCOL_VAULT_RELAYER_ADDRESS from '@cowprotocol/common-utils', which provides environment-aware versions of these constants.",
},
{
name: 'ethers',
message: "Please import from '@ethersproject/module' directly to support tree-shaking.",
},
{
name: 'styled-components',
message: 'Please import from styled-components/macro.',
Expand Down Expand Up @@ -235,7 +231,7 @@ module.exports = [
position: 'before',
},
{
pattern: '{@cowprotocol,@uniswap,@safe-global,@ethersproject,@web3-react}/**',
pattern: '{@cowprotocol,@uniswap,@safe-global}/**',
group: 'external',
position: 'before',
},
Expand Down Expand Up @@ -297,6 +293,12 @@ module.exports = [
'error',
{
paths: [
{
name: '@cowprotocol/cow-sdk',
importNames: ['COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS', 'COW_PROTOCOL_VAULT_RELAYER_ADDRESS'],
message:
"Please import COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS and COW_PROTOCOL_VAULT_RELAYER_ADDRESS from '@cowprotocol/common-utils', which provides environment-aware versions of these constants.",
},
{
name: 'react-router',
importNames: ['useNavigate'],
Expand Down Expand Up @@ -343,6 +345,12 @@ module.exports = [
message:
'common/** must stay module-agnostic. Move domain logic into modules/<domain> or extract shared logic into common/lib.',
},
{
name: '@cowprotocol/cow-sdk',
importNames: ['COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS', 'COW_PROTOCOL_VAULT_RELAYER_ADDRESS'],
message:
"Please import COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS and COW_PROTOCOL_VAULT_RELAYER_ADDRESS from '@cowprotocol/common-utils', which provides environment-aware versions of these constants.",
},
],
patterns: ['modules/*'],
},
Expand All @@ -364,6 +372,7 @@ module.exports = [
rules: {
complexity: ['error', 100],
'max-lines-per-function': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
'@typescript-eslint/no-restricted-imports': 'warn',
},
},

Expand Down
Loading