diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a167842 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: Code Check + +on: + push: + branches: + - main + pull_request: {} + +concurrency: + group: ${{ github.job }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + name: Lint + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Lint + run: npm run lint:check + - name: Prettier + run: npm run format:check diff --git a/package.json b/package.json index 070df8e..9cbc0a0 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,13 @@ "postinstall": "npx prisma generate", "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"", "serve": "nest start", "serve:dev": "nest start --watch", "serve:debug": "nest start --debug --watch", "serve:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", + "lint:check": "eslint \"{src,apps,libs,test}/**/*.ts\"", "test": "jest", "test:watch": "test jest --watch", "test:cov": "jest --coverage", diff --git a/src/api/pairs/controller.ts b/src/api/pairs/controller.ts index 985791f..a38da5b 100644 --- a/src/api/pairs/controller.ts +++ b/src/api/pairs/controller.ts @@ -149,9 +149,8 @@ the real response type is \`Array>\``, @Query('only-listed') onlyListedStr: string, //false | true ): Promise { const onlyListed = !!onlyListedStr && onlyListedStr !== 'false'; - const pairs = await this.pairsService.getAllPairsWithLiquidityInfo( - !!onlyListed, - ); + const pairs = + await this.pairsService.getAllPairsWithLiquidityInfo(!!onlyListed); const edges = pairs.map((data) => ({ data, t0: data.token0.address,