为VS2017设置TSLint [英] Set up TSLint for VS2017
本文介绍了为VS2017设置TSLint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我曾尝试安装此插件:
I have tried to install this plugin: Web Analyzer, but unfortunately it can not be installed in VS 2017. It showed:
VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
I am wondering whether there is a way to set up tslint in VS or there is any other way to check the syntax?
解决方案
Now that TypeScript has language server plugins support and there's TSLint plugin, another option is available:
- Install Visual Studio 2017 Update 2
- Install TypeScript 2.3 for Visual Studio (This is not only for VS 2015 but also for VS 2017 Update 2)
- Put
tslint.json
inC:\Program Files (x86)\Microsoft SDKs\TypeScript\2.3
or any of its parent directories and runnpm install typescript tslint tslint-language-service
(Visual Studio doesn't search fortslint.json
or plugins in the project folder) - Add
"plugins": [{ "name": "tslint-language-service" }]
tocompilerOptions
in yourtsconfig.json
Now TSLint in Visual Studio should work:
这篇关于为VS2017设置TSLint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文