Check TypeScript errors during build #1081
Open
+84
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
npm run typegen
(andnpm run build
) now will check TypeScript errors.I migrated
jsconfig.json
totsconfig.json
becausetsc --build
can only recognizetsconfig.json
.tsc --build
is faster thantsc
becausetsc --build
has cache, so it's better to usetsc --build
.Since it reveals all typing errors now, I need to address all of them to make the build pass.
Most of them are just missing types in configs, like the one below:
For those errors, I simply add
@ts-expect-error
comment to let TypeScript ignore it. I use@ts-expect-error
instead of@ts-ignore
because we can remove those comments once we add missing types in the future.I fixed some other types issues that I can fix.
One thing I noticed is that MgpstrProcessor.batch_decode has different shape compared to the method in the parent class. This might not be a good idea.