Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eslint Parsing error: ecmaVersion must be 3, 5, 6, or 7

Tags:

node.js

eslint

I'm using the eslint 3.18.0 and node 7.7.4. I'm setting the ecmaVersion to 8 (per the documentation), but getting this error: Parsing error: ecmaVersion must be 3, 5, 6, or 7. Is ecmaVersion 8 not supported? If it is why am I getting this parsing error?

Here's the full .eslintrc.json:

{
    "env": {
        "node": true,
        "mocha": true
    },
    "parserOptions": {
        "ecmaVersion": 8,
        "sourceType": "module"
    },
    "extends": "eslint:recommended",
    "rules": {
        "semi": ["error", "always"],
        "quotes": ["error", "single"]
    }
}
like image 909
Branon Barrett Avatar asked Mar 22 '17 12:03

Branon Barrett


Video Answer


1 Answers

ESLint currently supports versions 3, 5, 6 (es2015), 7(es2016) and 8(es2017). If you are having trouble enabling es2017, verify that your ESLint installation is up to date. es2017 was added to ESLint as of v3.6.0 that was released on Sep 23, 2016. Verify global/local version (whichever you are using).

like image 120
Ilya Volodin Avatar answered Sep 24 '22 11:09

Ilya Volodin