{"action":"opened","issue":{"url":"https://api.github.com/repos/weblogixx/react-webpack-template/issues/37","repository_url":"https://api.github.com/repos/weblogixx/react-webpack-template","labels_url":"https://api.github.com/repos/weblogixx/react-webpack-template/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/weblogixx/react-webpack-template/issues/37/comments","events_url":"https://api.github.com/repos/weblogixx/react-webpack-template/issues/37/events","html_url":"https://github.com/weblogixx/react-webpack-template/issues/37","id":165023015,"number":37,"title":"V2 -- Pick eslint-compatible arrow body for --stateless","user":{"login":"sthzg","id":1827893,"avatar_url":"https://avatars.githubusercontent.com/u/1827893?v=3","gravatar_id":"","url":"https://api.github.com/users/sthzg","html_url":"https://github.com/sthzg","followers_url":"https://api.github.com/users/sthzg/followers","following_url":"https://api.github.com/users/sthzg/following{/other_user}","gists_url":"https://api.github.com/users/sthzg/gists{/gist_id}","starred_url":"https://api.github.com/users/sthzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sthzg/subscriptions","organizations_url":"https://api.github.com/users/sthzg/orgs","repos_url":"https://api.github.com/users/sthzg/repos","events_url":"https://api.github.com/users/sthzg/events{/privacy}","received_events_url":"https://api.github.com/users/sthzg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/weblogixx/react-webpack-template/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-12T08:37:17Z","updated_at":"2016-07-12T08:37:17Z","closed_at":null,"body":"When creating `--stateless` components the template creates:\r\n\r\n```js\r\nconst Footer = () => {\r\n  return (\r\n    // jsx here\r\n  );\r\n};\r\n```\r\n\r\nWith the current eslint settings in place, this won't compile with an error:\r\n\r\n> 3:22  error  Unexpected block statement surrounding arrow body  arrow-body-style\r\n\r\nIn terms of the eslint rules, this is intended as [stated here](https://github.com/eslint/eslint/issues/5498). The reason is, that the arrow body only consists of the return statement, thus eslint would only validate it as:\r\n\r\n```js\r\nconst Footer = () => ({\r\n  // jsx here\r\n});\r\n```\r\n\r\nObviously this isn't hard to _fix_, either by altering the eslint config, adding some variable into the body or refactoring the arrow to return with `({})`. The more important question is, what's better for users of the generator, will they be more likely to extend the body or use it as a plain return stmt.\r\n\r\nI am against weakening the eslint rules, and IMO both use cases are equally important, so maybe another option to the generator makes sense. Otherwise we should probably pick (whichever) default that validates out-of-the-box.\r\n\r\nI will provide the PR based on a decision in this issue."}}
{"actor":{"display_login":"sthzg"}}