我正在尝试使用 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 taks,输出为 XML。有什么建议可以将它变成输出 HTML 的东西吗?
非常感谢
最佳答案
您需要编写自定义报告程序。查看有关编写自定义报告程序的 jshint 文档:http://jshint.com/docs/reporters/然后你可以指定记者的路径:
options: {
reporter: '/path/to/custom/html/reporter',
reporterOutput: 'jshint.html'
}
关于javascript - 咕噜声 : how to generate jshint output as HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17477788/