簡體   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