Skip to content

Commit f2facff

Browse files
feat(ci): add CI workflow for type checking and linting
1 parent c8c14a4 commit f2facff

File tree

3 files changed

+51
-35
lines changed

3 files changed

+51
-35
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI - Quality Check
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
quality:
11+
name: Type Check & Lint
12+
runs-on: ubuntu-latest
13+
14+
# Set the working directory to 'api' since that's where package.json is
15+
defaults:
16+
run:
17+
working-directory: ./api
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
cache: 'npm'
28+
cache-dependency-path: api/package-lock.json
29+
30+
- name: Install Dependencies
31+
run: npm ci
32+
33+
- name: Type Check
34+
# This runs the TypeScript compiler just to check for errors, not to emit files
35+
run: npx tsc --noEmit

api/nodemon.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"watch": ["./"],
33
"ext": "ts,json",
4-
"ignore": ["dist"],
4+
"ignore": ["dist", "node_modules"],
55
"exec": "tsx server.ts"
66
}

api/tsconfig.json

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,25 @@
11
{
2-
// Visit https://aka.ms/tsconfig to read more about this file
32
"compilerOptions": {
4-
// File Layout
5-
// "rootDir": "./src",
6-
// "outDir": "./dist",
3+
// 1. Change rootDir to current directory
4+
"rootDir": "./",
5+
"outDir": "./dist",
76

8-
// Environment Settings
9-
// See also https://aka.ms/tsconfig/module
7+
// 2. Standard settings
108
"module": "nodenext",
11-
"target": "esnext",
12-
"types": [],
13-
// For nodejs:
14-
// "lib": ["esnext"],
15-
// "types": ["node"],
16-
// and npm install -D @types/node
17-
18-
// Other Outputs
9+
"moduleResolution": "nodenext",
10+
"target": "es2022",
1911
"sourceMap": true,
2012
"declaration": true,
21-
"declarationMap": true,
22-
23-
// Stricter Typechecking Options
13+
"strict": true,
2414
"noUncheckedIndexedAccess": true,
2515
"exactOptionalPropertyTypes": true,
26-
27-
// Style Options
28-
// "noImplicitReturns": true,
29-
// "noImplicitOverride": true,
30-
// "noUnusedLocals": true,
31-
// "noUnusedParameters": true,
32-
// "noFallthroughCasesInSwitch": true,
33-
// "noPropertyAccessFromIndexSignature": true,
34-
35-
// Recommended Options
36-
"strict": true,
37-
"jsx": "react-jsx",
16+
"skipLibCheck": true,
3817
"verbatimModuleSyntax": true,
3918
"isolatedModules": true,
40-
"noUncheckedSideEffectImports": true,
41-
"moduleDetection": "force",
42-
"skipLibCheck": true,
43-
}
44-
}
19+
"moduleDetection": "force"
20+
},
21+
// 3. Include all TS files in this folder and subfolders
22+
"include": ["**/*.ts"],
23+
// 4. CRITICAL: Ignore node_modules and the build output
24+
"exclude": ["node_modules", "dist"]
25+
}

0 commit comments

Comments
 (0)