{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/3944","labels_url":"https://api.github.com/repos/eslint/eslint/issues/3944/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/3944/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/3944/events","html_url":"https://github.com/eslint/eslint/issues/3944","id":108354575,"number":3944,"title":"no-use-before-define should have an option for ES6 classes","user":{"login":"lucsky","id":15117,"avatar_url":"https://avatars.githubusercontent.com/u/15117?v=3","gravatar_id":"","url":"https://api.github.com/users/lucsky","html_url":"https://github.com/lucsky","followers_url":"https://api.github.com/users/lucsky/followers","following_url":"https://api.github.com/users/lucsky/following{/other_user}","gists_url":"https://api.github.com/users/lucsky/gists{/gist_id}","starred_url":"https://api.github.com/users/lucsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucsky/subscriptions","organizations_url":"https://api.github.com/users/lucsky/orgs","repos_url":"https://api.github.com/users/lucsky/repos","events_url":"https://api.github.com/users/lucsky/events{/privacy}","received_events_url":"https://api.github.com/users/lucsky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/triage","name":"triage","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-25T16:05:39Z","updated_at":"2015-09-25T16:14:58Z","closed_at":null,"body":"The \"no-use-before-define\" rule has a \"nofunc\" option which allows to specify that using a function before it has been declared is ok. It should be possible (with a \"noclass\" option for example) to also do that with ES6 classes where it would allow a class name to be used before the class is declared later in the file.\r\n\r\nEx, this triggers the \"Bar was used before it was defined\" error:\r\n\r\n```\r\nclass Foo {\r\n    constructor() {\r\n        this.bar = new Bar();\r\n    }\r\n}\r\n\r\nclass Bar {}\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26950531-no-use-before-define-should-have-an-option-for-es6-classes?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/143265576","html_url":"https://github.com/eslint/eslint/issues/3944#issuecomment-143265576","issue_url":"https://api.github.com/repos/eslint/eslint/issues/3944","id":143265576,"user":{"login":"michaelficarra","id":218840,"avatar_url":"https://avatars.githubusercontent.com/u/218840?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelficarra","html_url":"https://github.com/michaelficarra","followers_url":"https://api.github.com/users/michaelficarra/followers","following_url":"https://api.github.com/users/michaelficarra/following{/other_user}","gists_url":"https://api.github.com/users/michaelficarra/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelficarra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelficarra/subscriptions","organizations_url":"https://api.github.com/users/michaelficarra/orgs","repos_url":"https://api.github.com/users/michaelficarra/repos","events_url":"https://api.github.com/users/michaelficarra/events{/privacy}","received_events_url":"https://api.github.com/users/michaelficarra/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T16:14:58Z","updated_at":"2015-09-25T16:14:58Z","body":"I guess this new option should apply to anything that hoists with TDZ. Sounds good, though definitely dangerous."}}