繁体   English   中英

Grunt JSHint 多任务问题

[英]Grunt JSHint Multiple Tasks Problems

我在设置 JSHint 以运行多个任务时遇到问题。 这是我所拥有的:

 jshint: {
      app: {
        files: [
            'web/**/*.js',
            '!web/app.js',
            '!web/lib/**',
            '!web/build/**'
        ],
        options: {
            // Just let the templates do whatever they want when compiled
            ignores: ['web/templates/*.js'],
            // options here to override JSHint defaults
            loopfunc: true,
            newcap: false,
            reporter: require('jshint-stylish'),
            globals: {
                jQuery: true,
                gadget: true
            }
        }
      },
      test: {
        files: [
            'web/**/*.js',
            '!web/app.js',
            '!web/lib/**',
            '!web/build/**'
        ],
        options: {
            // just let the templates do whatever they want when compiled
            ignores: ['web/templates/*.js'],
            reporter: require('jshint-stylish'),
            jshintrc: '.jshintrc'
        }
      }

 }

当我尝试运行grunt jshint:appgrunt jshint:test ,我收到错误消息,其中任何一个都没有任务。

如果您看到我遗漏的任何内容,感谢您的帮助。

我认为你需要添加

grunt.loadNpmTasks('grunt-contrib-jshint');

到你的 grunt 文件

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM