grunt:如何以HTML生成jshint输出 [英] grunt: how to generate jshint output as HTML

查看:133
本文介绍了grunt:如何以HTML生成jshint输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用grunt运行jshint。这工作,但现在我想输出为HTML。这里是我的grunt文件

  module.exports = function(grunt){

//项目配置。
grunt.initConfig({
jshint:{
所有:[ 'Gruntfile.js', 'SRC / * JS。']
,选项:{
/ /记者:'jslint'
记者:'checkstyle'
,记者输出:'jshint.html'
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
};

运行这个grunt taks,输出为XML格式。任何建议如何把这个弄成输出HTML?



非常感谢


解决方案 http://jshint.com/docs/reporters/ 然后您可以通过以下方式指定记者的路径:

 选项:{
记者:'/ path / to / custom / html / reporter',
reporterOutput:'jshint.html'
}


I'm trying to run jshint using grunt. This works, but now I would like the output to be HTML. Here is my grunt file

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        jshint: {
            all: ['Gruntfile.js', 'src/*.js']
            , options: {
                //reporter: 'jslint'
                reporter:'checkstyle'
                , reporterOutput: 'jshint.html'
            }
         }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
};

Running this grunt taks, the output is in XML. Any suggestion how to turn this into something that outputs HTML ?

Thanks a lot

解决方案

You would need to write a custom reporter. Check the jshint docs on writing custom reporters: http://jshint.com/docs/reporters/ Then you can specify the path to the reporter with:

options: {
  reporter: '/path/to/custom/html/reporter',
  reporterOutput: 'jshint.html'
}

这篇关于grunt:如何以HTML生成jshint输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆