首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Grunt JSHint多任务问题

Grunt JSHint多任务问题
EN

Stack Overflow用户
提问于 2015-05-04 21:23:14
回答 1查看 48关注 0票数 2

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

代码语言:javascript
复制
 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时,我得到的错误是它们都没有任务。

如果你发现我遗漏了什么,谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2015-05-04 21:35:27

我觉得你需要加上

代码语言:javascript
复制
grunt.loadNpmTasks('grunt-contrib-jshint');

到你的呼叫声文件

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30031284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档