Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Typecheck

on:
pull_request:
types: [opened, synchronize]
paths:
- "**/*.[tj]s"
- "**/*.?[tj]s"
- "tsconfig.json"
- "package.json"
- "package-lock.json"
- ".nvmrc"
- ".github/workflows/typecheck.yml"

jobs:
typecheck:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
# 6.0.3
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10

# v6.1.0
- name: Setup Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json

- name: Install npm packages
run: npm ci
Comment thread
roryabraham marked this conversation as resolved.

- name: Typecheck
run: npm run typecheck

- name: Tell people how to run the failing check
if: failure()
run: echo "::error::The typecheck check failed! To run it locally, run \`npm ci && npm run typecheck\` from the GitHub-Actions repo root."
160 changes: 160 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"private": true,
"type": "module",
"scripts": {
"typecheck": "tsgo --noEmit -p tsconfig.json",
"verify-peer-review": "tsx scripts/verifyPeerReview.ts"
},
"dependencies": {
"expensify-common": "2.0.189"
},
"devDependencies": {
"@types/node": "^25.9.4",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match Node types to the runtime version

This repo's .nvmrc pins the workflow/runtime to Node 24, but the new typecheck dependency pulls Node 25 ambient types. If a future script uses a Node 25-only API, CI typechecking will pass even though the script can fail under the Node 24 version installed by setup-node; pin @types/node to the Node 24 line so the check reflects the actual runtime.

Useful? React with 👍 / 👎.

"@typescript/native-preview": "7.0.0-dev.20260702.3",
"tsx": "^4.22.5"
}
}
13 changes: 13 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Bundler",
"target": "ES2022",
"types": ["node"],
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"esModuleInterop": true
},
"include": ["scripts/**/*.ts", "tests/**/*.ts"]
}
Loading