This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
add null/undefined union types to definitions for strict null checking #113
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.
I want to use the d3 v4 definitions (thank you very much for doing them BTW) in a project that has
--strictNullChecks
enabled. At certain points, the d3 definitions themselves made references tonull
s andundefined
s that caused errors in this mode. This PR adds the requirednull
/undefined
union types to the d3 definitions that make these errors go away (but don't affect usage in any way in non strict null checking mode).What is not in this PR are any tests to make sure that compilation under
--strictNullChecks
succeeds. I tried to fiddle around with the Gruntfile a bit to create such, but for some reason changing thestrictNullChecks
option there totrue
there did nothing, so in the end I just abandoned the effort altogether.