{"action":"created","issue":{"url":"https://api.github.com/repos/palantir/tslint/issues/1632","repository_url":"https://api.github.com/repos/palantir/tslint","labels_url":"https://api.github.com/repos/palantir/tslint/issues/1632/labels{/name}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/1632/comments","events_url":"https://api.github.com/repos/palantir/tslint/issues/1632/events","html_url":"https://github.com/palantir/tslint/pull/1632","id":183246712,"number":1632,"title":"New rule: no-floating-promises","user":{"login":"JoshuaKGoldberg","id":3335181,"avatar_url":"https://avatars2.githubusercontent.com/u/3335181?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshuaKGoldberg","html_url":"https://github.com/JoshuaKGoldberg","followers_url":"https://api.github.com/users/JoshuaKGoldberg/followers","following_url":"https://api.github.com/users/JoshuaKGoldberg/following{/other_user}","gists_url":"https://api.github.com/users/JoshuaKGoldberg/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshuaKGoldberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshuaKGoldberg/subscriptions","organizations_url":"https://api.github.com/users/JoshuaKGoldberg/orgs","repos_url":"https://api.github.com/users/JoshuaKGoldberg/repos","events_url":"https://api.github.com/users/JoshuaKGoldberg/events{/privacy}","received_events_url":"https://api.github.com/users/JoshuaKGoldberg/received_events","type":"User","site_admin":false},"labels":[{"id":236421827,"url":"https://api.github.com/repos/palantir/tslint/labels/PR:%20waiting%20for%20author","name":"PR: waiting for author","color":"FBEA92","default":false},{"id":427273270,"url":"https://api.github.com/repos/palantir/tslint/labels/Requires%20Type%20Checker","name":"Requires Type Checker","color":"bfdadc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-10-16T03:29:58Z","updated_at":"2017-05-12T20:13:14Z","closed_at":"2017-01-19T03:59:14Z","pull_request":{"url":"https://api.github.com/repos/palantir/tslint/pulls/1632","html_url":"https://github.com/palantir/tslint/pull/1632","diff_url":"https://github.com/palantir/tslint/pull/1632.diff","patch_url":"https://github.com/palantir/tslint/pull/1632.patch"},"body":"Promises must be stored or passed to a function.\n\nThe idea here is that floating (unhandled) Promises can cause unexpected behavior. For example, in tests, they might resolve at unexpected times (like after another test following their parent test has started).\n\nFixes https://github.com/Microsoft/tslint-microsoft-contrib/issues/174 (PRing here because I'm not sure they support the type checker).\n"},"comment":{"url":"https://api.github.com/repos/palantir/tslint/issues/comments/301174811","html_url":"https://github.com/palantir/tslint/pull/1632#issuecomment-301174811","issue_url":"https://api.github.com/repos/palantir/tslint/issues/1632","id":301174811,"user":{"login":"RobFreundlich","id":7975013,"avatar_url":"https://avatars1.githubusercontent.com/u/7975013?v=3","gravatar_id":"","url":"https://api.github.com/users/RobFreundlich","html_url":"https://github.com/RobFreundlich","followers_url":"https://api.github.com/users/RobFreundlich/followers","following_url":"https://api.github.com/users/RobFreundlich/following{/other_user}","gists_url":"https://api.github.com/users/RobFreundlich/gists{/gist_id}","starred_url":"https://api.github.com/users/RobFreundlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobFreundlich/subscriptions","organizations_url":"https://api.github.com/users/RobFreundlich/orgs","repos_url":"https://api.github.com/users/RobFreundlich/repos","events_url":"https://api.github.com/users/RobFreundlich/events{/privacy}","received_events_url":"https://api.github.com/users/RobFreundlich/received_events","type":"User","site_admin":false},"created_at":"2017-05-12T20:13:14Z","updated_at":"2017-05-12T20:13:14Z","body":"When turning on no-floating-promises, code like the following is getting flagged as a problem:\r\n\r\n```typescript\r\nsomething_that_produces_a_promise().then(() => fulfillPromise());\r\nfunction fulfillPromise()\r\n{\r\n  // do some stuff ...\r\n  resolve(whatever);\r\n}\r\n```\r\n\r\nThat seems wrong to me - the ```Promise``` is getting handled by a ```then()```.  Granted, the ```then()``` technically returns a ```Promise```, but if TSLint is going to complain about that, then isn't this rule sort of impossible to *not* trigger?\r\n\r\nAm I misunderstanding something, or is this a bug?\r\n\r\nThanks!"}}
{"actor":{"display_login":"RobFreundlich"}}