-
-
Notifications
You must be signed in to change notification settings - Fork 75
Parser cannot parse inside decoration syntax #55
Comments
It looks like it is being parsed fine, it's just triggering linting errors. This is expected right now because ESLint doesn't understand decorator semantics. I'll leave this open to track, but the fix wont be in the parser. |
I see, thank you. I expect in the future. |
FYI: |
Yeah, there's no way we are going to do that here. :) |
Actually, it looks like we aren't even attaching the decorators into the AST. @JamesHenry do you have time to look into that? |
I actually thought about this for a bit after Alex submitted his issue :) I could not find any reference to ESTree or Flow capturing decorators though. Shall I go for whatever the TypeScript vernacular is for now? |
I have opened up a new issue to track adding decorators to the final AST: #63 |
@nzakas Just to confirm, even now that we have added the class decorators to the AST, the I guess this will be solved in the plugin? |
Yes, that's behavior is expected because escope doesn't know how to handle decorators. |
Have you had any thoughts about how we might address that for this case? I am very happy to work on a fix for this, but so far it's not clear to me how/where this will be tackled. |
In the short-term, we can probably add a rule in |
I am going to close this as it is neither a bug, nor a feature that relates to this project specifically. To summarise: TypeScript decorator syntax is fully supported by this parser, but there is not yet a way for the ESLint core rule This detection mechanism will be implemented in the complementary project |
I'm using in [email protected] and [email protected]. typescript-eslint-parser cannot perse the decorators syntax and inside the
@NgModule()
argument object. It was displayedno-unused-vars
in spite of actually it's using inside argument.The text was updated successfully, but these errors were encountered: