{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4717","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4717/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4717/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4717/events","html_url":"https://github.com/Microsoft/TypeScript/issues/4717","id":105691331,"number":4717,"title":"Removing unused imports \"feature\"","user":{"login":"nullptr128","id":10756452,"avatar_url":"https://avatars.githubusercontent.com/u/10756452?v=3","gravatar_id":"","url":"https://api.github.com/users/nullptr128","html_url":"https://github.com/nullptr128","followers_url":"https://api.github.com/users/nullptr128/followers","following_url":"https://api.github.com/users/nullptr128/following{/other_user}","gists_url":"https://api.github.com/users/nullptr128/gists{/gist_id}","starred_url":"https://api.github.com/users/nullptr128/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nullptr128/subscriptions","organizations_url":"https://api.github.com/users/nullptr128/orgs","repos_url":"https://api.github.com/users/nullptr128/repos","events_url":"https://api.github.com/users/nullptr128/events{/privacy}","received_events_url":"https://api.github.com/users/nullptr128/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/By%20Design","name":"By Design","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-09T21:48:55Z","updated_at":"2015-09-09T23:25:57Z","closed_at":"2015-09-09T21:58:08Z","body":"Hello!\r\n\r\nI recently stumbled upon a bit weird error which made me lost a bit of time. I am using TypeScript in client side SPA application with browserify (TypeScript module setting is \"commonjs\"). I found out that compiler has weird feature of silently removing \"dead\" imports that are not used within module code.\r\n\r\nThis should not work this way as it breaks code, because some libraries actually just extend other ones, with the example being Knockout Punches. This leads me to make a stupid workaround just to \"cheat\" TypeScript compiler. This behaviour shuold be documented and it should be configurable.\r\n\r\nCode: http://pastebin.com/0dSyzieq\r\n\r\nRemoving fakeArray causes line 25 (ko.punches.enableAll()) to break in runtime because TS skips this import and knockout.punches library is not extending base Knockout at all."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/139071490","html_url":"https://github.com/Microsoft/TypeScript/issues/4717#issuecomment-139071490","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4717","id":139071490,"user":{"login":"nullptr128","id":10756452,"avatar_url":"https://avatars.githubusercontent.com/u/10756452?v=3","gravatar_id":"","url":"https://api.github.com/users/nullptr128","html_url":"https://github.com/nullptr128","followers_url":"https://api.github.com/users/nullptr128/followers","following_url":"https://api.github.com/users/nullptr128/following{/other_user}","gists_url":"https://api.github.com/users/nullptr128/gists{/gist_id}","starred_url":"https://api.github.com/users/nullptr128/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nullptr128/subscriptions","organizations_url":"https://api.github.com/users/nullptr128/orgs","repos_url":"https://api.github.com/users/nullptr128/repos","events_url":"https://api.github.com/users/nullptr128/events{/privacy}","received_events_url":"https://api.github.com/users/nullptr128/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T23:25:57Z","updated_at":"2015-09-09T23:25:57Z","body":"Okay thank you. I wish it would be optional feature to switch off in configuration, because this is more often than not going to make problems. A lot of library use \"extend some type\" pattern, like KnockoutJS or jQuery."}}