{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/29065","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/29065/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/29065/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/29065/events","html_url":"https://github.com/Microsoft/TypeScript/issues/29065","id":391903982,"node_id":"MDU6SXNzdWUzOTE5MDM5ODI=","number":29065,"title":"[Compiler API] How to hoist variable to the top scope","user":{"login":"longlho","id":198255,"node_id":"MDQ6VXNlcjE5ODI1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/198255?v=4","gravatar_id":"","url":"https://api.github.com/users/longlho","html_url":"https://github.com/longlho","followers_url":"https://api.github.com/users/longlho/followers","following_url":"https://api.github.com/users/longlho/following{/other_user}","gists_url":"https://api.github.com/users/longlho/gists{/gist_id}","starred_url":"https://api.github.com/users/longlho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longlho/subscriptions","organizations_url":"https://api.github.com/users/longlho/orgs","repos_url":"https://api.github.com/users/longlho/repos","events_url":"https://api.github.com/users/longlho/events{/privacy}","received_events_url":"https://api.github.com/users/longlho/received_events","type":"User","site_admin":false},"labels":[{"id":172956911,"node_id":"MDU6TGFiZWwxNzI5NTY5MTE=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/API","name":"API","color":"bfe5bf","default":false},{"id":113971558,"node_id":"MDU6TGFiZWwxMTM5NzE1NTg=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-12-17T21:49:35Z","updated_at":"2018-12-18T02:01:04Z","closed_at":null,"author_association":"NONE","body":"Hi there, I'm trying to write a transformer that hoist constant variable decl to the top scope:\r\n```\r\nfunction () {\r\n  const FOO = 1\r\n  return FOO + 1\r\n}\r\n```\r\nto\r\n```\r\nconst FOO = 1\r\nfunction () {\r\n  return FOO + 1\r\n}\r\n```\r\n\r\nI've been digging through the existing transformers but could not find an example that does this. Any pointer would be great!\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/448068692","html_url":"https://github.com/Microsoft/TypeScript/issues/29065#issuecomment-448068692","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/29065","id":448068692,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODA2ODY5Mg==","user":{"login":"longlho","id":198255,"node_id":"MDQ6VXNlcjE5ODI1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/198255?v=4","gravatar_id":"","url":"https://api.github.com/users/longlho","html_url":"https://github.com/longlho","followers_url":"https://api.github.com/users/longlho/followers","following_url":"https://api.github.com/users/longlho/following{/other_user}","gists_url":"https://api.github.com/users/longlho/gists{/gist_id}","starred_url":"https://api.github.com/users/longlho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longlho/subscriptions","organizations_url":"https://api.github.com/users/longlho/orgs","repos_url":"https://api.github.com/users/longlho/repos","events_url":"https://api.github.com/users/longlho/events{/privacy}","received_events_url":"https://api.github.com/users/longlho/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T02:01:04Z","updated_at":"2018-12-18T02:01:04Z","author_association":"NONE","body":"Ah gotcha! Thanks a lot for the help!! Feel free to close this issue :)"}}
{"actor":{"display_login":"longlho"}}