Ale: ESLint giving config error. ALE gets mad.

Created on 1 Nov 2017  路  2Comments  路  Source: dense-analysis/ale


ALE throws an eslint config error
ALEDetails shows the message below

/Users/jwmann/work//app/.eslintrc:
        Configuration for rule "object-curly-spacing" is invalid:
        Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '"always"').   

Here's the actual JSON I'm using for config:

{
  "env": {
    "es6": true,
    "browser": true,
    "node": true
  },
  "rules": {
    "curly": 0,
    "comma-dangle": [2, "never"],
    "comma-spacing": 0,
    "eqeqeq": [2, "allow-null"],
    "key-spacing": 0,
    "no-underscore-dangle": 0,
    "no-unused-expressions": 0,
    "no-shadow": 0,
    "no-shadow-restricted-names": 0,
    "no-extend-native": 0,
    "no-var": 2,
    "new-cap": 0,
    "quotes": 0,
    "semi-spacing": 0,
    "space-unary-ops": 0,
    "space-infix-ops": 0,
    "consistent-return": 0,
    "strict": 0,
    "object-curly-spacing" : ["always"],
    "react/jsx-uses-vars": [2]
  },
  "parser": "babel-eslint",
  "plugins": [
    "react",
    "eslint-plugin-react"
  ],
  "ecmaFeatures": {
    "arrowFunctions": true,
    "jsx": true
  }
}

I'm pretty sure I'm passing object-curly-spacing properly. Am I missing something?
Thanks.

Most helpful comment

Just realized you have to add a severity rating to the rule array.

"object-curly-spacing" : [1, "always"]

Fixes it. Also has nothing to do with ALE.

All 2 comments

Just realized you have to add a severity rating to the rule array.

"object-curly-spacing" : [1, "always"]

Fixes it. Also has nothing to do with ALE.

Ah, I was about to say that. ALE was just reporting was ESLint said, and the option wasn't set correctly.

Was this page helpful?
0 / 5 - 0 ratings