我正在使用highland.js,并安装了它的类型定义:
jq .dependencies package.json | grep highland
"@types/highland": "https://registry.npmjs.org/@types/highland/-/highland-1.14.30.tgz",
"highland": "^2.9.0",
我正在使用PhpStorm(它使用WebStorm组件的TypeScript)。
当我输入提示:
Highland.Stream<any>
PhpStorm抱怨Stream:
Corresponding file not included in tsconfig.json
然而,go to声明工作,它跳转到node_modules/@types/highland/index.d.ts:367
:
interface Stream<R> extends NodeJS.EventEmitter { ... }
我可以用tsc
很好地编译代码,没有错误,并且它按预期工作。PhpStorm/ WebStorm的问题是什么?
$ jq . tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es2016",
"dom"
],
"target": "es6",
"noImplicitAny": true,
"sourceMap": true,
"outDir": "dist",
"strictNullChecks": true,
"skipLibCheck": true,
"types": [
"node",
"mocha",
"chai",
"sinon"
]
},
"exclude": [
"node_modules",
"src/typings-custom/main.d.ts"
]
}
我试着将highland添加到types
中,但没有成功,我不知道错误告诉我什么。
2条答案
按热度按时间6g8kf2rb1#
我在Webstorm 2018上遇到了同样的问题。我关闭并重新打开Webstorm,瞧:红线不见了!我只是需要更新Webstorm我猜。由于Webstorm和PHPStorm都在同一个保护伞下,也许这对你也有用。
yebdmbv42#
只要去
File > Repair IDE
和工作以及。