victorporof/Sublime-JSHint — pull request #46 by bruno-c (2013-10-18 21:50:43+00:00)
Title: Walking up the folders

Hello,

If you look at the code starting at line 92 in `run.js`

```javascript
while (currentFolder !== lastCurrentFolder) {
lastCurrentFolder = currentFolder;
if (fs.existsSync(jshintrcPath = currentFolder + path.sep + jshintrc)) {
setOptions(jshintrcPath, options, globals);
break; // Stop at the first found JSHint config file.
} else if (fs.existsSync(packagejsonPath = currentFolder + path.sep + packagejson)) {
var success = setOptions(packagejsonPath, options, globals);
if (success !== false) {
break; // Stop at the first package.json with JSHint config.
}
}
currentFolder = path.dirname(currentFolder);
}
```

You'll notice that that it doesn't actually go up the folders -- it only looks in the current folder! The current folder is never updated and the `while` condition will never be met so it'll only loop once.

I've made the changes necessary to have it actually go up the tree to find the configuration. I have not tested it outside of osx though -- but the code should work.

Also a small tweak to `JSHint.py` that makes it possible to work on the plugin with a symbolic link in Sublime's package folder.