I am a facade NodeJS module that simplifies interaction with the Shopify API for my backend’s needs. I have a function that returns a promise that when resolved, contains an object with the shop’s details (id, email, country, currency, etc).
I want to use JSDoc to document those properties to make the life of our devs easier (we are all using VSCode and Intellisense picks up JSDoc type definitions with zero config).
Unfortunately, the fields list returned by that API call is huge so I end up with a single line spanning multiple columns looking like this:
@return {Promise<{id, name, email, domain, province, country, address1, zip, city, source, phone, latitude, longitude, primary_locale, address2, created_at, updated_at, country_code, country_name, currency, customer_email, timezone, shop_owner, money_format, weight_unit, province_code, taxes_included.....
Is there a way to break this into separate lines and maintain both VSCode syntax highlight in the JSDoc and working Intellisense?
2
Answers
If you are using typescript (I assume that from the generic definition) I’d suggest to extract the generic type into a separate interface:
I know the question has been asked long ago meanwhile, but I found a solution that might be interesting fo other users:
Simply put a
<br>
tag between the items you want to display in a new line.It works in the VS Code as well as in the created documentation!