diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 63ade28..d710f3d 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 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 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/app/dealClient/_components/WriteContractFunctionForm.tsx b/packages/nextjs/app/dealClient/_components/WriteContractFunctionForm.tsx index 51542d7..7c00ece 100644 --- a/packages/nextjs/app/dealClient/_components/WriteContractFunctionForm.tsx +++ b/packages/nextjs/app/dealClient/_components/WriteContractFunctionForm.tsx @@ -183,6 +183,7 @@ const DealForm = ({ const endEpoch = dealInputs.start_epoch + months * 43200; handleInputChange({ ...e, + // @ts-ignore: number to string conversion target: { ...e.target, name: "end_epoch", value: endEpoch }, }); }; 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 (