Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is this configuration for ESLint in Visual Studio 2017 not working?

I am currently wondering, why ESLint is not working in my project in Visual Studio 2017. There is the file ".eslintrc" in the project-root:

{
"extends": "defaults/configurations/eslint",
"env": {
    "browser": true
},
"globals": {
    "xhr": true
},
"rules": {
    "eqeqeq": [ "error", "always", { "null": "ignore" } ]
}
}

If I remove the line with "eqeqeq", everything is working fine. But as soon as I add this line, no errors will be displayed at all.

Question 1: Is there any way to see an error-message about the issue ESLint obviously has?

Question 2 as a fallback: What is the issue with this line?

like image 371
Andreas Avatar asked May 02 '17 11:05

Andreas


People also ask

Why is my ESLint not working in Vscode?

Did you set up library execution? The ESLint plugin requires permission to execute the local ESLint installation from your node_modules . Open the command palette ( Ctrl / Cmd + Shift + P ) and select ESLint: Manage Library Execution to open the dialog for your project and confirm with 'Accept'.

How do you check ESLint errors in Visual Studio code?

Once you have a eslintrc file provided (either created by yourself or provided internally by a tool like create-react-app), you can make the ESLint warnings/errors visible in VS Code by installing the ESLint extension from the VS Code Marketplace. }, "eslint.


1 Answers

Thanks to btmills I took a dive into the sources and found the version: VS 2017 uses ESLint 2.0.0 (released 2016-02-12).

The correct configuration is:

"eqeqeq": [ 2, "allow-null" ]

Documentation is available here:

  • Getting started
  • Rules

The links from the error-list in VS 2017 lead to the current documentation, where you can find many features that do not work in version 2.0.0.

like image 120
Andreas Avatar answered Oct 15 '22 01:10

Andreas