{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel-eslint/issues/401","repository_url":"https://api.github.com/repos/babel/babel-eslint","labels_url":"https://api.github.com/repos/babel/babel-eslint/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel-eslint/issues/401/comments","events_url":"https://api.github.com/repos/babel/babel-eslint/issues/401/events","html_url":"https://github.com/babel/babel-eslint/issues/401","id":180420073,"number":401,"title":"`this` inside arrow function as property initializer trips no-invalid-this","user":{"login":"alxndr","id":174307,"avatar_url":"https://avatars.githubusercontent.com/u/174307?v=3","gravatar_id":"","url":"https://api.github.com/users/alxndr","html_url":"https://github.com/alxndr","followers_url":"https://api.github.com/users/alxndr/followers","following_url":"https://api.github.com/users/alxndr/following{/other_user}","gists_url":"https://api.github.com/users/alxndr/gists{/gist_id}","starred_url":"https://api.github.com/users/alxndr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alxndr/subscriptions","organizations_url":"https://api.github.com/users/alxndr/orgs","repos_url":"https://api.github.com/users/alxndr/repos","events_url":"https://api.github.com/users/alxndr/events{/privacy}","received_events_url":"https://api.github.com/users/alxndr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-30T23:08:31Z","updated_at":"2016-10-12T02:07:14Z","closed_at":null,"body":"[A React release announcement from January 2015](https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding) includes an example of using an arrow function \r\n\r\n> However, when we have the future property initializers, there is a neat trick that you can use to accomplish this [prebinding instance methods] syntactically:\r\n\r\n```javascript\r\nclass Counter extends React.Component {\r\n  tick = () => {\r\n    ...\r\n  }\r\n  ...\r\n}\r\n```\r\n\r\nHowever, using `this` inside such an arrow function appears to trip the `no-invalid-this` rule:\r\n\r\n```shell\r\n$ echo \"class Class {\\n\\tfunc = (foo) => {\\n\\t\\tthis.foo = foo;\\n\\t}\\n}\" | ./node_modules/.bin/eslint --parser babel-eslint --stdin --quiet\r\n\r\n<text>\r\n  3:3  error  Unexpected 'this'  no-invalid-this\r\n\r\n✖ 1 problem (1 error, 0 warnings)\r\n```\r\n\r\n(Hoping this belongs here and not in the main eslint project?)"},"comment":{"url":"https://api.github.com/repos/babel/babel-eslint/issues/comments/253099182","html_url":"https://github.com/babel/babel-eslint/issues/401#issuecomment-253099182","issue_url":"https://api.github.com/repos/babel/babel-eslint/issues/401","id":253099182,"user":{"login":"kaicataldo","id":7041728,"avatar_url":"https://avatars.githubusercontent.com/u/7041728?v=3","gravatar_id":"","url":"https://api.github.com/users/kaicataldo","html_url":"https://github.com/kaicataldo","followers_url":"https://api.github.com/users/kaicataldo/followers","following_url":"https://api.github.com/users/kaicataldo/following{/other_user}","gists_url":"https://api.github.com/users/kaicataldo/gists{/gist_id}","starred_url":"https://api.github.com/users/kaicataldo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaicataldo/subscriptions","organizations_url":"https://api.github.com/users/kaicataldo/orgs","repos_url":"https://api.github.com/users/kaicataldo/repos","events_url":"https://api.github.com/users/kaicataldo/events{/privacy}","received_events_url":"https://api.github.com/users/kaicataldo/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T02:07:14Z","updated_at":"2016-10-12T02:07:14Z","body":"`no-invalid-this` most likely needs to be forked, altered to check this case, and added to https://github.com/babel/eslint-plugin-babel"}}
{"actor":{"display_login":"kaicataldo"}}