解决:grunt-contrib-jshint插件支持es6 syntax的问题
来源:互联网 发布:淘宝渠道管理在哪里 编辑:程序博客网 时间:2024/06/05 08:43
grunt-contrib-jshint默认是不支持es6 syntax的。所以如果在被检查的代码中使用es6的新特性,那么就会报错。比如下面的报错信息就是由于用到es6的新特性
39 |class orgstructure_manage{^ 'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
- 如何解决:修改jshint配置
jshint:{ options: { esversion: 6 }}
文档出处:
esversion
This option is used to specify the ECMAScript version to which the code must adhere. It can assume one of the following values:
- 3 - If you need your program to be executable in older browsers—such as Internet Explorer 6/7/8/9—and other legacy JavaScript environments
- 5 - To enable syntax first defined in the ECMAScript 5.1 specification. This includes allowing reserved keywords as object properties.
- 6 - To tell JSHint that your code uses ECMAScript 6 specific syntax. Note that not all browsers implement them.
文档链接:
http://jshint.com/docs/options/#esversion
阅读全文
0 0
- 解决:grunt-contrib-jshint插件支持es6 syntax的问题
- grunt的grunt-contrib-jshint插件使用
- grunt的grunt-contrib-concat插件使用
- Grunt插件jshint使用指南
- 解决grunt-contrib-cssmin压缩默认会删除一些css hack的问题
- 解决grunt-contrib-cssmin压缩默认会删除一些css hack的问题
- JSHint 使用说明 (grunt jshint)
- grunt-contrib-requirejs插件合并压缩requirejs管理的Angularjs应用
- 一步一步讲解如何安装并执行Grunt-contrib-watch插件
- Grunt中批量无损压缩图片插件--Grunt-contrib-imagemin
- Grunt中批量无损压缩图片插件--Grunt-contrib-imagemin
- Grunt Contrib Watch Example
- 解决django1.6没有django.contrib.markup的问题
- python中的invalid syntax问题的解决
- win7安装grunt-contrib-qunit
- grunt-contrib-connect使用心得
- jshint处理GBK编码文件的问题
- [grunt]less插件的使用
- 2015ali android挑战赛第一题
- Oracle Parallel Execution(并行执行)
- python(一)列表与元组之序列基本操作
- html js 二级菜单联动
- php 冒泡、选择、插入、快速排序算法
- 解决:grunt-contrib-jshint插件支持es6 syntax的问题
- 数据库存储引擎的数据文件
- springboot(十三):springboot小技巧
- 深入java并发体系
- IDEA 打war包
- Scala中使用两种方式对单词进行次数统计(wordCount)
- 通过HttpURLConnection抓取图片
- dubbo运行流程
- 浙大PAT甲级-1007