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"
    }
  }

成功解决!!


相关文章
|
算法 C# C++
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
Parsing error: duplicate-attribute.eslintvue/no-parsing-error,Eslint如何添加两个@Click事件
Parsing error: duplicate-attribute.eslintvue/no-parsing-error,Eslint如何添加两个@Click事件
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
Error: Element type is invalid: expected a string (for built-in components) or a class/function
2550 0
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
|
6月前
|
Perl
报错:error Parsing error: x-invalid-end-tag
报错:error Parsing error: x-invalid-end-tag
136 0
|
JavaScript
ESLint Parsing error: control-character-in-input-stream vue/no-parsing-error
ESLint Parsing error: control-character-in-input-stream vue/no-parsing-error
157 0
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
140 0
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
145 0
|
C语言
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
148 0