Parsing error: The keyword ‘const‘ is reserved

简介: Parsing error: The keyword ‘const‘ is reserved

在文件.eslintrc.js中

因为eslint默认审查的es5,需要明确让他审查es6.,所以需要配置parserOptions

配置如下:

module.exports = {
    "plugins": ["prettier"],
    "rules": {
      "prettier/prettier": "error"
    },
    "parserOptions": {
      "ecmaVersion": 6,
      "sourceType": "module"
    }
  }

成功解决!!


相关文章
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
|
6月前
|
CDN
Iconfont——Error: <path> attribute d: Expected number, "MNaNNaNaNaNNaNNaN…".
Iconfont——Error: <path> attribute d: Expected number, "MNaNNaNaNaNNaNNaN…".
56 0
|
6月前
|
iOS开发
解决Invalid `Podfile` file: no implicit conversion of nil into String
解决Invalid `Podfile` file: no implicit conversion of nil into String
69 0
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
|
9月前
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
1024 0
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
146 0
|
JSON 数据格式
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
|
JavaScript 前端开发
element-plus 报错 TypeError: Cannot read properties of undefined (reading ‘setCheckedKeys‘)
element-plus 报错 TypeError: Cannot read properties of undefined (reading ‘setCheckedKeys‘)
493 0
|
JSON 数据格式
JsonParseException: Unexpected character (‘ï‘ (code 239)): was expecting comma to separate Object
JsonParseException: Unexpected character (‘ï‘ (code 239)): was expecting comma to separate Object
303 0