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

JSDoc updates to pass checkJs #1171

Closed
wants to merge 6 commits into from

Conversation

brodycj
Copy link

@brodycj brodycj commented Jul 22, 2018

Proposed updates by @rbiggs and @brodybits to pass tsc --checkJs from GH-1161, including new changes proposed by @brodybits in rbiggs/preact#4, squashed and rebased on master branch.

@coveralls
Copy link

coveralls commented Jul 22, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 7f53806 on brodybits:check-js-updates into b8a117a on developit:master.

Wobbabits and others added 2 commits July 22, 2018 21:39
* Improved JSDoc comments for better type check in VSCode with
  “implicitProjectConfig.checkJs": true” to enable type checking for
  JavaScript.
* Introduced JSDoc type casting to solve problems with type coercion.
* Updated JSDoc comment for VNode. Attribures property was set to type
  “object”. Unfortunately JSDoc types “object” and “Object” get
   treated as type “any” by TypeScript. To indicate a generic object
   you have to use this signature: Object.<string, any>.
* Add type cast for Ctor being called with new keyword to avoid
   warning "Cannot use 'new' with an expression whose type lacks a
   call or construct signature".
* Added type casting where type is a function, but original value
  could be a string as well. This tells type checker that the value
  can be called.
* Added numerous type casts in diff.js to resolve type conflicts,
  where type coercion would happen during runtime in browser,
  but static type checkers can’t foresee.
* Type casting adds an extra pair of parens around the value being
  cast. But these are removed during minification.
* Moved JSDoc imports to the beginning of each module.
* Other minor updates and fixes

Now passes tsc --checkJs

Co-authored-by: Robert Biggs <[email protected]>
Co-authored-by: Christopher J. Brody <[email protected]>
@brodycj
Copy link
Author

brodycj commented Jul 30, 2018

Closing, for now at least.

@brodycj brodycj closed this Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants