{"action":"created","issue":{"url":"https://api.github.com/repos/screepers/typed-screeps/issues/90","repository_url":"https://api.github.com/repos/screepers/typed-screeps","labels_url":"https://api.github.com/repos/screepers/typed-screeps/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/screepers/typed-screeps/issues/90/comments","events_url":"https://api.github.com/repos/screepers/typed-screeps/issues/90/events","html_url":"https://github.com/screepers/typed-screeps/pull/90","id":352503617,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5Nzk4NjI3","number":90,"title":"Remove index signature from Memory","user":{"login":"Jomik","id":699655,"node_id":"MDQ6VXNlcjY5OTY1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/699655?v=4","gravatar_id":"","url":"https://api.github.com/users/Jomik","html_url":"https://github.com/Jomik","followers_url":"https://api.github.com/users/Jomik/followers","following_url":"https://api.github.com/users/Jomik/following{/other_user}","gists_url":"https://api.github.com/users/Jomik/gists{/gist_id}","starred_url":"https://api.github.com/users/Jomik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jomik/subscriptions","organizations_url":"https://api.github.com/users/Jomik/orgs","repos_url":"https://api.github.com/users/Jomik/repos","events_url":"https://api.github.com/users/Jomik/events{/privacy}","received_events_url":"https://api.github.com/users/Jomik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-21T11:48:11Z","updated_at":"2018-09-12T16:33:11Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/screepers/typed-screeps/pulls/90","html_url":"https://github.com/screepers/typed-screeps/pull/90","diff_url":"https://github.com/screepers/typed-screeps/pull/90.diff","patch_url":"https://github.com/screepers/typed-screeps/pull/90.patch"},"body":"<!-- Thank you for your contribution to typed-screeps! Please replace {Please write here} with your description. -->\r\n\r\n### Brief Description\r\nRemoves `[name: string]: any` from `Memory` as this may be unwanted.\r\nHaving the index signature removes any possibility of getting errors when mistyping memory access.\r\nI personally want to specify the type of my memory exactly, and not have `any`.\r\nIf people want the old behavior, they can easily add the index signature.\r\n\r\n### Checklists\r\n\r\n<!-- Put an 'x' inside the '[ ]' next to each completed items -->\r\n\r\n- [x] Test passed\r\n- [x] Coding style (indentation, etc)\r\n- [x] Edits have been made to `src/` files not `index.d.ts`\r\n- [x] Run `npm run dtslint` to update `index.d.ts`\r\n"},"comment":{"url":"https://api.github.com/repos/screepers/typed-screeps/issues/comments/420714079","html_url":"https://github.com/screepers/typed-screeps/pull/90#issuecomment-420714079","issue_url":"https://api.github.com/repos/screepers/typed-screeps/issues/90","id":420714079,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDcxNDA3OQ==","user":{"login":"wtfrank","id":1202593,"node_id":"MDQ6VXNlcjEyMDI1OTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1202593?v=4","gravatar_id":"","url":"https://api.github.com/users/wtfrank","html_url":"https://github.com/wtfrank","followers_url":"https://api.github.com/users/wtfrank/followers","following_url":"https://api.github.com/users/wtfrank/following{/other_user}","gists_url":"https://api.github.com/users/wtfrank/gists{/gist_id}","starred_url":"https://api.github.com/users/wtfrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wtfrank/subscriptions","organizations_url":"https://api.github.com/users/wtfrank/orgs","repos_url":"https://api.github.com/users/wtfrank/repos","events_url":"https://api.github.com/users/wtfrank/events{/privacy}","received_events_url":"https://api.github.com/users/wtfrank/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T16:33:11Z","updated_at":"2018-09-12T16:33:11Z","author_association":"CONTRIBUTOR","body":"When you are first migrating to typescript, you probably want \"[name: string]: any \" in Memory to make migration easier.\r\n\r\nHowever once you've migrated you will probably decide to specify types for your Memory, so this line is actively harmful as it overrides any subtyping you do of Memory inside your own index.d.ts\r\n\r\nWorse, you have to edit node_modules/@types/screeps/index.d.ts before you can set up your own type checking on Memory. And then if you update this module, it will add this line back in and silently stop catching typos etc on Memory (which happened to me recently).\r\n\r\nIMO this line should be suggested in the Readme for people who are migrating from JS to TS, but it should not be enabled by default."}}
{"actor":{"display_login":"wtfrank"}}