Using Visual Studio 2015 Toolkit Preview for ESlint

I set tool preview 1 ( https://go.microsoft.com/fwlink/?LinkId=798481 ) because I want VS to check ESLint, now I use VS-Code and it will be great if VS15 can complete this task.

Like this: https://forums.meteor.com/t/eslint-now-officially-integrated-with-visual-studio-2015/23798

After I installed Í get "Web Code Analysis" in the "Tools" section, I can select .eslintrc to add my own rules. I tried this by copying my other file that uses "Gulp Watch", but this does not work. I tried to change the default rules, but nothing happens.

Could someone who installed this and working explain how to add my own rules and make it work, thanks!

+5
source share
1 answer

You are having a problem with Tooling Preview 1, but I know a similar problem with version 2. An error is reported (see thread ). The solution suggested by markvp solved my problem. Here is his message:

We also experienced this problem.

While they are trying to fix it ... try this workaround ...

Check the Web \ External folder in the VS installation folder (often C: \ Program Files (x86) \ Microsoft Visual Studio 14.0) for a file named eslint.cmd

If this does not exist, open a command prompt in this folder and type npm install eslint

If this does not fix your problem (or you already have the eslint.cmd file), add the full location of this direction in the PATH environment variable. e.g. C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Web \ External.

(see Google instructions as it depends on your Windows OS version).

If none of these problems fix the problem, try manually deleting the eslint subfolder in the node_modules folder and the two eslint files in the Web \ External folder. Then try the installation again using the query command with elevated privileges (works as an administrator).

Then, if you add the .eslintrc file to the root of your project, you can override the eslint rules.

 { "extends": "eslint:recommended", "parser": "babel-eslint", "env": { "browser": true }, "globals": { "angular": false }, "rules": { "quotes": [ "error", "single" ] // add rules here } } 

Please note that if you expand the "eslint:recommanded" , a set of rules already set by default. More information can be found in the official documentation .

0
source

All Articles