WIP: chore: Use JSDocs #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using JSDocs makes for a nicer IDE experience when hovering over symbols. Also it contains a
@throwskeyword that highlights which methods should be wrapped in atry/catchwhen used in a production application to prevent hard crashes.If this is okay to do, I'll update everything else to include additional JSDoc info.
@ -234,0 +254,4 @@* @param {Object} config - The configuration object for deserialization.* @param {Schema} config.schema - The schema to use. (Required)* @param {readonly Plugin[]} [config.plugins] - The set of active plugins. (Optional)* @param {any} json - The JSON representation of the state.This type of JSDoc could be updated to have a link to the Typescript Type and also be extended to show properties within the object -- though a bit redundant with TS.
No, this is not something we're going to do. The
dist/files do provide JSDoc commens so that TypeScript will pick them up. The source files will continue to use the current format.Fair enough - how about documenting which methods will throw an error? If a library is going to cause a hard application crash I think that sort of thing should be apparent without having to dig into source code.
That's done in prose, in the doc comments.
What do you mean by "That's done in prose" - I'm not super familiar with this project / just started testing it out. Do you mind pointing me in the direction of where I can see this info?
When I hover over for intellisense to see the comments I get this:

In the reference docs:

If you'd like, I'd gladly open a PR to update the docs with this info (unless it already exists somewhere)
I mean the exception is mentioned in the doc text (for example here).
Pull request closed