Fixed typescript props bug and added typescript compile to linting process #1485
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.
This PR fixes a small bug I found in the typescript definitions that wasn't caught by
eslint
.After some googling, I realized that
typescript-eslint
does not catch very specific typescript errors (like interface errors, or type mis-match errors). So the best way to ensure that all the typescript code (and definition files) are correct is to usetsc
to compile the typescript files in the project.tsc
will catch any type errors thattypescript-eslint
misses.So, I added
lint.ts
to our linting pipeline. It will simply build the typescript files (with no output generated thanks to thenoEmit
flag) and report any build errors. This caught the bug in our definitions, so I was able to fix it and re-lint and voila things are working!Note: The bug was that
VictoryCommonProps
and another interface both defined the same propcategories
(it was a mistake I introduced when fleshing out the demos). This isn't a breaking bug, just an annoying warning about duplicate definitions.