Fra*_*cke 8 typescript tsconfig visual-studio-code angular tsconfig-paths
vscode 以某种方式不尊重我的 tsconfig.json(几个星期以来,它已经不同了。无论是我的错误还是 vscode 更新......)
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@foo-animation/*": [
"src/app/animation/*"
],
...
Run Code Online (Sandbox Code Playgroud)
分别在问题选项卡中:
找不到模块“@foo-animation/animation-micro”或其相应的类型声明。ts(2307)
? 常规基本路径(如@angular/core)已正确解决,只有我的“自定义”路径才是问题...
? 编译、构建、运行......一切都像魅力一样。所以我相信从角度/打字稿的角度来看一切都很好。(另外,我使用 IntelliJ 的开发人员没有问题......)所以它似乎归结为“告诉 vscode 关于它”......:-/
Mytsconfig.json位于项目的根文件夹中。唯一的问题是,我使用了另一个tsconfig.app.json,其中包括上面的tsconfig.json。
那么有没有办法告诉 vscode 在哪里寻找它的 tsconfig.json (鼓励解析这些路径)?
This SO question和this VSCode github issue可能相关,但我仍然不知道该怎么做。
小智 2
我最近在设置存储库时遇到了类似的问题,我认为将此行添加到您的 vscode settings.json 应该有所帮助:
"tslint.configFile": "./tslint.json"
Run Code Online (Sandbox Code Playgroud)
如果您的 tslint.json 不在根目录中,您应该添加自己的路径。
| 归档时间: |
|
| 查看次数: |
859 次 |
| 最近记录: |