jshint说$未定义
解决方法:
You can also add two lines to your .jshintrc
"globals": { "$": false, "jQuery": false }
This tells jshint that there are two global variables. false
表示只读
Gulpfile.js:
gulp.task('jshint', function() { return gulp.src([ './*.js', './app/**/*.js', './public/res/classes/**/*.js', './public/res/extensions/**/*.js', './public/res/helpers/**/*.js', './public/res/providers/**/*.js', './public/res/*.js' ]) .pipe(jshint(".jshintrc")) // 这里必须!! .pipe(jshint.reporter('default')) .pipe(jshint.reporter('fail')); });