eslint 報錯


1. Parsing error: Adjacent JSX elements must be wrapped in an enclosing tag

解決方案:修改.eslintrc.js

1 // 初始
2 
3 "parser": "babel-eslint",
4 
5 // 改為
6 "parserOptions": {
7     "parser": "babel-eslint"
8 },

 

2.  Parsing error: sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options

解決方案:修改.eslintrc.js【當ecmaVersion <2015時,不支持sourceType'module'】

parserOptions: {
    "ecmaVersion": 2015
  },

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM