Webstorm 不识别es6 import React from ‘react’——webstorm不支持jsx语法怎么办


2016-10-31更新

webstorm不支持es6语法怎么办?

 

 

webstorm不支持jsx语法怎么办?

参考:webstorm不支持jsx语法怎么办

 

 

 

 

 


I spent ages trying to fix this. Every solution talks about 'setting options'. I don't know what that means. Finally, I figured it out. You can just include a commented out line at the top of the file /*jshint esversion: 6 */.

//如果jsx语法报错 在顶部加入
/*jshint esversion: 6 */这段注释
另外如果提示导入的包报错,请使用双引号 "react","antd"

可以参考这篇文章:http://stackoverflow.com/questions/27441803/why-does-jshint-throw-a-warning-if-i-am-using-const (需要翻墙好像。。。)

 

最后上张效果图:


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM