From c443f863c68e6deac75d7f2b085dc7320f14b836 Mon Sep 17 00:00:00 2001 From: MattWong-ca Date: Sun, 24 Nov 2024 19:42:09 -0500 Subject: [PATCH 1/4] update Akave CI --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 63ade28..6732252 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,7 +3,7 @@ name: Lint on: push: branches: - - main + - '*' pull_request: branches: - main From 490fed89efd6b617cc0aea2b254c7ca852dcc5be Mon Sep 17 00:00:00 2001 From: MattWong-ca Date: Sun, 24 Nov 2024 19:50:09 -0500 Subject: [PATCH 2/4] update CI --- .github/workflows/lint.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6732252..decf4fd 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -27,17 +27,25 @@ jobs: node-version: ${{ matrix.node }} cache: yarn + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + - name: Install dependencies run: yarn install --immutable - - name: Run hardhat node, deploy contracts (& generate contracts typescript output) - run: yarn chain & yarn deploy + - name: Compile contracts + run: | + cd packages/hardhat + yarn hardhat clean + yarn compile - name: Run nextjs lint - run: yarn next:lint --max-warnings=0 + run: yarn next:lint - name: Check typings on nextjs run: yarn next:check-types - name: Run hardhat lint - run: yarn hardhat:lint --max-warnings=0 \ No newline at end of file + run: yarn hardhat:lint \ No newline at end of file From e4cb3678d7d712dbd8c23a4adbc2120ccd7dd546 Mon Sep 17 00:00:00 2001 From: MattWong-ca Date: Sun, 24 Nov 2024 19:58:03 -0500 Subject: [PATCH 3/4] update scripts --- package.json | 4 +++- packages/hardhat/.eslintignore | 8 ++++++++ packages/hardhat/.eslintrc.json | 20 ++++++++++++++++++++ packages/hardhat/.prettierrc.json | 19 +++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 packages/hardhat/.eslintignore create mode 100644 packages/hardhat/.eslintrc.json create mode 100644 packages/hardhat/.prettierrc.json diff --git a/package.json b/package.json index b32eb4e..78c2d93 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,13 @@ "fork": "yarn workspace @fil-frame/hardhat fork", "generate": "yarn workspace @fil-frame/hardhat run scripts/generateAccount.ts", "flatten": "yarn workspace @fil-frame/hardhat flatten", - "lint": "yarn workspace @fil-frame/hardhat eslint --config ./.eslintrc.json --ignore-path ./.eslintignore ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts", + "next:lint": "yarn workspace @fil-frame/hardhat eslint --config ./.eslintrc.json --ignore-path ./.eslintignore ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts", + "next:check-types": "yarn workspace @fil-frame/nextjs check-types", "lint-staged": "yarn workspace @fil-frame/hardhat eslint --config ./.eslintrc.json --ignore-path ./.eslintignore", "format": "yarn workspace @fil-frame/hardhat prettier --write ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts", "verify": "yarn workspace @fil-frame/hardhat etherscan-verify", "hardhat-verify": "yarn workspace @fil-frame/hardhat verify", + "hardhat:lint": "yarn workspace @fil-frame/hardhat lint", "deploy": "yarn workspace @fil-frame/hardhat deploy", "deploy:verify": "yarn workspace @fil-frame/hardhat deploy:verify", "chain": "yarn workspace @fil-frame/hardhat chain", diff --git a/packages/hardhat/.eslintignore b/packages/hardhat/.eslintignore new file mode 100644 index 0000000..faef36d --- /dev/null +++ b/packages/hardhat/.eslintignore @@ -0,0 +1,8 @@ +# folders +artifacts +cache +contracts +node_modules/ +typechain-types +# files +**/*.json \ No newline at end of file diff --git a/packages/hardhat/.eslintrc.json b/packages/hardhat/.eslintrc.json new file mode 100644 index 0000000..edb3c31 --- /dev/null +++ b/packages/hardhat/.eslintrc.json @@ -0,0 +1,20 @@ +{ + "env": { + "node": true + }, + "parser": "@typescript-eslint/parser", + "extends": [ + "plugin:prettier/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-explicit-any": "off", + "prettier/prettier": [ + "warn", + { + "endOfLine": "auto" + } + ] + } +} \ No newline at end of file diff --git a/packages/hardhat/.prettierrc.json b/packages/hardhat/.prettierrc.json new file mode 100644 index 0000000..7cdc6f4 --- /dev/null +++ b/packages/hardhat/.prettierrc.json @@ -0,0 +1,19 @@ +{ + "arrowParens": "avoid", + "printWidth": 120, + "tabWidth": 2, + "trailingComma": "all", + "overrides": [ + { + "files": "*.sol", + "options": { + "printWidth": 80, + "tabWidth": 4, + "useTabs": true, + "singleQuote": false, + "bracketSpacing": true, + "explicitTypes": "always" + } + } + ] +} \ No newline at end of file From a1c2526de040cdb21bf9a5a334c5fb13ff400112 Mon Sep 17 00:00:00 2001 From: MattWong-ca Date: Sun, 24 Nov 2024 20:07:09 -0500 Subject: [PATCH 4/4] type assertions --- .../app/blockexplorer/_components/AddressComponent.tsx | 4 ++-- .../nextjs/app/blockexplorer/_components/ContractTabs.tsx | 6 +++--- packages/nextjs/components/assets/BlueBox.tsx | 2 +- packages/nextjs/components/assets/Logo.tsx | 2 +- packages/nextjs/components/assets/LogoLandscape.tsx | 2 +- packages/nextjs/components/assets/LogoWithText.tsx | 2 +- packages/nextjs/components/assets/RedArrow.tsx | 2 +- packages/nextjs/components/assets/RedPopBox.tsx | 2 +- packages/nextjs/components/assets/YellowCircle.tsx | 2 +- packages/nextjs/components/svg/Logo.tsx | 2 +- packages/nextjs/components/svg/LogoLandscape.tsx | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/nextjs/app/blockexplorer/_components/AddressComponent.tsx b/packages/nextjs/app/blockexplorer/_components/AddressComponent.tsx index fb975a4..3e60921 100644 --- a/packages/nextjs/app/blockexplorer/_components/AddressComponent.tsx +++ b/packages/nextjs/app/blockexplorer/_components/AddressComponent.tsx @@ -19,10 +19,10 @@ export const AddressComponent = ({
-
+
Balance: - +
diff --git a/packages/nextjs/app/blockexplorer/_components/ContractTabs.tsx b/packages/nextjs/app/blockexplorer/_components/ContractTabs.tsx index f19588c..8a2b548 100644 --- a/packages/nextjs/app/blockexplorer/_components/ContractTabs.tsx +++ b/packages/nextjs/app/blockexplorer/_components/ContractTabs.tsx @@ -32,7 +32,7 @@ export const ContractTabs = ({ address, contractData }: PageProps) => { useEffect(() => { const checkIsContract = async () => { - const contractCode = await publicClient.getBytecode({ address: address }); + const contractCode = await publicClient.getBytecode({ address: address as `0x${string}` }); setIsContract(contractCode !== undefined && contractCode !== "0x"); }; @@ -85,8 +85,8 @@ export const ContractTabs = ({ address, contractData }: PageProps) => { {activeTab === "code" && contractData && ( )} - {activeTab === "storage" && } - {activeTab === "logs" && } + {activeTab === "storage" && } + {activeTab === "logs" && } ); }; diff --git a/packages/nextjs/components/assets/BlueBox.tsx b/packages/nextjs/components/assets/BlueBox.tsx index e6faeec..1e067dd 100644 --- a/packages/nextjs/components/assets/BlueBox.tsx +++ b/packages/nextjs/components/assets/BlueBox.tsx @@ -1,4 +1,4 @@ -export default function BlueBox(props) { +export default function BlueBox(props: any) { return (