作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 JSDoc 中使用 ES2015 类作为类型时,在通过 require 语句导入该类的文件中似乎无法正常工作。
在定义类的同一文件中工作时,一切都按预期工作(如下所示)。
在不同的文件中工作时,该类似乎可以正确导入并显示其构造函数类型(如下所示)。
但是当我尝试使用该类进行输入时(如第一张图片中所做的那样),它不再将我的类视为有效类型。
这是我用于此示例的 jsconfig
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
}
}
最佳答案
这个答案可能有点晚了,但你最后一张图片的第 6 行应该是:
@param {ExampleType} exampleType
关于javascript - 来自 JSDoc 的 Intellisense 不适用于 VSCode 中的导入类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40877203/
我是一名优秀的程序员,十分优秀!