简体   繁体   English

VS 代码 angular 和 typescript 在 templateUrl 上掉毛

[英]VS Code angular and typescript linting on templateUrl

I am new to working with VS Code for my Angular 6 project.我是为我的 Angular 6 项目使用 VS Code 的新手。 All my components use templateUrl to define the template location.我所有的组件都使用 templateUrl 来定义模板位置。 Everything compiles and runs from the command line and in the dev server every template is delivered ok.一切都从命令行编译和运行,在开发服务器中,每个模板都可以正常交付。 The problem is that in VS Code all the templateUrl s are flagged as template cannot be found.问题是在 VS Code 中,所有 templateUrl 都被标记为找不到模板。 But the path to the file is correct.但是文件的路径是正确的。

So can I ignore this lint or block it in some way?那么我可以忽略这个 lint 或以某种方式阻止它吗? I do not wish to add annotations to my file as other members of the team use different IDEs.我不希望在我的文件中添加注释,因为团队的其他成员使用不同的 IDE。 Or is there a setting somewhere to set the path that it is reading from?或者是否有一个设置来设置它正在读取的路径? I am not sure if this is VS Code or ES lint.我不确定这是 VS Code 还是 ES lint。

在此处输入图像描述

In the end I removed the Angular Language Service extension and I no longer get the linting.. So I guess nothing to do with ESlint.最后我删除了 Angular 语言服务扩展,我不再得到 linting.. 所以我想与 ESlint 无关。 Seems strange though.不过看起来很奇怪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM