Skip to content

Commit 52821c2

Browse files
authored
Lint/typecheck/prettier local speed up chore (#3726)
* Update lint script to use eslint cache * Update prettier + prettier cache + format all dem files * Update lint and typecheck scripts in package.json * Update typescript, eslint and minimum node version (needed by new typescript), removed socket.io * Add lint, prettier, and typescript cache creation to dev and prod workflows * Update Node.js version to 18.19.1
1 parent c21717a commit 52821c2

File tree

88 files changed

+791
-870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+791
-870
lines changed

.codesandbox/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM node:18.12
1+
FROM node:18.19.1

.github/workflows/aws-staging.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup node
2424
uses: actions/setup-node@v3
2525
with:
26-
node-version: 18.12
26+
node-version: 18.19.1
2727

2828
- name: Check required secrets
2929
env:

.github/workflows/build.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v3
1919
- uses: actions/setup-node@v3
2020
with:
21-
node-version: 18.12
21+
node-version: 18.19.1
2222
- uses: actions/cache@v3
2323
id: yarn-cache
2424
with:
@@ -36,7 +36,7 @@ jobs:
3636
if (( 10#${numbers[1]} != 10#${numbers[0]}+1 )); then
3737
echo "The last two migration files do not have consecutive numbers: ${numbers[0]} and ${numbers[1]}"
3838
exit 1
39-
fi
39+
fi
4040
- name: Install packages
4141
if: steps.yarn-cache.outputs.cache-hit != 'true'
4242
run: yarn --no-progress --non-interactive --frozen-lockfile
@@ -54,7 +54,7 @@ jobs:
5454
- uses: actions/checkout@v3
5555
- uses: actions/setup-node@v3
5656
with:
57-
node-version: 18.12
57+
node-version: 18.19.1
5858
- uses: actions/cache@v3
5959
id: yarn-cache
6060
with:
@@ -77,7 +77,7 @@ jobs:
7777
- uses: actions/checkout@v3
7878
- uses: actions/setup-node@v3
7979
with:
80-
node-version: 18.12
80+
node-version: 18.19.1
8181
- uses: actions/cache@v3
8282
id: yarn-cache
8383
with:
@@ -103,7 +103,7 @@ jobs:
103103
- uses: actions/checkout@v3
104104
- uses: actions/setup-node@v3
105105
with:
106-
node-version: 18.12
106+
node-version: 18.19.1
107107
- uses: actions/cache@v3
108108
id: yarn-cache
109109
with:

.github/workflows/dev-cache.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Check Out Repo
1717
uses: actions/checkout@v3
1818

19-
- name: Use Node.js 18.12
19+
- name: Use Node.js 18.19.1
2020
uses: actions/setup-node@v3
2121
with:
22-
node-version: 18.12
22+
node-version: 18.19.1
2323

2424
- name: Generate Cache Key
2525
id: key
@@ -40,10 +40,10 @@ jobs:
4040
if: ${{ !needs.search.outputs.cache-hit }}
4141
steps:
4242
- uses: actions/checkout@v3
43-
- name: Use Node.js 18.12
43+
- name: Use Node.js 18.19.1
4444
uses: actions/setup-node@v3
4545
with:
46-
node-version: 18.12
46+
node-version: 18.19.1
4747
- name: Check cache
4848
uses: actions/cache@v3
4949
id: yarn-cache
@@ -53,6 +53,15 @@ jobs:
5353
- name: Install packages
5454
if: steps.yarn-cache.outputs.cache-hit != 'true'
5555
run: yarn --no-progress --non-interactive --frozen-lockfile
56+
- name: Create lint cache
57+
if: steps.yarn-cache.outputs.cache-hit != 'true'
58+
run: yarn lint --quiet
59+
- name: Create prettier cache
60+
if: steps.yarn-cache.outputs.cache-hit != 'true'
61+
run: yarn format
62+
- name: Create typescript cache
63+
if: steps.yarn-cache.outputs.cache-hit != 'true'
64+
run: yarn typecheck
5665
cleanup:
5766
name: Cleanup old caches
5867
needs: [search]

.github/workflows/nextjs-bundle-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v3
2727
- uses: actions/setup-node@v3
2828
with:
29-
node-version: 18.12
29+
node-version: 18.19.1
3030
- name: Use modules cache
3131
uses: actions/cache@v3
3232
id: yarn-cache

.github/workflows/prod-cache.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Check Out Repo
1717
uses: actions/checkout@v3
1818

19-
- name: Use Node.js 18.12
19+
- name: Use Node.js 18.19.1
2020
uses: actions/setup-node@v3
2121
with:
22-
node-version: 18.12
22+
node-version: 18.19.1
2323

2424
- name: Generate Cache Key
2525
id: key
@@ -40,10 +40,10 @@ jobs:
4040
if: ${{ !needs.search.outputs.cache-hit }}
4141
steps:
4242
- uses: actions/checkout@v3
43-
- name: Use Node.js 18.12
43+
- name: Use Node.js 18.19.1
4444
uses: actions/setup-node@v3
4545
with:
46-
node-version: 18.12
46+
node-version: 18.19.1
4747
- name: Check cache
4848
uses: actions/cache@v3
4949
id: yarn-cache
@@ -53,6 +53,15 @@ jobs:
5353
- name: Install packages
5454
if: steps.yarn-cache.outputs.cache-hit != 'true'
5555
run: yarn --no-progress --non-interactive --frozen-lockfile
56+
- name: Create lint cache
57+
if: steps.yarn-cache.outputs.cache-hit != 'true'
58+
run: yarn lint --quiet
59+
- name: Create prettier cache
60+
if: steps.yarn-cache.outputs.cache-hit != 'true'
61+
run: yarn format
62+
- name: Create typescript cache
63+
if: steps.yarn-cache.outputs.cache-hit != 'true'
64+
run: yarn typecheck
5665
cleanup:
5766
name: Cleanup old caches
5867
needs: [search]

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
fetch-depth: 0
3333
- uses: actions/setup-node@v3
3434
with:
35-
node-version: 18.12
35+
node-version: 18.19.1
3636
- name: 'Determine Release Type'
3737
run: |
3838
if ${{ contains(github.event.inputs.release_type, 'major') }}; then

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.12
1+
18.19.1

Dockerfile.production

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.12
1+
FROM node:18.19.1
22

33
EXPOSE 3000
44

blockchain/better-calls/send-generic-transaction.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export const sendGenericTransaction$ = ({
3838
receipt.status === 1
3939
? TxStatus.Success
4040
: receipt.status === 0
41-
? TxStatus.Error
42-
: TxStatus.WaitingForConfirmation
41+
? TxStatus.Error
42+
: TxStatus.WaitingForConfirmation
4343

4444
return {
4545
status,

blockchain/calls/observe.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ export function observe<A, R>(
2424
)
2525
}
2626

27-
export type CallObservable<C extends CallDef<any, any>> = C extends CallDef<infer A, infer R>
28-
? (a: A) => Observable<R>
29-
: never
27+
export type CallObservable<C extends CallDef<any, any>> =
28+
C extends CallDef<infer A, infer R> ? (a: A) => Observable<R> : never

blockchain/vault.maths.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export function buildPosition({
8686
const daiYieldFromLockedCollateralWithoutOriginationFee = availableDebt.lt(ilkDebtAvailable)
8787
? availableDebt
8888
: ilkDebtAvailable.gt(zero)
89-
? ilkDebtAvailable
90-
: zero
89+
? ilkDebtAvailable
90+
: zero
9191

9292
const daiYieldFromLockedCollateral = daiYieldFromLockedCollateralWithoutOriginationFee.div(
9393
originationFee.plus(1),

components/assetsTable/cellComponents/AssetsTableDataCellRiskProtection.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export function AssetsTableDataCellProtection({
2424
{level > 0
2525
? t('discover.table.protection-value', { protection: level })
2626
: isOwner
27-
? t('discover.table.activate')
28-
: t('discover.table.inactive')}
27+
? t('discover.table.activate')
28+
: t('discover.table.inactive')}
2929
</Button>
3030
</AppLink>
3131
</>

components/navigation/NavigationMenuDropdownContent.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export function NavigationMenuDropdownContent({
118118
(selected[0] === i && selected[1] < j) || selected[0] < i
119119
? 50
120120
: (selected[0] === i && selected[1] > j) || selected[0] > i
121-
? -50
122-
: 0
121+
? -50
122+
: 0
123123
}px)`,
124124
}}
125125
{...(selected[0] === i && selected[1] === j && { ref })}

components/vault/VaultActionInput.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ export function VaultActionInput({
198198
{auxiliaryFlag && BigNumber.isBigNumber(minAuxiliaryAmount)
199199
? formatCryptoBalance(minAuxiliaryAmount)
200200
: !auxiliaryFlag && BigNumber.isBigNumber(minAmount)
201-
? formatCryptoBalance(minAmount)
202-
: null}
201+
? formatCryptoBalance(minAmount)
202+
: null}
203203
</Text>
204204
</>
205205
)}
@@ -217,8 +217,8 @@ export function VaultActionInput({
217217
{auxiliaryFlag && BigNumber.isBigNumber(maxAuxiliaryAmount)
218218
? formatCryptoBalance(maxAuxiliaryAmount)
219219
: !auxiliaryFlag && BigNumber.isBigNumber(maxAmount)
220-
? formatCryptoBalance(maxAmount)
221-
: null}
220+
? formatCryptoBalance(maxAmount)
221+
: null}
222222
</Text>
223223
</>
224224
)}{' '}

components/vault/VaultDetails.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export function getCollRatioColor(
3939
return collateralizationRatio.isZero()
4040
? 'primary100'
4141
: vaultWillBeAtRiskLevelDanger || vaultWillBeUnderCollateralized
42-
? 'critical100'
43-
: vaultWillBeAtRiskLevelWarning
44-
? 'warning100'
45-
: 'success100'
42+
? 'critical100'
43+
: vaultWillBeAtRiskLevelWarning
44+
? 'warning100'
45+
: 'success100'
4646
}
4747

4848
export function getPriceChangeColor({
@@ -51,8 +51,8 @@ export function getPriceChangeColor({
5151
return collateralPricePercentageChange.isZero()
5252
? 'neutral80'
5353
: collateralPricePercentageChange.gt(zero)
54-
? 'success100'
55-
: 'critical100'
54+
? 'success100'
55+
: 'critical100'
5656
}
5757

5858
export function getAfterPillColors(collRatioColor: CollRatioColor) {

components/vault/VaultWarnings.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ export function VaultWarnings({
138138
isAutoSellEnabled && isAutoBuyEnabled
139139
? `Auto-Sell ${t('and')} Auto-Buy`
140140
: isAutoSellEnabled
141-
? 'Auto-Sell'
142-
: isAutoBuyEnabled
143-
? 'Auto-Buy'
144-
: t('active-triggers'),
141+
? 'Auto-Sell'
142+
: isAutoBuyEnabled
143+
? 'Auto-Buy'
144+
: t('active-triggers'),
145145
}}
146146
components={[ConstantMultipleKBLink]}
147147
/>

components/vault/commonMultiply/ManageMultiplyVaultButton.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ export function manageMultiplyVaultButtonText(state: ManageMultiplyVaultState):
1616
? t('adjust-your-position')
1717
: t('enter-an-amount')
1818
: !state.proxyAddress
19-
? t('setup-proxy')
20-
: state.insufficientCollateralAllowance
21-
? t('set-token-allowance', { token: state.vault.token })
22-
: state.insufficientDaiAllowance
23-
? t('set-token-allowance', { token: 'DAI' })
24-
: state.originalEditingStage === 'otherActions' && state.otherAction === 'closeVault'
25-
? t('close-vault')
26-
: t('confirm')
19+
? t('setup-proxy')
20+
: state.insufficientCollateralAllowance
21+
? t('set-token-allowance', { token: state.vault.token })
22+
: state.insufficientDaiAllowance
23+
? t('set-token-allowance', { token: 'DAI' })
24+
: state.originalEditingStage === 'otherActions' && state.otherAction === 'closeVault'
25+
? t('close-vault')
26+
: t('confirm')
2727

2828
case 'proxySuccess':
2929
return state.insufficientCollateralAllowance
3030
? t('set-token-allowance', { token: state.vault.token })
3131
: state.insufficientDaiAllowance
32-
? t('set-token-allowance', { token: 'DAI' })
33-
: t('continue')
32+
? t('set-token-allowance', { token: 'DAI' })
33+
: t('continue')
3434

3535
case 'collateralAllowanceSuccess':
3636
return state.insufficientDaiAllowance

components/vault/commonMultiply/ManageMultiplyVaultConfirmation.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export function ManageMultiplyVaultConfirmationStatus({
4040
originalEditingStage === 'adjustPosition'
4141
? 'adjusting-vault-multiply'
4242
: otherAction === 'closeVault'
43-
? 'closing-vault-multiply'
44-
: 'changing-vault-multiply'
43+
? 'closing-vault-multiply'
44+
: 'changing-vault-multiply'
4545

4646
return (
4747
<TxStatusCardProgress text={t(messageKey)} etherscan={etherscan!} txHash={manageTxHash!} />

components/vault/commonMultiply/ManageVaultHeaderAllowance.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export function ManageVaultHeaderAllowance({
2525
? t('vault-form.header.proxy-success')
2626
: t('vault-form.header.proxy')
2727
: isCollateralAllowanceStage
28-
? t('vault-form.header.allowance', { token: token.toUpperCase() })
29-
: isDaiAllowanceStage
30-
? t('vault-form.header.daiAllowance')
31-
: stage === 'manageInProgress'
32-
? t('vault-form.header.modified')
33-
: t('vault-form.header.review-manage')}
28+
? t('vault-form.header.allowance', { token: token.toUpperCase() })
29+
: isDaiAllowanceStage
30+
? t('vault-form.header.daiAllowance')
31+
: stage === 'manageInProgress'
32+
? t('vault-form.header.modified')
33+
: t('vault-form.header.review-manage')}
3434
</Text>
3535
</WithVaultFormStepIndicator>
3636
<Text variant="paragraph3" sx={{ color: 'neutral80', lineHeight: '22px' }}>

components/vault/commonMultiply/OpenMultiplyVaultTitle.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export function OpenMultiplyVaultTitle({
2525
{isEditingStage
2626
? title
2727
: isProxyStage
28-
? stage === 'proxySuccess'
29-
? t('vault-form.header.proxy-success')
30-
: t('vault-form.header.proxy')
31-
: isAllowanceStage
32-
? t('vault-form.header.allowance', { token: token.toUpperCase() })
33-
: stage === 'txInProgress'
34-
? t('vault-form.header.confirm-in-progress')
35-
: t('vault-form.header.confirm')}
28+
? stage === 'proxySuccess'
29+
? t('vault-form.header.proxy-success')
30+
: t('vault-form.header.proxy')
31+
: isAllowanceStage
32+
? t('vault-form.header.allowance', { token: token.toUpperCase() })
33+
: stage === 'txInProgress'
34+
? t('vault-form.header.confirm-in-progress')
35+
: t('vault-form.header.confirm')}
3636
</Text>
3737
</WithVaultFormStepIndicator>
3838
<Text variant="paragraph3" sx={{ color: 'neutral80', lineHeight: '22px' }}>

components/vault/detailsCards/VaultDetailsCardNetValue.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ export function VaultDetailsNetValueModal({
4040
const lockedCollateralUSD = isCollateralLpToken
4141
? vault?.lockedCollateralUSD || zero
4242
: vault && marketPrice
43-
? vault.lockedCollateral.times(marketPrice)
44-
: zero
43+
? vault.lockedCollateral.times(marketPrice)
44+
: zero
4545

4646
const daiDebtUndercollateralizedToken = vault
4747
? isCollateralLpToken
4848
? vault.debt.dividedBy(oraclePrice)
4949
: marketPrice
50-
? vault.debt.dividedBy(marketPrice)
51-
: zero
50+
? vault.debt.dividedBy(marketPrice)
51+
: zero
5252
: zero
5353

5454
const netValueUndercollateralizedToken = vault
5555
? isCollateralLpToken
5656
? netValueUSD.dividedBy(oraclePrice)
5757
: marketPrice
58-
? netValueUSD.dividedBy(marketPrice)
59-
: zero
58+
? netValueUSD.dividedBy(marketPrice)
59+
: zero
6060
: zero
6161

6262
return (

0 commit comments

Comments
 (0)