Skip to content

Commit 960ef75

Browse files
authored
fix: update packages (#77)
* fix: update packages
1 parent b8b40a6 commit 960ef75

16 files changed

+1810
-3485
lines changed

.eslintrc.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import tseslint from 'typescript-eslint';
4+
import eslintReact from 'eslint-plugin-react';
5+
import eslintReactHooks from 'eslint-plugin-react-hooks';
6+
import prettierPlugin from 'eslint-plugin-prettier';
7+
import eslintConfigPrettier from 'eslint-config-prettier';
8+
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
9+
import eslintPluginImport from 'eslint-plugin-import';
10+
11+
/** @type {import('eslint').Linter.FlatConfig[]} */
12+
export default tseslint.config(
13+
{
14+
plugins: {
15+
'@typescript-eslint': tseslint.plugin,
16+
'react': eslintReact,
17+
'react-hooks': eslintReactHooks,
18+
prettier: prettierPlugin,
19+
'simple-import-sort': eslintPluginSimpleImportSort,
20+
'import': eslintPluginImport,
21+
},
22+
},
23+
{
24+
ignores: ['dist', 'node_modules', 'coverage', 'eslint.config.mjs', "icons"],
25+
},
26+
js.configs.recommended,
27+
...tseslint.configs.recommended,
28+
{
29+
languageOptions: {
30+
globals: {
31+
...globals.browser,
32+
...globals.node,
33+
...globals.es2020,
34+
},
35+
parserOptions: {
36+
project: ['tsconfig.json'],
37+
},
38+
parser: tseslint.parser,
39+
ecmaVersion: 'latest'
40+
},
41+
},
42+
{
43+
files: ['**/*.{ts,tsx}'],
44+
extends: [tseslint.configs.disableTypeChecked],
45+
rules: {
46+
...eslintConfigPrettier.rules,
47+
...eslintPluginImport.configs.recommended.rules,
48+
'@typescript-eslint/no-empty-interface': 'off',
49+
'@typescript-eslint/no-explicit-any': 'warn',
50+
'prettier/prettier': 'warn',
51+
'simple-import-sort/imports': 'error',
52+
'simple-import-sort/exports': 'warn',
53+
'import/first': 'error',
54+
'import/no-duplicates': 'error',
55+
'import/no-named-as-default': 'off',
56+
'import/no-unresolved': 'off',
57+
'import/no-named-as-default-member': 'off',
58+
'import/namespace': 'off',
59+
'import/named': 'off',
60+
'@typescript-eslint/no-require-imports': 'off'
61+
},
62+
},
63+
);

package.json

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,39 @@
4040
"node": ">=18"
4141
},
4242
"peerDependencies": {
43-
"@bgd-labs/aave-address-book": "^3.1.1",
43+
"@bgd-labs/aave-address-book": "^4",
4444
"ethers": "^5",
45-
"viem": "^2.9.3"
45+
"viem": "^2"
4646
},
4747
"devDependencies": {
48-
"@bgd-labs/aave-address-book": "^3.1.1",
48+
"@bgd-labs/aave-address-book": "^4.1.0",
4949
"@bgd-labs/js-utils": "^1.4.2",
50-
"@size-limit/preset-small-lib": "^11.1.2",
51-
"@types/lodash": "^4.17.0",
52-
"@types/node": "^20.11.30",
50+
"@size-limit/preset-small-lib": "^11.1.6",
51+
"@types/lodash": "^4.17.10",
52+
"@types/node": "^22.7.5",
5353
"bignumber.js": "^9.1.2",
5454
"dotenv": "^16.4.5",
55-
"esbuild-plugin-file-path-extensions": "^2.0.0",
56-
"eslint": "^8.57.0",
55+
"eslint": "^9.12.0",
5756
"eslint-config-prettier": "^9.1.0",
58-
"eslint-config-react-app": "^7.0.1",
59-
"eslint-plugin-import": "^2.29.1",
60-
"eslint-plugin-prettier": "^5.1.3",
61-
"eslint-plugin-react-hooks": "^4.6.0",
62-
"eslint-plugin-simple-import-sort": "^12.0.0",
57+
"eslint-plugin-import": "^2.31.0",
58+
"eslint-plugin-prettier": "^5.2.1",
59+
"eslint-plugin-react": "^7.37.1",
60+
"eslint-plugin-react-hooks": "^5.0.0",
61+
"eslint-plugin-simple-import-sort": "^12.1.1",
6362
"ethers": "5",
63+
"globals": "^15.11.0",
6464
"lodash": "^4.17.21",
65-
"prettier": "^3.2.5",
66-
"tsup": "^8.0.2",
67-
"tsx": "^4.7.1",
68-
"typescript": "^5.4.3",
69-
"viem": "^2.9.3"
65+
"prettier": "^3.3.3",
66+
"tsup": "^8.3.0",
67+
"tsx": "^4.19.1",
68+
"typescript": "^5.6.3",
69+
"typescript-eslint": "^8.9.0",
70+
"viem": "^2.21.27"
7071
},
7172
"dependencies": {
72-
"bs58": "^5.0.0",
73-
"dayjs": "^1.11.10",
73+
"abitype": "^1.0.6",
74+
"bs58": "^6.0.0",
75+
"dayjs": "^1.11.13",
7476
"gray-matter": "^4.0.3"
7577
},
7678
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"

src/scripts/parse-cache.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
IVotingMachineDataHelper_ABI,
33
IVotingPortal_ABI,
4-
} from '@bgd-labs/aave-address-book';
4+
} from '@bgd-labs/aave-address-book/abis';
55
import {
66
CHAIN_ID_CLIENT_MAP,
77
readJSONCache,
@@ -246,7 +246,7 @@ async function parseProposalEvents(
246246
) || [];
247247

248248
// PAYLOADS_CREATED
249-
formattedProposalData.payloads.forEach((payload, index) => {
249+
formattedProposalData.payloads.forEach((payload) => {
250250
const historyId = `${formattedProposalData.id}_${HistoryItemType.PAYLOADS_CREATED}_${payload.id}_${payload.chainId}`;
251251

252252
const eventsPath = `${payload.chainId}/events`;
@@ -440,7 +440,7 @@ async function parseProposalEvents(
440440
(payload) => payload?.executedAt > 0 && !isVotingFailed,
441441
)
442442
) {
443-
formattedProposalData.payloads.forEach((payload, index) => {
443+
formattedProposalData.payloads.forEach((payload) => {
444444
if (payload?.executedAt > 0) {
445445
const historyId = `${formattedProposalData.id}_${HistoryItemType.PAYLOADS_EXECUTED}_${payload.id}_${payload.chainId}`;
446446

@@ -492,7 +492,7 @@ async function parseProposalEvents(
492492
(payload) => payload?.state === PayloadState.Expired && !isVotingFailed,
493493
)
494494
) {
495-
formattedProposalData.payloads.forEach((payload, index) => {
495+
formattedProposalData.payloads.forEach((payload) => {
496496
if (payload.state === PayloadState.Expired) {
497497
const historyId = `${formattedProposalData.id}_${HistoryItemType.PAYLOADS_EXPIRED}_${payload.id}_${payload.chainId}`;
498498
setEvent({
@@ -650,7 +650,7 @@ async function parseCache() {
650650

651651
return {
652652
...vote,
653-
ensName: !!name ? name : undefined,
653+
ensName: name ? name : undefined,
654654
};
655655
} catch {
656656
return {

src/scripts/update-cache-package.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
IGovernanceCore_ABI,
33
IPayloadsControllerCore_ABI,
44
IVotingPortal_ABI,
5-
} from '@bgd-labs/aave-address-book';
5+
} from '@bgd-labs/aave-address-book/abis';
66
import {
77
CHAIN_ID_CLIENT_MAP,
88
getBlockAtTimestamp,
@@ -48,6 +48,7 @@ async function updateIpfsCache(proposalsCache: ProposalsCache) {
4848
if (metadata) {
4949
ipfsCache[proposalsCache[id].ipfsHash] = metadata;
5050
}
51+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5152
} catch (e) {
5253
console.log(
5354
`Error when ipfs data getting, ipfs hash: ${proposalsCache[id].ipfsHash}`,
@@ -158,7 +159,7 @@ async function updatePayloadsData(
158159
}
159160

160161
async function updateGovCoreEvents(
161-
govCoreChainId: BigInt | number,
162+
govCoreChainId: bigint | number,
162163
govCoreContractAddress: Address,
163164
proposalsCache: ProposalsCache,
164165
bookKeepingCache: BookKeepingCache,
@@ -210,7 +211,7 @@ async function updateGovCoreEvents(
210211
}
211212

212213
async function updateVMEvents(
213-
govCoreChainId: BigInt | number,
214+
govCoreChainId: bigint | number,
214215
votingPortals: Set<Address>,
215216
bookKeepingCache: BookKeepingCache,
216217
) {
@@ -278,7 +279,7 @@ export async function updateCache({
278279
govCoreChainId,
279280
govCoreContractAddress,
280281
}: {
281-
govCoreChainId: BigInt | number;
282+
govCoreChainId: bigint | number;
282283
govCoreContractAddress: Address;
283284
}) {
284285
/**

src/utils/generic/genericFunctions.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export async function getProposalMetadataBase({
3535
description: content,
3636
...data,
3737
};
38+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3839
} catch (e) {
3940
const data = matter(await clone.text());
4041
return {
@@ -68,8 +69,9 @@ export async function getProposalMetadataInit(
6869
isRequestSuccess = true;
6970
return await getProposalMetadataBase({ ipfsHash, ipfsResponse });
7071
}
72+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7173
} catch (e) {
72-
if (!!fallbackGateways?.length) {
74+
if (fallbackGateways?.length) {
7375
for (let i = 0; i < fallbackGateways.length && !isRequestSuccess; i++) {
7476
const gatewayInside = fallbackGateways[i];
7577
const ipfsInsidePath = getLink(ipfsHash, gatewayInside);
@@ -86,6 +88,7 @@ export async function getProposalMetadataInit(
8688
ipfsResponse: ipfsResponseInside,
8789
});
8890
}
91+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8992
} catch (e) {
9093
console.error(`IPFS: error fetching ${ipfsPath}`);
9194
}
@@ -113,7 +116,7 @@ export async function getProposalMetadata({
113116
];
114117

115118
if (incorectedHashses.some((h) => hash === h)) {
116-
if (!!setIpfsError) {
119+
if (setIpfsError) {
117120
setIpfsError(hash, errorText);
118121
} else {
119122
console.error('Fetch metadata from ipfs error:', 'incorrect ipfs hash');
@@ -127,14 +130,14 @@ export async function getProposalMetadata({
127130
fallbackGateways,
128131
);
129132

130-
return !!metadata
133+
return metadata
131134
? {
132135
...metadata,
133136
originalIpfsHash: hash,
134137
}
135138
: undefined;
136139
} catch (e) {
137-
if (!!setIpfsError) {
140+
if (setIpfsError) {
138141
setIpfsError(hash);
139142
} else {
140143
console.error('Fetch metadata from ipfs error:', e);

src/utils/viem/events/governance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book';
1+
import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book/abis';
22
import { strategicGetLogs } from '@bgd-labs/js-utils';
33
import type { ExtractAbiEvent } from 'abitype';
44
import { Address, Client, getAbiItem } from 'viem';

src/utils/viem/events/payloadsController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IPayloadsControllerCore_ABI } from '@bgd-labs/aave-address-book';
1+
import { IPayloadsControllerCore_ABI } from '@bgd-labs/aave-address-book/abis';
22
import { strategicGetLogs } from '@bgd-labs/js-utils';
33
import { Address, Client, getAbiItem } from 'viem';
44

src/utils/viem/events/votingMachine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IVotingMachineWithProofs_ABI } from '@bgd-labs/aave-address-book';
1+
import { IVotingMachineWithProofs_ABI } from '@bgd-labs/aave-address-book/abis';
22
import { strategicGetLogs } from '@bgd-labs/js-utils';
33
import { Address, Client, getAbiItem } from 'viem';
44

src/utils/viem/getGovCoreConfigs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IGovernanceDataHelper_ABI } from '@bgd-labs/aave-address-book';
1+
import { IGovernanceDataHelper_ABI } from '@bgd-labs/aave-address-book/abis';
22
import { Client, Hex } from 'viem';
33
import { readContract } from 'viem/actions';
44

0 commit comments

Comments
 (0)