diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bfa46112..65d8dadc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: with: node-version: 20 - run: npm ci + - run: npm run check:types - run: npm test - name: 'Build web app artifacts' diff --git a/.husky/pre-commit b/.husky/pre-commit index 6a485211c..0ef3e2c9e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -5,4 +5,5 @@ set -e npx pretty-quick --staged npm run lint +npm run check:types CI=true npm test diff --git a/package.json b/package.json index 468b85f1b..1d8010e8c 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "test": "vitest", "prepare": "husky install", "prettier": "prettier \"**/*.{ts,tsx}\" --write", - "lint": "eslint src --max-warnings=0" + "lint": "eslint src --max-warnings=0", + "check:types": "tsc && echo \"No type errors.\"" }, "eslintConfig": { "extends": [ diff --git a/tsconfig.json b/tsconfig.json index 0decd621e..4452bd1ee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,7 @@ "paths": { "trystero/torrent": ["../node_modules/trystero/src/torrent.d.ts"] }, - "types": ["vite-plugin-pwa/client", "vite/client"] + "types": ["vite-plugin-pwa/client", "vite/client", "vitest/globals"] }, "include": ["src"] }