帮助了 AmazingCounters.com 位小伙伴

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 (需要FQ好像。。。)

 

最后上张效果图:

posted on 2016-09-09 10:42  云的旋律  阅读(11263)  评论(2编辑  收藏  举报

导航

前端攻城狮分享群