Commit 2f004ed1 authored by eddie's avatar eddie Committed by GitHub

fix: remove deprecated default imports from zustand (#6270)

* fix: replace default imports from zustand

* fix: add eslint rule

* fix: typo

o
parent db257c73
...@@ -4,4 +4,23 @@ require('@uniswap/eslint-config/load') ...@@ -4,4 +4,23 @@ require('@uniswap/eslint-config/load')
module.exports = { module.exports = {
extends: '@uniswap/eslint-config/react', extends: '@uniswap/eslint-config/react',
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'zustand',
importNames: ['default'],
message: 'Default import from zustand is deprecated. Import `{ create }` instead.',
},
],
},
],
},
},
],
} }
import { NftStandard } from 'graphql/data/__generated__/types-and-hooks' import { NftStandard } from 'graphql/data/__generated__/types-and-hooks'
import { BagItem, BagItemStatus, BagStatus, UpdatedGenieAsset } from 'nft/types' import { BagItem, BagItemStatus, BagStatus, UpdatedGenieAsset } from 'nft/types'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
interface BagState { interface BagState {
......
import { NftAssetSortableField } from 'graphql/data/__generated__/types-and-hooks' import { NftAssetSortableField } from 'graphql/data/__generated__/types-and-hooks'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
export enum SortBy { export enum SortBy {
......
import create from 'zustand' import { create } from 'zustand'
import { devtools, persist } from 'zustand/middleware' import { devtools, persist } from 'zustand/middleware'
interface State { interface State {
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
interface State { interface State {
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
interface NFTClaim { interface NFTClaim {
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
export type MarketplaceOption = { name: string; icon: string } export type MarketplaceOption = { name: string; icon: string }
......
import { CollectionRow, ListingRow, ListingStatus } from 'nft/types' import { CollectionRow, ListingRow, ListingStatus } from 'nft/types'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
interface NFTListState { interface NFTListState {
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { OpenSeaAsset } from '../types' import { OpenSeaAsset } from '../types'
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
interface PriceRangeProps { interface PriceRangeProps {
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { ProfilePageStateType } from '../types' import { ProfilePageStateType } from '../types'
......
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { GenieAsset } from '../types' import { GenieAsset } from '../types'
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { ListingMarket, WalletAsset } from '../types' import { ListingMarket, WalletAsset } from '../types'
......
...@@ -5,7 +5,7 @@ import { ContractReceipt } from '@ethersproject/contracts' ...@@ -5,7 +5,7 @@ import { ContractReceipt } from '@ethersproject/contracts'
import type { JsonRpcSigner } from '@ethersproject/providers' import type { JsonRpcSigner } from '@ethersproject/providers'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { NFTEventName } from '@uniswap/analytics-events' import { NFTEventName } from '@uniswap/analytics-events'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import ERC721 from '../../abis/erc721.json' import ERC721 from '../../abis/erc721.json'
......
import create from 'zustand' import { create } from 'zustand'
import { devtools, persist } from 'zustand/middleware' import { devtools, persist } from 'zustand/middleware'
import { GenieAsset } from '../types' import { GenieAsset } from '../types'
......
import { Currency } from '@uniswap/sdk-core' import { Currency } from '@uniswap/sdk-core'
import { TokenTradeInput } from 'graphql/data/__generated__/types-and-hooks' import { TokenTradeInput } from 'graphql/data/__generated__/types-and-hooks'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
interface TokenInputState { interface TokenInputState {
......
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
interface traitOpen { interface traitOpen {
......
import { TxResponse } from 'nft/types' import { TxResponse } from 'nft/types'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
type TransactionResponseValue = TxResponse | undefined type TransactionResponseValue = TxResponse | undefined
......
import { NftStandard } from 'graphql/data/__generated__/types-and-hooks' import { NftStandard } from 'graphql/data/__generated__/types-and-hooks'
import create from 'zustand' import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { WalletAsset, WalletCollection } from '../types' import { WalletAsset, WalletCollection } from '../types'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment