GitHub PullRequestReviewCommentEvent at 2014-06-26 08:19:10
Repository: atom-jshint
Actor: Joezo
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Joezo/atom-jshint/pulls/comments/14229689","id":14229689,"diff_hunk":"@@ -14,53 +14,91 @@ module.exports = AtomJshint = (function(){\n   });\n   var $ = require('atom').$;\n   function AtomJsHint(){\n-    atom.workspace.eachEditor((function(self) {\n-      return function(editor) {\n-        return self.handleEvents(editor);\n-      };\n-    })(this));\n-    this.config = {globals:{},options:{}};\n-    this.loadConfig();\n+    this.configs = {};\n+    this.currentConfig = null;\n+    this.npmConfig = this.loadNpmConfig();\n+    this.subscribe(atom.workspaceView, 'pane-container:active-pane-item-changed',\n+        function(event,editor){\n+        this.unsubscribeEditor(this.editor);\n+        this.currentConfig = null;\n+        if (editor.constructor.name === 'Editor'){\n+          this.editor = editor;\n+          this.subscribeEditor(editor);\n+          this.run(editor);\n+        } else {\n+          this.resetState();\n+        }\n+      }.bind(this)\n+    );\n+    this.editor = atom.workspace.getActiveEditor();\n+    if(this.editor){\n+      setTimeout(function(){\n+        this.subscribeEditor(this.editor);\n+        this.run(this.editor);\n+      }.bind(this), 1000);\n+    }\n   }\n   Subscriber.includeInto(AtomJsHint);\n \n   AtomJsHint.prototype.destroy = function(){\n+    this.configs.forEach(function(config){\n+      if (config.fileWatcher){\n+        config.fileWatcher.close();\n+        delete config.fileWatcher;\n+      }\n+    });\n+    if (this.editor) {\n+      this.unsubscribeEditor(editor);","path":"lib/atom-jshint.js","position":45,"original_position":45,"commit_id":"21c219fe23d0cddc50581b68a3f6baeba5d6298b","original_commit_id":"21c219fe23d0cddc50581b68a3f6baeba5d6298b","user":{"login":"Joezo","id":2870255,"avatar_url":"https://avatars.githubusercontent.com/u/2870255?","gravatar_id":"604ac7902855109cc651823282d66ca4","url":"https://api.github.com/users/Joezo","html_url":"https://github.com/Joezo","followers_url":"https://api.github.com/users/Joezo/followers","following_url":"https://api.github.com/users/Joezo/following{/other_user}","gists_url":"https://api.github.com/users/Joezo/gists{/gist_id}","starred_url":"https://api.github.com/users/Joezo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joezo/subscriptions","organizations_url":"https://api.github.com/users/Joezo/orgs","repos_url":"https://api.github.com/users/Joezo/repos","events_url":"https://api.github.com/users/Joezo/events{/privacy}","received_events_url":"https://api.github.com/users/Joezo/received_events","type":"User","site_admin":false},"body":"jshint tells me that `editor` is not defined, i'm assuming it should be `this.editor`?","created_at":"2014-06-26T08:19:10Z","updated_at":"2014-06-26T08:19:10Z","html_url":"https://github.com/Joezo/atom-jshint/pull/39#discussion_r14229689","pull_request_url":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/Joezo/atom-jshint/pulls/comments/14229689"},"html":{"href":"https://github.com/Joezo/atom-jshint/pull/39#discussion_r14229689"},"pull_request":{"href":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39","id":17451480,"html_url":"https://github.com/Joezo/atom-jshint/pull/39","diff_url":"https://github.com/Joezo/atom-jshint/pull/39.diff","patch_url":"https://github.com/Joezo/atom-jshint/pull/39.patch","issue_url":"https://api.github.com/repos/Joezo/atom-jshint/issues/39","number":39,"state":"open","title":"Use .jshintrc relative to file being hinted.","user":{"login":"sjurba","id":1729935,"avatar_url":"https://avatars.githubusercontent.com/u/1729935?","gravatar_id":"553d4fcebf8bf754cea3a9c827fcd95c","url":"https://api.github.com/users/sjurba","html_url":"https://github.com/sjurba","followers_url":"https://api.github.com/users/sjurba/followers","following_url":"https://api.github.com/users/sjurba/following{/other_user}","gists_url":"https://api.github.com/users/sjurba/gists{/gist_id}","starred_url":"https://api.github.com/users/sjurba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjurba/subscriptions","organizations_url":"https://api.github.com/users/sjurba/orgs","repos_url":"https://api.github.com/users/sjurba/repos","events_url":"https://api.github.com/users/sjurba/events{/privacy}","received_events_url":"https://api.github.com/users/sjurba/received_events","type":"User","site_admin":false},"body":"I had a stab at changing the config loading behaviour, and ended up changing quite a bit of the code. You can take a look and see if you like some of the ideas. \r\n\r\nWould fix #11 and #30","created_at":"2014-06-22T20:11:14Z","updated_at":"2014-06-26T08:19:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"447c5573d715bc5877a6d5286cd1fcfe671a4f7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39/commits","review_comments_url":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39/comments","review_comment_url":"https://api.github.com/repos/Joezo/atom-jshint/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Joezo/atom-jshint/issues/39/comments","statuses_url":"https://api.github.com/repos/Joezo/atom-jshint/statuses/21c219fe23d0cddc50581b68a3f6baeba5d6298b","head":{"label":"sjurba:multiConfig","ref":"multiConfig","sha":"21c219fe23d0cddc50581b68a3f6baeba5d6298b","user":{"login":"sjurba","id":1729935,"avatar_url":"https://avatars.githubusercontent.com/u/1729935?","gravatar_id":"553d4fcebf8bf754cea3a9c827fcd95c","url":"https://api.github.com/users/sjurba","html_url":"https://github.com/sjurba","followers_url":"https://api.github.com/users/sjurba/followers","following_url":"https://api.github.com/users/sjurba/following{/other_user}","gists_url":"https://api.github.com/users/sjurba/gists{/gist_id}","starred_url":"https://api.github.com/users/sjurba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjurba/subscriptions","organizations_url":"https://api.github.com/users/sjurba/orgs","repos_url":"https://api.github.com/users/sjurba/repos","events_url":"https://api.github.com/users/sjurba/events{/privacy}","received_events_url":"https://api.github.com/users/sjurba/received_events","type":"User","site_admin":false},"repo":{"id":20267943,"name":"atom-jshint","full_name":"sjurba/atom-jshint","owner":{"login":"sjurba","id":1729935,"avatar_url":"https://avatars.githubusercontent.com/u/1729935?","gravatar_id":"553d4fcebf8bf754cea3a9c827fcd95c","url":"https://api.github.com/users/sjurba","html_url":"https://github.com/sjurba","followers_url":"https://api.github.com/users/sjurba/followers","following_url":"https://api.github.com/users/sjurba/following{/other_user}","gists_url":"https://api.github.com/users/sjurba/gists{/gist_id}","starred_url":"https://api.github.com/users/sjurba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjurba/subscriptions","organizations_url":"https://api.github.com/users/sjurba/orgs","repos_url":"https://api.github.com/users/sjurba/repos","events_url":"https://api.github.com/users/sjurba/events{/privacy}","received_events_url":"https://api.github.com/users/sjurba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sjurba/atom-jshint","description":"Validate your JS against JSHint as you type, while using Atom","fork":true,"url":"https://api.github.com/repos/sjurba/atom-jshint","forks_url":"https://api.github.com/repos/sjurba/atom-jshint/forks","keys_url":"https://api.github.com/repos/sjurba/atom-jshint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sjurba/atom-jshint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sjurba/atom-jshint/teams","hooks_url":"https://api.github.com/repos/sjurba/atom-jshint/hooks","issue_events_url":"https://api.github.com/repos/sjurba/atom-jshint/issues/events{/number}","events_url":"https://api.github.com/repos/sjurba/atom-jshint/events","assignees_url":"https://api.github.com/repos/sjurba/atom-jshint/assignees{/user}","branches_url":"https://api.github.com/repos/sjurba/atom-jshint/branches{/branch}","tags_url":"https://api.github.com/repos/sjurba/atom-jshint/tags","blobs_url":"https://api.github.com/repos/sjurba/atom-jshint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sjurba/atom-jshint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sjurba/atom-jshint/git/refs{/sha}","trees_url":"https://api.github.com/repos/sjurba/atom-jshint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sjurba/atom-jshint/statuses/{sha}","languages_url":"https://api.github.com/repos/sjurba/atom-jshint/languages","stargazers_url":"https://api.github.com/repos/sjurba/atom-jshint/stargazers","contributors_url":"https://api.github.com/repos/sjurba/atom-jshint/contributors","subscribers_url":"https://api.github.com/repos/sjurba/atom-jshint/subscribers","subscription_url":"https://api.github.com/repos/sjurba/atom-jshint/subscription","commits_url":"https://api.github.com/repos/sjurba/atom-jshint/commits{/sha}","git_commits_url":"https://api.github.com/repos/sjurba/atom-jshint/git/commits{/sha}","comments_url":"https://api.github.com/repos/sjurba/atom-jshint/comments{/number}","issue_comment_url":"https://api.github.com/repos/sjurba/atom-jshint/issues/comments/{number}","contents_url":"https://api.github.com/repos/sjurba/atom-jshint/contents/{+path}","compare_url":"https://api.github.com/repos/sjurba/atom-jshint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sjurba/atom-jshint/merges","archive_url":"https://api.github.com/repos/sjurba/atom-jshint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sjurba/atom-jshint/downloads","issues_url":"https://api.github.com/repos/sjurba/atom-jshint/issues{/number}","pulls_url":"https://api.github.com/repos/sjurba/atom-jshint/pulls{/number}","milestones_url":"https://api.github.com/repos/sjurba/atom-jshint/milestones{/number}","notifications_url":"https://api.github.com/repos/sjurba/atom-jshint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sjurba/atom-jshint/labels{/name}","releases_url":"https://api.github.com/repos/sjurba/atom-jshint/releases{/id}","created_at":"2014-05-28T18:28:44Z","updated_at":"2014-06-25T22:37:03Z","pushed_at":"2014-06-25T22:58:55Z","git_url":"git://github.com/sjurba/atom-jshint.git","ssh_url":"git@github.com:sjurba/atom-jshint.git","clone_url":"https://github.com/sjurba/atom-jshint.git","svn_url":"https://github.com/sjurba/atom-jshint","homepage":"","size":768,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Joezo:master","ref":"master","sha":"700bb20e01100d83385734cba75f389d70fbf0b6","user":{"login":"Joezo","id":2870255,"avatar_url":"https://avatars.githubusercontent.com/u/2870255?","gravatar_id":"604ac7902855109cc651823282d66ca4","url":"https://api.github.com/users/Joezo","html_url":"https://github.com/Joezo","followers_url":"https://api.github.com/users/Joezo/followers","following_url":"https://api.github.com/users/Joezo/following{/other_user}","gists_url":"https://api.github.com/users/Joezo/gists{/gist_id}","starred_url":"https://api.github.com/users/Joezo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joezo/subscriptions","organizations_url":"https://api.github.com/users/Joezo/orgs","repos_url":"https://api.github.com/users/Joezo/repos","events_url":"https://api.github.com/users/Joezo/events{/privacy}","received_events_url":"https://api.github.com/users/Joezo/received_events","type":"User","site_admin":false},"repo":{"id":17241189,"name":"atom-jshint","full_name":"Joezo/atom-jshint","owner":{"login":"Joezo","id":2870255,"avatar_url":"https://avatars.githubusercontent.com/u/2870255?","gravatar_id":"604ac7902855109cc651823282d66ca4","url":"https://api.github.com/users/Joezo","html_url":"https://github.com/Joezo","followers_url":"https://api.github.com/users/Joezo/followers","following_url":"https://api.github.com/users/Joezo/following{/other_user}","gists_url":"https://api.github.com/users/Joezo/gists{/gist_id}","starred_url":"https://api.github.com/users/Joezo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joezo/subscriptions","organizations_url":"https://api.github.com/users/Joezo/orgs","repos_url":"https://api.github.com/users/Joezo/repos","events_url":"https://api.github.com/users/Joezo/events{/privacy}","received_events_url":"https://api.github.com/users/Joezo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Joezo/atom-jshint","description":"Validate your JS against JSHint as you type, while using Atom","fork":false,"url":"https://api.github.com/repos/Joezo/atom-jshint","forks_url":"https://api.github.com/repos/Joezo/atom-jshint/forks","keys_url":"https://api.github.com/repos/Joezo/atom-jshint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Joezo/atom-jshint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Joezo/atom-jshint/teams","hooks_url":"https://api.github.com/repos/Joezo/atom-jshint/hooks","issue_events_url":"https://api.github.com/repos/Joezo/atom-jshint/issues/events{/number}","events_url":"https://api.github.com/repos/Joezo/atom-jshint/events","assignees_url":"https://api.github.com/repos/Joezo/atom-jshint/assignees{/user}","branches_url":"https://api.github.com/repos/Joezo/atom-jshint/branches{/branch}","tags_url":"https://api.github.com/repos/Joezo/atom-jshint/tags","blobs_url":"https://api.github.com/repos/Joezo/atom-jshint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Joezo/atom-jshint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Joezo/atom-jshint/git/refs{/sha}","trees_url":"https://api.github.com/repos/Joezo/atom-jshint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Joezo/atom-jshint/statuses/{sha}","languages_url":"https://api.github.com/repos/Joezo/atom-jshint/languages","stargazers_url":"https://api.github.com/repos/Joezo/atom-jshint/stargazers","contributors_url":"https://api.github.com/repos/Joezo/atom-jshint/contributors","subscribers_url":"https://api.github.com/repos/Joezo/atom-jshint/subscribers","subscription_url":"https://api.github.com/repos/Joezo/atom-jshint/subscription","commits_url":"https://api.github.com/repos/Joezo/atom-jshint/commits{/sha}","git_commits_url":"https://api.github.com/repos/Joezo/atom-jshint/git/commits{/sha}","comments_url":"https://api.github.com/repos/Joezo/atom-jshint/comments{/number}","issue_comment_url":"https://api.github.com/repos/Joezo/atom-jshint/issues/comments/{number}","contents_url":"https://api.github.com/repos/Joezo/atom-jshint/contents/{+path}","compare_url":"https://api.github.com/repos/Joezo/atom-jshint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Joezo/atom-jshint/merges","archive_url":"https://api.github.com/repos/Joezo/atom-jshint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Joezo/atom-jshint/downloads","issues_url":"https://api.github.com/repos/Joezo/atom-jshint/issues{/number}","pulls_url":"https://api.github.com/repos/Joezo/atom-jshint/pulls{/number}","milestones_url":"https://api.github.com/repos/Joezo/atom-jshint/milestones{/number}","notifications_url":"https://api.github.com/repos/Joezo/atom-jshint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Joezo/atom-jshint/labels{/name}","releases_url":"https://api.github.com/repos/Joezo/atom-jshint/releases{/id}","created_at":"2014-02-27T07:56:38Z","updated_at":"2014-06-22T15:28:49Z","pushed_at":"2014-03-12T18:59:45Z","git_url":"git://github.com/Joezo/atom-jshint.git","ssh_url":"git@github.com:Joezo/atom-jshint.git","clone_url":"https://github.com/Joezo/atom-jshint.git","svn_url":"https://github.com/Joezo/atom-jshint","homepage":"","size":768,"stargazers_count":23,"watchers_count":23,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":12,"mirror_url":null,"open_issues_count":21,"forks":12,"open_issues":21,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39"},"html":{"href":"https://github.com/Joezo/atom-jshint/pull/39"},"issue":{"href":"https://api.github.com/repos/Joezo/atom-jshint/issues/39"},"comments":{"href":"https://api.github.com/repos/Joezo/atom-jshint/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/Joezo/atom-jshint/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Joezo/atom-jshint/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/Joezo/atom-jshint/statuses/21c219fe23d0cddc50581b68a3f6baeba5d6298b"}}}}