我正在使用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提示流:
Corresponding file not included in tsconfig.json
但是go声明起作用了,它跳转到
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"
]
}
我试图在
types
中添加高地无济于事,而且我也不知道错误告诉我什么。
最佳答案
我在Webstorm 2018中遇到了同样的问题。我关闭并重新打开了Webstorm,然后瞧,红线消失了!我只想刷新Webstorm。由于Webstorm和PHPStorm都位于同一保护伞下,因此也许这也将对您有用。
关于typescript - 如何解决WebStorm中的 "Corresponding file not included in tsconfig.json"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41144902/