style: enforce object-shorthand (#2286)
This commit is contained in:
parent
6b99740f91
commit
5831328364
@ -29,6 +29,7 @@
|
||||
"@typescript-eslint/ban-ts-ignore": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"object-shorthand": ["error", "always"],
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ export function useApproveCallback(
|
||||
.then((response: TransactionResponse) => {
|
||||
addTransaction(response, {
|
||||
summary: 'Approve ' + amountToApprove.currency.symbol,
|
||||
approval: { tokenAddress: token.address, spender: spender },
|
||||
approval: { tokenAddress: token.address, spender },
|
||||
})
|
||||
})
|
||||
.catch((error: Error) => {
|
||||
|
@ -126,7 +126,7 @@ export function usePoolActiveLiquidity(
|
||||
return {
|
||||
isLoading,
|
||||
isUninitialized,
|
||||
isError: isError,
|
||||
isError,
|
||||
error,
|
||||
activeTick,
|
||||
data: ticksProcessed,
|
||||
|
@ -101,7 +101,7 @@ function useSwapCallArguments(
|
||||
approveAmountCalldata(trade.maximumAmountIn(allowedSlippage), routerContract.address),
|
||||
{
|
||||
to: routerContract.address,
|
||||
value: value,
|
||||
value,
|
||||
data: routerContract.interface.encodeFunctionData(methodName, args),
|
||||
},
|
||||
],
|
||||
@ -155,7 +155,7 @@ function useSwapCallArguments(
|
||||
approveAmountCalldata(trade.maximumAmountIn(allowedSlippage), swapRouterAddress),
|
||||
{
|
||||
to: swapRouterAddress,
|
||||
value: value,
|
||||
value,
|
||||
data: calldata,
|
||||
},
|
||||
],
|
||||
|
@ -51,8 +51,8 @@ export default createReducer(initialState, (builder) =>
|
||||
const pendingUpdate = state.byUrl[url]?.pendingUpdate ?? null
|
||||
|
||||
state.byUrl[url] = {
|
||||
current: current,
|
||||
pendingUpdate: pendingUpdate,
|
||||
current,
|
||||
pendingUpdate,
|
||||
loadingRequestId: requestId,
|
||||
error: null,
|
||||
}
|
||||
@ -68,7 +68,7 @@ export default createReducer(initialState, (builder) =>
|
||||
if (upgradeType === VersionUpgrade.NONE) return
|
||||
if (loadingRequestId === null || loadingRequestId === requestId) {
|
||||
state.byUrl[url] = {
|
||||
current: current,
|
||||
current,
|
||||
pendingUpdate: tokenList,
|
||||
loadingRequestId: null,
|
||||
error: null,
|
||||
|
@ -149,7 +149,7 @@ function toCallState(
|
||||
valid: true,
|
||||
loading: false,
|
||||
syncing,
|
||||
result: result,
|
||||
result,
|
||||
error: !success,
|
||||
}
|
||||
}
|
||||
|
@ -203,9 +203,9 @@ export function useStakingInfo(pairToFilterBy?: Pair | null): StakingInfo[] {
|
||||
periodFinish: periodFinishMs > 0 ? new Date(periodFinishMs) : undefined,
|
||||
earnedAmount: CurrencyAmount.fromRawAmount(uni, JSBI.BigInt(earnedAmountState?.result?.[0] ?? 0)),
|
||||
rewardRate: individualRewardRate,
|
||||
totalRewardRate: totalRewardRate,
|
||||
stakedAmount: stakedAmount,
|
||||
totalStakedAmount: totalStakedAmount,
|
||||
totalRewardRate,
|
||||
stakedAmount,
|
||||
totalStakedAmount,
|
||||
getHypotheticalRewardRate,
|
||||
active,
|
||||
})
|
||||
|
@ -39,7 +39,7 @@ export default createReducer<SwapState>(initialState, (builder) =>
|
||||
currencyId: outputCurrencyId,
|
||||
},
|
||||
independentField: field,
|
||||
typedValue: typedValue,
|
||||
typedValue,
|
||||
recipient,
|
||||
}
|
||||
}
|
||||
@ -51,14 +51,14 @@ export default createReducer<SwapState>(initialState, (builder) =>
|
||||
return {
|
||||
...state,
|
||||
independentField: state.independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT,
|
||||
[field]: { currencyId: currencyId },
|
||||
[field]: { currencyId },
|
||||
[otherField]: { currencyId: state[field].currencyId },
|
||||
}
|
||||
} else {
|
||||
// the normal case
|
||||
return {
|
||||
...state,
|
||||
[field]: { currencyId: currencyId },
|
||||
[field]: { currencyId },
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user