ESLint Visual studio 2017 support

ESLint static intellisense does not seem to be supported in Visual Studio 2017, which makes coding in .js files a real pain since I need to run the eslint cmd command to get any sorting errors. In VSCode, I can just use the ESLint extension. What about visual studio 2017?

Is this any way I can turn it on?

+42
source share
4 answers

How to get ESLint to work in Visual Studio 2019 and 2017:

2019 v16 & 2017> = v15.8

In the end, I included instructions on the previous version, but do yourself a favor and upgrade if you want this feature.

From the menu: Tools> Options> Text Editor> Javascript / Typescript> Linting

Check Enable Eslint enter image description here

The global-in-visual-studio .eslintrc is located in your root user directory (Windows 10) along with other visual studio configurations. You can still install eslint through npm install eslint -g on your computer. VS will not use this. It comes with a responsive plugin, but you can install other plugins and they will work. You can expand the configs in your project ( eslint ref )

Used by Eslint v4, but acc. in MS documents,

if your project has a local ESLint installation, it will use this version instead


2017 v.15.7

From the menu: Tools β†’ Options β†’ Text Editor β†’ Javascript / Typescript Set Enable Eslint to True (if not already done)

Then from the main menu: Tools β†’ Web Code Analysis β†’ Change ESLint Settings

You will need to save the .eslintrc and your.js files for the rules to take effect. There may be a way to enable intellisense on input, but I did not find it. I found that if I update the rules after Visual Studio has already started drawing, I will have to restart the project for the new rule to take effect. Still awkward, but it's a great way to quickly implement the coding standard, especially when you map it to the format of your text editor and use autoformat for the save plugin, like this

Remember to edit the .eslintrc file in ESLint 2.0.0 format, found here here.

+73
source

I don’t know if this is part of the 15.8.2 update (just added on 08.23.18) or not, but the layout for the parameters has changed a bit:

enter image description here

Like the menu items in the "Web Code Analysis" section:

enter image description here

I suddenly started getting most Picayune errors (for example, "Expected" === "and instead saw" == ".), Which I suspect is due to the fact that it is" improved "for better performance.

+13
source

As of 8/14/2018, eslint has much better support in Visual Studio 2017 (15.8.0)

https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes-v15.8#eslint-improvements

+4
source

The version of Visual Studio for eslint is not the latest, so you cannot make eslint work like in VSCode.

There is an extension called VisualLinter that allows you to use the newer version of eslint.

+3
source

Source: https://habr.com/ru/post/1268337/


All Articles