2016-10-21 28 views
1

我寫了一個演示了jshint與咕嚕,代碼列舉如下:異常有:jshint-的JUnit記者

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" 
     } 
    }); 
}; 

,並得到例外:

enter image description here

這裏是jshint的結果 - 軍警記者安裝: enter image description here

及相關軟件版本: npm:3.10.8 咕嚕-CLI V1.2.0 咕嚕V1.0.1 的NodeJS:v0.12.7 我真的很感激任何意見

回答

1

記者:和reporterOutput:有兩個選項,並在選項塊應符合規定。嘗試更新你的任務是:

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

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

+0

測試OK,非常感謝:) –