{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21251","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21251/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21251/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21251/events","html_url":"https://github.com/Microsoft/TypeScript/issues/21251","id":289477201,"number":21251,"title":"Misleading English message for error TS1046","user":{"login":"dtgriscom","id":842958,"avatar_url":"https://avatars3.githubusercontent.com/u/842958?v=4","gravatar_id":"","url":"https://api.github.com/users/dtgriscom","html_url":"https://github.com/dtgriscom","followers_url":"https://api.github.com/users/dtgriscom/followers","following_url":"https://api.github.com/users/dtgriscom/following{/other_user}","gists_url":"https://api.github.com/users/dtgriscom/gists{/gist_id}","starred_url":"https://api.github.com/users/dtgriscom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtgriscom/subscriptions","organizations_url":"https://api.github.com/users/dtgriscom/orgs","repos_url":"https://api.github.com/users/dtgriscom/repos","events_url":"https://api.github.com/users/dtgriscom/events{/privacy}","received_events_url":"https://api.github.com/users/dtgriscom/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":306530502,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Domain:%20Error%20Messages","name":"Domain: Error Messages","color":"fef2c0","default":false},{"id":265374716,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/good%20first%20issue","name":"good first issue","color":"7944ba","default":true},{"id":117630704,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/help%20wanted","name":"help wanted","color":"009800","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2","html_url":"https://github.com/Microsoft/TypeScript/milestone/2","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2/labels","id":721044,"number":2,"title":"Community","description":"Issues in the 'Community' milestone are ones which we are accepting pull requests for","creator":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars3.githubusercontent.com/u/6685088?v=4","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"open_issues":475,"closed_issues":141,"state":"open","created_at":"2014-07-14T23:24:58Z","updated_at":"2018-04-02T16:50:21Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-01-18T01:53:51Z","updated_at":"2018-04-02T17:02:36Z","closed_at":null,"author_association":"NONE","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<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:**  2.0.10 (checked; message is the same on master branch)\r\n\r\n**Code**\r\n\r\nThe following test.d.ts file:\r\n\r\n    module test {\r\n        export const test: number;\r\n    }\r\n\r\nwhen compiled, yields the following error message:\r\n\r\n```error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.```\r\n\r\nThis is both misleading and just wrong, as the following test.d.ts file is legal:\r\n\r\n    export const test: number;\r\n\r\n**Expected behavior:**\r\n\r\nThe error message should not be misleading.\r\n\r\n**Actual behavior:**\r\n\r\nThe error message is misleading. This led me on a wild goose chase trying to get my .d.ts file to compile, all the time using the apparently required `declare` statement, when the solution didn't have `declare` at all.\r\n\r\n**Related:**\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/377979336","html_url":"https://github.com/Microsoft/TypeScript/issues/21251#issuecomment-377979336","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21251","id":377979336,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T17:02:36Z","updated_at":"2018-04-02T17:02:36Z","author_association":"CONTRIBUTOR","body":"First we need a new message text proposal. \r\n\r\nFor the change itself, all messages are stored in https://github.com/Microsoft/TypeScript/blob/master/src/compiler/diagnosticMessages.json, you will need to change it and change the reference site to it in https://raw.githubusercontent.com/Microsoft/TypeScript/master/src/compiler/checker.ts (search for `Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file`)."}}
{"actor":{"display_login":"mhegazy"}}