【问题标题】:Exception with :jshint-junit-reporter例外:jshint-junit-reporter
【发布时间】:2016-10-21 09:45:40
【问题描述】:

我用 Grunt 为 jshint 写了一个演示,代码如下:

module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('jshint-junit-reporter');
    grunt.initConfig({
        jshint: {
            all: ['Gruntfile.js'],
            reporter: require("jshint-junit-reporter"),
            reporterOutput: "junit-output.xml"
        }
    });
};

并得到异常:

这是 jshint-junit-reporter 安装的结果:

及相关软件版本: npm:3.10.8 咕噜声-cli v1.2.0 咕噜声 v1.0.1 节点JS:v0.12.7 我非常感谢任何建议

【问题讨论】:

    标签: npm gruntjs jshint


    【解决方案1】:

    reporter: 和 reporterOutput: 都是选项,应在选项块中指定。尝试将您的任务更新为:

    jshint: {
        all: ['Gruntfile.js'],
        options: {
            reporter: require("jshint-junit-reporter"),
            reporterOutput: "junit-output.xml"
        }
    }
    

    https://github.com/gruntjs/grunt-contrib-jshint

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-14
      • 2013-04-08
      相关资源
      最近更新 更多