{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3576","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3576/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3576/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3576/events","html_url":"https://github.com/Microsoft/TypeScript/issues/3576","id":89665638,"number":3576,"title":"Emit 'use strict' code for input defined via ES6 modules","user":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/In%20Discussion","name":"In Discussion","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-19T21:34:02Z","updated_at":"2015-09-30T14:16:17Z","closed_at":null,"body":"ES6 modules default to running the code in the module in the strict mode. When transpiling this input into ES5 the strict mode should be preserved.\r\n\r\nAs of Typescript 1.5 beta this is not the case:\r\n\r\ninput:\r\n\r\n```\r\nexport class Foo{}\r\n```\r\n\r\ntranspile with: `tsc --module commonjs test.ts`\r\n\r\nactual output:\r\n\r\n```\r\nvar Foo = (function () {\r\n    function Foo() {\r\n    }\r\n    return Foo;\r\n})();\r\nexports.Foo = Foo;\r\n```\r\n\r\nexpected output:\r\n\r\n```\r\n'use strict';\r\n\r\nvar Foo = (function () {\r\n    function Foo() {\r\n    }\r\n    return Foo;\r\n})();\r\nexports.Foo = Foo;\r\n```\r\n\r\nThe same issue affects output for amd and system module formats."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/144424256","html_url":"https://github.com/Microsoft/TypeScript/issues/3576#issuecomment-144424256","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3576","id":144424256,"user":{"login":"speigg","id":507127,"avatar_url":"https://avatars.githubusercontent.com/u/507127?v=3","gravatar_id":"","url":"https://api.github.com/users/speigg","html_url":"https://github.com/speigg","followers_url":"https://api.github.com/users/speigg/followers","following_url":"https://api.github.com/users/speigg/following{/other_user}","gists_url":"https://api.github.com/users/speigg/gists{/gist_id}","starred_url":"https://api.github.com/users/speigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/speigg/subscriptions","organizations_url":"https://api.github.com/users/speigg/orgs","repos_url":"https://api.github.com/users/speigg/repos","events_url":"https://api.github.com/users/speigg/events{/privacy}","received_events_url":"https://api.github.com/users/speigg/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T14:16:17Z","updated_at":"2015-09-30T14:16:17Z","body":"@DanielRosenwasser es6 modules cannot be simply concatenated together. Any bundler has to ensure that each module has it's own scope. "}}