{"action":"created","comment":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/comments/30944918","id":30944918,"diff_hunk":"@@ -0,0 +1,44 @@\n+var Checker = require('../../../lib/checker');\n+var assert = require('assert');\n+\n+describe('rules/require-arrow-functions', function() {\n+    var checker;\n+\n+    beforeEach(function() {\n+        checker = new Checker();\n+        checker.registerDefaultRules();\n+        checker.configure({ requireArrowFunctions: true, esnext: true });\n+    });\n+\n+    it('should report use of function expression in declaration', function() {\n+        assert(checker.checkString([\n+            'var a = function(n) {',\n+                'return n + 1;',\n+            '});'\n+        ].join('\\n')).getErrorCount() === 1);\n+    });\n+\n+    it('should report use of function expression as callback', function() {\n+        assert(checker.checkString([\n+            'a.map(function(n) {',\n+                'return n + 1;',\n+            '});'\n+        ].join('\\n')).getErrorCount() === 1);\n+    });\n+\n+    it('should not report a function declaration', function() {","path":"test/specs/rules/require-arrow-functions.js","position":29,"original_position":29,"commit_id":"83ef76ef4b9c535fa84717b76e05c6d17dd29d88","original_commit_id":"83ef76ef4b9c535fa84717b76e05c6d17dd29d88","user":{"login":"mrjoelkemp","id":865203,"avatar_url":"https://avatars.githubusercontent.com/u/865203?v=3","gravatar_id":"","url":"https://api.github.com/users/mrjoelkemp","html_url":"https://github.com/mrjoelkemp","followers_url":"https://api.github.com/users/mrjoelkemp/followers","following_url":"https://api.github.com/users/mrjoelkemp/following{/other_user}","gists_url":"https://api.github.com/users/mrjoelkemp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrjoelkemp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrjoelkemp/subscriptions","organizations_url":"https://api.github.com/users/mrjoelkemp/orgs","repos_url":"https://api.github.com/users/mrjoelkemp/repos","events_url":"https://api.github.com/users/mrjoelkemp/events{/privacy}","received_events_url":"https://api.github.com/users/mrjoelkemp/received_events","type":"User","site_admin":false},"body":"Can we also add a test for named function expressions?\r\n\r\ne.g., \r\n\r\nshould still report on \r\n\r\n```js\r\nvar foo = function mySweetFunc() {};\r\n```","created_at":"2015-05-23T13:24:57Z","updated_at":"2015-05-23T13:24:57Z","html_url":"https://github.com/jscs-dev/node-jscs/pull/1396#discussion_r30944918","pull_request_url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396","_links":{"self":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/comments/30944918"},"html":{"href":"https://github.com/jscs-dev/node-jscs/pull/1396#discussion_r30944918"},"pull_request":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396"}}},"pull_request":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396","id":35896045,"html_url":"https://github.com/jscs-dev/node-jscs/pull/1396","diff_url":"https://github.com/jscs-dev/node-jscs/pull/1396.diff","patch_url":"https://github.com/jscs-dev/node-jscs/pull/1396.patch","issue_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1396","number":1396,"state":"open","locked":false,"title":"New Rule: requireArrowFunction","user":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"body":"Fixes #1383 \r\n\r\n","created_at":"2015-05-21T03:02:30Z","updated_at":"2015-05-23T13:24:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b340595479b70ac97d69ab47f73a3d7940e0b27f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396/commits","review_comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396/comments","review_comment_url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1396/comments","statuses_url":"https://api.github.com/repos/jscs-dev/node-jscs/statuses/83ef76ef4b9c535fa84717b76e05c6d17dd29d88","head":{"label":"hzoo:i-1383","ref":"i-1383","sha":"83ef76ef4b9c535fa84717b76e05c6d17dd29d88","user":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"repo":{"id":25034038,"name":"node-jscs","full_name":"hzoo/node-jscs","owner":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hzoo/node-jscs","description":"JavaScript Code Style checker","fork":true,"url":"https://api.github.com/repos/hzoo/node-jscs","forks_url":"https://api.github.com/repos/hzoo/node-jscs/forks","keys_url":"https://api.github.com/repos/hzoo/node-jscs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hzoo/node-jscs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hzoo/node-jscs/teams","hooks_url":"https://api.github.com/repos/hzoo/node-jscs/hooks","issue_events_url":"https://api.github.com/repos/hzoo/node-jscs/issues/events{/number}","events_url":"https://api.github.com/repos/hzoo/node-jscs/events","assignees_url":"https://api.github.com/repos/hzoo/node-jscs/assignees{/user}","branches_url":"https://api.github.com/repos/hzoo/node-jscs/branches{/branch}","tags_url":"https://api.github.com/repos/hzoo/node-jscs/tags","blobs_url":"https://api.github.com/repos/hzoo/node-jscs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hzoo/node-jscs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hzoo/node-jscs/git/refs{/sha}","trees_url":"https://api.github.com/repos/hzoo/node-jscs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hzoo/node-jscs/statuses/{sha}","languages_url":"https://api.github.com/repos/hzoo/node-jscs/languages","stargazers_url":"https://api.github.com/repos/hzoo/node-jscs/stargazers","contributors_url":"https://api.github.com/repos/hzoo/node-jscs/contributors","subscribers_url":"https://api.github.com/repos/hzoo/node-jscs/subscribers","subscription_url":"https://api.github.com/repos/hzoo/node-jscs/subscription","commits_url":"https://api.github.com/repos/hzoo/node-jscs/commits{/sha}","git_commits_url":"https://api.github.com/repos/hzoo/node-jscs/git/commits{/sha}","comments_url":"https://api.github.com/repos/hzoo/node-jscs/comments{/number}","issue_comment_url":"https://api.github.com/repos/hzoo/node-jscs/issues/comments{/number}","contents_url":"https://api.github.com/repos/hzoo/node-jscs/contents/{+path}","compare_url":"https://api.github.com/repos/hzoo/node-jscs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hzoo/node-jscs/merges","archive_url":"https://api.github.com/repos/hzoo/node-jscs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hzoo/node-jscs/downloads","issues_url":"https://api.github.com/repos/hzoo/node-jscs/issues{/number}","pulls_url":"https://api.github.com/repos/hzoo/node-jscs/pulls{/number}","milestones_url":"https://api.github.com/repos/hzoo/node-jscs/milestones{/number}","notifications_url":"https://api.github.com/repos/hzoo/node-jscs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hzoo/node-jscs/labels{/name}","releases_url":"https://api.github.com/repos/hzoo/node-jscs/releases{/id}","created_at":"2014-10-10T12:14:15Z","updated_at":"2015-05-08T01:09:27Z","pushed_at":"2015-05-21T21:03:09Z","git_url":"git://github.com/hzoo/node-jscs.git","ssh_url":"git@github.com:hzoo/node-jscs.git","clone_url":"https://github.com/hzoo/node-jscs.git","svn_url":"https://github.com/hzoo/node-jscs","homepage":"","size":3369,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jscs-dev:master","ref":"master","sha":"6284a69137885257b50def57bdb2fb95248c1de7","user":{"login":"jscs-dev","id":8018201,"avatar_url":"https://avatars.githubusercontent.com/u/8018201?v=3","gravatar_id":"","url":"https://api.github.com/users/jscs-dev","html_url":"https://github.com/jscs-dev","followers_url":"https://api.github.com/users/jscs-dev/followers","following_url":"https://api.github.com/users/jscs-dev/following{/other_user}","gists_url":"https://api.github.com/users/jscs-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/jscs-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jscs-dev/subscriptions","organizations_url":"https://api.github.com/users/jscs-dev/orgs","repos_url":"https://api.github.com/users/jscs-dev/repos","events_url":"https://api.github.com/users/jscs-dev/events{/privacy}","received_events_url":"https://api.github.com/users/jscs-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":10697582,"name":"node-jscs","full_name":"jscs-dev/node-jscs","owner":{"login":"jscs-dev","id":8018201,"avatar_url":"https://avatars.githubusercontent.com/u/8018201?v=3","gravatar_id":"","url":"https://api.github.com/users/jscs-dev","html_url":"https://github.com/jscs-dev","followers_url":"https://api.github.com/users/jscs-dev/followers","following_url":"https://api.github.com/users/jscs-dev/following{/other_user}","gists_url":"https://api.github.com/users/jscs-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/jscs-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jscs-dev/subscriptions","organizations_url":"https://api.github.com/users/jscs-dev/orgs","repos_url":"https://api.github.com/users/jscs-dev/repos","events_url":"https://api.github.com/users/jscs-dev/events{/privacy}","received_events_url":"https://api.github.com/users/jscs-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jscs-dev/node-jscs","description":"JavaScript Code Style checker","fork":false,"url":"https://api.github.com/repos/jscs-dev/node-jscs","forks_url":"https://api.github.com/repos/jscs-dev/node-jscs/forks","keys_url":"https://api.github.com/repos/jscs-dev/node-jscs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jscs-dev/node-jscs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jscs-dev/node-jscs/teams","hooks_url":"https://api.github.com/repos/jscs-dev/node-jscs/hooks","issue_events_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/events{/number}","events_url":"https://api.github.com/repos/jscs-dev/node-jscs/events","assignees_url":"https://api.github.com/repos/jscs-dev/node-jscs/assignees{/user}","branches_url":"https://api.github.com/repos/jscs-dev/node-jscs/branches{/branch}","tags_url":"https://api.github.com/repos/jscs-dev/node-jscs/tags","blobs_url":"https://api.github.com/repos/jscs-dev/node-jscs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jscs-dev/node-jscs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jscs-dev/node-jscs/git/refs{/sha}","trees_url":"https://api.github.com/repos/jscs-dev/node-jscs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jscs-dev/node-jscs/statuses/{sha}","languages_url":"https://api.github.com/repos/jscs-dev/node-jscs/languages","stargazers_url":"https://api.github.com/repos/jscs-dev/node-jscs/stargazers","contributors_url":"https://api.github.com/repos/jscs-dev/node-jscs/contributors","subscribers_url":"https://api.github.com/repos/jscs-dev/node-jscs/subscribers","subscription_url":"https://api.github.com/repos/jscs-dev/node-jscs/subscription","commits_url":"https://api.github.com/repos/jscs-dev/node-jscs/commits{/sha}","git_commits_url":"https://api.github.com/repos/jscs-dev/node-jscs/git/commits{/sha}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/comments{/number}","issue_comment_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/comments{/number}","contents_url":"https://api.github.com/repos/jscs-dev/node-jscs/contents/{+path}","compare_url":"https://api.github.com/repos/jscs-dev/node-jscs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jscs-dev/node-jscs/merges","archive_url":"https://api.github.com/repos/jscs-dev/node-jscs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jscs-dev/node-jscs/downloads","issues_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues{/number}","pulls_url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls{/number}","milestones_url":"https://api.github.com/repos/jscs-dev/node-jscs/milestones{/number}","notifications_url":"https://api.github.com/repos/jscs-dev/node-jscs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/labels{/name}","releases_url":"https://api.github.com/repos/jscs-dev/node-jscs/releases{/id}","created_at":"2013-06-14T20:53:48Z","updated_at":"2015-05-23T11:27:28Z","pushed_at":"2015-05-23T11:17:46Z","git_url":"git://github.com/jscs-dev/node-jscs.git","ssh_url":"git@github.com:jscs-dev/node-jscs.git","clone_url":"https://github.com/jscs-dev/node-jscs.git","svn_url":"https://github.com/jscs-dev/node-jscs","homepage":"http://jscs.info/","size":13109,"stargazers_count":3301,"watchers_count":3301,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":319,"mirror_url":null,"open_issues_count":202,"forks":319,"open_issues":202,"watchers":3301,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396"},"html":{"href":"https://github.com/jscs-dev/node-jscs/pull/1396"},"issue":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1396"},"comments":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1396/comments"},"review_comments":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396/comments"},"review_comment":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1396/commits"},"statuses":{"href":"https://api.github.com/repos/jscs-dev/node-jscs/statuses/83ef76ef4b9c535fa84717b76e05c6d17dd29d88"}}}}