jshint/jshint — pull request #1735 by SkySpiral7 (2014-06-22 22:28:45+00:00)
Title: Allow absolute paths and fixed ignore paths.

Reasons for changing the file:
I wrote a batch script to run js hint and discovered 2 problems which I have fixed. The first is that it is now possible to specify files using an absolute path (previously findFile would ultimately get to "C:\C:\file" then return null). The second problem I corrected was that previously the files to ignore were relative to pwd instead of the directory that will be linted (which meant that none of the files in .jshintignore were found since that file is relative to . whereas pwd is relative to the calling process). And actually the .jshintignore that was defined in the target directory wasn't being found because it was instead looking for the file in pwd.

Reason for every single line changed (the new line numbers are used):
(79) home is undefined at this point so to improve clarity and maintain functionality I returned undefined.
(85) moved home down since it isn't used by proj which might return making home unneeded
(157, 161.5) dir must now be provided, removed the cwd call and updated the doc
(171) moved parent down for the same reason I moved home down earlier
(173-178) this is what makes absolute paths possible, if checks to see if the name (without dir) is a valid file path then returns
(181-182) fixed this oversight in caching, previously if not found it would only cache "C:\file" instead of the whole path which wouldn't save much time.
(189-192, 195-197) loadIgnores needs to know the location of the target directory in order to find .jshintignore and the files to ignore. and updated the doc
(212, 214) target needs to be used in case file is not found. this is correct: although the file may be located in any parent, only files in the target or children need to be ignored.
(566-568, 728) loadIgnores needs to be passed the target location. these lines also force the result of loadIgnores to be mapped, previously only opts.ignores was mapped.

Concerns:
On line 79 I assume you meant to return null instead of undefined but I'm not sure so I kept the same functionality.
I don't know how stdin works so I don't know if my changes will work for that.
I only looked a little bit at this 1 file and don't know the possible impact of the changes.