Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check types in CI #1070

Merged
merged 2 commits into from
Nov 20, 2024
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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ jobs:
- run: npm run lint:static-site
- run: node ./scripts/check-resource-index-match.js

type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: npm ci
- run: npm run type-check:ci

# Build into Heroku slug so we can deploy the same build that we test.
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"lint": "npm run lint:server",
"lint:server": "DEBUG=eslint:cli-engine npx eslint --max-warnings=0 --ext .js,.jsx .",
"lint:static-site": "cd static-site && DEBUG=eslint:cli-engine npx eslint --max-warnings=0 --ext .js,.jsx,.ts,.tsx .",
"type-check": "cd static-site && tsc",
victorlin marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

... ./build.sh && cd static-site && tsc here?

"type-check:ci": "npm run build && cd static-site && tsc",
"server": "node server.js",
"groups": "node server.js --app ./src/groupsApp.js",
"start": "npm run server",
Expand Down
20 changes: 0 additions & 20 deletions static-site/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
declare module "*.css" {
const value: unknown;
export default value;
}

declare module "*.jpg" {
const value: { src: string };
export default value;
}

declare module "*.png" {
const value: { src: string };
export default value;
}

declare module "*.svg" {
const value: { src: string };
export default value;
}

declare module "*.yaml" {
// Actual type should be set upon import via type assertion.
const contents: unknown;
Expand Down