{"action":"created","issue":{"url":"https://api.github.com/repos/palantir/tslint/issues/3212","repository_url":"https://api.github.com/repos/palantir/tslint","labels_url":"https://api.github.com/repos/palantir/tslint/issues/3212/labels{/name}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/3212/comments","events_url":"https://api.github.com/repos/palantir/tslint/issues/3212/events","html_url":"https://github.com/palantir/tslint/issues/3212","id":256730427,"node_id":"MDU6SXNzdWUyNTY3MzA0Mjc=","number":3212,"title":"Rule prefer-object-spread should not work when the first argument of Object.assign is not {}","user":{"login":"zheeeng","id":1303154,"node_id":"MDQ6VXNlcjEzMDMxNTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1303154?v=4","gravatar_id":"","url":"https://api.github.com/users/zheeeng","html_url":"https://github.com/zheeeng","followers_url":"https://api.github.com/users/zheeeng/followers","following_url":"https://api.github.com/users/zheeeng/following{/other_user}","gists_url":"https://api.github.com/users/zheeeng/gists{/gist_id}","starred_url":"https://api.github.com/users/zheeeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zheeeng/subscriptions","organizations_url":"https://api.github.com/users/zheeeng/orgs","repos_url":"https://api.github.com/users/zheeeng/repos","events_url":"https://api.github.com/users/zheeeng/events{/privacy}","received_events_url":"https://api.github.com/users/zheeeng/received_events","type":"User","site_admin":false},"labels":[{"id":243410757,"node_id":"MDU6TGFiZWwyNDM0MTA3NTc=","url":"https://api.github.com/repos/palantir/tslint/labels/P2","name":"P2","color":"bbbbbb","default":false},{"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":242422875,"node_id":"MDU6TGFiZWwyNDI0MjI4NzU=","url":"https://api.github.com/repos/palantir/tslint/labels/Type:%20Breaking%20Change","name":"Type: Breaking Change","color":"f7c6c7","default":false},{"id":49399917,"node_id":"MDU6TGFiZWw0OTM5OTkxNw==","url":"https://api.github.com/repos/palantir/tslint/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"2588C4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-09-11T14:49:05Z","updated_at":"2019-10-02T07:04:17Z","closed_at":null,"author_association":"NONE","body":"### Bug Report\r\n\r\n- __TSLint version__: 5.7.0\r\n- __TypeScript version__: 2.5\r\n- __Running TSLint via__: VS Code\r\n\r\n#### TypeScript code being linted\r\n\r\n```ts\r\nconst values = [2, 3, 4, 5]\r\nconst obj = values.reduce(\r\n    (o, v, i) => Object.assign(o, {[i]: v}),\r\n    {},\r\n)\r\n```\r\n\r\nwith `tslint.json` configuration:\r\n\r\n```json\r\n\"prefer-object-spread\": true,\r\n```\r\n\r\n#### Actual behavior\r\n\r\n```\r\n[tslint] 'Object.assign' returns the first argument. Prefer object spread if you want a new object. (prefer-object-spread)\r\n```\r\n\r\n#### Expected behavior\r\n\r\nI actually want assign properties to the first argument, I want this side effects, it is common in reducing. The reasonable tips appearing is using `Object.assign({}, o1, o2)`, it should be suggested to using spread instead of. What I'm using is the Object.assign designed for."},"comment":{"url":"https://api.github.com/repos/palantir/tslint/issues/comments/537364899","html_url":"https://github.com/palantir/tslint/issues/3212#issuecomment-537364899","issue_url":"https://api.github.com/repos/palantir/tslint/issues/3212","id":537364899,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNzM2NDg5OQ==","user":{"login":"JoshuaKGoldberg","id":3335181,"node_id":"MDQ6VXNlcjMzMzUxODE=","avatar_url":"https://avatars1.githubusercontent.com/u/3335181?v=4","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},"created_at":"2019-10-02T07:04:17Z","updated_at":"2019-10-02T07:04:17Z","author_association":"COLLABORATOR","body":"Removing the `Type: Breaking Change` label per #4811. Now accepting PRs!"}}
{"actor":{"display_login":"JoshuaKGoldberg"}}