{"action":"closed","issue":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1340","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1340/labels{/name}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1340/comments","events_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1340/events","html_url":"https://github.com/jscs-dev/node-jscs/issues/1340","id":73179461,"number":1340,"title":"New Rule: requireShorthandArrowFunctions (ES6)","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},"labels":[{"url":"https://api.github.com/repos/jscs-dev/node-jscs/labels/help-wanted","name":"help-wanted","color":"fef2c0"},{"url":"https://api.github.com/repos/jscs-dev/node-jscs/labels/new%20rule","name":"new rule","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-05T02:12:08Z","updated_at":"2015-05-29T15:34:47Z","closed_at":"2015-05-29T15:34:47Z","body":"[airbnb/javascript#8.2](https://github.com/airbnb/javascript/tree/master#8.2)\r\n\r\nNames: \r\n`requireArrowFunctionShorthand`\r\n`requireImplicitReturnInArrowFunction`\r\n`disallowExplicitReturnInArrowFunction`\r\n\r\nIf the arrow function body is only a single expression?\r\n\r\n```js\r\n// good\r\nevens.map(v => v + 1);\r\n// bad\r\nevens.map(v => { return v + 1; });\r\n```\r\n\r\nMaybe..?\r\n```js\r\nfile.iterateNodesByType('ArrowFunctionExpression', function(node) {\r\n    if (body.type === 'BlockStatement' &&\r\n        body.body.length === 1 &&\r\n        body.body[0].type === 'ReturnStatement') {\r\n        errors.add..\r\n    }\r\n}\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/13120182-new-rule-requireshorthandarrowfunctions-es6?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}