{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/typescript-eslint-parser/issues/63","repository_url":"https://api.github.com/repos/eslint/typescript-eslint-parser","labels_url":"https://api.github.com/repos/eslint/typescript-eslint-parser/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/eslint/typescript-eslint-parser/issues/63/comments","events_url":"https://api.github.com/repos/eslint/typescript-eslint-parser/issues/63/events","html_url":"https://github.com/eslint/typescript-eslint-parser/issues/63","id":172528712,"number":63,"title":"Add decorators to AST","user":{"login":"JamesHenry","id":900523,"avatar_url":"https://avatars.githubusercontent.com/u/900523?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesHenry","html_url":"https://github.com/JamesHenry","followers_url":"https://api.github.com/users/JamesHenry/followers","following_url":"https://api.github.com/users/JamesHenry/following{/other_user}","gists_url":"https://api.github.com/users/JamesHenry/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesHenry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesHenry/subscriptions","organizations_url":"https://api.github.com/users/JamesHenry/orgs","repos_url":"https://api.github.com/users/JamesHenry/repos","events_url":"https://api.github.com/users/JamesHenry/events{/privacy}","received_events_url":"https://api.github.com/users/JamesHenry/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/typescript-eslint-parser/labels/triage","name":"triage","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-22T19:02:17Z","updated_at":"2016-08-22T20:20:00Z","closed_at":null,"body":"This issue it to track progress against supporting decorators within the final AST that the parser produces. We currently remove them during parsing.\r\n\r\nWe need to ensure that the following are accurately carried over from the original TypeScript AST:\r\n\r\n- [ ] Parameter Decorators\r\n - [ ] On instance member\r\n - [ ] On static member\r\n - [ ] In constructor\r\n- [ ] Method Decorators\r\n - [ ] On instance member\r\n - [ ] On static member\r\n- [ ] Accessor Decorators\r\n - [ ] On instance member\r\n - [ ] On static member\r\n- [ ] Property Decorators\r\n - [ ] On instance member\r\n - [ ] On static member\r\n- [ ] Class Decorators\r\n\r\nWe also need to account for the difference between decorators and decorator factories:\r\n\r\n**Decorator:**\r\n![unspecified-11](https://cloud.githubusercontent.com/assets/900523/17868173/a20191a2-68a5-11e6-8808-a85e97be70b6.png)\r\n\r\n**Decorator Factory:**\r\n![unspecified-12](https://cloud.githubusercontent.com/assets/900523/17868172/a0dcc9fe-68a5-11e6-8ab6-7f6db611af56.png)\r\n\r\nAt the AST-level, the decorator is an `Identifier` TSNode, whereas the decorator factory is a `CallExpression` TSNode.\r\n\r\nDecorators are not currently covered by the ESTree spec as they are still a fairly early-stage es-proposal, but Angular 2, for example, has adopted them as a core aspect of the framework.\r\n\r\nTypeScript adds a `decorators` array to the node in question, and I propose we do the same. \r\n\r\nResources:\r\nhttps://www.typescriptlang.org/docs/handbook/decorators.html"},"comment":{"url":"https://api.github.com/repos/eslint/typescript-eslint-parser/issues/comments/241536958","html_url":"https://github.com/eslint/typescript-eslint-parser/issues/63#issuecomment-241536958","issue_url":"https://api.github.com/repos/eslint/typescript-eslint-parser/issues/63","id":241536958,"user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T20:20:00Z","updated_at":"2016-08-22T20:20:00Z","body":"> TypeScript adds a decorators array to the node in question, and I propose we do the same.\r\n\r\nAgreed. \r\n\r\nIt's probably worth looking at the AST that Babel produces for decorators, which I'm guessing is similar. "}}
{"actor":{"display_login":"nzakas"}}