How to support ES7 in ESLint

Add this to your .eslintrc.json:

"parserOptions": {
    "ecmaVersion": 2016
},

Source: https://eslint.org/docs/user-guide/configuring#specifying-parser-options

ecmaVersion - set to 3, 5 (default), 6, 7, 8, 9, or 10 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), or 2019 (same as 10) to use the year-based naming.


Assuming you are using Babel, you probably want to use babel-eslint as your ESLint parser ("parser": "babel-eslint",).