From dd52be3a01fca4831cccb82d7fe1585cfbfd01cf Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 17 Feb 2023 02:57:40 +0100 Subject: [PATCH] ci: run typecheck and eslint separately (#9966) * ci: run typecheck and eslint separately * fix syntax --- .github/workflows/lint.yml | 5 ++++- packages/backend/package.json | 4 +++- packages/frontend/package.json | 4 +++- packages/sw/package.json | 4 +++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6a579bffc8..94d7d1371c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,6 +36,9 @@ jobs: - backend - frontend - sw + lint: + - typecheck + - eslint steps: - uses: actions/checkout@v3.3.0 with: @@ -51,4 +54,4 @@ jobs: cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile - - run: pnpm --filter ${{ matrix.workspace }} run lint + - run: pnpm --filter ${{ matrix.workspace }} run ${{ matrix.lint }} diff --git a/packages/backend/package.json b/packages/backend/package.json index 90acaac754..52b0d74ad0 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -11,7 +11,9 @@ "watch:swc": "swc src -d built -D -w", "build": "tsc -p tsconfig.json || echo done. && tsc-alias -p tsconfig.json", "watch": "node watch.mjs", - "lint": "tsc --noEmit && eslint --quiet \"src/**/*.ts\"", + "typecheck": "tsc --noEmit", + "eslint": "eslint --quiet \"src/**/*.ts\"", + "lint": "pnpm typecheck && pnpm eslint", "jest": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit --runInBand", "jest-and-coverage": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --coverage --forceExit --runInBand", "jest-clear": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --clearCache", diff --git a/packages/frontend/package.json b/packages/frontend/package.json index bf22f7aaad..61c0135ba3 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -4,7 +4,9 @@ "scripts": { "watch": "vite", "build": "vite build", - "lint": "vue-tsc --noEmit && eslint --quiet \"src/**/*.{ts,vue}\"" + "typecheck": "vue-tsc --noEmit", + "eslint": "eslint --quiet \"src/**/*.{ts,vue}\"", + "lint": "pnpm typecheck && pnpm eslint" }, "dependencies": { "@discordapp/twemoji": "14.0.2", diff --git a/packages/sw/package.json b/packages/sw/package.json index 8650f9597b..4de260fcfc 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -4,7 +4,9 @@ "scripts": { "watch": "node build.js watch", "build": "node build.js", - "lint": "tsc --noEmit && eslint --quiet src/**/*.ts" + "typecheck": "tsc --noEmit", + "eslint": "eslint --quiet src/**/*.ts", + "lint": "pnpm typecheck && pnpm eslint" }, "dependencies": { "esbuild": "0.14.42",