{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9821","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9821/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9821/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9821/events","html_url":"https://github.com/Microsoft/TypeScript/issues/9821","id":166364461,"number":9821,"title":"es6 import should not emit a 'require' for d.ts file with const enum","user":{"login":"nojvek","id":1018196,"avatar_url":"https://avatars.githubusercontent.com/u/1018196?v=3","gravatar_id":"","url":"https://api.github.com/users/nojvek","html_url":"https://github.com/nojvek","followers_url":"https://api.github.com/users/nojvek/followers","following_url":"https://api.github.com/users/nojvek/following{/other_user}","gists_url":"https://api.github.com/users/nojvek/gists{/gist_id}","starred_url":"https://api.github.com/users/nojvek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nojvek/subscriptions","organizations_url":"https://api.github.com/users/nojvek/orgs","repos_url":"https://api.github.com/users/nojvek/repos","events_url":"https://api.github.com/users/nojvek/events{/privacy}","received_events_url":"https://api.github.com/users/nojvek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-19T15:41:39Z","updated_at":"2016-07-19T17:02:44Z","closed_at":"2016-07-19T17:02:44Z","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  1.8.0 / nightly (2.0.0-dev.201xxxxx)\r\n\r\n**Code**\r\n\r\nexample.ts:\r\n```ts\r\n// A *self-contained* demonstration of the problem follows...\r\nimport * as foo from './foo'\r\nif (foo.Commands.Yay) {\r\n   console.log(\"yay\")\r\n}\r\n```\r\n\r\nfoo.d.t.s\r\n```\r\nexport const enum Commands {\r\n   Yay = 1,\r\n   Boo = 2\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nfoo.d.ts is  purely a typescript declaration. It doesn't have a foo.js file\r\n\r\nwhen example.js is emitted it should have\r\n\r\n```\r\nif (1 /* Commands.Yay */){\r\n   console.log(\"yay\")\r\n}\r\n```\r\n\r\n**Actual behavior:** \r\n\r\n```\r\nfoo = require(\"./foo\") // Should not be emitted for const enum uses\r\n\r\nif (1 /* Commands.Yay */){\r\n   console.log(\"yay\")\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/233698951","html_url":"https://github.com/Microsoft/TypeScript/issues/9821#issuecomment-233698951","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9821","id":233698951,"user":{"login":"vladima","id":8052307,"avatar_url":"https://avatars.githubusercontent.com/u/8052307?v=3","gravatar_id":"","url":"https://api.github.com/users/vladima","html_url":"https://github.com/vladima","followers_url":"https://api.github.com/users/vladima/followers","following_url":"https://api.github.com/users/vladima/following{/other_user}","gists_url":"https://api.github.com/users/vladima/gists{/gist_id}","starred_url":"https://api.github.com/users/vladima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladima/subscriptions","organizations_url":"https://api.github.com/users/vladima/orgs","repos_url":"https://api.github.com/users/vladima/repos","events_url":"https://api.github.com/users/vladima/events{/privacy}","received_events_url":"https://api.github.com/users/vladima/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T17:02:44Z","updated_at":"2016-07-19T17:02:44Z","body":"duplicate of #4690"}}
{"actor":{"display_login":"vladima"}}