From a1721c003bfa45ff529fee2dfae2e824a3b29df7 Mon Sep 17 00:00:00 2001 From: sharky3112 Date: Tue, 11 Mar 2014 11:08:48 +0100 Subject: [PATCH] begin searching for .jshintrc in the same folder the active file is in --- lib/atom-jshint.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/atom-jshint.js b/lib/atom-jshint.js index 110e14c..7ceb357 100644 --- a/lib/atom-jshint.js +++ b/lib/atom-jshint.js @@ -155,8 +155,14 @@ module.exports = AtomJshint = (function(){ return this.setConfig(packageJson.jshintConfig); } } - var workingPath = atom.project.path || ''; - var dirs = workingPath.split(path.sep); + var workingPath = ''; + var dirs = ['']; + if (atom.state.workspace.paneContainer.root.active) { + workingPath = atom.state.workspace.paneContainer.root.activeItemUri || ''; + dirs = workingPath.split(path.sep); + // remove active file's name: + dirs.pop(); + } while ( dirs.length >= 1 ) { var configPath = path.join(dirs.join(path.sep), '/.jshintrc'); if( fs.existsSync(configPath) ){