Parsing error: The keyword ‘const‘ is reserved

Parsing error: The keyword ‘const’ is reserved

Insert image description here
In the file .eslintrc.js,
because eslint reviews es5 by default, you need to explicitly let it review es6. Therefore, you need to configure the parserOptions
configuration as follows:
Insert image description here

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

Solved successfully! !

Guess you like

Origin blog.csdn.net/m0_46374969/article/details/132778688