Open jjspace opened 6 days ago
Thank you for the pull request, @jjspace!
:white_check_mark: We can confirm we have a CLA on file for you.
@javagl Would you mind taking a look at this? I think you've been looking into our type system and typescript adjacent stuff recently so you might be a good person to provide input.
After enabling the "Check JS" functionality in VS Code, it did complain about many things. But it did not generate the "...is possibly undefined" messages for me.
@javagl I sometimes find I have to run the Restart TS Server
or Reload Window
commands to refresh typescript. They seem to cache some things internally or something that makes it get out of sync, especially in JS environments that aren't actually TS
This is NOT in the scope of this PR, but I cannot look at the gulpfile.js without pointing out that this is one of my pet peeves
I fully agree with this sentiment, I'd love if the logic was centralized because I always forget to change both any time I touch this. Definitely outside the scope of this PR though. I'm happy to review a PR for cleaning up the gulpfile but as you say, every time I touch this file I'm worried about breaking something
Description
defined.d.ts
which will now get picked up and provide the correct type predicates and assertions so JS Type checking will understand things are defined after this callindex.d.ts
file for types like it will with the newdefined.d.ts
fileCheck.d.ts
for local development so the TS server understands it's a default export not an exported objectCesium.d.ts
andengine/index.d.ts
files should be identical to the previous ones.Issue number and link
No issue, just a small DX issue I've grown too tired of seeing
Testing plan
main
runnpm run built-ts
Source/Cesium.d.ts
andpackages/engine/index.d.ts
somewhere you can check laternpm run build-ts
defined
andCheck
locallyCheck JS
for type checking with the TS server (This may or may not be necessary, I'm not sure)main
the types aren't correct as shown above, verify that in this branch they areCheckJS
if you're not ready to see a lot of other (false positive) errors scattered in our codeAuthor checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change