{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/7036","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/7036/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/7036/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/7036/events","html_url":"https://github.com/eslint/eslint/issues/7036","id":174602184,"number":7036,"title":"Add allowPattern to no-invalid-this","user":{"login":"halleycarleton","id":5501216,"avatar_url":"https://avatars.githubusercontent.com/u/5501216?v=3","gravatar_id":"","url":"https://api.github.com/users/halleycarleton","html_url":"https://github.com/halleycarleton","followers_url":"https://api.github.com/users/halleycarleton/followers","following_url":"https://api.github.com/users/halleycarleton/following{/other_user}","gists_url":"https://api.github.com/users/halleycarleton/gists{/gist_id}","starred_url":"https://api.github.com/users/halleycarleton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halleycarleton/subscriptions","organizations_url":"https://api.github.com/users/halleycarleton/orgs","repos_url":"https://api.github.com/users/halleycarleton/repos","events_url":"https://api.github.com/users/halleycarleton/events{/privacy}","received_events_url":"https://api.github.com/users/halleycarleton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/eslint/eslint/labels/evaluating","name":"evaluating","color":"fef2c0"},{"url":"https://api.github.com/repos/eslint/eslint/labels/needs%20info","name":"needs info","color":"808000"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-01T19:10:56Z","updated_at":"2016-09-02T03:09:50Z","closed_at":null,"body":"**What version are you using?**\r\n3.4.0\r\n\r\n**What did you do?**\r\nWrote mocha tests with `no-invalid-this` enabled\r\n\r\n```js\r\n/* eslint-env node, mocha */\r\n/* eslint no-invalid-this: \"error\" */\r\ndescribe(function() {\r\n  beforeEach(function() {\r\n    this.original = obj.prop;\r\n  });\r\n  afterEach(function() {\r\n    obj.prop = this.original;\r\n  });\r\n});\r\n```\r\n\r\n**What happened?**\r\nReceived error `(no-invalid-this) Unexpected 'this'.`\r\n\r\n**What did you expect to happen?**\r\nExpected not to receive errors for using `this` keyword in `describe` callback when env is mocha.\r\n\r\nI think the best solution would be to add an allowPattern option(or similar) to `no-invalid-this` to allow the user to define functions where the callback should have access to `this`.\r\n"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/244272326","html_url":"https://github.com/eslint/eslint/issues/7036#issuecomment-244272326","issue_url":"https://api.github.com/repos/eslint/eslint/issues/7036","id":244272326,"user":{"login":"eslintbot","id":13383618,"avatar_url":"https://avatars.githubusercontent.com/u/13383618?v=3","gravatar_id":"","url":"https://api.github.com/users/eslintbot","html_url":"https://github.com/eslintbot","followers_url":"https://api.github.com/users/eslintbot/followers","following_url":"https://api.github.com/users/eslintbot/following{/other_user}","gists_url":"https://api.github.com/users/eslintbot/gists{/gist_id}","starred_url":"https://api.github.com/users/eslintbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslintbot/subscriptions","organizations_url":"https://api.github.com/users/eslintbot/orgs","repos_url":"https://api.github.com/users/eslintbot/repos","events_url":"https://api.github.com/users/eslintbot/events{/privacy}","received_events_url":"https://api.github.com/users/eslintbot/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T03:09:50Z","updated_at":"2016-09-02T03:09:50Z","body":"Hi @halleycarleton, thanks for the issue. It looks like there's not enough information for us to know how to help you.\n\nIf you're reporting a bug, please be sure to include:\n\n1. The version of ESLint you are using (run `eslint -v`)\n2. What you did (the source code and ESLint configuration)\n3. The actual ESLint output complete with numbers\n4. What you expected to happen instead\n\nRequesting a new rule? Please see [Proposing a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules) for instructions.\n\nRequesting a rule change? Please see [Proposing a Rule Change](http://eslint.org/docs/developer-guide/contributing/rule-changes) for instructions.\n\nIf it's something else, please just provide as much additional information as possible. Thanks!"}}
{"actor":{"display_login":"eslintbot"}}