0

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

module.exports = {

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

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

4

1 回答 1

0

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

module.exports = {

options: {
    reporter: './example/folder/src/reporters/my_reporter',
于 2016-02-10T20:00:54.700 回答