move noImplicitAny and some type declarations
This commit is contained in:
parent
66a2006284
commit
f7a1a2ab58
@ -200,7 +200,7 @@ const MainWalletAction = styled(WalletAction)`
|
|||||||
color: ${({ theme }) => theme.primary1};
|
color: ${({ theme }) => theme.primary1};
|
||||||
`
|
`
|
||||||
|
|
||||||
function renderTransactions(transactions) {
|
function renderTransactions(transactions: string[]) {
|
||||||
return (
|
return (
|
||||||
<TransactionListWrapper>
|
<TransactionListWrapper>
|
||||||
{transactions.map((hash, i) => {
|
{transactions.map((hash, i) => {
|
||||||
@ -212,8 +212,8 @@ function renderTransactions(transactions) {
|
|||||||
|
|
||||||
interface AccountDetailsProps {
|
interface AccountDetailsProps {
|
||||||
toggleWalletModal: () => void
|
toggleWalletModal: () => void
|
||||||
pendingTransactions: any[]
|
pendingTransactions: string[]
|
||||||
confirmedTransactions: any[]
|
confirmedTransactions: string[]
|
||||||
ENSName?: string
|
ENSName?: string
|
||||||
openOptions: () => void
|
openOptions: () => void
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ export const Input = React.memo(function InnerInput({
|
|||||||
...rest
|
...rest
|
||||||
}: {
|
}: {
|
||||||
value: string | number
|
value: string | number
|
||||||
onUserInput: (string) => void
|
onUserInput: (input: string) => void
|
||||||
error?: boolean
|
error?: boolean
|
||||||
fontSize?: string
|
fontSize?: string
|
||||||
align?: 'right' | 'left'
|
align?: 'right' | 'left'
|
||||||
|
@ -44,7 +44,8 @@ export default function ListUpdatePopup({
|
|||||||
return diffTokenLists(oldList.tokens, newList.tokens)
|
return diffTokenLists(oldList.tokens, newList.tokens)
|
||||||
}, [newList.tokens, oldList.tokens])
|
}, [newList.tokens, oldList.tokens])
|
||||||
const numTokensChanged = useMemo(
|
const numTokensChanged = useMemo(
|
||||||
() => Object.keys(tokensChanged).reduce((memo, chainId) => memo + Object.keys(tokensChanged[chainId]).length, 0),
|
() =>
|
||||||
|
Object.keys(tokensChanged).reduce((memo, chainId: any) => memo + Object.keys(tokensChanged[chainId]).length, 0),
|
||||||
[tokensChanged]
|
[tokensChanged]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -118,12 +118,12 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
|
|||||||
deadlineError = DeadlineError.InvalidInput
|
deadlineError = DeadlineError.InvalidInput
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCustomSlippage(event) {
|
function parseCustomSlippage(value: string) {
|
||||||
setSlippageInput(event.target.value)
|
setSlippageInput(value)
|
||||||
|
|
||||||
let valueAsIntFromRoundedFloat: number
|
let valueAsIntFromRoundedFloat: number
|
||||||
try {
|
try {
|
||||||
valueAsIntFromRoundedFloat = Number.parseInt((Number.parseFloat(event.target.value) * 100).toString())
|
valueAsIntFromRoundedFloat = Number.parseInt((Number.parseFloat(value) * 100).toString())
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -135,12 +135,12 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCustomDeadline(event) {
|
function parseCustomDeadline(value: string) {
|
||||||
setDeadlineInput(event.target.value)
|
setDeadlineInput(value)
|
||||||
|
|
||||||
let valueAsInt: number
|
let valueAsInt: number
|
||||||
try {
|
try {
|
||||||
valueAsInt = Number.parseInt(event.target.value) * 60
|
valueAsInt = Number.parseInt(value) * 60
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
if (typeof valueAsInt === 'number' && !Number.isNaN(valueAsInt) && valueAsInt > 0) {
|
if (typeof valueAsInt === 'number' && !Number.isNaN(valueAsInt) && valueAsInt > 0) {
|
||||||
@ -200,9 +200,9 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
|
|||||||
placeholder={(rawSlippage / 100).toFixed(2)}
|
placeholder={(rawSlippage / 100).toFixed(2)}
|
||||||
value={slippageInput}
|
value={slippageInput}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
parseCustomSlippage({ target: { value: (rawSlippage / 100).toFixed(2) } })
|
parseCustomSlippage((rawSlippage / 100).toFixed(2))
|
||||||
}}
|
}}
|
||||||
onChange={parseCustomSlippage}
|
onChange={e => parseCustomSlippage(e.target.value)}
|
||||||
color={!slippageInputIsValid ? 'red' : ''}
|
color={!slippageInputIsValid ? 'red' : ''}
|
||||||
/>
|
/>
|
||||||
%
|
%
|
||||||
@ -238,11 +238,11 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
|
|||||||
<Input
|
<Input
|
||||||
color={!!deadlineError ? 'red' : undefined}
|
color={!!deadlineError ? 'red' : undefined}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
parseCustomDeadline({ target: { value: (deadline / 60).toString() } })
|
parseCustomDeadline((deadline / 60).toString())
|
||||||
}}
|
}}
|
||||||
placeholder={(deadline / 60).toString()}
|
placeholder={(deadline / 60).toString()}
|
||||||
value={deadlineInput}
|
value={deadlineInput}
|
||||||
onChange={parseCustomDeadline}
|
onChange={e => parseCustomDeadline(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</OptionCustom>
|
</OptionCustom>
|
||||||
<TYPE.body style={{ paddingLeft: '8px' }} fontSize={14}>
|
<TYPE.body style={{ paddingLeft: '8px' }} fontSize={14}>
|
||||||
|
@ -17,6 +17,7 @@ import { ReactComponent as Close } from '../../assets/images/x.svg'
|
|||||||
import { injected, fortmatic, portis } from '../../connectors'
|
import { injected, fortmatic, portis } from '../../connectors'
|
||||||
import { OVERLAY_READY } from '../../connectors/Fortmatic'
|
import { OVERLAY_READY } from '../../connectors/Fortmatic'
|
||||||
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
|
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
|
||||||
|
import { AbstractConnector } from '@web3-react/abstract-connector'
|
||||||
|
|
||||||
const CloseIcon = styled.div`
|
const CloseIcon = styled.div`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -128,7 +129,7 @@ export default function WalletModal({
|
|||||||
|
|
||||||
const [walletView, setWalletView] = useState(WALLET_VIEWS.ACCOUNT)
|
const [walletView, setWalletView] = useState(WALLET_VIEWS.ACCOUNT)
|
||||||
|
|
||||||
const [pendingWallet, setPendingWallet] = useState()
|
const [pendingWallet, setPendingWallet] = useState<AbstractConnector | undefined>()
|
||||||
|
|
||||||
const [pendingError, setPendingError] = useState<boolean>()
|
const [pendingError, setPendingError] = useState<boolean>()
|
||||||
|
|
||||||
@ -161,7 +162,7 @@ export default function WalletModal({
|
|||||||
}
|
}
|
||||||
}, [setWalletView, active, error, connector, walletModalOpen, activePrevious, connectorPrevious])
|
}, [setWalletView, active, error, connector, walletModalOpen, activePrevious, connectorPrevious])
|
||||||
|
|
||||||
const tryActivation = async connector => {
|
const tryActivation = async (connector: AbstractConnector | undefined) => {
|
||||||
let name = ''
|
let name = ''
|
||||||
Object.keys(SUPPORTED_WALLETS).map(key => {
|
Object.keys(SUPPORTED_WALLETS).map(key => {
|
||||||
if (connector === SUPPORTED_WALLETS[key].connector) {
|
if (connector === SUPPORTED_WALLETS[key].connector) {
|
||||||
|
@ -19,7 +19,7 @@ const Message = styled.h2`
|
|||||||
color: ${({ theme }) => theme.secondary1};
|
color: ${({ theme }) => theme.secondary1};
|
||||||
`
|
`
|
||||||
|
|
||||||
export default function Web3ReactManager({ children }) {
|
export default function Web3ReactManager({ children }: { children: JSX.Element }): JSX.Element {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { active } = useWeb3React()
|
const { active } = useWeb3React()
|
||||||
const { active: networkActive, error: networkError, activate: activateNetwork } = useWeb3React(NetworkContextName)
|
const { active: networkActive, error: networkError, activate: activateNetwork } = useWeb3React(NetworkContextName)
|
||||||
|
@ -3,7 +3,7 @@ import ReactGA from 'react-ga'
|
|||||||
import { RouteComponentProps } from 'react-router-dom'
|
import { RouteComponentProps } from 'react-router-dom'
|
||||||
|
|
||||||
// fires a GA pageview every time the route changes
|
// fires a GA pageview every time the route changes
|
||||||
export default function GoogleAnalyticsReporter({ location: { pathname, search } }: RouteComponentProps) {
|
export default function GoogleAnalyticsReporter({ location: { pathname, search } }: RouteComponentProps): null {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
ReactGA.pageview(`${pathname}${search}`)
|
ReactGA.pageview(`${pathname}${search}`)
|
||||||
}, [pathname, search])
|
}, [pathname, search])
|
||||||
|
@ -16,6 +16,7 @@ export class FortmaticConnector extends FortmaticConnectorCore {
|
|||||||
async activate() {
|
async activate() {
|
||||||
if (!this.fortmatic) {
|
if (!this.fortmatic) {
|
||||||
const { default: Fortmatic } = await import('fortmatic')
|
const { default: Fortmatic } = await import('fortmatic')
|
||||||
|
|
||||||
const { apiKey, chainId } = this as any
|
const { apiKey, chainId } = this as any
|
||||||
if (chainId in CHAIN_ID_NETWORK_ARGUMENT) {
|
if (chainId in CHAIN_ID_NETWORK_ARGUMENT) {
|
||||||
this.fortmatic = new Fortmatic(apiKey, CHAIN_ID_NETWORK_ARGUMENT[chainId as FormaticSupportedChains])
|
this.fortmatic = new Fortmatic(apiKey, CHAIN_ID_NETWORK_ARGUMENT[chainId as FormaticSupportedChains])
|
||||||
|
8
src/ethereum.d.ts
vendored
8
src/ethereum.d.ts
vendored
@ -1,8 +0,0 @@
|
|||||||
interface Window {
|
|
||||||
ethereum?: {
|
|
||||||
isMetaMask?: true
|
|
||||||
on?: (...args: any[]) => void
|
|
||||||
removeListener?: (...args: any[]) => void
|
|
||||||
}
|
|
||||||
web3?: {}
|
|
||||||
}
|
|
8
src/hooks/ethereum.d.ts
vendored
8
src/hooks/ethereum.d.ts
vendored
@ -1,8 +0,0 @@
|
|||||||
interface Window {
|
|
||||||
ethereum?: {
|
|
||||||
isMetaMask?: true
|
|
||||||
on?: (...args: any[]) => void
|
|
||||||
removeListener?: (...args: any[]) => void
|
|
||||||
}
|
|
||||||
web3?: {}
|
|
||||||
}
|
|
@ -83,7 +83,7 @@ function V1PairRemoval({
|
|||||||
})
|
})
|
||||||
setPendingRemovalHash(response.hash)
|
setPendingRemovalHash(response.hash)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error: Error) => {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
setConfirmingRemoval(false)
|
setConfirmingRemoval(false)
|
||||||
})
|
})
|
||||||
|
25
src/react-app-env.d.ts
vendored
25
src/react-app-env.d.ts
vendored
@ -1 +1,26 @@
|
|||||||
/// <reference types="react-scripts" />
|
/// <reference types="react-scripts" />
|
||||||
|
|
||||||
|
declare module 'jazzicon' {
|
||||||
|
export default function(diameter: number, seed: number): HTMLElement
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'fortmatic'
|
||||||
|
|
||||||
|
interface Window {
|
||||||
|
ethereum?: {
|
||||||
|
isMetaMask?: true
|
||||||
|
on?: (...args: any[]) => void
|
||||||
|
removeListener?: (...args: any[]) => void
|
||||||
|
}
|
||||||
|
web3?: {}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'content-hash' {
|
||||||
|
declare function decode(x: string): string
|
||||||
|
declare function getCodec(x: string): string
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'multihashes' {
|
||||||
|
declare function decode(buff: Uint8Array): { code: number; name: string; length: number; digest: Uint8Array }
|
||||||
|
declare function toB58String(hash: Uint8Array): string
|
||||||
|
}
|
||||||
|
@ -5,7 +5,7 @@ import useIsWindowVisible from '../../hooks/useIsWindowVisible'
|
|||||||
import { updateBlockNumber } from './actions'
|
import { updateBlockNumber } from './actions'
|
||||||
import { useDispatch } from 'react-redux'
|
import { useDispatch } from 'react-redux'
|
||||||
|
|
||||||
export default function Updater() {
|
export default function Updater(): null {
|
||||||
const { library, chainId } = useActiveWeb3React()
|
const { library, chainId } = useActiveWeb3React()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ export function outdatedListeningKeys(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Updater() {
|
export default function Updater(): null {
|
||||||
const dispatch = useDispatch<AppDispatch>()
|
const dispatch = useDispatch<AppDispatch>()
|
||||||
const state = useSelector<AppState, AppState['multicall']>(state => state.multicall)
|
const state = useSelector<AppState, AppState['multicall']>(state => state.multicall)
|
||||||
// wait for listeners to settle before triggering updates
|
// wait for listeners to settle before triggering updates
|
||||||
|
@ -26,7 +26,7 @@ export function shouldCheck(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Updater() {
|
export default function Updater(): null {
|
||||||
const { chainId, library } = useActiveWeb3React()
|
const { chainId, library } = useActiveWeb3React()
|
||||||
|
|
||||||
const lastBlockNumber = useBlockNumber()
|
const lastBlockNumber = useBlockNumber()
|
||||||
|
@ -3,7 +3,7 @@ import { useDispatch } from 'react-redux'
|
|||||||
import { AppDispatch } from '../index'
|
import { AppDispatch } from '../index'
|
||||||
import { updateMatchesDarkMode } from './actions'
|
import { updateMatchesDarkMode } from './actions'
|
||||||
|
|
||||||
export default function Updater() {
|
export default function Updater(): null {
|
||||||
const dispatch = useDispatch<AppDispatch>()
|
const dispatch = useDispatch<AppDispatch>()
|
||||||
|
|
||||||
// keep dark mode in sync with the system
|
// keep dark mode in sync with the system
|
||||||
|
@ -5,7 +5,7 @@ import { parse } from 'qs'
|
|||||||
import { AppDispatch } from '../state'
|
import { AppDispatch } from '../state'
|
||||||
import { updateUserDarkMode } from '../state/user/actions'
|
import { updateUserDarkMode } from '../state/user/actions'
|
||||||
|
|
||||||
export default function DarkModeQueryParamReader({ location: { search } }: RouteComponentProps) {
|
export default function DarkModeQueryParamReader({ location: { search } }: RouteComponentProps): null {
|
||||||
const dispatch = useDispatch<AppDispatch>()
|
const dispatch = useDispatch<AppDispatch>()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
4
src/utils/content-hash.d.ts
vendored
4
src/utils/content-hash.d.ts
vendored
@ -1,4 +0,0 @@
|
|||||||
declare module 'content-hash' {
|
|
||||||
declare function decode(x: string): string
|
|
||||||
declare function getCodec(x: string): string
|
|
||||||
}
|
|
4
src/utils/multihashes.d.ts
vendored
4
src/utils/multihashes.d.ts
vendored
@ -1,4 +0,0 @@
|
|||||||
declare module 'multihashes' {
|
|
||||||
declare function decode(buff: Uint8Array): { code: number; name: string; length: number; digest: Uint8Array }
|
|
||||||
declare function toB58String(hash: Uint8Array): string
|
|
||||||
}
|
|
@ -15,6 +15,7 @@
|
|||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitAny": true,
|
|
||||||
"alwaysStrict": true,
|
"alwaysStrict": true,
|
||||||
"strictNullChecks": true
|
"strictNullChecks": true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user