{"action":"created","issue":{"url":"https://api.github.com/repos/palantir/tslint/issues/2549","repository_url":"https://api.github.com/repos/palantir/tslint","labels_url":"https://api.github.com/repos/palantir/tslint/issues/2549/labels{/name}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/2549/comments","events_url":"https://api.github.com/repos/palantir/tslint/issues/2549/events","html_url":"https://github.com/palantir/tslint/issues/2549","id":220972608,"number":2549,"title":"prefer-for-of rule false positive when with HTMLCollectionOf<Element>","user":{"login":"plantain-00","id":7639395,"avatar_url":"https://avatars3.githubusercontent.com/u/7639395?v=3","gravatar_id":"","url":"https://api.github.com/users/plantain-00","html_url":"https://github.com/plantain-00","followers_url":"https://api.github.com/users/plantain-00/followers","following_url":"https://api.github.com/users/plantain-00/following{/other_user}","gists_url":"https://api.github.com/users/plantain-00/gists{/gist_id}","starred_url":"https://api.github.com/users/plantain-00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plantain-00/subscriptions","organizations_url":"https://api.github.com/users/plantain-00/orgs","repos_url":"https://api.github.com/users/plantain-00/repos","events_url":"https://api.github.com/users/plantain-00/events{/privacy}","received_events_url":"https://api.github.com/users/plantain-00/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-11T14:34:20Z","updated_at":"2017-04-13T00:59:31Z","closed_at":null,"body":"### Bug Report\r\n\r\n- __TSLint version__:5.0.0\r\n- __TypeScript version__:2.2.2\r\n- __Running TSLint via__: CLI\r\n\r\n#### TypeScript code being linted\r\n\r\n```ts\r\nconst children = document.getElementsByClassName(\"abc\");\r\nfor (let i = 0; i < children.length; i++) {\r\n    const child = children[i];\r\n    console.log(child);\r\n}\r\n```\r\n\r\nwith `tslint.json` configuration:\r\n\r\n```json\r\n{\r\n    \"extends\": \"tslint:latest\",\r\n    \"rules\": {\r\n        \"forin\": false,\r\n        \"interface-name\": [\r\n            false\r\n        ],\r\n        \"max-line-length\": [\r\n            false\r\n        ],\r\n        \"no-var-requires\": false,\r\n        \"no-console\": [\r\n            false\r\n        ],\r\n        \"no-string-literal\": false,\r\n        \"no-reference\": false,\r\n        \"ordered-imports\": [\r\n            false\r\n        ],\r\n        \"object-literal-sort-keys\": false,\r\n        \"variable-name\": [\r\n            true,\r\n            \"ban-keywords\"\r\n        ],\r\n        \"no-bitwise\": false,\r\n        \"member-access\": false,\r\n        \"arrow-parens\": false,\r\n        \"array-type\": [\r\n            true,\r\n            \"array\"\r\n        ],\r\n        \"max-classes-per-file\": [\r\n            false\r\n        ],\r\n        \"interface-over-type-literal\": false\r\n    }\r\n}\r\n```\r\n\r\n#### Actual behavior\r\n\r\n```\r\nExpected a 'for-of' loop instead of a 'for' loop with this simple iteration\r\n```\r\n\r\n#### Expected behavior\r\n\r\nNo error, because `HTMLCollectionOf<Element>` can not work with `for...of`:\r\n\r\n```ts\r\nconst children = document.getElementsByClassName(\"abc\");\r\nfor (const child of children) {\r\n    console.log(child);\r\n}\r\n```\r\n\r\n```\r\n[ts] Type 'HTMLCollectionOf<Element>' is not an array type or a string type.\r\n```"},"comment":{"url":"https://api.github.com/repos/palantir/tslint/issues/comments/293747852","html_url":"https://github.com/palantir/tslint/issues/2549#issuecomment-293747852","issue_url":"https://api.github.com/repos/palantir/tslint/issues/2549","id":293747852,"user":{"login":"andy-hanson","id":5387404,"avatar_url":"https://avatars3.githubusercontent.com/u/5387404?v=3","gravatar_id":"","url":"https://api.github.com/users/andy-hanson","html_url":"https://github.com/andy-hanson","followers_url":"https://api.github.com/users/andy-hanson/followers","following_url":"https://api.github.com/users/andy-hanson/following{/other_user}","gists_url":"https://api.github.com/users/andy-hanson/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-hanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-hanson/subscriptions","organizations_url":"https://api.github.com/users/andy-hanson/orgs","repos_url":"https://api.github.com/users/andy-hanson/repos","events_url":"https://api.github.com/users/andy-hanson/events{/privacy}","received_events_url":"https://api.github.com/users/andy-hanson/received_events","type":"User","site_admin":false},"created_at":"2017-04-13T00:59:31Z","updated_at":"2017-04-13T00:59:31Z","body":"Looks like a dupe of #2021."}}
{"actor":{"display_login":"andy-hanson"}}