2
votes

I am getting the below error by eslint.

I have added ecmaFeatures: { "modules": true } in the .eslintrc file as well.

enter image description here

1

1 Answers

8
votes

Because you're getting that message, it looks like you've upgraded to ESLint 2.0, which is great! I can see two changes that you'll make to your configuration, though if anything else comes up, it's probably covered under the 2.0 migration guide:

  1. In 2.0, "ecmaFeatures": { "modules": true } has become "parserOptions": { "sourceType": "module" }.
  2. We replaced space-after-keywords with a new rule, keyword-spacing, which was introduced in one of the 2.0 betas. If you were using "space-after-keywords: 2, you can change that to "keyword-spacing": 2 now.

Putting that all together, your .eslintrc for ESLint 2.0 should include something like this:

{
    "parserOptions": {
        "sourceType": "module"
    },
    "env": {
        "es6": true
    },
    "rules": {
        "keyword-spacing": 2
    }
}