{"action":"created","issue":{"url":"https://api.github.com/repos/palantir/tslint/issues/3279","repository_url":"https://api.github.com/repos/palantir/tslint","labels_url":"https://api.github.com/repos/palantir/tslint/issues/3279/labels{/name}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/3279/comments","events_url":"https://api.github.com/repos/palantir/tslint/issues/3279/events","html_url":"https://github.com/palantir/tslint/issues/3279","id":262858497,"node_id":"MDU6SXNzdWUyNjI4NTg0OTc=","number":3279,"title":"strict-boolean-expressions should not fire for logical operators used in a non-boolean context","user":{"login":"marcind","id":607223,"node_id":"MDQ6VXNlcjYwNzIyMw==","avatar_url":"https://avatars3.githubusercontent.com/u/607223?v=4","gravatar_id":"","url":"https://api.github.com/users/marcind","html_url":"https://github.com/marcind","followers_url":"https://api.github.com/users/marcind/followers","following_url":"https://api.github.com/users/marcind/following{/other_user}","gists_url":"https://api.github.com/users/marcind/gists{/gist_id}","starred_url":"https://api.github.com/users/marcind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcind/subscriptions","organizations_url":"https://api.github.com/users/marcind/orgs","repos_url":"https://api.github.com/users/marcind/repos","events_url":"https://api.github.com/users/marcind/events{/privacy}","received_events_url":"https://api.github.com/users/marcind/received_events","type":"User","site_admin":false},"labels":[{"id":234815875,"node_id":"MDU6TGFiZWwyMzQ4MTU4NzU=","url":"https://api.github.com/repos/palantir/tslint/labels/Status:%20Accepting%20PRs","name":"Status: Accepting PRs","color":"0052cc","default":false},{"id":236412286,"node_id":"MDU6TGFiZWwyMzY0MTIyODY=","url":"https://api.github.com/repos/palantir/tslint/labels/Status:%20Work%20In%20Progress","name":"Status: Work In Progress","color":"bfe5bf","default":false},{"id":49399915,"node_id":"MDU6TGFiZWw0OTM5OTkxNQ==","url":"https://api.github.com/repos/palantir/tslint/labels/Type:%20Bug","name":"Type: Bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-10-04T16:54:18Z","updated_at":"2018-12-29T13:49:11Z","closed_at":null,"author_association":"NONE","body":"### Bug Report\r\n\r\n- __TSLint version__: 5.7\r\n- __TypeScript version__: 2.5.3\r\n- __Running TSLint via__: CLI\r\n\r\n#### TypeScript code being linted\r\n\r\n```ts\r\n// code snippet\r\nfunction valueOrDefault(a?: string) {\r\n  return a || \"the default\";\r\n}\r\n```\r\n\r\nwith `tslint.json` configuration:\r\n\r\n```json\r\n{\r\n  \"defaultSeverity\": \"error\",\r\n  \"extends\": [\r\n      \"tslint:all\"\r\n  ]\r\n}\r\n```\r\n\r\n#### Actual behavior\r\n\r\nGetting report of 2 errors:\r\n`strict-boolean-expressions  This type is not allowed in the operand for the '||' operator because it could be undefined. Only booleans are allowed.`\r\n`strict-boolean-expressions  This type is not allowed in the operand for the '||' operator because it is always truthy. Only booleans are allowed.`\r\n\r\n#### Expected behavior\r\n\r\nNo errors being reported. I'm using the logical `||` operator to provide a default value for the parameter (I know I could use a function parameter default declaration, the snippet is just to illustrate the general problem). There's no `boolean` in play anywhere: neither the input or the output of the expression."},"comment":{"url":"https://api.github.com/repos/palantir/tslint/issues/comments/450494514","html_url":"https://github.com/palantir/tslint/issues/3279#issuecomment-450494514","issue_url":"https://api.github.com/repos/palantir/tslint/issues/3279","id":450494514,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDQ5NDUxNA==","user":{"login":"rimiti","id":28003749,"node_id":"MDQ6VXNlcjI4MDAzNzQ5","avatar_url":"https://avatars0.githubusercontent.com/u/28003749?v=4","gravatar_id":"","url":"https://api.github.com/users/rimiti","html_url":"https://github.com/rimiti","followers_url":"https://api.github.com/users/rimiti/followers","following_url":"https://api.github.com/users/rimiti/following{/other_user}","gists_url":"https://api.github.com/users/rimiti/gists{/gist_id}","starred_url":"https://api.github.com/users/rimiti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rimiti/subscriptions","organizations_url":"https://api.github.com/users/rimiti/orgs","repos_url":"https://api.github.com/users/rimiti/repos","events_url":"https://api.github.com/users/rimiti/events{/privacy}","received_events_url":"https://api.github.com/users/rimiti/received_events","type":"User","site_admin":false},"created_at":"2018-12-29T13:49:11Z","updated_at":"2018-12-29T13:49:11Z","author_association":"NONE","body":"includes for array is an ES7 feature.\r\nYou need to change you ts configuration to use ES7 or ESNEXT 🦄\r\n\r\nRegards, 🚀"}}
{"actor":{"display_login":"rimiti"}}