{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2575","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2575/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2575/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2575/events","html_url":"https://github.com/Microsoft/TypeScript/issues/2575","id":65710120,"number":2575,"title":"Compiler warnings / errors for common automatic semi-colon insertion (ASI) issues","user":{"login":"jeffmay","id":755988,"avatar_url":"https://avatars.githubusercontent.com/u/755988?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffmay","html_url":"https://github.com/jeffmay","followers_url":"https://api.github.com/users/jeffmay/followers","following_url":"https://api.github.com/users/jeffmay/following{/other_user}","gists_url":"https://api.github.com/users/jeffmay/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffmay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffmay/subscriptions","organizations_url":"https://api.github.com/users/jeffmay/orgs","repos_url":"https://api.github.com/users/jeffmay/repos","events_url":"https://api.github.com/users/jeffmay/events{/privacy}","received_events_url":"https://api.github.com/users/jeffmay/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-04-01T15:18:47Z","updated_at":"2015-04-14T06:31:18Z","closed_at":null,"body":"Personally, I like the look (and simplicity) of ECMA6 / TypeScript without semi-colons. The only problem is that there are some known danger-zones with automatic semi-colon insertion. Could we have compiler warnings to prevent these from slipping through the cracks?\r\n\r\nExample:\r\n```typescript\r\nfunction dangerous(): string {\r\n    return\r\n        \"watch the semi-colons!\"\r\n}\r\ndangerous()\r\n```\r\n\r\nCompiles to the following with no warnings or compiler errors (even though the function actually doesn't return a string):\r\n```javascript\r\nfunction dangerous() {\r\n    return;\r\n    \"watch the semi-colons!\";\r\n}\r\ndangerous();\r\n```\r\n\r\nThis specific case is kind of scary / annoying, but it might be worth looking into others.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/92646197","html_url":"https://github.com/Microsoft/TypeScript/issues/2575#issuecomment-92646197","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2575","id":92646197,"user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T06:31:18Z","updated_at":"2015-04-14T06:31:18Z","body":"> `return undefined` is such a strange thing to do.\r\n\r\nYup. Some people don't want to write `undefined` the same way some people don't want to write semicolons."}}