{"action":"opened","number":204,"pull_request":{"url":"https://api.github.com/repos/Continuities/adarkroom/pulls/204","id":26805849,"html_url":"https://github.com/Continuities/adarkroom/pull/204","diff_url":"https://github.com/Continuities/adarkroom/pull/204.diff","patch_url":"https://github.com/Continuities/adarkroom/pull/204.patch","issue_url":"https://api.github.com/repos/Continuities/adarkroom/issues/204","number":204,"state":"open","locked":false,"title":"Fix many of the JSHint warnings","user":{"login":"rgravina","id":19086,"avatar_url":"https://avatars.githubusercontent.com/u/19086?v=3","gravatar_id":"","url":"https://api.github.com/users/rgravina","html_url":"https://github.com/rgravina","followers_url":"https://api.github.com/users/rgravina/followers","following_url":"https://api.github.com/users/rgravina/following{/other_user}","gists_url":"https://api.github.com/users/rgravina/gists{/gist_id}","starred_url":"https://api.github.com/users/rgravina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgravina/subscriptions","organizations_url":"https://api.github.com/users/rgravina/orgs","repos_url":"https://api.github.com/users/rgravina/repos","events_url":"https://api.github.com/users/rgravina/events{/privacy}","received_events_url":"https://api.github.com/users/rgravina/received_events","type":"User","site_admin":false},"body":"This fixes many (but not all) JS Hint warnings. Specifically, only low risk changes were made. i.e. small changes which should be safe and don't change semantics significantly.\r\n\r\n* Added in missing semicolons (and removed redundant ones).\r\n* Changed ```== 0``` and ```!= 0``` to triple equals.\r\n* Renamed some of the variables hiding a parameter with the same name.\r\n* Used array literal ```[]``` instead of ```new Array()```\r\n* Removed one instance of a statement which did nothing (```Engine.turnLightsOff;``` didn't actually call the function, and it seems to work fine without it)\r\n* Removed null definitions which were later defined as something (```activeEvent``` and ```eventPanel``` in ```script/event.js```).\r\n* Fixed some whitespace that Sublime Text wanted to modify on every save in ```stage_manager.js``` (was spaces and not tabs). Sorry, it's unrelated to this!\r\n* Moved some variable definitions to outside of if statements (```space.js```).\r\n* Fixed (moved) line break position in the middle of an if statement.\r\n* Fixed comparisons to ```''``` and ```true``` to use triple equals.\r\n* Fixed all checks for ```undefined``` returned from ```$SM.get``` to use ```===``` or  ```!==``` because we know it will return a value, 0 or undefined.\r\n* Fixed \"Confusing use of '!'\" warnings. Since ```$SM.get``` returns a zero if null, I replaced with ```=== 0```.\r\n\r\nI purposefully didn't change any of the ```== null```s or ```== undefined```s as these I expect would require much more testing (and it's open to interpretation about whether or not they are good/bad).\r\n\r\nDown to 23 errors from JSHint with this .jshintrc (not committed, as a linter hasn't been chosen in #188 yet).\r\n\r\n```\r\n{\r\n  \"eqnull\": true,\r\n  \"sub\": true,\r\n  \"multistr\": true\r\n}\r\n```\r\nRemaining warnings below (will update this description if some issues are fixed).\r\n\r\nNotes to fix remaining issues:\r\n\r\n*  ```Don't make functions within a loop.``` Fix these by extracting functions to outside the loop and calling from within the loop. Functions defined inside a loop get _redeclared_ on each iteration.\r\n* ```'k' is already defined.``` These loops could be refactored to a function, or just ```var k``` at the top of the function.\r\n* ```Variables should not be deleted.``` Could set it to null instead.\r\n\r\n```\r\nscript/events.js: line 272, col 27, 'k' is already defined.\r\n\r\nscript/localization.js: line 68, col 20, Variables should not be deleted.\r\n\r\nscript/outside.js: line 257, col 18, Don't make functions within a loop.\r\nscript/outside.js: line 589, col 19, 'i' is already defined.\r\n\r\nscript/path.js: line 198, col 22, Don't make functions within a loop.\r\n\r\nscript/room.js: line 818, col 18, Don't make functions within a loop.\r\nscript/room.js: line 1050, col 27, 'k' is already defined.\r\nscript/room.js: line 1065, col 19, 'k' is already defined.\r\nscript/room.js: line 1067, col 21, 'max' is already defined.\r\nscript/room.js: line 1080, col 33, 'costTooltip' is already defined.\r\nscript/room.js: line 1082, col 26, 'cost' is already defined.\r\nscript/room.js: line 1083, col 27, 'k' is already defined.\r\n\r\nscript/space.js: line 378, col 19, 'k' is already defined.\r\n\r\nscript/state_manager.js: line 62, col 18, 'i' is already defined.\r\nscript/state_manager.js: line 80, col 13, eval can be harmful.\r\nscript/state_manager.js: line 88, col 13, eval can be harmful.\r\nscript/state_manager.js: line 163, col 13, eval can be harmful.\r\nscript/state_manager.js: line 177, col 16, eval can be harmful.\r\nscript/state_manager.js: line 183, col 13, eval can be harmful.\r\n\r\nscript/world.js: line 652, col 23, 'i' is already defined.\r\nscript/world.js: line 721, col 25, 'cur' is already defined.\r\nscript/world.js: line 729, col 19, 't' is already defined.\r\nscript/world.js: line 740, col 19, 'i' is already defined.\r\n\r\n23 errors\r\n```","created_at":"2015-01-05T04:24:52Z","updated_at":"2015-01-05T04:24:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Continuities/adarkroom/pulls/204/commits","review_comments_url":"https://api.github.com/repos/Continuities/adarkroom/pulls/204/comments","review_comment_url":"https://api.github.com/repos/Continuities/adarkroom/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Continuities/adarkroom/issues/204/comments","statuses_url":"https://api.github.com/repos/Continuities/adarkroom/statuses/34ca99a946ed5c56d302b94229ccc00c14fec30e","head":{"label":"rgravina:188_fix_jshint_warnings","ref":"188_fix_jshint_warnings","sha":"34ca99a946ed5c56d302b94229ccc00c14fec30e","user":{"login":"rgravina","id":19086,"avatar_url":"https://avatars.githubusercontent.com/u/19086?v=3","gravatar_id":"","url":"https://api.github.com/users/rgravina","html_url":"https://github.com/rgravina","followers_url":"https://api.github.com/users/rgravina/followers","following_url":"https://api.github.com/users/rgravina/following{/other_user}","gists_url":"https://api.github.com/users/rgravina/gists{/gist_id}","starred_url":"https://api.github.com/users/rgravina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgravina/subscriptions","organizations_url":"https://api.github.com/users/rgravina/orgs","repos_url":"https://api.github.com/users/rgravina/repos","events_url":"https://api.github.com/users/rgravina/events{/privacy}","received_events_url":"https://api.github.com/users/rgravina/received_events","type":"User","site_admin":false},"repo":{"id":28448375,"name":"adarkroom","full_name":"rgravina/adarkroom","owner":{"login":"rgravina","id":19086,"avatar_url":"https://avatars.githubusercontent.com/u/19086?v=3","gravatar_id":"","url":"https://api.github.com/users/rgravina","html_url":"https://github.com/rgravina","followers_url":"https://api.github.com/users/rgravina/followers","following_url":"https://api.github.com/users/rgravina/following{/other_user}","gists_url":"https://api.github.com/users/rgravina/gists{/gist_id}","starred_url":"https://api.github.com/users/rgravina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgravina/subscriptions","organizations_url":"https://api.github.com/users/rgravina/orgs","repos_url":"https://api.github.com/users/rgravina/repos","events_url":"https://api.github.com/users/rgravina/events{/privacy}","received_events_url":"https://api.github.com/users/rgravina/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rgravina/adarkroom","description":"A Dark Room - A Minimalist Text Adventure","fork":true,"url":"https://api.github.com/repos/rgravina/adarkroom","forks_url":"https://api.github.com/repos/rgravina/adarkroom/forks","keys_url":"https://api.github.com/repos/rgravina/adarkroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rgravina/adarkroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rgravina/adarkroom/teams","hooks_url":"https://api.github.com/repos/rgravina/adarkroom/hooks","issue_events_url":"https://api.github.com/repos/rgravina/adarkroom/issues/events{/number}","events_url":"https://api.github.com/repos/rgravina/adarkroom/events","assignees_url":"https://api.github.com/repos/rgravina/adarkroom/assignees{/user}","branches_url":"https://api.github.com/repos/rgravina/adarkroom/branches{/branch}","tags_url":"https://api.github.com/repos/rgravina/adarkroom/tags","blobs_url":"https://api.github.com/repos/rgravina/adarkroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rgravina/adarkroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rgravina/adarkroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/rgravina/adarkroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rgravina/adarkroom/statuses/{sha}","languages_url":"https://api.github.com/repos/rgravina/adarkroom/languages","stargazers_url":"https://api.github.com/repos/rgravina/adarkroom/stargazers","contributors_url":"https://api.github.com/repos/rgravina/adarkroom/contributors","subscribers_url":"https://api.github.com/repos/rgravina/adarkroom/subscribers","subscription_url":"https://api.github.com/repos/rgravina/adarkroom/subscription","commits_url":"https://api.github.com/repos/rgravina/adarkroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/rgravina/adarkroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/rgravina/adarkroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/rgravina/adarkroom/issues/comments/{number}","contents_url":"https://api.github.com/repos/rgravina/adarkroom/contents/{+path}","compare_url":"https://api.github.com/repos/rgravina/adarkroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rgravina/adarkroom/merges","archive_url":"https://api.github.com/repos/rgravina/adarkroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rgravina/adarkroom/downloads","issues_url":"https://api.github.com/repos/rgravina/adarkroom/issues{/number}","pulls_url":"https://api.github.com/repos/rgravina/adarkroom/pulls{/number}","milestones_url":"https://api.github.com/repos/rgravina/adarkroom/milestones{/number}","notifications_url":"https://api.github.com/repos/rgravina/adarkroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rgravina/adarkroom/labels{/name}","releases_url":"https://api.github.com/repos/rgravina/adarkroom/releases{/id}","created_at":"2014-12-24T12:32:14Z","updated_at":"2014-12-25T04:36:50Z","pushed_at":"2015-01-05T04:14:55Z","git_url":"git://github.com/rgravina/adarkroom.git","ssh_url":"git@github.com:rgravina/adarkroom.git","clone_url":"https://github.com/rgravina/adarkroom.git","svn_url":"https://github.com/rgravina/adarkroom","homepage":null,"size":2247,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Continuities:master","ref":"master","sha":"94fdcc7463b4dafe7347318aa6065f4e3475b98a","user":{"login":"Continuities","id":4884483,"avatar_url":"https://avatars.githubusercontent.com/u/4884483?v=3","gravatar_id":"","url":"https://api.github.com/users/Continuities","html_url":"https://github.com/Continuities","followers_url":"https://api.github.com/users/Continuities/followers","following_url":"https://api.github.com/users/Continuities/following{/other_user}","gists_url":"https://api.github.com/users/Continuities/gists{/gist_id}","starred_url":"https://api.github.com/users/Continuities/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Continuities/subscriptions","organizations_url":"https://api.github.com/users/Continuities/orgs","repos_url":"https://api.github.com/users/Continuities/repos","events_url":"https://api.github.com/users/Continuities/events{/privacy}","received_events_url":"https://api.github.com/users/Continuities/received_events","type":"User","site_admin":false},"repo":{"id":11152831,"name":"adarkroom","full_name":"Continuities/adarkroom","owner":{"login":"Continuities","id":4884483,"avatar_url":"https://avatars.githubusercontent.com/u/4884483?v=3","gravatar_id":"","url":"https://api.github.com/users/Continuities","html_url":"https://github.com/Continuities","followers_url":"https://api.github.com/users/Continuities/followers","following_url":"https://api.github.com/users/Continuities/following{/other_user}","gists_url":"https://api.github.com/users/Continuities/gists{/gist_id}","starred_url":"https://api.github.com/users/Continuities/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Continuities/subscriptions","organizations_url":"https://api.github.com/users/Continuities/orgs","repos_url":"https://api.github.com/users/Continuities/repos","events_url":"https://api.github.com/users/Continuities/events{/privacy}","received_events_url":"https://api.github.com/users/Continuities/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Continuities/adarkroom","description":"A Dark Room - A Minimalist Text Adventure","fork":false,"url":"https://api.github.com/repos/Continuities/adarkroom","forks_url":"https://api.github.com/repos/Continuities/adarkroom/forks","keys_url":"https://api.github.com/repos/Continuities/adarkroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Continuities/adarkroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Continuities/adarkroom/teams","hooks_url":"https://api.github.com/repos/Continuities/adarkroom/hooks","issue_events_url":"https://api.github.com/repos/Continuities/adarkroom/issues/events{/number}","events_url":"https://api.github.com/repos/Continuities/adarkroom/events","assignees_url":"https://api.github.com/repos/Continuities/adarkroom/assignees{/user}","branches_url":"https://api.github.com/repos/Continuities/adarkroom/branches{/branch}","tags_url":"https://api.github.com/repos/Continuities/adarkroom/tags","blobs_url":"https://api.github.com/repos/Continuities/adarkroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Continuities/adarkroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Continuities/adarkroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/Continuities/adarkroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Continuities/adarkroom/statuses/{sha}","languages_url":"https://api.github.com/repos/Continuities/adarkroom/languages","stargazers_url":"https://api.github.com/repos/Continuities/adarkroom/stargazers","contributors_url":"https://api.github.com/repos/Continuities/adarkroom/contributors","subscribers_url":"https://api.github.com/repos/Continuities/adarkroom/subscribers","subscription_url":"https://api.github.com/repos/Continuities/adarkroom/subscription","commits_url":"https://api.github.com/repos/Continuities/adarkroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/Continuities/adarkroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/Continuities/adarkroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/Continuities/adarkroom/issues/comments/{number}","contents_url":"https://api.github.com/repos/Continuities/adarkroom/contents/{+path}","compare_url":"https://api.github.com/repos/Continuities/adarkroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Continuities/adarkroom/merges","archive_url":"https://api.github.com/repos/Continuities/adarkroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Continuities/adarkroom/downloads","issues_url":"https://api.github.com/repos/Continuities/adarkroom/issues{/number}","pulls_url":"https://api.github.com/repos/Continuities/adarkroom/pulls{/number}","milestones_url":"https://api.github.com/repos/Continuities/adarkroom/milestones{/number}","notifications_url":"https://api.github.com/repos/Continuities/adarkroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Continuities/adarkroom/labels{/name}","releases_url":"https://api.github.com/repos/Continuities/adarkroom/releases{/id}","created_at":"2013-07-03T14:30:59Z","updated_at":"2015-01-04T09:06:19Z","pushed_at":"2015-01-03T14:42:17Z","git_url":"git://github.com/Continuities/adarkroom.git","ssh_url":"git@github.com:Continuities/adarkroom.git","clone_url":"https://github.com/Continuities/adarkroom.git","svn_url":"https://github.com/Continuities/adarkroom","homepage":null,"size":3552,"stargazers_count":1462,"watchers_count":1462,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":364,"mirror_url":null,"open_issues_count":31,"forks":364,"open_issues":31,"watchers":1462,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Continuities/adarkroom/pulls/204"},"html":{"href":"https://github.com/Continuities/adarkroom/pull/204"},"issue":{"href":"https://api.github.com/repos/Continuities/adarkroom/issues/204"},"comments":{"href":"https://api.github.com/repos/Continuities/adarkroom/issues/204/comments"},"review_comments":{"href":"https://api.github.com/repos/Continuities/adarkroom/pulls/204/comments"},"review_comment":{"href":"https://api.github.com/repos/Continuities/adarkroom/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Continuities/adarkroom/pulls/204/commits"},"statuses":{"href":"https://api.github.com/repos/Continuities/adarkroom/statuses/34ca99a946ed5c56d302b94229ccc00c14fec30e"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":6,"additions":123,"deletions":122,"changed_files":11}}