Can I set multiple jsHint tasks in one Grunt file?

I have a grunt file configured for two different modules. In one task, I can provide multiple sources, and everything works fine. Now my requirement is to give different options for both modules: I want different JsHint rules for both modules, and I want both projects to have separate mini files and a common mini file.

Gruntfile.js →

jshint: {

ac:{ options: { laxcomma: true, // maybe we should turn this on? Why do we have these curly: true, eqeqeq: true, immed: true, latedef: true, onevar: true }, source: { src: ['module1/*.js'] } }, lib:{ options: { laxcomma: true, // maybe we should turn this on? Why do we have these curly: true, eqeqeq: true, immed: true, latedef: true }, source: { src: ['module2/*.js'] } } 

}

I saw some question, but I could only find the Grunt-hub as an option, where I need to create 2 separate files and then the grunt hub file. I do not want to do this, please help me how to do this?

+4
source share
1 answer

Use Goals: http://gruntjs.com/configuring-tasks#task-configuration-and-targets

 grunt.initConfig({ jshint: { one: { src: ['files/*'], options: { /* ... */ } }, two: { src: ['files2/*'], options: { /* ... */ } } } }); 
+10
source

Source: https://habr.com/ru/post/1480533/


All Articles