diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 63ade28..decf4fd 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 @@ -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