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

#3 Add type checker for json files #5

Merged
merged 2 commits into from
Jan 18, 2022
Merged

Conversation

thekingofcity
Copy link
Member

@thekingofcity thekingofcity commented Jan 16, 2022

Use ts-node and ttypescript.

  1. $Env:TS_NODE_COMPILER="ttypescript"
  2. node --loader ts-node/esm .\checker\check.ts

This checker may be used in CI with little modification since any invalid json will process.exit(1); immediately.

During the development, I find a mismatch of dortmund and durtmund.

@thekingofcity
Copy link
Member Author

TypeStrong/ts-node#313
TypeStrong/ts-node#1007

Note that the ES6 module is not supported by default (CommonJS) so an extra command line is used.
https://stackoverflow.com/questions/62096269/cant-run-my-node-js-typescript-project-typeerror-err-unknown-file-extension

Use ttypescript when ts-node/esm is enabled.
https://github.com/TypeStrong/ts-node#transpilation

@wongchito
Copy link
Member

Approved. Feel free to merge. Thanks!

@thekingofcity thekingofcity merged commit f2fb322 into master Jan 18, 2022
@thekingofcity thekingofcity linked an issue Jan 18, 2022 that may be closed by this pull request
@thekingofcity thekingofcity deleted the #3-type-checker branch January 18, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add type checker for json files
2 participants