rwjblue / broccoli-jshint

MIT License
6 stars 30 forks source link

Pass options to jshint #14

Open jlgrall opened 9 years ago

jlgrall commented 9 years ago

A way to pass options directly to jshint, like what https://github.com/gruntjs/grunt-contrib-jshint allows.

This is a blocker for me, I use different sets of scripts that need different options. Having a global config in the .jshintrc, then overwriting some options in the Brocfile.js would be nice.

rwjblue commented 9 years ago

You can either pass options to the plugin via the jshintrc option or override the getConfig method.

var tree = jshintTree(someTree, {
  jshintrc: { /* some custom jshint config here */ }
});

var tree = jshintTree(someTree, {
  getConfig: function(jshintPath) { 
    /* some custom jshint config logic here */ 
  }
});
devinrhode2 commented 9 years ago

@jlgrall, could adding a directory specific .jshintrc that merges with and overrides the properties on the root .jshintrc solve your problem?

jlgrall commented 9 years ago

Thanks for the answers.

@rwjblue: thx, you should add it to your doc.

@devinrhode2: I will see what is the best for me. Per directory .jshintrc is nice. I haven't decided if I prefer to have all configs in a single file or dispatched.

rwjblue commented 9 years ago

@jlgrall - I would happily accept a PR documenting.

jlgrall commented 9 years ago

Another thing missing: how to specify a reporter ? See reporter here: http://jshint.com/docs/cli/