Set up TSLint for VS2017

后端 未结 4 1097
别那么骄傲
别那么骄傲 2020-12-30 10:55

I have tried to install this plugin: Web Analyzer, but unfortunately it can not be installed in VS 2017. It showed:

VSIXInstaller.NoApplicableSKUsExce

4条回答
  •  孤独总比滥情好
    2020-12-30 11:13

    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 in C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.3 or any of its parent directories and run npm install typescript tslint tslint-language-service (Visual Studio doesn't search for tslint.json or plugins in the project folder)
    • Add "plugins": [{ "name": "tslint-language-service" }] to compilerOptions in your tsconfig.json

    Now TSLint in Visual Studio should work:

提交回复
热议问题