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