eslint: error Parsing error: The keyword 'const' is reserved

后端 未结 6 1200
余生分开走
余生分开走 2020-12-12 15:04

I am getting this error from ESLint:

error  Parsing error: The keyword \'const\' is reserved

from

6条回答
  •  余生分开走
    2020-12-12 16:04

    If using Visual Code one option is to add this to the settings.json file:

    "eslint.options": {
        "useEslintrc": false,
        "parserOptions": {
            "ecmaVersion": 2017
        },
        "env": {
            "es6": true
        }
    }
    

提交回复
热议问题