我在vscode中遇到了一个问题,当我在另一个js文件中导入一个js类时,我看不到该类中定义的jsdocs。
./src/person/index.js
/**
* This is a person class.
*/
export default class Person{
/**
* Person constructor
* @param {string} Name of the person
* @param {number} Age of the person
*/
constructor(name, age){
this.name = name;
this.age = age;
}
}
./src/index.js
import { Person } from './src/person/index.js'
const jim = new Person("him", 88) // jsdoc is not recognized
1条答案
按热度按时间ruarlubt1#
./src/index.js
jim
不是字符串。您应该更改"jim"