Skip to content

vscode jsdoc import module type def not imported #46463

@shivshankar3578

Description

@shivshankar3578

@VScode:1.21
@node: 8.10

mod.js

/**
 *  @module mod
 */

/**
 * @typedef {Object} foobar
 * @property {String} foo
 * @property {Boolean} [bar] - Optional value
 */

/**
 * 
 * 
 * @param {string} foo 
 * @param {string} bar 
 * @return {foobar} 
 */
function doSomething (foo, bar) {
  console.log(foo, bar);
  // do something
  return {
	foo : foo,
	bar : bar
  }
}

let n = doSomething('a', 'b');

module.exports  = doSomething;

jsdoc.js

const mod = require('./mod');
let n = new mod('a', 'b'); 
console.log(n)

pic-1 n:foobar

pic-1

then why n:any here

pic-2

while imported module have foobar return type

pic-3

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions