{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/javascript/pulls/comments/62241851","id":62241851,"diff_hunk":"@@ -0,0 +1,11 @@\n+class Foo {\n+  foo = {bar: 12, baz: true};\n+  bar = {[baz]: 'something'};","path":"packages/shopify-codemod/test/fixtures/constructor-literal-assignment-to-class-property/complex-literals.output.js","position":3,"original_position":3,"commit_id":"376f8a62882d308a9fffa542c2353f18561f4ef8","original_commit_id":"376f8a62882d308a9fffa542c2353f18561f4ef8","user":{"login":"bouk","id":97820,"avatar_url":"https://avatars.githubusercontent.com/u/97820?v=3","gravatar_id":"","url":"https://api.github.com/users/bouk","html_url":"https://github.com/bouk","followers_url":"https://api.github.com/users/bouk/followers","following_url":"https://api.github.com/users/bouk/following{/other_user}","gists_url":"https://api.github.com/users/bouk/gists{/gist_id}","starred_url":"https://api.github.com/users/bouk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bouk/subscriptions","organizations_url":"https://api.github.com/users/bouk/orgs","repos_url":"https://api.github.com/users/bouk/repos","events_url":"https://api.github.com/users/bouk/events{/privacy}","received_events_url":"https://api.github.com/users/bouk/received_events","type":"User","site_admin":false},"body":"does this make the eslint rule fail if we don't put it as a class property? because it's pretty confusing to have to intersperse the contructor and these lines to be able to make sense of it (like, there's no easy way to see where baz came from)","created_at":"2016-05-05T19:35:26Z","updated_at":"2016-05-05T19:35:26Z","html_url":"https://github.com/Shopify/javascript/pull/62#discussion_r62241851","pull_request_url":"https://api.github.com/repos/Shopify/javascript/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/Shopify/javascript/pulls/comments/62241851"},"html":{"href":"https://github.com/Shopify/javascript/pull/62#discussion_r62241851"},"pull_request":{"href":"https://api.github.com/repos/Shopify/javascript/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/javascript/pulls/62","id":69034572,"html_url":"https://github.com/Shopify/javascript/pull/62","diff_url":"https://github.com/Shopify/javascript/pull/62.diff","patch_url":"https://github.com/Shopify/javascript/pull/62.patch","issue_url":"https://api.github.com/repos/Shopify/javascript/issues/62","number":62,"state":"open","locked":false,"title":"Add constructor-literal-assignment-to-class-property transform","user":{"login":"lemonmade","id":3012583,"avatar_url":"https://avatars.githubusercontent.com/u/3012583?v=3","gravatar_id":"","url":"https://api.github.com/users/lemonmade","html_url":"https://github.com/lemonmade","followers_url":"https://api.github.com/users/lemonmade/followers","following_url":"https://api.github.com/users/lemonmade/following{/other_user}","gists_url":"https://api.github.com/users/lemonmade/gists{/gist_id}","starred_url":"https://api.github.com/users/lemonmade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemonmade/subscriptions","organizations_url":"https://api.github.com/users/lemonmade/orgs","repos_url":"https://api.github.com/users/lemonmade/repos","events_url":"https://api.github.com/users/lemonmade/events{/privacy}","received_events_url":"https://api.github.com/users/lemonmade/received_events","type":"User","site_admin":false},"body":"This PR adds a transform that is basically just for enforcing the `prefer-class-property` ESLint rule we added. It moves any context assignments in the constructor that are not dynamic (i.e., that don't depend on `this` and that don't depend on any bindings only available in the constructor) to be class properties.\r\n\r\ncc/ @GoodForOneFare @bouk @fandy ","created_at":"2016-05-05T16:49:08Z","updated_at":"2016-05-05T19:35:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8aa07c38e2e580241a65710e98c21b206305f699","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/javascript/pulls/62/commits","review_comments_url":"https://api.github.com/repos/Shopify/javascript/pulls/62/comments","review_comment_url":"https://api.github.com/repos/Shopify/javascript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/javascript/issues/62/comments","statuses_url":"https://api.github.com/repos/Shopify/javascript/statuses/376f8a62882d308a9fffa542c2353f18561f4ef8","head":{"label":"Shopify:static-constructor-assignment-to-class-property","ref":"static-constructor-assignment-to-class-property","sha":"376f8a62882d308a9fffa542c2353f18561f4ef8","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":49887169,"name":"javascript","full_name":"Shopify/javascript","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/javascript","description":"The home for all things JavaScript at Shopify.","fork":false,"url":"https://api.github.com/repos/Shopify/javascript","forks_url":"https://api.github.com/repos/Shopify/javascript/forks","keys_url":"https://api.github.com/repos/Shopify/javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/javascript/teams","hooks_url":"https://api.github.com/repos/Shopify/javascript/hooks","issue_events_url":"https://api.github.com/repos/Shopify/javascript/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/javascript/events","assignees_url":"https://api.github.com/repos/Shopify/javascript/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/javascript/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/javascript/tags","blobs_url":"https://api.github.com/repos/Shopify/javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/javascript/languages","stargazers_url":"https://api.github.com/repos/Shopify/javascript/stargazers","contributors_url":"https://api.github.com/repos/Shopify/javascript/contributors","subscribers_url":"https://api.github.com/repos/Shopify/javascript/subscribers","subscription_url":"https://api.github.com/repos/Shopify/javascript/subscription","commits_url":"https://api.github.com/repos/Shopify/javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/javascript/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/javascript/merges","archive_url":"https://api.github.com/repos/Shopify/javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/javascript/downloads","issues_url":"https://api.github.com/repos/Shopify/javascript/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/javascript/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/javascript/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/javascript/deployments","created_at":"2016-01-18T15:54:37Z","updated_at":"2016-05-02T18:43:12Z","pushed_at":"2016-05-05T16:49:09Z","git_url":"git://github.com/Shopify/javascript.git","ssh_url":"git@github.com:Shopify/javascript.git","clone_url":"https://github.com/Shopify/javascript.git","svn_url":"https://github.com/Shopify/javascript","homepage":null,"size":342,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":12,"forks":3,"open_issues":12,"watchers":21,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"24729fd2abf19cf556e598892de5ded3bd209745","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":49887169,"name":"javascript","full_name":"Shopify/javascript","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/javascript","description":"The home for all things JavaScript at Shopify.","fork":false,"url":"https://api.github.com/repos/Shopify/javascript","forks_url":"https://api.github.com/repos/Shopify/javascript/forks","keys_url":"https://api.github.com/repos/Shopify/javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/javascript/teams","hooks_url":"https://api.github.com/repos/Shopify/javascript/hooks","issue_events_url":"https://api.github.com/repos/Shopify/javascript/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/javascript/events","assignees_url":"https://api.github.com/repos/Shopify/javascript/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/javascript/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/javascript/tags","blobs_url":"https://api.github.com/repos/Shopify/javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/javascript/languages","stargazers_url":"https://api.github.com/repos/Shopify/javascript/stargazers","contributors_url":"https://api.github.com/repos/Shopify/javascript/contributors","subscribers_url":"https://api.github.com/repos/Shopify/javascript/subscribers","subscription_url":"https://api.github.com/repos/Shopify/javascript/subscription","commits_url":"https://api.github.com/repos/Shopify/javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/javascript/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/javascript/merges","archive_url":"https://api.github.com/repos/Shopify/javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/javascript/downloads","issues_url":"https://api.github.com/repos/Shopify/javascript/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/javascript/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/javascript/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/javascript/deployments","created_at":"2016-01-18T15:54:37Z","updated_at":"2016-05-02T18:43:12Z","pushed_at":"2016-05-05T16:49:09Z","git_url":"git://github.com/Shopify/javascript.git","ssh_url":"git@github.com:Shopify/javascript.git","clone_url":"https://github.com/Shopify/javascript.git","svn_url":"https://github.com/Shopify/javascript","homepage":null,"size":342,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":12,"forks":3,"open_issues":12,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/javascript/pulls/62"},"html":{"href":"https://github.com/Shopify/javascript/pull/62"},"issue":{"href":"https://api.github.com/repos/Shopify/javascript/issues/62"},"comments":{"href":"https://api.github.com/repos/Shopify/javascript/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/javascript/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/javascript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/javascript/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/javascript/statuses/376f8a62882d308a9fffa542c2353f18561f4ef8"}}}}