简体   繁体   English

在VS2015中的构建上运行tslint

[英]Run tslint on build in VS2015

I have VS2015 Update 3 and I have some TypeScript files that should be checked by the tslint, but I can't get TSLint to analyze project on build (or preferably on the fly). 我有VS2015 Update 3,并且有一些TypeScript文件应由tslint检查,但是我无法让TSLint在构建时(最好是在运行中)分析项目。

When I open a *.ts file, the Error List window displays lint warnings from the file, but once I close it, they disappear. 当我打开* .ts文件时,“错误列表”窗口显示文件中的棉绒警告,但是一旦关闭它,它们就会消失。

When I run Code Analysis on an individual *.ts file (Run Web Code Analysis), the warnings appear (whether file is closed or open), but when I run Code Analysis on the whole project, it looks like everything a fine (=no warnings, although there should be some). 当我在单个* .ts文件上运行代码分析(运行Web代码分析)时,会出现警告(无论文件是关闭还是打开),但是当我在整个项目上运行代码分析时,看起来一切正常(=没有警告,尽管应该有一些警告)。

I tried to enable "Enable Code Analysis on Build", in project properties (under Code Analysis tab), but it also didn't generate any warnings. 我试图在项目属性中(在“代码分析”选项卡下)启用“在生成时启用代码分析”,但是它也没有生成任何警告。

Basically I can get TSLint warnings only on individual files(open them/run Web Code Analysis), but I want them automatically for the whole project (Run Code Analysis). 基本上,我只能在单个文件上获得TSLint警告(打开它们/运行Web代码分析),但是我希望它们在整个项目中自动运行(运行代码分析)。

The linters under Tools -> Web Code Analysis are from .NET Core Tools and at this time it seems that they are limited to opened files. 工具-> Web代码分析下的短毛绒来自.NET Core Tools,目前看来,它们仅限于打开的文件。

There is an issue to solve this: https://github.com/aspnet/Tooling/issues/718 有一个问题可以解决这个问题: https : //github.com/aspnet/Tooling/issues/718

It seems that I would have to find some other extension to make it work. 看来我必须找到其他扩展名才能使其正常工作。

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

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