将ESLint与Visual Studio 2015集成 [英] Integrate ESLint with Visual Studio 2015
问题描述
我正在将ESLint用于JavaScript.我将其安装在计算机中,并且能够运行并检查所需文件中的错误.一切都很好,但是如果我只能在命令提示符下使用它,则必须为每个文件或文件夹手动运行它.我正在考虑将其集成到Visual Studio中,这样当我像在解决方案上运行ESLint一样运行它时,它将为解决方案中的所有JS文件提供警告/错误列表.即使我们无法做到这一点,也可以在Visual Studio 2015中选择一个文件并对该文件运行ESLint吗?
I am using ESLint for JavaScript. I installed it in my machine and am able to run and check for the errors in the file that I want to. Everything is good but if I have to use it only from command prompt I have to manually run this for each file or a folder. I am thinking about integrating this into Visual Studio so that when I run it like "Run ESLint on solution" it will give a list of warnings/errors for all the JS files in the solution. Even if we can't do that, is it possible to select a file and to run ESLint on that file in Visual Studio 2015?
我将ESLint添加到Visual Studio中的外部工具中
I added ESLint to external tools in Visual Studio:
但是当我运行它时,它没有显示任何错误或任何东西.它仅显示了help命令的详细信息.如何在特定文件上运行它?
But when I run it, it's not showing any errors or anything. It is just showing the details of the help command. How do I run this on a particular file?
推荐答案
Web分析器扩展现已内置于.NET Core Tooling Preview 1中的Visual Studio中.
Web Analyzer extension has now been built in to Visual Studio in the .NET Core Tooling Preview 1
点击链接下载以下版本的安装程序 .NET Core工具预览1
Follow the link to download the installer for .NET Core Tooling Preview 1
您也可以安装Web Analyzer扩展,但是在重新启动后,您将得到提示:
You can install Web Analyzer extension as well, but after the restart you will get a prompt:
这篇关于将ESLint与Visual Studio 2015集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!