-
Notifications
You must be signed in to change notification settings - Fork 48
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
Check types in CI #1070
Conversation
5e9722e
to
4fa273c
Compare
4fa273c
to
7b7fca4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking commentary.
.github/workflows/ci.yml
Outdated
- run: npm run build | ||
- run: npm run type-check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the type-checking depends on having a build, wouldn't it be better to include the build part in the type-check
entry in package.json:scripts
?
IOW, make this only npm run type-check
here and...
@@ -17,6 +17,7 @@ | |||
"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", |
There was a problem hiding this comment.
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?
Previously, the only enforcement of TypeScript was through ESLint rules from @typescript-eslint. Note that a build is necessary before checking to generate the static-site/next-env.d.ts file which provides types from Next.js.
These are provided by Next.js in static-site/next-env.d.ts, which is generated during build.
7b7fca4
to
8ea90e5
Compare
@genehack good point. I've added a separate |
👍 I was hoping that |
Description of proposed changes
Previously, the only enforcement of TypeScript was through ESLint rules from @typescript-eslint.
Related issues
Image
usage to avoid type error [#1072] #1080Checklist