- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Gulp 和 Browserify和 Hintify . standard way捕捉错误似乎是这样的:
browserify({
entries: 'app.js',
transform: [
// Some other transforms
plugins.hintify
]
// A bunch of other settings
}).bundle()
// Error handling
.on('error', function(error) {
util.beep(); // Util is gulp-util
util.log(error);
this.emit('end');
})
.pipe(...)
jshint
我得到这样的东西:
Users/me/Sites/project/client/scripts/app.js: line 11, col 23, Missing semicolon.
jshint
错误停止处理构建。我喜欢检查我的代码是否达到标准,但如果我在函数中有未使用的参数,它不应该阻止构建所有内容。
最佳答案
当前设置对我有用(配置与 here 相同):
var jshint = require('gulp-jshint');
var notify = require('gulp-notify');
var stylish = require('jshint-stylish')
...
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
//.pipe(jshint.reporter('fail')) // <- omit a fail reporter
...
...
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
.on('error', notify.onError({ message: 'JS hint fail'})) // <- pipe fail to notification
...
...
src\m\typings.js
line 0 col 0 ES5 option is now set per default
line 3 col 18 ['SUCCESS'] is better written in dot notation.
line 4 col 18 ['FAILURE'] is better written in dot notation.
line 5 col 18 ['UNSTABLE'] is better written in dot notation.
line 6 col 18 ['NOT_BUILT'] is better written in dot notation.
line 10 col 26 ['info'] is better written in dot notation.
line 11 col 26 ['success'] is better written in dot notation.
line 12 col 26 ['mark'] is better written in dot notation.
line 13 col 26 ['warn'] is better written in dot notation.
line 14 col 26 ['error'] is better written in dot notation.
line 15 col 26 ['debug'] is better written in dot notation.
line 16 col 26 ['none'] is better written in dot notation.
line 18 col 1 Unnecessary semicolon.
‼ 13 warnings
[10:08:32] src\m\typings.js
src\helper\scaffolding.helper.js
line 0 col 0 ES5 option is now set per default
line 65 col 61 Regular parameters cannot come after default parameters.
line 82 col 79 Expected an assignment or function call and instead saw an expression.
line 84 col 77 Regular parameters cannot come after default parameters.
line 90 col 39 Expected an assignment or function call and instead saw an expression.
line 91 col 21 Missing 'new' prefix when invoking a constructor.
line 91 col 60 Expected an assignment or function call and instead saw an expression.
line 105 col 46 Expected an assignment or function call and instead saw an expression.
line 106 col 29 Missing 'new' prefix when invoking a constructor.
line 106 col 103 Expected an assignment or function call and instead saw an expression.
line 3 col 12 'require' is not defined.
line 4 col 14 'require' is not defined.
line 5 col 11 'require' is not defined.
line 6 col 19 'require' is not defined.
line 7 col 10 'require' is not defined.
line 8 col 13 'require' is not defined.
line 9 col 13 'require' is not defined.
line 33 col 17 'none' is not defined.
line 42 col 13 'color' is not defined.
line 45 col 13 'color' is not defined.
line 48 col 13 'color' is not defined.
line 51 col 13 'color' is not defined.
line 54 col 13 'color' is not defined.
line 57 col 13 'color' is not defined.
line 60 col 13 'color' is not defined.
line 63 col 12 'color' is not defined.
line 85 col 25 'process' is not defined.
× 2 errors
‼ 25 warnings
[10:08:32] src\helper\scaffolding.helper.js
src\helper\scaffolding.server.js
line 0 col 0 ES5 option is now set per default
line 22 col 44 Expected an assignment or function call and instead saw an expression.
line 23 col 25 Missing 'new' prefix when invoking a constructor.
line 23 col 75 Expected an assignment or function call and instead saw an expression.
line 25 col 43 Expected an assignment or function call and instead saw an expression.
line 26 col 25 Missing 'new' prefix when invoking a constructor.
line 26 col 117 Expected an assignment or function call and instead saw an expression.
line 38 col 40 Expected an assignment or function call and instead saw an expression.
line 39 col 21 Missing 'new' prefix when invoking a constructor.
line 39 col 50 Expected an assignment or function call and instead saw an expression.
line 74 col 43 Expected an assignment or function call and instead saw an expression.
line 75 col 25 Missing 'new' prefix when invoking a constructor.
line 75 col 96 Expected an assignment or function call and instead saw an expression.
line 4 col 12 'require' is not defined.
line 5 col 13 'require' is not defined.
line 7 col 13 'require' is not defined.
‼ 16 warnings
[10:08:32] src\helper\scaffolding.server.js
src\server\publish.js
line 0 col 0 ES5 option is now set per default
line 17 col 17 Missing 'new' prefix when invoking a constructor.
line 17 col 54 Expected an assignment or function call and instead saw an expression.
line 29 col 21 Missing 'new' prefix when invoking a constructor.
line 29 col 44 Expected an assignment or function call and instead saw an expression.
line 3 col 12 'require' is not defined.
line 4 col 13 'require' is not defined.
line 7 col 14 'require' is not defined.
line 9 col 12 'require' is not defined.
line 10 col 10 'require' is not defined.
line 11 col 14 'require' is not defined.
line 12 col 13 'require' is not defined.
‼ 12 warnings
[10:08:32] gulp-notify: [Error running Gulp] JS hint fail
[10:08:32] src\server\publish.js
[10:08:32] Finished 'build' after 1.61 s
^1.12.0
关于gulp - 让 Browserify 转换 Hintify 继续出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33358582/
实习测试框架有没有 有任何 gulp 插件或文档可以与 gulp 集成吗? 最佳答案 它看起来不像,但我已经做到了 使用 gulp-shell : gulp.task('intern', shell.
我正在寻找答案,不必深入或详细。只是想确切地知道任务序列发生了什么。 gulp.task('name',['*this right here*'], function() { // conte
假设有四个任务 'a'、'b'、'c'、'd'(b 依赖于 c 和 d;c 和 d 都依赖于 a),因此任务按以下顺序运行: a-> (c, d) -> b 这是相应地工作的 gulpfile.js:
我安装了本地gulp插件,并意识到我不需要它。如何删除它,是否有例如npm remove gulp-sass这样的命令? 最佳答案 只需运行npm uninstall --save即可。转到此链接h
我使用del包删除文件夹: gulp.task('clean', function(){ return del('dist/**/*', {force:true}); }); 但是,如果dis
有一个 super 简单的 gulp 文件,我想在其中依次运行一些基本的 gulp 任务。 我似乎无法在 Gulp v4 中运行它。使用 run-sequence 在 Gulp v3 中有类似的东西而
我目前有这样的文件结构 SASS gulpfile.js node_modules sites example-site scss
我创建了一个简单的 Gulp 任务来检查我的 ES6 文件中的更改。我想转换它们并在出现问题时显示错误消息。 正在显示错误屏幕。但是,当一切都成功时,我想显示不同的信息。 我试过 .on('end')
我已经安装了gulp在全局范围内 sudo npm install --global gulp-cli 和本地 npm install --save-dev gulp /usr/local/bin/g
我正在尝试使用 gulp-rev、gulp-rev-replace 和 gulp-rev-css-url 重写对我的版本图像文件的引用。 我已设法修改文件并将 list 与以下 gulp 代码合并:
尝试创建一个 gulp 任务,通过 LESS 通过管道传输来自不同文件夹的一堆文件,然后将它们输出到基于原始源的文件夹。考虑这个文件夹结构: Project +-- /Module_A | +-
我在终端上的项目文件夹中,并且: 如果我执行: gulp -v 我得到: [15:47:15] CLI version 3.9.0 [15:47:15] Local version 3.9.
设置很简单: gulp.task('rev-js', function() { return gulp.src('/js/main.js, {base: '.'}) .pipe(ne
我有两个任务,B 依赖于 A。 任务A需要循环一个数组,然后执行gulp.dest,但似乎B会在A完成之前执行。 A 所做的就是加载所有 html,并将每个 html 注入(inject)到 temp
我尝试在工作流程中将 gulp-data 与 gulp-jade 结合使用,但收到与 gulp-data 插件相关的错误。 这是我的 gulpfile.js var gulp = require('g
编辑:有没有办法清理这段代码? 任务.咖啡 # Watch pages gulp.task 'jade', -> # Watch index gulp.src('src/jade/index.
这可能听起来很愚蠢,但请耐心等待。我遇到了麻烦。 我正在开发一个使用 Grunt 来编译和构建其发行版的项目。但是,它使用另一个名为 prism 的库,您可以在 http://prismjs.com
我有一个简单的 less 任务的 gulp 工作流程,如下所示: gulp.task('less', function() { gulp.src(source_less) .p
我有一个 gulp 工作流程,一切都运行良好,但似乎它只适用于最上面的文件,例如:public/index.html,但如果我想使用 public/products/item.html,gulp-da
我想使用 gulp-useref 将我所有的 JavaScript 文件连接成一个。 在我的 JavaScript 文件中,我混合了pre-minified 和non-minified 文件。 我只想
我是一名优秀的程序员,十分优秀!