【问题标题】:How to specify custom reporter with JSHint如何使用 JSHint 指定自定义报告器
【发布时间】:2016-02-10 19:48:39
【问题描述】:

我在一个项目中使用 JSHint(在 grunt 任务中),目前已将其设置为使用“jshint-stylish”作为记者。它在 jshint.js 文件中定义,如下代码所示

module.exports = {

options: {
    reporter: require('jshint-stylish'),

但我想使用我自己的自定义记者。如何定义报告器以识别自定义报告器?

【问题讨论】:

    标签: jshint grunt-contrib-jshint


    【解决方案1】:

    使用https://stackoverflow.com/a/17493367/5144741 中标识的结构,我发现我的相对路径不正确。需要注意的重要一点:在识别报告者时不要包含扩展名。在这种情况下也不需要 require 语句。

    module.exports = {
    
    options: {
        reporter: './example/folder/src/reporters/my_reporter',
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-22
      • 2021-09-14
      • 1970-01-01
      • 1970-01-01
      • 2013-09-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多