我正在尝试使用 grunt 运行 jshint。这可行,但现在我希望输出为 HTML。这是我的 grunt 文件
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');
};
运行这个 grunt 任务,输出为 XML 格式。有什么建议如何将其转换为输出 HTML 的内容吗?
多谢
您需要编写一个自定义报告器。检查关于编写自定义记者的 jshint 文档:http://jshint.com/docs/reporters/ http://jshint.com/docs/reporters/然后您可以使用以下命令指定报告者的路径:
options: {
reporter: '/path/to/custom/html/reporter',
reporterOutput: 'jshint.html'
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)