jshint/node-jshint — Issue #88: Proposal for changing how JSHint locates a .jshintrc config
Author: dominicbarnes
Created: 2012-02-29 01:11:53+00:00
State: open

I would like to propose an alternative to locating the config file that JSHint will use. This is inspired by the way [grunt](https://github.com/cowboy/grunt) locates it's configuration information.

Once a `.jshintrc` is found within any of the following steps, stop immediately and use that specified config.

1. `cwd`
2. `../` from `cwd` until filesystem root. (ie. `/` or `C:/`)
3. `$HOME`

Of course, if the `--config` option is passed, this will bypass this series altogether.

I personally prefer this approach as I would like to keep 1 single `.jshintrc` file in the root of my project, rather either creating a mess of links in each directory or multiple files. In addition, this would be a much more predictable method especially when running from either an editor or the command line directly as I've often done both.

Any thoughts? I wouldn't mind writing up the code for this and sending it in either, in fact I'll probably be doing just that in the coming days.