{"action":"opened","issue":{"url":"https://api.github.com/repos/webschik/tslint-config-security/issues/1","repository_url":"https://api.github.com/repos/webschik/tslint-config-security","labels_url":"https://api.github.com/repos/webschik/tslint-config-security/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/webschik/tslint-config-security/issues/1/comments","events_url":"https://api.github.com/repos/webschik/tslint-config-security/issues/1/events","html_url":"https://github.com/webschik/tslint-config-security/issues/1","id":313639211,"number":1,"title":"tsr-detect-non-literal-fs-filename: TypeError when Linted Function Name Exists on Object.prototype","user":{"login":"paulroper","id":1245666,"avatar_url":"https://avatars1.githubusercontent.com/u/1245666?v=4","gravatar_id":"","url":"https://api.github.com/users/paulroper","html_url":"https://github.com/paulroper","followers_url":"https://api.github.com/users/paulroper/followers","following_url":"https://api.github.com/users/paulroper/following{/other_user}","gists_url":"https://api.github.com/users/paulroper/gists{/gist_id}","starred_url":"https://api.github.com/users/paulroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulroper/subscriptions","organizations_url":"https://api.github.com/users/paulroper/orgs","repos_url":"https://api.github.com/users/paulroper/repos","events_url":"https://api.github.com/users/paulroper/events{/privacy}","received_events_url":"https://api.github.com/users/paulroper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-12T09:08:47Z","updated_at":"2018-04-12T09:08:47Z","closed_at":null,"author_association":"NONE","body":"Hey! Thanks for making this set of rules, we're finding them really useful to have on our project.\r\n\r\nWe've run in to a tiny bug with the `tsr-detect-non-literal-fs-filename` rule when it runs on a `toString` call. \r\n\r\nAs `toString` exists as a function on the prototype of the `fsModuleMethodsArgumentsInfo` object, the rule thinks that it's found a match for `fs` and throws a `TypeError: fsArgsInfo.filter is not a function` error when it tries to lint it.\r\n\r\nI guess more broadly this would affect any case where the name of the function being linted is a function on `Object.prototype`.\r\n\r\n## Code Reference\r\n\r\nWhen `methodName` is `toString`, this returns the object's `toString` function rather than an entry from the `fsModuleMethodsArgumentsInfo` list:\r\n\r\nhttps://github.com/webschik/tslint-config-security/blob/master/src/rules/tsrDetectNonLiteralFsFilenameRule.ts#L16\r\n\r\nAnd then this tries to call `filter` on the object's `toString` function:\r\n\r\nhttps://github.com/webschik/tslint-config-security/blob/master/src/rules/tsrDetectNonLiteralFsFilenameRule.ts#L20\r\n"}}
{"actor":{"display_login":"paulroper"}}