6

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?

4
  • I think, I found the issue: in VS2017, only numbers are allowed. "eqeqeq": 2 works fine. Unfortunately, this does not allow any detailed configuration...
    – Andreas
    Commented May 2, 2017 at 11:44
  • Try "eqeqeq": [2, "always", { "null": "ignore" }]. Older versions of ESLint used number to configure warning level before we added "off"/"warning"/"error", so maybe the VS2017 version hasn't been updated.
    – btmills
    Commented May 2, 2017 at 21:02
  • @btmills: Tried that, it did not help. "eqeqeq": [ 2 ] is still working, "eqeqeq": [ 2, "always" ] and your version are not.
    – Andreas
    Commented May 3, 2017 at 10:06
  • I just found the version-number, if it helps. If I'm not mistaken, VS 2017 uses version 2.0.0 (released 2016-02-12).
    – Andreas
    Commented May 3, 2017 at 13:52

1 Answer 1

6

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:

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.