{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/4183","labels_url":"https://api.github.com/repos/eslint/eslint/issues/4183/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/4183/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/4183/events","html_url":"https://github.com/eslint/eslint/issues/4183","id":112022092,"number":4183,"title":"Rule proposal: arrow-body-braces","user":{"login":"cjihrig","id":2512748,"avatar_url":"https://avatars.githubusercontent.com/u/2512748?v=3","gravatar_id":"","url":"https://api.github.com/users/cjihrig","html_url":"https://github.com/cjihrig","followers_url":"https://api.github.com/users/cjihrig/followers","following_url":"https://api.github.com/users/cjihrig/following{/other_user}","gists_url":"https://api.github.com/users/cjihrig/gists{/gist_id}","starred_url":"https://api.github.com/users/cjihrig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjihrig/subscriptions","organizations_url":"https://api.github.com/users/cjihrig/orgs","repos_url":"https://api.github.com/users/cjihrig/repos","events_url":"https://api.github.com/users/cjihrig/events{/privacy}","received_events_url":"https://api.github.com/users/cjihrig/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/triage","name":"triage","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-18T14:05:42Z","updated_at":"2015-10-18T14:05:52Z","closed_at":null,"body":"I'm looking for a rule similar to `arrow-parens`, but that will ensure that curly braces are always used around an arrow function's body.\r\n\r\n**When does this rule warn? Please describe and show example code:**\r\n\r\nThis rule warns when an arrow function's body is not enclosed in curly braces (even if the braces are not strictly required).\r\n\r\nExample code that produces a warning:\r\n\r\n```javascript\r\ns => s.length;\r\n(s) => s.length;\r\n```\r\n\r\nHowever, this would not produce a warning:\r\n\r\n```javascript\r\ns => { return s.length };\r\n(s) => { return s.length };\r\n```\r\n\r\n**Is this rule preventing an error or is it stylistic?**\r\n\r\nStylistic\r\n\r\n**Why is this rule a candidate for inclusion instead of creating a custom rule?**\r\n\r\nThere is already a similar rule for arrow function parens. This would also be analogous to enforcing curly braces on `if` statements.\r\n\r\n**Are you willing to create the rule yourself?**\r\n\r\nYes\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27500488-rule-proposal-arrow-body-braces?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/149019343","html_url":"https://github.com/eslint/eslint/issues/4183#issuecomment-149019343","issue_url":"https://api.github.com/repos/eslint/eslint/issues/4183","id":149019343,"user":{"login":"eslintbot","id":13383618,"avatar_url":"https://avatars.githubusercontent.com/u/13383618?v=3","gravatar_id":"","url":"https://api.github.com/users/eslintbot","html_url":"https://github.com/eslintbot","followers_url":"https://api.github.com/users/eslintbot/followers","following_url":"https://api.github.com/users/eslintbot/following{/other_user}","gists_url":"https://api.github.com/users/eslintbot/gists{/gist_id}","starred_url":"https://api.github.com/users/eslintbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslintbot/subscriptions","organizations_url":"https://api.github.com/users/eslintbot/orgs","repos_url":"https://api.github.com/users/eslintbot/repos","events_url":"https://api.github.com/users/eslintbot/events{/privacy}","received_events_url":"https://api.github.com/users/eslintbot/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T14:05:52Z","updated_at":"2015-10-18T14:05:52Z","body":"Thanks for the issue! If you're reporting a bug, please be sure to include:\n\n1. The version of ESLint you are using (run `eslint -v`)\n2. What you did (the source code and ESLint configuration)\n3. The actual ESLint output complete with numbers\n4. What you expected to happen instead\n\nRequesting a new rule? Please see [Proposing a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules) for instructions."}}