Typescript Intellij can';找不到tsconfig.json
我遇到Intellij无法找到我的Typescript Intellij can';找不到tsconfig.json,typescript,intellij-idea,tsconfig,Typescript,Intellij Idea,Tsconfig,我遇到Intellij无法找到我的tsconfig.json文件的问题。我的文件夹结构如下: /ui /src (all typescript files in here) tsconfig.json 在我的tsconfig.json文件中,我有: { "compilerOptions": { "outDir": "build/dist", "module": "esnext", "target": "es5", "lib": ["es7", "do
tsconfig.json
文件的问题。我的文件夹结构如下:
/ui
/src (all typescript files in here)
tsconfig.json
在我的tsconfig.json
文件中,我有:
{
"compilerOptions": {
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["es7", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": false,
"suppressImplicitAnyIndexErrors": true,
"experimentalDecorators": true,
"types": [
"node",
"webpack-env"
]
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest"
],
"include": [
"src/**/*"
]
}
Intellij知道如何使用command+B(转到声明)从“src”导航到我的src文件夹。如果我关闭Intellij并重新打开它,然后在Typescript中单击“CompileAll”,它甚至会将所有内容编译成Javascript。然后它报告错误错误:找不到父级“tsconfig.json”
。在那之后,它有时仍然编译成Typescript,但当我点击“编译全部”时,它永远不会编译成Typescript
这是Intellij bug吗?好像是一个。我刚刚升级到Intellij 2017.3,但我不确定我以前是否有过这个问题
Typescript版本是2.6.2,但我在使用2.5.3时遇到了同样的问题。我也遇到了同样的问题。我通过在Typescript下的设置中显式设置tsconfig.json的路径来解决这个问题(有一个选项输入字段): 其中./是我的项目中的根目录。你的情况可能不同,比如
-p ./ui/tsconfig.json
很高兴知道这个问题不仅仅是我的项目!虽然Intellij仍然显示未使用的函数。。。啊!谢谢你的提示。我打开了这张票。
-p ./ui/tsconfig.json