diff --git a/.github/workflows/ts-packages.yml b/.github/workflows/ts-packages.yml index ec38fa9a19f9..8968fcb73999 100644 --- a/.github/workflows/ts-packages.yml +++ b/.github/workflows/ts-packages.yml @@ -138,6 +138,66 @@ jobs: verbose: true flags: sdk + depcheck: + name: Check for unused dependencies + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Fetch history + run: git fetch + + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: '16.x' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + # only install dependencies if there was a change in the deps + # if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install + + - name: Check packages/batch-submitter + working-directory: ./packages/batch-submitter + run: npx depcheck + + - name: Check packages/contracts + working-directory: ./packages/contracts + run: npx depcheck + + - name: Check packages/core-utils + working-directory: ./packages/core-utils + run: npx depcheck + + - name: Check packages/data-transport-layer + working-directory: ./packages/data-transport-layer + run: npx depcheck + + - name: Check packages/message-relayer + working-directory: ./packages/message-relayer + run: npx depcheck + + - name: Check packages/sdk + working-directory: ./packages/sdk + run: npx depcheck + + - name: Check integration-tests + working-directory: ./integration-tests + run: npx depcheck + lint: name: Linting runs-on: ubuntu-latest diff --git a/integration-tests/.depcheckrc b/integration-tests/.depcheckrc new file mode 100644 index 000000000000..3401fedfc718 --- /dev/null +++ b/integration-tests/.depcheckrc @@ -0,0 +1,8 @@ +ignores: [ + "@openzeppelin/contracts", + "@types/mocha", + "@types/rimraf", + "@uniswap/v3-core", + "mocha", + "typescript", +] \ No newline at end of file diff --git a/packages/contracts/.depcheckrc b/packages/contracts/.depcheckrc new file mode 100644 index 000000000000..df14a6c25291 --- /dev/null +++ b/packages/contracts/.depcheckrc @@ -0,0 +1,11 @@ +ignores: [ + "@codechecks/client", + "@ethersproject/transactions", + "@openzeppelin/contracts", + "@openzeppelin/contracts-upgradeable", + "@typechain/ethers-v5", + "prettier-plugin-solidity", + "solhint-plugin-prettier", + "ts-generator", + "yargs", +] \ No newline at end of file diff --git a/packages/sdk/.depcheckrc b/packages/sdk/.depcheckrc new file mode 100644 index 000000000000..aed57c26f51e --- /dev/null +++ b/packages/sdk/.depcheckrc @@ -0,0 +1,4 @@ +ignores: [ + "@eth-optimism/core-utils", + "ts-mocha", +] \ No newline at end of file