Commit 58313283 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

style: enforce object-shorthand (#2286)

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