How to return void in JsDoc?

Is there a specified way to declare a method or a function to return void in JsDoc? Currently I am in the belief that void is the default return value, and other return values must be specifically...

Document collection (array of type) return value and parameter in JSDoc

How to document Array return value (and parameters) in JSDoc when array elements can be either of the following: A type (e.g. String, Array). An object literal.

How to specify resolution and rejection type of the promise in JSDoc?

I have some code that returns a promise object, e.g. using Q library for NodeJS. var Q = require('q'); /** * @returns ??? */ function task(err) { return err? Q.reject(new Error('Some...

Should JavaScript libraries use the deprecated annotation?

Obviously it's up to the developers as to when to deprecate and when to remove, but I'm wondering how to warn developers that a JavaScript function has been deprecated? Some popular languages...

documenting side-effects of javascript methods

I'm trying to improve the documentation of my javascript code, and am following the JSDoc guidelines https://jsdoc.app/. I can't find how to document an intentional side-effect. For example the...

Intellij Says "Unresolved variable or type" but it's defined using @name

This is ths code: /** * @name Me * @property {String} name * @property {Number} minVer * @property {Number} maxVer */ /** @type {Me} the moshe*/ var y; Why IntelliJ says that {Me} is not...

Is there a way to generate JSDoc comments in Visual Studio Code

I am currently developing a NodeJS project and found out that there is no built in functionality to create JSDoc comments for functions/methods. I am aware of the TypeScript definitions that exist...

Why does jsDoc not parse my comment that has no trailing code?

I added a new plugin to jsdoc, introducing a new tag: dictionary.defineTag("newtag", { mustHaveValue: false, canHaveType: false, canHaveName: true, onTagged: function(doclet, tag) { ...

JsDoc: How do I document that an object can have arbritrary (unknown) properties but with a particular type?

This is a similar to question 30360391. I want to express that the parameter of a function is a plain JS object that can have arbitrary properties (with unknown) names but all properties are...

tslint error: Asterik in jsdoc must be aligned

I keep getting this tslint error and don't see what's wrong with the code. Does anybody see an issues with the jsdoc asteriks below not being aligned correctly: /** * @ngdoc directive * @module...

JSDoc Include All Properties from Another @typedef Object

If I use JSDoc to create two objects, one of which has all of the properties of the other, how do I show that? For instance you'd have: /** * @typdef Foo * @type {Object} * @property {string}...

Disable eslint rules for folder

Is there a way to disable specific rules for a folder? For example, I don't want to have required JSDoc comments for all my test files in the test folder. Is there a way to do this?

JS Doc comment link method

In JavaScript comments, I want to mention a method present in some file. How can I link to that method in comment? Eg. Say my method is: function xyz() { } and say I am writing a comment like //...

Refer to type in different file in JSDoc without importing

I'm writing JavaScript (ES6) code in Visual Studio Code and enabled VSCode's type checking as explained in the VSCode docs. When referring to a type that is defined in another file (Track in the...

Generating swagger docs from typescript interfaces

I'm using swager-jsdoc to document all the DTOs of the app. I was wondering is there any way to generate the swagger docs automatically from typescript interfaces. I have a lot of them in the...

Swagger Bearer Authorization not usable in ui

I am using openApi 3.0 specification, koa2-swagger-ui, and swagger-jsdoc. I am trying to get the Authorize button on the swagger ui to allow me to enter a JWT token so my requests will be...

React Hooks - JSDoc with destructured array variables

I'm trying to JSDoc a simple React Typescript component with hooks. Unfortunately, I can't seem to find a way that makes JSDoc work with declared destructured arrays. There are some answers...

How to fix 'Definition for rule '@typescript-eslint/no-use-before-declare' was not found.eslint(@typescript-eslint/no-use-before-declare)'

I am new to eslint and I cannot figure out how to solve this issue. The beginning of my imports is always underlined with a red line. It complains about the definition not being found for the...

npm doesn't install node-gyp, error: ‘class v8::Object’ has no member named ‘ForceSet’

First project from work and got stuck with this tedious error on Ubuntu. Currently using node -v 13.8.0, installed python 2.7.17, GCC 7.5.0 also checked node-gyp npm page and installed all python...

JSDoc error 'description does not satisfy the regex pattern' from 'Comments in Typescript' plugin

The JSDoc for the code below always gives me the error Error: JSDoc description does not satisfy the regex pattern in typescript (using Comments in Typescript Plugin for VS Code) for producing...

Using // comment format for Intellisense

TL;DR: Where does the JS comment-appending behavior of the VSCode "Editor Hover" box come from and can it be adapted to use // comments? When editing .js/.ts files, VSCode shows a box when the...

How to resolve 'Assertions require every name in the call target to be declared with an explicit type annotation.ts(2775)'?

I have the JavaScript code below, and I'm using the TypeScript Compiler (TSC) to provide type-checking as per the Typescript Docs JSDoc Reference. const assert = require('assert'); const mocha =...

Parsing error: Cannot read file '.../tsconfig.json'.eslint

The error Parsing error: Cannot read file '.../tsconfig.json'.eslint shows in all .ts files in the src folder including index.ts. I have no idea how to set up configs. The issue just shows a red...

Did Firebase Cloud Functions ESLint change recently?

I created a cloud function project with firebase a few months ago, and used linting. I recently created a new cloud function project with linting, and now the linter is complaining about random...

How to pass a generic type argument with JSDoc?

Before giving up I wanted to give it a shot here. I have a definition file with typings like the following: /** * My json decode function, in reality very different * implementation (class like)...

Reference mongoose schema definition in swagger-jsdoc?

I've built a express.js project with a mongoDB backend using mongoose. Since I've created the mongoose models via mongoose schemas, I was wondering if it is possible to reference to the mongoose...

Monaco Editor (TypeScript): Decorate JSDoc or TSDoc with further buttons/links/actions

I'm using Microsoft Monaco Editor for TypeScript language. The TypeScript classes and functions have JSDoc. I'd like to add buttons/links/etc. to the existing JSDoc in order to invoke a JavaScript...

Typescript confusing error after .js file renamed to .tsx file

Sometimes when I try to rename a .jsx or .js file to .ts or .tsx I get a really frustrating error in my typescript compilation. TypeScript error in undefined(undefined,undefined): Type 'never'...

JSDoc + IDE vs. TypeScript

Premise With a properly maintained JSDoc, almost any modern IDE can identify a type mismatch (of assignments, functions' signatures/arguments) and many other issues that a non-strong-typed...

How does one make jsdoc actually output docs?

I'm trying to get jsdoc (version 3.6.7, using node 16) to turn my documented js code into actual documentation, but no matter what I do it just generates an out directory with an index.html that...