Improve Readability by Annotating Types with JSDoc

Tomasz Ducin
InstructorTomasz Ducin
Share this video with your friends

Social Share Links

Send Tweet
Published 5 months ago
Updated 2 weeks ago

JSDoc allows you to add more context to what is displayed to your type when you hover over a value in your editor. We'll go over a basic use case of adding comments to our Type Alias so those will appear when we hover over them.

[00:00] When creating type aliases provide the JS doc annotations briefly defining what is the purpose of this type. In our case, the money type is intended only for money related values and the skill type represents an employee skill. Whenever anyone hovers over [00:19] the type, they will see the type's relevant information. This can include links to tasks and documentation, but it can also be information about relations to other types used within the system. Of course, providing JsDoc could be useful in many other situations.

egghead
egghead
~ 19 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today