wookiehangover/jshint.vim — pull request #11 by jaredmcateer (2013-04-19 19:56:00+00:00)
Title: Check for a .jshintrc relative to the current file being worked on

Hallet's jslint vim plugin will check the current working directory for a `.jslintrc` file before defaulting to `~/.jslintrc`. I wanted to take it one step further and have this plugin start at the current file's working directory and walk up the directory tree looking for a `.jshintrc`, which would presumably be in the project's root but could also have special files in subdirectories (e.g., different `.jshintrc` files for client side and server side javascript)

Along the way I noticed that if you want to make your `.jshintrc` a little more readable by separating out into multiple lines it will work but it will also generate an error. I've also fixed that issue by converting the `.jshintrc` into a single line after reading it into the plugin.

* Walks up directory tree from the current file's location
* If not found, it will default to `~/.jshintrc`
* If not found, use module's defaults
* Fixed issue that prevented having .jshintrc in multiple lines