{"action":"created","comment":{"url":"https://api.github.com/repos/eslint/eslint/pulls/comments/41141834","id":41141834,"diff_hunk":"@@ -49,25 +63,33 @@ module.exports = function(context) {\n             for (var i = 0; i < declarations.length; ++i) {\n                 var declaration = declarations[i],\n                     id = declaration.id,\n-                    initialized = isInitialized(declaration);\n-\n+                    initialized = isInitialized(declaration),\n+                    isIgnoredForLoop = params.ignoreForLoops && isForLoop(node.parent);\n                 if (id.type !== \"Identifier\") {\n                     continue;\n                 }\n \n                 if (mode === MODE_ALWAYS && !initialized) {\n                     context.report(declaration, \"Variable '\" + id.name + \"' should be initialized on declaration.\");\n-                } else if (mode === MODE_NEVER && kind !== \"const\" && initialized) {\n+                } else if (mode === MODE_NEVER && kind !== \"const\" && initialized && !isIgnoredForLoop) {\n                     context.report(declaration, \"Variable '\" + id.name + \"' should not be initialized on declaration.\");\n                 }\n             }\n         }\n     };\n-\n };\n \n module.exports.schema = [\n     {\n         \"enum\": [\"always\", \"never\"]\n+    },\n+    {\n+        \"type\": \"object\",\n+        \"properties\": {","path":"lib/rules/init-declarations.js","position":69,"original_position":69,"commit_id":"3d35275f8110a96825035c858f88d4397c28a4c1","original_commit_id":"3d35275f8110a96825035c858f88d4397c28a4c1","user":{"login":"ilyavolodin","id":1380062,"avatar_url":"https://avatars.githubusercontent.com/u/1380062?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyavolodin","html_url":"https://github.com/ilyavolodin","followers_url":"https://api.github.com/users/ilyavolodin/followers","following_url":"https://api.github.com/users/ilyavolodin/following{/other_user}","gists_url":"https://api.github.com/users/ilyavolodin/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyavolodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyavolodin/subscriptions","organizations_url":"https://api.github.com/users/ilyavolodin/orgs","repos_url":"https://api.github.com/users/ilyavolodin/repos","events_url":"https://api.github.com/users/ilyavolodin/events{/privacy}","received_events_url":"https://api.github.com/users/ilyavolodin/received_events","type":"User","site_admin":false},"body":"@btmills Any ideas?","created_at":"2015-10-05T13:18:05Z","updated_at":"2015-10-05T13:18:05Z","html_url":"https://github.com/eslint/eslint/pull/4038#discussion_r41141834","pull_request_url":"https://api.github.com/repos/eslint/eslint/pulls/4038","_links":{"self":{"href":"https://api.github.com/repos/eslint/eslint/pulls/comments/41141834"},"html":{"href":"https://github.com/eslint/eslint/pull/4038#discussion_r41141834"},"pull_request":{"href":"https://api.github.com/repos/eslint/eslint/pulls/4038"}}},"pull_request":{"url":"https://api.github.com/repos/eslint/eslint/pulls/4038","id":46732414,"html_url":"https://github.com/eslint/eslint/pull/4038","diff_url":"https://github.com/eslint/eslint/pull/4038.diff","patch_url":"https://github.com/eslint/eslint/pull/4038.patch","issue_url":"https://api.github.com/repos/eslint/eslint/issues/4038","number":4038,"state":"open","locked":false,"title":"Update: Option to ignore for loops in init-declarations (fixes #3641)","user":{"login":"alberto","id":72561,"avatar_url":"https://avatars.githubusercontent.com/u/72561?v=3","gravatar_id":"","url":"https://api.github.com/users/alberto","html_url":"https://github.com/alberto","followers_url":"https://api.github.com/users/alberto/followers","following_url":"https://api.github.com/users/alberto/following{/other_user}","gists_url":"https://api.github.com/users/alberto/gists{/gist_id}","starred_url":"https://api.github.com/users/alberto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alberto/subscriptions","organizations_url":"https://api.github.com/users/alberto/orgs","repos_url":"https://api.github.com/users/alberto/repos","events_url":"https://api.github.com/users/alberto/events{/privacy}","received_events_url":"https://api.github.com/users/alberto/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-04T20:25:30Z","updated_at":"2015-10-05T13:18:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c914b1dcaf8923a019d97801e32cd46d8fd1afb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eslint/eslint/pulls/4038/commits","review_comments_url":"https://api.github.com/repos/eslint/eslint/pulls/4038/comments","review_comment_url":"https://api.github.com/repos/eslint/eslint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/4038/comments","statuses_url":"https://api.github.com/repos/eslint/eslint/statuses/3d35275f8110a96825035c858f88d4397c28a4c1","head":{"label":"alberto:issue3641","ref":"issue3641","sha":"3d35275f8110a96825035c858f88d4397c28a4c1","user":{"login":"alberto","id":72561,"avatar_url":"https://avatars.githubusercontent.com/u/72561?v=3","gravatar_id":"","url":"https://api.github.com/users/alberto","html_url":"https://github.com/alberto","followers_url":"https://api.github.com/users/alberto/followers","following_url":"https://api.github.com/users/alberto/following{/other_user}","gists_url":"https://api.github.com/users/alberto/gists{/gist_id}","starred_url":"https://api.github.com/users/alberto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alberto/subscriptions","organizations_url":"https://api.github.com/users/alberto/orgs","repos_url":"https://api.github.com/users/alberto/repos","events_url":"https://api.github.com/users/alberto/events{/privacy}","received_events_url":"https://api.github.com/users/alberto/received_events","type":"User","site_admin":false},"repo":{"id":42359194,"name":"eslint","full_name":"alberto/eslint","owner":{"login":"alberto","id":72561,"avatar_url":"https://avatars.githubusercontent.com/u/72561?v=3","gravatar_id":"","url":"https://api.github.com/users/alberto","html_url":"https://github.com/alberto","followers_url":"https://api.github.com/users/alberto/followers","following_url":"https://api.github.com/users/alberto/following{/other_user}","gists_url":"https://api.github.com/users/alberto/gists{/gist_id}","starred_url":"https://api.github.com/users/alberto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alberto/subscriptions","organizations_url":"https://api.github.com/users/alberto/orgs","repos_url":"https://api.github.com/users/alberto/repos","events_url":"https://api.github.com/users/alberto/events{/privacy}","received_events_url":"https://api.github.com/users/alberto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alberto/eslint","description":"A fully pluggable tool for identifying and reporting on patterns in JavaScript.","fork":true,"url":"https://api.github.com/repos/alberto/eslint","forks_url":"https://api.github.com/repos/alberto/eslint/forks","keys_url":"https://api.github.com/repos/alberto/eslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alberto/eslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alberto/eslint/teams","hooks_url":"https://api.github.com/repos/alberto/eslint/hooks","issue_events_url":"https://api.github.com/repos/alberto/eslint/issues/events{/number}","events_url":"https://api.github.com/repos/alberto/eslint/events","assignees_url":"https://api.github.com/repos/alberto/eslint/assignees{/user}","branches_url":"https://api.github.com/repos/alberto/eslint/branches{/branch}","tags_url":"https://api.github.com/repos/alberto/eslint/tags","blobs_url":"https://api.github.com/repos/alberto/eslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alberto/eslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alberto/eslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/alberto/eslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alberto/eslint/statuses/{sha}","languages_url":"https://api.github.com/repos/alberto/eslint/languages","stargazers_url":"https://api.github.com/repos/alberto/eslint/stargazers","contributors_url":"https://api.github.com/repos/alberto/eslint/contributors","subscribers_url":"https://api.github.com/repos/alberto/eslint/subscribers","subscription_url":"https://api.github.com/repos/alberto/eslint/subscription","commits_url":"https://api.github.com/repos/alberto/eslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/alberto/eslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/alberto/eslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/alberto/eslint/issues/comments{/number}","contents_url":"https://api.github.com/repos/alberto/eslint/contents/{+path}","compare_url":"https://api.github.com/repos/alberto/eslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alberto/eslint/merges","archive_url":"https://api.github.com/repos/alberto/eslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alberto/eslint/downloads","issues_url":"https://api.github.com/repos/alberto/eslint/issues{/number}","pulls_url":"https://api.github.com/repos/alberto/eslint/pulls{/number}","milestones_url":"https://api.github.com/repos/alberto/eslint/milestones{/number}","notifications_url":"https://api.github.com/repos/alberto/eslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alberto/eslint/labels{/name}","releases_url":"https://api.github.com/repos/alberto/eslint/releases{/id}","created_at":"2015-09-12T14:07:54Z","updated_at":"2015-09-17T05:46:24Z","pushed_at":"2015-10-05T06:48:13Z","git_url":"git://github.com/alberto/eslint.git","ssh_url":"git@github.com:alberto/eslint.git","clone_url":"https://github.com/alberto/eslint.git","svn_url":"https://github.com/alberto/eslint","homepage":"http://eslint.org","size":7671,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"eslint:master","ref":"master","sha":"8de4c9bedb7724a0fd84a754c9014ac878c7cbb3","user":{"login":"eslint","id":6019716,"avatar_url":"https://avatars.githubusercontent.com/u/6019716?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint","html_url":"https://github.com/eslint","followers_url":"https://api.github.com/users/eslint/followers","following_url":"https://api.github.com/users/eslint/following{/other_user}","gists_url":"https://api.github.com/users/eslint/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint/subscriptions","organizations_url":"https://api.github.com/users/eslint/orgs","repos_url":"https://api.github.com/users/eslint/repos","events_url":"https://api.github.com/users/eslint/events{/privacy}","received_events_url":"https://api.github.com/users/eslint/received_events","type":"Organization","site_admin":false},"repo":{"id":11061773,"name":"eslint","full_name":"eslint/eslint","owner":{"login":"eslint","id":6019716,"avatar_url":"https://avatars.githubusercontent.com/u/6019716?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint","html_url":"https://github.com/eslint","followers_url":"https://api.github.com/users/eslint/followers","following_url":"https://api.github.com/users/eslint/following{/other_user}","gists_url":"https://api.github.com/users/eslint/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint/subscriptions","organizations_url":"https://api.github.com/users/eslint/orgs","repos_url":"https://api.github.com/users/eslint/repos","events_url":"https://api.github.com/users/eslint/events{/privacy}","received_events_url":"https://api.github.com/users/eslint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eslint/eslint","description":"A fully pluggable tool for identifying and reporting on patterns in JavaScript.","fork":false,"url":"https://api.github.com/repos/eslint/eslint","forks_url":"https://api.github.com/repos/eslint/eslint/forks","keys_url":"https://api.github.com/repos/eslint/eslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eslint/eslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eslint/eslint/teams","hooks_url":"https://api.github.com/repos/eslint/eslint/hooks","issue_events_url":"https://api.github.com/repos/eslint/eslint/issues/events{/number}","events_url":"https://api.github.com/repos/eslint/eslint/events","assignees_url":"https://api.github.com/repos/eslint/eslint/assignees{/user}","branches_url":"https://api.github.com/repos/eslint/eslint/branches{/branch}","tags_url":"https://api.github.com/repos/eslint/eslint/tags","blobs_url":"https://api.github.com/repos/eslint/eslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eslint/eslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eslint/eslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/eslint/eslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eslint/eslint/statuses/{sha}","languages_url":"https://api.github.com/repos/eslint/eslint/languages","stargazers_url":"https://api.github.com/repos/eslint/eslint/stargazers","contributors_url":"https://api.github.com/repos/eslint/eslint/contributors","subscribers_url":"https://api.github.com/repos/eslint/eslint/subscribers","subscription_url":"https://api.github.com/repos/eslint/eslint/subscription","commits_url":"https://api.github.com/repos/eslint/eslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/eslint/eslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/eslint/eslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/eslint/eslint/issues/comments{/number}","contents_url":"https://api.github.com/repos/eslint/eslint/contents/{+path}","compare_url":"https://api.github.com/repos/eslint/eslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eslint/eslint/merges","archive_url":"https://api.github.com/repos/eslint/eslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eslint/eslint/downloads","issues_url":"https://api.github.com/repos/eslint/eslint/issues{/number}","pulls_url":"https://api.github.com/repos/eslint/eslint/pulls{/number}","milestones_url":"https://api.github.com/repos/eslint/eslint/milestones{/number}","notifications_url":"https://api.github.com/repos/eslint/eslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eslint/eslint/labels{/name}","releases_url":"https://api.github.com/repos/eslint/eslint/releases{/id}","created_at":"2013-06-29T23:59:48Z","updated_at":"2015-10-05T12:02:06Z","pushed_at":"2015-10-05T11:28:56Z","git_url":"git://github.com/eslint/eslint.git","ssh_url":"git@github.com:eslint/eslint.git","clone_url":"https://github.com/eslint/eslint.git","svn_url":"https://github.com/eslint/eslint","homepage":"http://eslint.org","size":23768,"stargazers_count":3063,"watchers_count":3063,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":577,"mirror_url":null,"open_issues_count":170,"forks":577,"open_issues":170,"watchers":3063,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eslint/eslint/pulls/4038"},"html":{"href":"https://github.com/eslint/eslint/pull/4038"},"issue":{"href":"https://api.github.com/repos/eslint/eslint/issues/4038"},"comments":{"href":"https://api.github.com/repos/eslint/eslint/issues/4038/comments"},"review_comments":{"href":"https://api.github.com/repos/eslint/eslint/pulls/4038/comments"},"review_comment":{"href":"https://api.github.com/repos/eslint/eslint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eslint/eslint/pulls/4038/commits"},"statuses":{"href":"https://api.github.com/repos/eslint/eslint/statuses/3d35275f8110a96825035c858f88d4397c28a4c1"}}}}