deno
deno copied to clipboard
`deno doc --lint` says no return type annotation error for JS code
A JS code for a function with @returns JSDoc below:
any_mod.js
/**
* Module description here
*
* @module
*/
/**
* Function description here
*
* @returns {number} Return value description
*/
export function any_func() {
return 0;
}
Then doc lint it:
deno doc --lint *.js
The linter returns the error:
error[missing-return-type]: exported function is missing an explicit return type annotation
--> /home/akuad/work/any_mod.js:12:1
|
12 | export function any_func() {
| ^
error: Found 1 documentation lint error.
It says 'missing an explicit return type annotation', but type annotation is for TS, not for JS.
I suggest to be skipped the 'missing-return-type' error for JS functions what having @return/@returns JSDoc.
Or is this linter for TS only, not for JS?
Add (12/02/2025): It occurs at Deno version 2.5.4