From 0e195c5d65b3525e71381799d36e83977881536d Mon Sep 17 00:00:00 2001 From: ianwoodard <17186604+IanWoodard@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:02:31 -0700 Subject: [PATCH 1/2] Linting --- earn/src/components/advanced/BorrowGraph.tsx | 8 ++++---- earn/src/hooks/UseRedeem.ts | 9 ++------- earn/src/pages/AdvancedPage.tsx | 6 +----- earn/src/pages/MarketsPage.tsx | 11 ++++++----- earn/src/pages/PortfolioPage.tsx | 7 +------ shared/src/hooks/UseBorrowerNft.ts | 11 +++++++---- 6 files changed, 21 insertions(+), 31 deletions(-) diff --git a/earn/src/components/advanced/BorrowGraph.tsx b/earn/src/components/advanced/BorrowGraph.tsx index 24bf93f0..147f4436 100644 --- a/earn/src/components/advanced/BorrowGraph.tsx +++ b/earn/src/components/advanced/BorrowGraph.tsx @@ -1,14 +1,14 @@ import { LABEL_TEXT_COLOR } from 'shared/lib/components/common/Modal'; import { Text } from 'shared/lib/components/common/Typography'; -import useMediaQuery from 'shared/lib/hooks/UseMediaQuery'; -import styled from 'styled-components'; - -import BorrowGraphTooltip from './BorrowGraphTooltip'; import { RESPONSIVE_BREAKPOINT_MD, RESPONSIVE_BREAKPOINT_SM, RESPONSIVE_BREAKPOINTS, } from 'shared/lib/data/constants/Breakpoints'; +import useMediaQuery from 'shared/lib/hooks/UseMediaQuery'; +import styled from 'styled-components'; + +import BorrowGraphTooltip from './BorrowGraphTooltip'; import Graph from '../graph/Graph'; const TEXT_COLOR = '#82a0b6'; diff --git a/earn/src/hooks/UseRedeem.ts b/earn/src/hooks/UseRedeem.ts index 625bdf75..6c7d827d 100644 --- a/earn/src/hooks/UseRedeem.ts +++ b/earn/src/hooks/UseRedeem.ts @@ -2,12 +2,7 @@ import { lenderLensAbi } from 'shared/lib/abis/LenderLens'; import { ALOE_II_LENDER_LENS_ADDRESS } from 'shared/lib/data/constants/ChainSpecific'; import { GN } from 'shared/lib/data/GoodNumber'; import { Address, erc4626Abi, maxUint256, zeroAddress } from 'viem'; -import { - useReadContract, - useReadContracts, - useSimulateContract, - useWriteContract, -} from 'wagmi'; +import { useReadContract, useReadContracts, useSimulateContract, useWriteContract } from 'wagmi'; export enum RedeemState { WAITING_FOR_INPUT, @@ -65,7 +60,7 @@ export function useRedeem( }); const shares = sharesData ?? 0n; - const threshold = maxShares * 999n / 1000n; + const threshold = (maxShares * 999n) / 1000n; const shouldRedeemMax = shares >= threshold && maxSharesIsChanging; /*////////////////////////////////////////////////////////////// diff --git a/earn/src/pages/AdvancedPage.tsx b/earn/src/pages/AdvancedPage.tsx index 2dfffd15..330aeca9 100644 --- a/earn/src/pages/AdvancedPage.tsx +++ b/earn/src/pages/AdvancedPage.tsx @@ -322,11 +322,7 @@ export default function AdvancedPage() { /> - + - } - onClick={() => {}} - /> + } onClick={() => {}} />
diff --git a/shared/src/hooks/UseBorrowerNft.ts b/shared/src/hooks/UseBorrowerNft.ts index 90bd3944..922e8585 100644 --- a/shared/src/hooks/UseBorrowerNft.ts +++ b/shared/src/hooks/UseBorrowerNft.ts @@ -208,10 +208,13 @@ export function useBorrowerNfts( const { borrowers, refetchBorrowers } = useBorrowers(uniswapPools, borrowerNftRefs, chainId, staleTime); const borrowerNfts = useMemo(() => { - return borrowerNftRefs.map((borrowerNftRef, i) => ({ - ...borrowerNftRef, - borrower: borrowers.at(i), - } as BorrowerNft)); + return borrowerNftRefs.map( + (borrowerNftRef, i) => + ({ + ...borrowerNftRef, + borrower: borrowers.at(i), + } as BorrowerNft) + ); }, [borrowerNftRefs, borrowers]); return { borrowerNfts, refetchBorrowerNftRefs, refetchBorrowers }; From fef50cb835075a846689935e0967060c6b1c4ac5 Mon Sep 17 00:00:00 2001 From: ianwoodard <17186604+IanWoodard@users.noreply.github.com> Date: Sun, 16 Jun 2024 12:06:05 -0700 Subject: [PATCH 2/2] Updating testing deps --- earn/package.json | 6 ++-- prime/package.json | 6 ++-- yarn.lock | 84 ++++++++++++++++++++++------------------------ 3 files changed, 46 insertions(+), 50 deletions(-) diff --git a/earn/package.json b/earn/package.json index f7872dee..82746bb3 100644 --- a/earn/package.json +++ b/earn/package.json @@ -19,9 +19,9 @@ "@tanstack/query-sync-storage-persister": "^5.37.1", "@tanstack/react-query": "5.35.1", "@tanstack/react-query-persist-client": "^5.37.1", - "@testing-library/jest-dom": "^5.16.1", - "@testing-library/react": "^12.1.2", - "@testing-library/user-event": "^13.5.0", + "@testing-library/jest-dom": "^6.4.6", + "@testing-library/react": "^16.0.0", + "@testing-library/user-event": "^14.5.2", "@types/big.js": "^6.1.2", "@types/jest": "^27.4.0", "@types/node": "^16.11.22", diff --git a/prime/package.json b/prime/package.json index b729ca4f..2fdfec7c 100644 --- a/prime/package.json +++ b/prime/package.json @@ -18,9 +18,9 @@ "@tanstack/query-sync-storage-persister": "^5.37.1", "@tanstack/react-query": "5.35.1", "@tanstack/react-query-persist-client": "^5.37.1", - "@testing-library/jest-dom": "^5.16.1", - "@testing-library/react": "^12.1.2", - "@testing-library/user-event": "^13.5.0", + "@testing-library/jest-dom": "^6.4.6", + "@testing-library/react": "^16.0.0", + "@testing-library/user-event": "^14.5.2", "@types/big.js": "^6.1.2", "@types/jest": "^27.4.0", "@types/node": "^16.11.22", diff --git a/yarn.lock b/yarn.lock index 86df637c..c0b86b31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.3.3.tgz#90749bde8b89cd41764224f5aac29cd4138f75ff" integrity sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ== +"@adobe/css-tools@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.4.0.tgz#728c484f4e10df03d5a3acd0d8adcbbebff8ad63" + integrity sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ== + "@adraffy/ens-normalize@1.10.0": version "1.10.0" resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" @@ -1205,7 +1210,7 @@ preact "^10.16.0" sha.js "^2.4.11" -"@coinbase/wallet-sdk@^3.5.3": +"@coinbase/wallet-sdk@^3.5.3", "cbw-sdk@npm:@coinbase/wallet-sdk@3.9.3": version "3.9.3" resolved "https://registry.yarnpkg.com/@coinbase/wallet-sdk/-/wallet-sdk-3.9.3.tgz#daf10cb0c85d0363315b7270cb3f02bedc408aab" integrity sha512-N/A2DRIf0Y3PHc1XAMvbBUu4zisna6qAdqABMZwBMNEfWrXpAwx16pZGkYCLGE+Rvv1edbcB2LYDRnACNcmCiw== @@ -3613,6 +3618,20 @@ lodash "^4.17.15" redent "^3.0.0" +"@testing-library/jest-dom@^6.4.6": + version "6.4.6" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.6.tgz#ec1df8108651bed5475534955565bed88c6732ce" + integrity sha512-8qpnGVincVDLEcQXWaHOf6zmlbwTKc6Us6PPu4CRnPXCzo2OGBS5cwgMMOWdxDpEz1mkbvXHpEy99M5Yvt682w== + dependencies: + "@adobe/css-tools" "^4.4.0" + "@babel/runtime" "^7.9.2" + aria-query "^5.0.0" + chalk "^3.0.0" + css.escape "^1.5.1" + dom-accessibility-api "^0.6.3" + lodash "^4.17.21" + redent "^3.0.0" + "@testing-library/react@^12.1.2": version "12.1.5" resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-12.1.5.tgz#bb248f72f02a5ac9d949dea07279095fa577963b" @@ -3622,6 +3641,13 @@ "@testing-library/dom" "^8.0.0" "@types/react-dom" "<18.0.0" +"@testing-library/react@^16.0.0": + version "16.0.0" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-16.0.0.tgz#0a1e0c7a3de25841c3591b8cb7fb0cf0c0a27321" + integrity sha512-guuxUKRWQ+FgNX0h0NS0FIq3Q3uLtWVpBzcLOggmfMoUpgBnzBzvLLd4fbm6yS8ydJd94cIfY4yP9qUQjM2KwQ== + dependencies: + "@babel/runtime" "^7.12.5" + "@testing-library/user-event@^13.5.0": version "13.5.0" resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-13.5.0.tgz#69d77007f1e124d55314a2b73fd204b333b13295" @@ -3629,6 +3655,11 @@ dependencies: "@babel/runtime" "^7.12.5" +"@testing-library/user-event@^14.5.2": + version "14.5.2" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.5.2.tgz#db7257d727c891905947bd1c1a99da20e03c2ebd" + integrity sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ== + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -6154,21 +6185,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -"cbw-sdk@npm:@coinbase/wallet-sdk@3.9.3": - version "3.9.3" - resolved "https://registry.yarnpkg.com/@coinbase/wallet-sdk/-/wallet-sdk-3.9.3.tgz#daf10cb0c85d0363315b7270cb3f02bedc408aab" - integrity sha512-N/A2DRIf0Y3PHc1XAMvbBUu4zisna6qAdqABMZwBMNEfWrXpAwx16pZGkYCLGE+Rvv1edbcB2LYDRnACNcmCiw== - dependencies: - bn.js "^5.2.1" - buffer "^6.0.3" - clsx "^1.2.1" - eth-block-tracker "^7.1.0" - eth-json-rpc-filters "^6.0.0" - eventemitter3 "^5.0.1" - keccak "^3.0.3" - preact "^10.16.0" - sha.js "^2.4.11" - chalk@5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" @@ -7447,6 +7463,11 @@ dom-accessibility-api@^0.5.6, dom-accessibility-api@^0.5.9: resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== +dom-accessibility-api@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz#993e925cc1d73f2c662e7d75dd5a5445259a8fd8" + integrity sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w== + dom-converter@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" @@ -14873,7 +14894,7 @@ string-similarity@^4.0.3: resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b" integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -14891,15 +14912,6 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -14983,7 +14995,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -14997,13 +15009,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -16610,7 +16615,7 @@ workbox-window@6.6.1: "@types/trusted-types" "^2.0.2" workbox-core "6.6.1" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -16637,15 +16642,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"