简体   繁体   English

tslint在Visual Studio代码中不起作用

[英]tslint is not working in visual studio code

I installed the tslint add-on in top of my angularJS project in visual studio code. 我在Visual Studio代码中的我的angularJS项目顶部安装了tslint附加组件。

The issue that its not working, I can't see any error begin shown in the editor. 它不起作用的问题,我看不到编辑器中开始显示任何错误。

I made sure the tslint add-on is enabled in the extensions tab. 我确保在扩展标签中启用了tslint附加组件。

I checked in vscode settings and also tslint is enabled for typescript files. 我检查了vscode设置,还为打字稿文件启用了tslint。

In tslint console I can see this warning: 在tslint控制台中,我可以看到以下警告:

[Warn  - 10:19:51 PM] vscode-tslint: Cannot read tslint configuration - 'Cannot read property 'findConfigurationPath' of undefined'

Can you please help me fix this issue? 您能帮我解决这个问题吗?

Thanks 谢谢

It means that you are missing tslint config file. 这意味着您缺少tslint配置文件。 tslint.json Here is a guide on how to config it it https://palantir.github.io/tslint/usage/configuration/ tslint.json这是有关如何对其进行配置的指南https://palantir.github.io/tslint/usage/configuration/

If you have tslint installed globally as node package you can run tslint --init and it will create the file with default config 如果您已将tslint作为节点软件包全局安装,则可以运行tslint --init ,它将使用默认配置创建文件

If you have tslint installed as local package run npx tslint --init (this requires npm v5+ i think) 如果您已经将tslint安装为本地软件包,请运行npx tslint --init (我认为这需要npm v5 +)

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

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