Skip to content

Commit 09f8191

Browse files
committed
feat(middleware): add typechecking command and action
1 parent cfaf8d5 commit 09f8191

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,41 @@ jobs:
4545

4646
- name: Lint
4747
run: pnpm lint
48+
49+
tsc:
50+
name: Check types
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v3
55+
56+
- name: Setup Node
57+
uses: actions/setup-node@v3
58+
with:
59+
node-version: 18
60+
61+
- uses: pnpm/action-setup@v2
62+
name: Install pnpm
63+
with:
64+
version: 7
65+
run_install: false
66+
67+
- name: Get pnpm store directory
68+
id: pnpm-cache
69+
shell: bash
70+
run: |
71+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
72+
73+
- uses: actions/cache@v3
74+
name: Setup pnpm cache
75+
with:
76+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
77+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
78+
restore-keys: |
79+
${{ runner.os }}-pnpm-store-
80+
81+
- name: Install dependencies
82+
run: pnpm install --frozen-lockfile
83+
84+
- name: Check types
85+
run: pnpm tsc

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"start": "tsup src/index.ts --watch",
1818
"build": "tsup",
1919
"lint": "eslint src/ --ext ts",
20-
"test": "jest"
20+
"test": "jest",
21+
"tsc": "tsc --noEmit -p ."
2122
},
2223
"peerDependencies": {
2324
"next": ">=13.1"

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"noImplicitReturns": true,
2121
"noFallthroughCasesInSwitch": true,
2222
"moduleResolution": "node",
23+
"skipLibCheck": true,
2324
"baseUrl": "./",
2425
"jsx": "react",
2526
"esModuleInterop": true,

0 commit comments

Comments
 (0)